Navigation¶
This page describes the class Navigation
For some simulations it is important that agents can travel over thes sea to islands.
The class Navigation
provides “tunnels” or “bridges” connecting points an different land masses.
The action Navigate uses this data to assign crossing probabilities to bridges.
The bridges are usually automatically calculated (with the tool “SeaWays”), but bridges can also ne added manually
- Code:
Type Definitions¶
typedef std::map<gridtype, double> distlist;
typedef std::map<gridtype, distlist> distancemap;
A distancemap
assigns a origins and istances to destinations.
typedef std::pair<gridtype,gridtype> bridgedef;
typedef std::vector<bridgedef> bridgelist;
A bridgedef
holds the origin and destination of a bridge; a bridgelist
is a vector containing bridge definitiions.
Public Members¶
uint m_iNumPorts;
The number of ports (i.e. origin points).
uint m_iNumDests;
The number of destination points.
uint m_iNumDists;
Number of entries in the distance map.
double m_dSampleDist;
The sampling distance is needed to calculate crossing probabilities.
uint m_iNumBridges;
Number of bridges.
distancemap m_mDestinations;
Map for all involved distances.
bridgelist m_vBridges;
The list of ‘manual’ bridges.
Public Methods¶
constructor
¶
Navigation();
The constructor initializes the members.
destructor
¶
virtual ~Navigation();
The destructor does nothing.
setData
¶
int setData(const distancemap &mDests, double dSampleDist);
mDests
A distance map.
dSampleDist
Sampling distance.
Set distance map and sample distance.
setBridges
¶
int setBridges(const bridgelist &vBridges);
vBridges
List of bridges.
Set the list of bridges.
checkSizes
¶
int checkSizes(uint iNumPorts, uint iNumDests, uint iNumDists);
iNumPorts
Expected number of ports.
iNumDests
Expected number of destinations.
iNumDists
Expected number of distances.
(Debugging) Checks wether the calculated numbers agree with the expected numbers.