edu.ohiou.cs456_badabing.sceneapi.exec.data_model
Class DataBaseModel

java.lang.Object
  extended by edu.ohiou.cs456_badabing.sceneapi.exec.data_model.DataBaseModel

public class DataBaseModel
extends java.lang.Object

Contains Harvest data that is read from Excel file.

Description: Contains harvest information on all counties and years that are loaded from Excel file.

Copyright: Copyright (c) 2008, Lev A Neiman

Company: Ohio University EECS


Field Summary
 java.util.TreeMap<java.lang.String,CountyInfo> counties
          map of county name as string to CountyInfo object for that county.
private  double max_harvest
          what is the biggest single harvest from all years, and counties?
private  int max_year
          what is the biggest year ( most recent ).
private  double min_harvest
          what is the smallest single harvest from all years and counties?
private  int min_year
          what is the smallest year ( most old ).
 java.util.ArrayList<DeerTuple> tuples
          All the tuples contained in an array.
 
Constructor Summary
DataBaseModel()
           
 
Method Summary
 void addTuple(DeerTuple new_tuple)
          add a new Deer tuple to the database.
 double getMaxHarvest()
          Get max harvest out of all years and counties.
 int getMaxYear()
          what is the most recent year.
 double getMinHarvest()
          get min harvest out of all years and counties.
 int getMinYear()
          what is the oldest year.
static DeerTuple newYearPreHuntPopulation(DeerTuple post_birth_population, PredictionData parameters)
          apply summer mortality rate from post birth population to arrive at new year's pre hunt population.
static DeerTuple postBirthPopulation(DeerTuple pre_birth_population, PredictionData parameters)
          apply reproduction information from pre birth population to compute post birth population.
static DeerTuple postHuntPopulation(DeerTuple pre_hunt_info, PredictionData parameters)
          applies harvest data to compute post hunt population
static DeerTuple preBirthPopulation(DeerTuple post_hunt_population, PredictionData parameters)
          applies winter mortality rates from post hunt population to arrive at pre birth population.
static DeerTuple predict(DeerTuple input, PredictionData parameters)
          return a new deer tuple that is the prediction based on input, given parameters scenario.
static DeerTuple preHuntPopulation(DeerTuple input, PredictionData parameters)
          applies population expansion factors.
static DataBaseModel readHarvestDataFile(java.lang.String file_name)
          This function reads in Excel file into memory and returns a new instance of DataBaseModel
 java.lang.String toString()
          out put entire contents of this database into a string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tuples

public java.util.ArrayList<DeerTuple> tuples
All the tuples contained in an array.


counties

public java.util.TreeMap<java.lang.String,CountyInfo> counties
map of county name as string to CountyInfo object for that county.


max_year

private int max_year
what is the biggest year ( most recent ).


min_year

private int min_year
what is the smallest year ( most old ).


max_harvest

private double max_harvest
what is the biggest single harvest from all years, and counties?


min_harvest

private double min_harvest
what is the smallest single harvest from all years and counties?

Constructor Detail

DataBaseModel

public DataBaseModel()
Method Detail

getMaxHarvest

public double getMaxHarvest()
Get max harvest out of all years and counties.

Returns:
double

getMinHarvest

public double getMinHarvest()
get min harvest out of all years and counties.

Returns:
double

getMaxYear

public int getMaxYear()
what is the most recent year.

Returns:
int

getMinYear

public int getMinYear()
what is the oldest year.

Returns:
int

addTuple

public void addTuple(DeerTuple new_tuple)
add a new Deer tuple to the database.

Parameters:
new_tuple - DeerTuple

toString

public java.lang.String toString()
out put entire contents of this database into a string.

Overrides:
toString in class java.lang.Object
Returns:
String

readHarvestDataFile

public static DataBaseModel readHarvestDataFile(java.lang.String file_name)
                                         throws java.lang.Exception
This function reads in Excel file into memory and returns a new instance of DataBaseModel

Parameters:
file_name - String - absolute path to the file.
Returns:
DataBaseModel
Throws:
java.lang.Exception

preHuntPopulation

public static DeerTuple preHuntPopulation(DeerTuple input,
                                          PredictionData parameters)
applies population expansion factors. refer to slide 11 in Overview presentation file.

Parameters:
input - DeerTuple
parameters - PredictionData
Returns:
DeerTuple

postHuntPopulation

public static DeerTuple postHuntPopulation(DeerTuple pre_hunt_info,
                                           PredictionData parameters)
applies harvest data to compute post hunt population

Parameters:
input - DeerTuple
parameters - PredictionData
Returns:
DeerTuple

preBirthPopulation

public static DeerTuple preBirthPopulation(DeerTuple post_hunt_population,
                                           PredictionData parameters)
applies winter mortality rates from post hunt population to arrive at pre birth population.

Parameters:
post_hunt_population - DeerTuple
parameters - PredictionData
Returns:
DeerTuple

postBirthPopulation

public static DeerTuple postBirthPopulation(DeerTuple pre_birth_population,
                                            PredictionData parameters)
apply reproduction information from pre birth population to compute post birth population.

Parameters:
pre_birth_population - DeerTuple
parameters - PredictionData
Returns:
DeerTuple

newYearPreHuntPopulation

public static DeerTuple newYearPreHuntPopulation(DeerTuple post_birth_population,
                                                 PredictionData parameters)
apply summer mortality rate from post birth population to arrive at new year's pre hunt population.

Parameters:
post_birth_population - DeerTuple
parameters - PredictionData
Returns:
DeerTuple

predict

public static DeerTuple predict(DeerTuple input,
                                PredictionData parameters)
return a new deer tuple that is the prediction based on input, given parameters scenario.

Parameters:
input - DeerTuple
parameters - PredictionData
Returns:
DeerTuple