RepastHPC  2.3.1
Public Member Functions | Protected Attributes | Friends | List of all members
repast::relogo::RelogoAgent Class Referenceabstract

Base agent for Relogo. More...

#include <RelogoAgent.h>

Inheritance diagram for repast::relogo::RelogoAgent:
repast::Agent repast::relogo::AbstractRelogoAgent repast::relogo::Patch repast::relogo::Turtle

Public Member Functions

 RelogoAgent (repast::AgentId id, Observer *observer)
 Creates a RelogoAgent with the specified id and managed by the specified Observer. More...
 
virtual repast::AgentIdgetId ()
 Gets the id of this RelogoAgent. More...
 
virtual const repast::AgentIdgetId () const
 Gets the const id of this RelogoAgent. More...
 
Point< double > location () const
 Gets the location of this RelogoAgent. More...
 
virtual void hatchCopy ()
 If this ReLogo agent is 'hatched', makes an appropriate copy, setting instance variables as appropriate.
 
double xCor () const
 Gets the x coordinate of the agent's location. More...
 
double yCor () const
 Gets the y coordinate of the agent's location. More...
 
virtual int pxCor () const =0
 Gets the patch x coordinate of the agent's location. More...
 
virtual int pyCor () const =0
 Gets the patch y coordinate of the agent's location. More...
 
double distance (RelogoAgent *obj) const
 Gets the distance from this RelogoAgent to the specified agent. More...
 
double distancexy (double x, double y) const
 Gets the distance from this RelogoAgent to the specified point. More...
 

Protected Attributes

Observer_observer
 
Point< double > _location
 
repast::AgentId _id
 

Friends

class RelogoContinuousSpaceAdder
 
class WorldCreator
 
template<typename GPTransformer , typename Adder >
class RelogoSharedContinuousSpace
 

Detailed Description

Base agent for Relogo.

Constructor & Destructor Documentation

◆ RelogoAgent()

repast::relogo::RelogoAgent::RelogoAgent ( repast::AgentId  id,
Observer observer 
)
inline

Creates a RelogoAgent with the specified id and managed by the specified Observer.

Parameters
idthe id of this RelogoAgent
observerthe observer that will manage this agent.

Member Function Documentation

◆ distance()

double repast::relogo::RelogoAgent::distance ( RelogoAgent obj) const

Gets the distance from this RelogoAgent to the specified agent.

Returns
the distance from this RelogoAgent to the specified agent.

◆ distancexy()

double repast::relogo::RelogoAgent::distancexy ( double  x,
double  y 
) const

Gets the distance from this RelogoAgent to the specified point.

Returns
the distance from this RelogoAgent to the specified point.

◆ getId() [1/2]

virtual repast::AgentId& repast::relogo::RelogoAgent::getId ( )
inlinevirtual

Gets the id of this RelogoAgent.

Returns
the id of this RelogoAgent.

Implements repast::Agent.

◆ getId() [2/2]

virtual const repast::AgentId& repast::relogo::RelogoAgent::getId ( ) const
inlinevirtual

Gets the const id of this RelogoAgent.

Returns
the const id of this RelogoAgent.

Implements repast::Agent.

◆ location()

Point<double> repast::relogo::RelogoAgent::location ( ) const
inline

Gets the location of this RelogoAgent.

Returns
the location of this RelogoAgent.

◆ pxCor()

virtual int repast::relogo::RelogoAgent::pxCor ( ) const
pure virtual

Gets the patch x coordinate of the agent's location.

Returns
the patch x coordinate of the agent's location.

Implemented in repast::relogo::AbstractRelogoAgent, repast::relogo::Turtle, and repast::relogo::Patch.

◆ pyCor()

virtual int repast::relogo::RelogoAgent::pyCor ( ) const
pure virtual

Gets the patch y coordinate of the agent's location.

Returns
the patch y coordinate of the agent's location.

Implemented in repast::relogo::AbstractRelogoAgent, repast::relogo::Turtle, and repast::relogo::Patch.

◆ xCor()

double repast::relogo::RelogoAgent::xCor ( ) const

Gets the x coordinate of the agent's location.

Returns
the x coordinate of the agent's location.

◆ yCor()

double repast::relogo::RelogoAgent::yCor ( ) const

Gets the y coordinate of the agent's location.

Returns
the y coordinate of the agent's location.

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