|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IDivision
A group of types, each of which has an associated "share" of the total. A division is used to generate people or vehicles of the given types in proportion to the specification of shares.
| Field Summary | |
|---|---|
static IDivision[] |
ZERO
A static zero-length array, created for convenience, and to save memory |
| Fields inherited from interface com.azalient.api.a.tables.IRecord |
|---|
DELETED, KEY_SEP, KEY_SEP_CHAR |
| Method Summary | |
|---|---|
void |
equalizeShares()
Set all shares to be an equal fraction of 100% |
void |
normalizeShares()
Multiply all shares by the same factor so that they sum to 100% (1.0) |
IType |
randomType(double p)
Given a random variable between 0 and 1, return a type from this division. |
IType |
randomType(double p,
int maxFriends)
Given a random variable between 0 and 1, return a type from this division. |
IVehicleType |
randomType(double p,
IRouter router,
ILink origin,
IZone destination,
IBehaviour behaviour)
Given a random variable between 0 and 1, return a vehicle type from this division. |
double |
share(IType type)
Returns the share [0.0, 1.0] in this division for the given type. |
void |
share(IType type,
double share,
boolean normalize)
Sets the share [0.0, 1.0] in this division for the given type, and optionally, normalizes all shares so that they sum to 1.0. |
| Methods inherited from interface com.azalient.api.b.parameters.ITypeSet |
|---|
add, contains, count, logical, logical, mode, remove, standard, type |
| Methods inherited from interface com.azalient.api.file.StoreRecordRW |
|---|
canRename, rename, store |
| Methods inherited from interface com.azalient.api.file.RecordR |
|---|
extraSet, finished, isApplicable, isEditable, set |
| Methods inherited from interface com.azalient.api.a.tables.IRecord |
|---|
name |
| Methods inherited from interface com.azalient.api.file.RecordW |
|---|
extraCols, extraGet, extraGetB, extraGetD, extraGetI, extraGetS, extraGetT, get, isVolatile |
| Field Detail |
|---|
static final IDivision[] ZERO
| Method Detail |
|---|
double share(IType type)
void share(IType type,
double share,
boolean normalize)
void normalizeShares()
void equalizeShares()
IType randomType(double p)
IType randomType(double p,
int maxFriends)
IVehicleType randomType(double p,
IRouter router,
ILink origin,
IZone destination,
IBehaviour behaviour)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||