![]() |
fpmas 1.6
|
#include <graph.h>


Public Member Functions | |
| GraphRange (bool include_location=INCLUDE_LOCATION) | |
| std::size_t | radius (GraphCellType *) const override |
| bool | contains (GraphCellType *root, GraphCellType *cell) const override |
Public Member Functions inherited from fpmas::api::model::Range< GraphCell > | |
| virtual bool | contains (GraphCell *root, GraphCell *cell) const=0 |
| virtual std::size_t | radius (GraphCell *origin) const=0 |
Static Public Member Functions | |
| static void | synchronize (api::model::SpatialModel< GraphCellType > &model) |
A GraphCell based api::model::Range implementation.
The specified GraphCellType is assumed to extend the two following classes:
A cell is assumed to be contained in this GraphRange, centered in root, if and only if the cell id is contained in the reachable_cells list of the root.
It is currently assumed that ids contained in the reachable_cells list are direct neighbors of the root on the CELL_SUCCESSOR, what means that a cell at a distance of 2 (in term of graph distance) from root can't be added to the range. This behavior might evolve in the future.
The special case cell==root is handled according to the include_location parameter, specified in the constructor.
In order to be usable, is it required to call the synchronize() method after the corresponding SpatialModel initialization, but before any SpatialAgent execution. This requirement will probably be relaxed in a next release.
|
inline |
GraphRange constructor.
| include_location | specifies if the current location of the SpatialAgent (assumed to be root) must be included in this GraphRange |
|
inlineoverride |
Radius of the GraphRange.
Since it is assumed that only direct neighbors of a root on the CELL_SUCCESSOR layer can be added to its reachable_cells collection, the radius of this range is 1.
|
inlineoverride |
If root==cell:
true iff include_location is true. Else:true iff the cell id is contained in the reachable_cells list of rootcell is contained in this GraphRange, located on root.
|
inlinestatic |
Automatically updates the reachable_cells list of GraphCells contained in the specified model.
All out neighbors cells on the CELL_SUCCESSOR layer of each GraphCell are added to its reachable_cells list.
The synchronization can be performed dynamically if the GraphCell network evolves during the simulation.
This method is synchronous, and must be called from all processes.
| model | initialized SpatialModel, based on a GraphCell network. |