Navigate¶
This page describes the class Navigate
The class Navigate
is derived from Action
and handles the sea crossing of agents.
It manages the “bridges” between landmasses (obtained by the Navigation)
and calculates the crossing probabilities using a sampling distance \(d_0\),
a crossing probability \(p_0\) for that distance and a decay \(D < 1\):
where \(A = p_0/e^{D*d_0}\)
In other words the probability for a crossing diminishes with growing distance between land masses. The values \(d_0\), \(p_0\) and \(D\) model the population’s ability to navigate the open sea.
- Code:
Attributes:
|
“Navigate” |
action name |
|
“Navigate_decay” |
probability decay |
|
“Navigate_dist0” |
sampling distance |
|
“Navigate_prob0” |
probability for sampling distance |
|
“Navigate_min_dens” |
minimum density for crossing |
Public Methods¶
constructor
¶
Navigate(SPopulation<T> *pPop, SCellGrid *pCG, std::string sID, WELL512 **apWELL);
pPop
A pointer to the SPopulation object performing this action.
pCG
A pointer to the SCellGrid object on which the simulation runs.
sID
An ID for this action.
apWELL
A pointer to an array of WELL512 random number generators (one for each thread).
Adds itself to the observers of the population.
destructor
¶
~Navigate();
Some cleaning up.
recalculate
¶
void recalculate();
Recalculate the crossing probabilities for the bridges.
cleanup
¶
void cleanup();
Clearing aome containiers and deletingh some allocated arrays.
execute
¶
virtual int execute(int iA, float fT);
iAgentIndex
Current agent’s index.
fT
Current simulation step.
preLoop
¶
virtual int preLoop();
Makes sure there is a Geography
object and a Navigation
object.
extractAttributesQDF
¶
virtual int extractAttributesQDF(hid_t hSpeciesGroup);
hSpeciesGroup
HDF handle for the species group to read from.
This method reads the action’s attributes from the specified group in a QDF file.
writeAttributesQDF
¶
virtual int writeAttributesQDF(hid_t hSpeciesGroup);
hSpeciesGroup
HDF handle for the species group to write to.
This method writes the action’s attributes to the specified group in a QDF file.
tryGetAttributes
¶
virtual int tryGetAttributes(const ModuleComplex *pMC);
pMC
A
ModuleComplex
object.
Extracts the action’s attributes from the ModuleComplex
object.
notify
¶
void notify(Observable *pObs, int iEvent, const void *pData);
pObs
Pointer to the observed object.
iType
Type of the notification (an integer).
pCom
pointer to some data which has to be cast to the correct type.
This method is an implementation of the Observer interfacxe, and is called by an Observable object. This action is only interested in events related to Geography
or Navigation
.
isEqual
¶
virtual bool isEqual(Action<T> *pAction, bool bStrict);
pAction
Pointer to an action object to compare with this.
bStrict
Strictness of comparisons (ignored here).
pAction
is equal to this
, if it is a Navigate
object and all their attributes match.