|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pop.model.ModelManager
Loosely manages the model's activities. Maintains the only handle to the set of Statics constants, and is the only handle by which a gui or other application may control the model's behavior.
Statics
Constructor Summary | |
ModelManager(Constants c)
Handy constructor takes a Constants object. |
|
ModelManager(int maximum_age,
int categories,
java.lang.String[] category_names,
int years,
int base_year,
java.lang.String model_title)
Alternate, uglier constructor requires multiple parameters. |
Method Summary | |
void |
destroy()
Destroys the current model; necessary to create a new one. |
boolean |
has_fert_source()
True if the model has a source of fertility rates. |
boolean |
has_migrant_source()
True if the model has a source of migration data. |
boolean |
has_mort_source()
True if the model has a source of mortality rates. |
boolean |
has_pop_source()
True if the model has a source of initial population sizes. |
boolean |
increment_model()
Increments the model one year, until the current year is equal to Statics.years(). |
static ModelManager |
load(java.lang.String filename)
Tries to load a new model from the specified file. |
PopulationSizesFactory |
pop_source()
Returns initial population sizes factory if one is available; null otherwise. |
void |
reset()
Resets the current year to 0, so model can be rerun. |
Results |
results()
Returns the results (null if model not yet incremented). |
void |
run_model()
Runs the model for all remaining years (0 to end if increment() not invoked). |
boolean |
save(java.lang.String filename)
Saves the current model to a new file with the specified filename. |
void |
set_factory(FertilityFactory fert_source)
Sets the factory that will produce fertility factors. |
void |
set_factory(MigrationFactory migrant_source)
Sets the factory that will produce migration data. |
void |
set_factory(MortalityFactory mort_source)
Sets the factory that will produce mortality factors. |
void |
set_factory(PopulationSizesFactory pop_source)
Sets the factory that will produce initial population sizes. |
void |
set_new_labels(Constants c)
Changes just the labels in Statics. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public ModelManager(Constants c)
public ModelManager(int maximum_age, int categories, java.lang.String[] category_names, int years, int base_year, java.lang.String model_title)
for an explanation of these parameters.
Method Detail |
public void set_new_labels(Constants c)
public void set_factory(PopulationSizesFactory pop_source)
public void set_factory(FertilityFactory fert_source)
public void set_factory(MortalityFactory mort_source)
public void set_factory(MigrationFactory migrant_source)
public void run_model()
public boolean increment_model()
public Results results()
public void reset()
public boolean save(java.lang.String filename)
public static ModelManager load(java.lang.String filename)
public boolean has_pop_source()
public PopulationSizesFactory pop_source()
public boolean has_fert_source()
public boolean has_mort_source()
public boolean has_migrant_source()
public void destroy()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |