RepastHPC  2.3.1
Public Member Functions | List of all members
repast::relogo::Patch Class Reference

A logo patch. More...

#include <Patch.h>

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

Public Member Functions

 Patch (repast::AgentId id, Observer *observer)
 Creates a Patch that will have the specified id and be managed by the specified Observer. More...
 
virtual int pxCor () const
 Gets the patch x coordinate of this patch's location.
 
virtual int pyCor () const
 Gets the patch y coordinate of this patch's location.
 
template<typename PatchType >
AgentSet< PatchType > neighbors ()
 Gets the 8 (Moore neighborhood) neighboring Patches of this Patch. More...
 
template<typename PatchType >
AgentSet< PatchType > neighbors4 ()
 Gets the 4 (Von Neumann neighborhood) neighboring Patches of this Patch. More...
 
template<typename PatchType >
void neighbors (AgentSet< PatchType > &out)
 Gets the 8 (Moore neighborhood) neighboring Patches of this Patch and puts them out. More...
 
template<typename PatchType >
void neighbors4 (AgentSet< PatchType > &out)
 Gets the 4 (Von Neumann neighborhood) neighboring Patches of this Patch. More...
 
- Public Member Functions inherited from repast::relogo::AbstractRelogoAgent
 AbstractRelogoAgent (AgentId id, Observer *observer)
 
template<typename AgentType >
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 outSet. More...
 
template<typename PatchType >
PatchType * patchAt (double dx, double dy) const
 Gets the patch at direction dx, dy from the this agent. More...
 
template<typename AgentType >
void turtlesHere (AgentSet< AgentType > &set) const
 Gets all the turtles on this turtle's patch and puts them into the specifed set. More...
 
template<typename AgentType >
AgentSet< AgentType > turtlesHere () const
 Gets all the turtles on this turtle's patch and returns them in an AgentSet. More...
 
template<typename PatchType >
PatchType * patchAtHeadingAndDistance (float heading, double distance)
 Gets the patch at the specified heading and distance from this patch or turtle. More...
 
template<typename AgentType >
void turtlesOn (AgentSet< AgentType > &out) const
 Gets the turtles that are on this patch or if this is a Turtle get the turtles that are on the patch this turtle is on. More...
 
template<typename AgentType >
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 this turtle is on. More...
 
- Public Member Functions inherited from repast::relogo::RelogoAgent
 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...
 
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...
 

Additional Inherited Members

- Protected Attributes inherited from repast::relogo::RelogoAgent
Observer_observer
 
Point< double > _location
 
repast::AgentId _id
 

Detailed Description

A logo patch.

Constructor & Destructor Documentation

◆ Patch()

repast::relogo::Patch::Patch ( repast::AgentId  id,
Observer observer 
)

Creates a Patch that will have the specified id and be managed by the specified Observer.

Parameters
id
observer

Member Function Documentation

◆ neighbors() [1/2]

template<typename PatchType >
AgentSet< PatchType > repast::relogo::Patch::neighbors

Gets the 8 (Moore neighborhood) neighboring Patches of this Patch.

Template Parameters
thepatch type
Returns
the 8 (Moore neighborhood) neighboring Patches of this Patch.

◆ neighbors() [2/2]

template<typename PatchType >
void repast::relogo::Patch::neighbors ( AgentSet< PatchType > &  out)

Gets the 8 (Moore neighborhood) neighboring Patches of this Patch and puts them out.

Parameters
outthe AgentSet to the neighbors in
Template Parameters
thepatch type

◆ neighbors4() [1/2]

template<typename PatchType >
AgentSet< PatchType > repast::relogo::Patch::neighbors4

Gets the 4 (Von Neumann neighborhood) neighboring Patches of this Patch.

Template Parameters
thepatch type
Returns
the 4 (Von Neumann neighborhood) neighboring Patches of this Patch.

◆ neighbors4() [2/2]

template<typename PatchType >
void repast::relogo::Patch::neighbors4 ( AgentSet< PatchType > &  out)

Gets the 4 (Von Neumann neighborhood) neighboring Patches of this Patch.

Parameters
outthe AgentSet to put the neighbors in
Template Parameters
thepatch type

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