RepastHPC  2.3.1
Public Member Functions | Public Attributes | List of all members
repast::DimensionDatum< T > Class Template Reference

The DimensionDatum class stores all of the data that the ValueLayerND class will need for each dimension in the N-dimensional space. More...

#include <ValueLayerND.h>

Public Member Functions

 DimensionDatum (int indx, GridDimensions globalBoundaries, GridDimensions localBoundaries, int buffer, bool isPeriodic)
 Constructor. More...
 
virtual ~DimensionDatum ()
 Destructor.
 
int getSendReceiveSize (int relativeLocation)
 Gets the size of the data to be sent during synchronization. More...
 
int getTransformedCoord (int originalCoord)
 Given a coordinate in global simulation coordinates, returns the value in simplified coordinates. More...
 
int getIndexedCoord (int originalCoord, bool isSimplified=false)
 Given a coordinate, returns the index of that coordinate. More...
 
bool isInLocalBounds (int originalCoord)
 Returns true if the specified coordinate is within the local boundaries on this dimension. More...
 
void report (int dimensionNumber)
 Writes a report to the std out file. More...
 

Public Attributes

int globalCoordinateMin
 
int globalCoordinateMax
 
int localBoundariesMin
 
int localBoundariesMax
 
int simplifiedBoundariesMin
 
int simplifiedBoundariesMax
 
int leftBufferSize
 
int rightBufferSize
 
int matchingCoordinateMin
 
int matchingCoordinateMax
 
bool periodic
 
bool atLeftBound
 
bool atRightBound
 
bool spaceContinuesLeft
 
bool spaceContinuesRight
 
int globalWidth
 
int localWidth
 
int width
 
int widthInBytes
 

Detailed Description

template<typename T>
class repast::DimensionDatum< T >

The DimensionDatum class stores all of the data that the ValueLayerND class will need for each dimension in the N-dimensional space.

This mainly includes coordinate boundaries along each dimension, but these boundaries include local, global, and a few other memoized variants.

Constructor & Destructor Documentation

◆ DimensionDatum()

template<typename T >
repast::DimensionDatum< T >::DimensionDatum ( int  indx,
GridDimensions  globalBoundaries,
GridDimensions  localBoundaries,
int  buffer,
bool  isPeriodic 
)

Constructor.

Parameters
indx
globalBoundariesglobal simulation space boundaries
localBoundarieslocal boundaries of this process's space
bufferthe size of the buffer zone
isPeriodictrue if the space is periodic, false if not

Member Function Documentation

◆ getIndexedCoord()

template<typename T >
int repast::DimensionDatum< T >::getIndexedCoord ( int  originalCoord,
bool  isSimplified = false 
)

Given a coordinate, returns the index of that coordinate.

The original coordinate may be in global simulation coordinates or in 'simplified' coordinates. If it is not in simplified coordinates, the first step is to simplify.

For example, suppose the global space is from 0 to 100, and the local space is from 0 to 10, and the buffer zone value is 3. Passing 99 in global coordinates is equivalent to passing -1 in simplified coordinates. The index value in both cases is ((-1) - (-3)) or 2.

Parameters
originalCoordthe original coordinate to be transformed
isSimplifiedtrue if the original coordinate is already in simplified coordinates

◆ getSendReceiveSize()

template<typename T >
int repast::DimensionDatum< T >::getSendReceiveSize ( int  relativeLocation)

Gets the size of the data to be sent during synchronization.

Returns
the size of the data to be sent for this dimension.

◆ getTransformedCoord()

template<typename T >
int repast::DimensionDatum< T >::getTransformedCoord ( int  originalCoord)

Given a coordinate in global simulation coordinates, returns the value in simplified coordinates.

For example, suppose the global space is from 0 to 100, and the local space is from 0 to 10, and the buffer zone value is 3. The simplified coordinates for this region of the local space will be -3 to 13. If the value passed to this function is 99, this function will return -1.

Parameters
originalCoordthe original coordinate
Returns
the coordinate adjusted for local boundaries system

◆ isInLocalBounds()

template<typename T >
bool repast::DimensionDatum< T >::isInLocalBounds ( int  originalCoord)

Returns true if the specified coordinate is within the local boundaries on this dimension.

Parameters
originalCoordinatethe coordinate to be tested
Returns
true if the coordinate is within the local boundaries

◆ report()

template<typename T >
void repast::DimensionDatum< T >::report ( int  dimensionNumber)
inline

Writes a report to the std out file.

Parameters
dimensionNumberpassed to the written report, identifying which dimension this is

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