|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--pop.data.MigrationSpreader
Creates Migration objects from partial input data. Spreads a single value for a particular year over the entire category-, sex-, and age-range of a migration object. This spread is proportional to an input array of shares that is held constant for all years. Services are provided to input either or both of the totals or/and shares from a file that is appropriately structured.
MigrationFactory
, Serialized FormConstructor Summary | |
MigrationSpreader(int[] total,
double[][][] shares)
Basic constructor takes an array of total migration values and a 3-dimensional array of shares. |
|
MigrationSpreader(int[] total,
java.lang.String filename)
Constructs a MigrationSpreader using migration totals from an array and default shares from a file. |
|
MigrationSpreader(java.lang.String filename)
Constructs a MigrationSpreader using both migration data and default shares from the same file. |
|
MigrationSpreader(java.lang.String filename,
double[][][] shares)
Constructs a MigrationSpreader using migration data from a file, and default shares from an array. |
Method Summary | |
PopulationCharacteristics |
get_characteristics(int category)
Returns a new Migration object for the indicated population category and the current year of the model. |
PopulationCharacteristics |
get_characteristics(java.lang.String category)
Returns a new Migration object for the indicated population category and the current year of the model. |
Migration |
get_migration(int category,
int year)
Returns a new Migration object for the indicated population category and year. |
Migration |
get_migration(java.lang.String category,
int year)
Returns a new Migration object for the indicated population category and year. |
boolean |
ready()
Simply returns true; any fully-created MigrationSpreader is ready. |
void |
reset_proportion(int year,
double[][][] shares)
Resets the proportioning used to spread migrations for a particular year only. |
double[][][] |
shares_of(PopulationSizes[] sizes)
Returns an appropriately arranged double array of shares that reflect the distribution of population in the input array of population sizes. |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public MigrationSpreader(int[] total, double[][][] shares)
total
- array of total migration, must be [Statics.years()].shares
- array of shares, must be
[Statics.categories()][2][Statics.maximum_age+1].public MigrationSpreader(java.lang.String filename)
filename
- - the name of the file.public MigrationSpreader(int[] total, java.lang.String filename)
total
- array of total migration, must be [Statics.years()]filename
- - the name of the file.public MigrationSpreader(java.lang.String filename, double[][][] shares)
filename
- - the name of the file.shares
- array of shares, must be
[Statics.categories()][2][Statics.maximum_age+1].Method Detail |
public Migration get_migration(int category, int year)
public Migration get_migration(java.lang.String category, int year)
public PopulationCharacteristics get_characteristics(int category)
public PopulationCharacteristics get_characteristics(java.lang.String category)
public void reset_proportion(int year, double[][][] shares)
year
- must be in the valid range.shares
- in the appropriate dimensions
(see basic constructor).public double[][][] shares_of(PopulationSizes[] sizes)
public boolean ready()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |