41 #ifndef ABSTRACTRELOGOAGENT_H_
42 #define ABSTRACTRELOGOAGENT_H_
44 #include "RelogoAgent.h"
66 virtual int pxCor()
const = 0;
73 virtual int pyCor()
const = 0;
82 template<
typename AgentType>
96 template<
typename PatchType>
97 PatchType*
patchAt(
double dx,
double dy)
const;
106 template<
typename AgentType>
118 template<
typename AgentType>
129 template<
typename PatchType>
139 template<
typename AgentType>
152 template<
typename AgentType>
157 template<
typename AgentType>
159 _observer->
inRadius<AgentType> (_location, inSet, radius, outSet);
162 template<
typename PatchType>
164 return static_cast<PatchType*
> (_observer->
patchAt(_location, dx, dy));
167 template<
typename AgentType>
172 template<
typename AgentType>
179 template<
typename PatchType>
181 std::vector<double> disp = calcDisplacementFromHeadingDistance(heading,
distance);
182 return static_cast<PatchType*
> (_observer->
patchAt(_location, disp[0], disp[1]));
185 template<
typename AgentType>
190 template<
typename AgentType>
193 turtlesOn<AgentType>(agents);
void inRadius(AgentSet< RelogoAgent > &inSet, double radius, AgentSet< AgentType > &outSet) const
Gets all the agents in the inSet within the specified radius for this RelogoAgent and put them in the...
Definition: AbstractRelogoAgent.h:158
virtual int pxCor() const =0
Gets the patch x coordinate of the agent's location.
AgentSet< AgentType > turtlesOn() const
Gets the turtles that are on this patch or if this is a Turtle get the turtles that are on the patch ...
Definition: AbstractRelogoAgent.h:191
double distance(RelogoAgent *obj) const
Gets the distance from this RelogoAgent to the specified agent.
Definition: RelogoAgent.cpp:57
void inRadius(const Point< double > ¢er, AgentSet< RelogoAgent > &inSet, double radius, AgentSet< AgentType > &outSet)
Puts all the agents in the inSet that are of the specified type and within the specified radius from ...
Definition: Observer.h:821
Base agent for Relogo.
Definition: RelogoAgent.h:60
virtual int pyCor() const =0
Gets the patch y coordinate of the agent's location.
Abstract base class for turtles and patches.
Definition: AbstractRelogoAgent.h:55
Agent identity information.
Definition: AgentId.h:60
Specialized indexable collection class for agents.
Definition: AgentSet.h:82
PatchType * patchAt(double dx, double dy) const
Gets the patch at direction dx, dy from the this agent.
Definition: AbstractRelogoAgent.h:163
PatchType * patchAt(int x, int y)
Gets the patch at the specified coordinates.
Definition: Observer.h:793
AgentSet< AgentType > turtlesHere() const
Gets all the turtles on this turtle's patch and returns them in an AgentSet.
Definition: AbstractRelogoAgent.h:173
AgentSet< AgentType > turtlesAt(int x, int y)
Gets all of the agents of the templated type at the specified patch location.
Definition: Observer.h:729
Implementation of a logo Observer.
Definition: Observer.h:110
PatchType * patchAtHeadingAndDistance(float heading, double distance)
Gets the patch at the specified heading and distance from this patch or turtle.
Definition: AbstractRelogoAgent.h:180
void turtlesOn(AgentSet< RelogoAgent > &agentSet, AgentSet< TurtleType > &out)
Gets all the turtles that are on any patches contained in the agentSet or on the patches where any tu...
Definition: Observer.h:808