fpmas 1.6
Public Member Functions | Protected Member Functions | List of all members
fpmas::api::model::GridAgentBase Class Referenceabstract

#include <grid.h>

Inheritance diagram for fpmas::api::model::GridAgentBase:
Inheritance graph
[legend]

Public Member Functions

virtual DiscretePoint locationPoint () const =0
 

Protected Member Functions

virtual void moveTo (DiscretePoint point)=0
 

Detailed Description

A non-templated GridAgent base class.

This notably allows the usage of moveTo(DiscretePoint) and locationPoint() methods from a dynamic_cast from the api::model::Agent base, without the need for the CellType template parameter.

Member Function Documentation

◆ moveTo()

virtual void fpmas::api::model::GridAgentBase::moveTo ( DiscretePoint  point)
protectedpure virtual

Moves to the Cell at the specified point.

Notice that it is assumed that at most one GridCell can be located at each point.

If no Cell at point can be found in the current mobility field, an OutOfMobilityFieldException is thrown.

Parameters
pointdiscrete coordinates
Exceptions
OutOfMobilityFieldException

Implemented in fpmas::model::GridAgent< AgentType, GridCellType, Derived >, fpmas::api::model::GridAgent< GridCellType >, and fpmas::api::model::GridAgent< model::GridCell >.

◆ locationPoint()

virtual DiscretePoint fpmas::api::model::GridAgentBase::locationPoint ( ) const
pure virtual

Returns the current location of the GridAgent as discrete coordinates.

The behavior of this method is similar to the SpatialAgent::locationId() method: considering the moveTo(DiscretePoint) method, the agent can move using this kind of operations:

agent->moveTo(neighbor->locationPoint())
Returns
location of the GridAgent

Implemented in fpmas::model::GridAgent< AgentType, GridCellType, Derived >.


The documentation for this class was generated from the following file: