Navigation

  • index
  • next |
  • previous |
  • QHG4 4.1 documentation »
  • Code Documentation »
  • actions »
  • Navigate

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\):

\[p_C = A \cdot e^{D * d_0}\]

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:
Navigate.h
Navigate.cpp

Attributes:

ATTR_NAVIGATE_NAME

“Navigate”

action name

ATTR_NAVIGATE_DECAY_NAME

“Navigate_decay”

probability decay

ATTR_NAVIGATE_DIST0_NAME

“Navigate_dist0”

sampling distance

ATTR_NAVIGATE_PROB0_NAME

“Navigate_prob0”

probability for sampling distance

ATTR_NAVIGATE_MIN_DENS_NAME

“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.

This method is called for all agents (in parallel).
For each agent and each crossing originating from its cell, a random number is drawn. If it is less than the calculated crossing probability for this bridge, it is moved to the endpoint of the crossing.

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.

Table of Contents

  • Navigate
    • Public Methods
      • constructor
      • destructor
      • recalculate
      • cleanup
      • execute
      • preLoop
      • extractAttributesQDF
      • writeAttributesQDF
      • tryGetAttributes
      • notify
      • isEqual

Previous topic

ConfinedMove

Next topic

MoveStats

This Page

  • Show Source

Quick search

Navigation

  • index
  • next |
  • previous |
  • QHG4 4.1 documentation »
  • Code Documentation »
  • actions »
  • Navigate
© Copyright 2022, jodyxha. Created using Sphinx 8.1.3.