RepastHPC  2.3.1
Public Member Functions | List of all members
repast::ContinuousValueLayer< ValueType, Borders > Class Template Reference

Continous value layer whose location coordinates are double. More...

#include <ValueLayer.h>

Inheritance diagram for repast::ContinuousValueLayer< ValueType, Borders >:
repast::ValueLayer< ValueType, double > repast::BaseValueLayer

Public Member Functions

 ContinuousValueLayer (const ContinuousValueLayer< ValueType, Borders > &other)
 
ContinuousValueLayeroperator= (const ContinuousValueLayer< ValueType, Borders > &rhs)
 
 ContinuousValueLayer (const std::string &name, const GridDimensions &dimensions, const ValueType &defaultValue=ValueType())
 Creates a ContinuousValueLayer whose cells contain a default value of ValueType() with the specified dimensions. More...
 
ValueType & get (const Point< double > &pt)
 Gets the value at the specified point. More...
 
void set (const ValueType &value, const Point< double > &pt)
 Sets the value at the specified point. More...
 
- Public Member Functions inherited from repast::ValueLayer< ValueType, double >
 ValueLayer (const std::string &name, const GridDimensions &dimensions)
 
ValueType & operator[] (const Point< double > &pt)
 Gets the value at the specified point. More...
 
const ValueType & operator[] (const Point< double > &pt) const
 Gets the value at the specified point. More...
 
const GridDimensions dimensions () const
 Gets the dimensions of this ValueLayer. More...
 
const Point< double > shape () const
 Gets the extents of this ValueLayer. More...
 
- Public Member Functions inherited from repast::BaseValueLayer
 BaseValueLayer (const std::string &name)
 Creates a BaseValueLayer with the specified name.
 
std::string name () const
 Gets the value layer's name. More...
 

Additional Inherited Members

- Protected Member Functions inherited from repast::ValueLayer< ValueType, double >
void translate (std::vector< double > &pt)
 Translates pt by dimensions origin.
 
- Protected Attributes inherited from repast::ValueLayer< ValueType, double >
GridDimensions _dimensions
 
- Protected Attributes inherited from repast::BaseValueLayer
std::string _name
 

Detailed Description

template<typename ValueType, typename Borders>
class repast::ContinuousValueLayer< ValueType, Borders >

Continous value layer whose location coordinates are double.

Template Parameters
ValueTypethe type of what the value layer stores.
Bordersthe type of borders (wrapped / periodic, strict). Border types can be found in GridComponents.h

Constructor & Destructor Documentation

◆ ContinuousValueLayer()

template<typename ValueType , typename Borders >
repast::ContinuousValueLayer< ValueType, Borders >::ContinuousValueLayer ( const std::string &  name,
const GridDimensions dimensions,
const ValueType &  defaultValue = ValueType() 
)

Creates a ContinuousValueLayer whose cells contain a default value of ValueType() with the specified dimensions.

Parameters
namethe name of the ContinuousValueLayer
dimensionthe dimensions of the ContinuousValueLayer
densewhether or not the ValueLayer will be densely populated or not
defaultValuethe default value to return if no value has been set of a location. The default is the result of ValueType().

Member Function Documentation

◆ get()

template<typename ValueType , typename Borders >
ValueType & repast::ContinuousValueLayer< ValueType, Borders >::get ( const Point< double > &  pt)
virtual

Gets the value at the specified point.

If no value has been set at the specified point then this returns the default value.

param pt the location to get the value of

Returns
the value at the specified point, or if no value has been set, then the default value.

Implements repast::ValueLayer< ValueType, double >.

◆ set()

template<typename ValueType , typename Borders >
void repast::ContinuousValueLayer< ValueType, Borders >::set ( const ValueType &  value,
const Point< double > &  pt 
)
virtual

Sets the value at the specified point.

Parameters
valuethe value
ptthe point where the value should be stored

Implements repast::ValueLayer< ValueType, double >.


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