RepastHPC
2.3.1
|
Discrete matrix-like SharedBaseGrid implementation. More...
#include <SharedDiscreteSpace.h>
Public Member Functions | |
SharedDiscreteSpace (std::string name, GridDimensions gridDims, std::vector< int > processDims, int buffer, boost::mpi::communicator *communicator) | |
Public Member Functions inherited from repast::SharedBaseGrid< T, GPTransformer, Adder, int > | |
void | balance () |
SharedBaseGrid (std::string name, GridDimensions gridDims, std::vector< int > processDims, int buffer, boost::mpi::communicator *communicator) | |
Creates a SharedGrid with the specified name. More... | |
virtual const GridDimensions | bounds () const |
Gets the global bounds for this grid. More... | |
virtual const GridDimensions | dimensions () const |
Gets the local bounds of this SharedGrid. More... | |
virtual bool | moveTo (const AgentId &id, const std::vector< int > &newLocation) |
Moves the specified agent to the specified location. More... | |
virtual bool | moveTo (const AgentId &id, const Point< int > &pt) |
Moves the specified agent to the specified point. More... | |
virtual void | removeAgent (T *agent) |
virtual void | getRequiredAgents (std::set< AgentId > &agentsToTest, std::set< AgentId > &agentsRequired) |
virtual void | getAgentsToPush (std::set< AgentId > &agentsToTest, std::map< int, std::set< AgentId > > &agentsToPush) |
Given a set of agents, gets the agents that this projection implementation must 'push' to other processes. More... | |
virtual void | getInfoExchangePartners (std::set< int > &psToSendTo, std::set< int > &psToReceiveFrom) |
Gets the set of processes with which this Projection exchanges projection info. More... | |
virtual void | getAgentStatusExchangePartners (std::set< int > &psToSendTo, std::set< int > &psToReceiveFrom) |
Gets the set of processes with which this Projection exchanges agent status info- that is, the set of processes from which agents can move to this one or to which they can move when moving from this one. More... | |
virtual void | updateProjectionInfo (ProjectionInfoPacket *pip, Context< T > *context) |
Public Member Functions inherited from repast::BaseGrid< T, MultipleOccupancy< T, int >, GPTransformer, Adder, int > | |
BaseGrid (std::string name, GridDimensions dimensions) | |
Creates a BaseGrid with the specified name and dimensions. More... | |
virtual bool | contains (const AgentId &id) |
Gets whether or not this grid contains the agent with the specified id. More... | |
virtual bool | getLocation (const T *agent, std::vector< int > &pt) const |
Gets the location of this agent and puts it in the specified vector. More... | |
virtual bool | getLocation (const AgentId &id, std::vector< int > &out) const |
Gets the location of this agent and puts it in the specified vectors. More... | |
virtual T * | getObjectAt (const Point< int > &pt) const |
Gets the first object found at the specified point, or NULL if there is no such object. More... | |
virtual void | getObjectsAt (const Point< int > &pt, std::vector< T * > &out) const |
Gets all the objects found at the specified point. More... | |
virtual bool | moveTo (const T *agent, const std::vector< int > &newLocation) |
Moves the specified agent to the specified location. More... | |
virtual bool | moveTo (const T *agent, const Point< int > &newLocation) |
Moves the specified agent to the specified location. More... | |
virtual std::pair< bool, Point< int > > | moveByDisplacement (const T *agent, const std::vector< int > &displacement) |
Moves the specified object from its current location by the specified amount. More... | |
virtual std::pair< bool, Point< int > > | moveByVector (const T *agent, double distance, const std::vector< double > &anglesInRadians) |
doc inherited from Grid | |
virtual const_iterator | begin () const |
Gets an iterator over the agents in this BaseGrid starting with the first agent. More... | |
virtual const_iterator | end () const |
Gets the end of an iterator over the agents in this BaseGrid. More... | |
virtual size_t | size () const |
Gets the number of agents in this BaseGrid. More... | |
virtual double | getDistance (const Point< int > &pt1, const Point< int > &pt2) const |
Gets the distance between the two grid points. More... | |
virtual double | getDistanceSq (const Point< int > &pt1, const Point< int > &pt2) const |
Gets the square of the distance between the two grid points. More... | |
virtual void | getDisplacement (const Point< int > &pt1, const Point< int > &pt2, std::vector< int > &out) const |
Gets vector difference between point 1 and point 2, putting the result in out. More... | |
virtual void | translate (const Point< int > &location, const Point< int > &displacement, std::vector< int > &out) const |
Translates the specified location by the specified displacement put the result in out. More... | |
virtual void | transform (const std::vector< int > &location, std::vector< int > &out) const |
Transforms the specified location using the properties (e.g. More... | |
virtual bool | isPeriodic () const |
Gets whether or not this grid is periodic (i.e. More... | |
virtual ProjectionInfoPacket * | getProjectionInfo (AgentId id, bool secondaryInfo=false, std::set< AgentId > *secondaryIds=0, int destProc=-1) |
Public Member Functions inherited from repast::Grid< T, int > | |
Grid (std::string name) | |
Creates a Grid with the specified name. More... | |
virtual void | getRequiredAgents (std::set< AgentId > &agentsToTest, std::set< AgentId > &agentsRequired, RADIUS radius=Projection< T >::PRIMARY) |
Given a set of agents to test, gets the subset that must be kept in order to fulfill the projection's 'contract' to the specified radius. More... | |
virtual bool | keepsAgentsOnSyncProj () |
Should return true if the Projection implemented can 'keep' some (non-local) agents during a projection information synchronization operation. More... | |
virtual bool | sendsSecondaryAgentsOnStatusExchange () |
Should return true if the Projection implemented will send secondary agents during a status exchange. More... | |
virtual void | cleanProjectionInfo (std::set< AgentId > &agentsToKeep) |
Public Member Functions inherited from repast::Projection< T > | |
Projection (std::string name) | |
Creates a projection with specified name. More... | |
const std::string | name () const |
Gets the name of this projection. | |
void | addFilterVal (int type) |
Adds an entry to the list of agent types that can be added to this projection. More... | |
void | removeFilterVal (int type) |
Removes an entry from the list of agent types that can be added to this projection. More... | |
void | clearFilter () |
Clears the list of agent types that can be added to this projection; the result is that the filter is empty, and any agent can be added. | |
bool | agentCanBeAdded (boost::shared_ptr< T > agent) |
Returns true if the agent can be added to the projection, which will be the case if the filter list is empty or if the agent's type is in the filter list. More... | |
virtual void | getProjectionInfo (std::vector< AgentId > &agents, std::vector< ProjectionInfoPacket * > &packets, bool secondaryInfo=false, std::set< AgentId > *secondaryIds=0, int destProc=-1) |
Convenience wrapper that gets all of the projection information for the agents specified (calls implementation in child class that gets only the information for one agent). | |
void | updateProjectionInfo (std::vector< ProjectionInfoPacket * > &pips, Context< T > *context) |
Updates the projection information for the agents in this projection according to the information contained in the vector of information packets passed. | |
Protected Member Functions | |
virtual void | synchMoveTo (const AgentId &id, const Point< int > &pt) |
Protected Member Functions inherited from repast::BaseGrid< T, MultipleOccupancy< T, int >, GPTransformer, Adder, int > | |
virtual bool | addAgent (boost::shared_ptr< T > agent) |
LocationMapConstIter | locationsBegin () const |
LocationMapConstIter | locationsEnd () const |
T * | get (const AgentId &id) |
Additional Inherited Members | |
Public Types inherited from repast::BaseGrid< T, MultipleOccupancy< T, int >, GPTransformer, Adder, int > | |
typedef boost::transform_iterator< AgentFromGridPoint< T, int >, LocationMapConstIter > | const_iterator |
A const iterator over shared_ptr<T>. | |
Public Types inherited from repast::Projection< T > | |
enum | RADIUS { PRIMARY, SECONDARY } |
Protected Types inherited from repast::SharedBaseGrid< T, GPTransformer, Adder, int > | |
typedef repast::BaseGrid< T, MultipleOccupancy< T, int >, GPTransformer, Adder, int > | GridBaseType |
Protected Types inherited from repast::BaseGrid< T, MultipleOccupancy< T, int >, GPTransformer, Adder, int > | |
typedef AgentLocationMap::iterator | LocationMapIter |
typedef AgentLocationMap::const_iterator | LocationMapConstIter |
Protected Attributes inherited from repast::SharedBaseGrid< T, GPTransformer, Adder, int > | |
int | _buffer |
GridDimensions | localBounds |
GridDimensions | globalBounds |
Neighbors * | nghs |
std::vector< AgentId > | buffered |
int | rank |
boost::mpi::communicator * | comm |
Protected Attributes inherited from repast::BaseGrid< T, MultipleOccupancy< T, int >, GPTransformer, Adder, int > | |
GPTransformer | gpTransformer |
Adder | adder |
Protected Attributes inherited from repast::Projection< T > | |
std::string | name_ |
std::set< int > | filter |
Discrete matrix-like SharedBaseGrid implementation.
This primarily adds the buffer synchronization appropriate for this type. Default templated typical SharedGrid types are defined in SharedGrids.