movement.map
Class PointsOfInterest

java.lang.Object
  extended by movement.map.PointsOfInterest

public class PointsOfInterest
extends java.lang.Object

Handler for points of interest data.


Field Summary
static java.lang.String POI_FILE_S
          Points Of Interest file path -prefix id ("poiFile")
static java.lang.String POI_NS
          Points Of Interest settings namespace ("PointsOfInterest")
static java.lang.String POI_SELECT_S
          Per node group setting used for selecting POI groups and their probabilities ("pois").
Syntax: poiGroupIndex1, groupSelectionProbability1, groupIndex2, prob2, etc...
Sum of probabilities must be less than or equal to one (1.0).
 
Constructor Summary
PointsOfInterest(SimMap parentMap, int[] okMapNodeTypes, Settings settings, java.util.Random rng)
          Constructor.
 
Method Summary
 MapNode selectDestination()
          Selects a random destination from POIs or all MapNodes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POI_NS

public static final java.lang.String POI_NS
Points Of Interest settings namespace ("PointsOfInterest")

See Also:
Constant Field Values

POI_FILE_S

public static final java.lang.String POI_FILE_S
Points Of Interest file path -prefix id ("poiFile")

See Also:
Constant Field Values

POI_SELECT_S

public static final java.lang.String POI_SELECT_S
Per node group setting used for selecting POI groups and their probabilities ("pois").
Syntax: poiGroupIndex1, groupSelectionProbability1, groupIndex2, prob2, etc...
Sum of probabilities must be less than or equal to one (1.0). If the sum is less than one, chance of getting a random MapPoint is 1-sum.

See Also:
Constant Field Values
Constructor Detail

PointsOfInterest

public PointsOfInterest(SimMap parentMap,
                        int[] okMapNodeTypes,
                        Settings settings,
                        java.util.Random rng)
Constructor.

Parameters:
parentMap - The map whose MapNodes' subset the POIs are
okMapNodeTypes - Array of map node types that are OK to visit or null if all nodes are OK
settings - The Settings object where settings are read from
rng - The random number generator to use
Method Detail

selectDestination

public MapNode selectDestination()
Selects a random destination from POIs or all MapNodes. Selecting among POI groups is done by their probabilities. If sum of their probabilities is less than 1.0 and the drawn random probability is bigger than the sum, a random MapNode is selected from the SimMap.

Returns:
A destination among POIs or all MapNodes