1 #ifndef CELL_STATE_SPACE_H 2 #define CELL_STATE_SPACE_H 22 template <
class CellType,
class IDType,
class StateVectorType>
28 virtual const CellType&
getCellAtState(
const StateVectorType& state)
const = 0;
32 virtual CellType&
getCellAtState(
const StateVectorType& state) = 0;
36 virtual const CellType&
getCell(
const IDType
id)
const = 0;
40 virtual CellType&
getCell(
const IDType
id) = 0;
41 virtual const StateVectorType&
getCenter()
const = 0;
42 virtual const StateVectorType&
getWidth()
const = 0;
45 template <
class CellType,
class IDType,
class StateVectorType>
87 IDType
getID(
const StateVectorType& state)
const {
114 const CellType&
getCell(
const IDType ID)
const {
117 const StateVectorType
getCenter(
const IDType ID)
const {
123 std::vector<IDType> cellCoord(
dimension);
132 centerState[j] += cellCoord[j] *
cellWidth[j];
151 template <
class CellType,
class IDType,
class StateVectorType>
158 return this->
cells[ID].getImage();
161 return this->
cells[ID].getGroup();
164 return this->
cells[ID].getStep();
166 void setImage(
const IDType ID,
const IDType image) {
167 this->
cells[ID].setImage(image);
169 void setGroup(
const IDType ID,
const IDType group) {
170 this->
cells[ID].setGroup(group);
172 void setStep(
const IDType ID,
const IDType step) {
173 this->
cells[ID].setStep(step);
179 #endif //CELL_STATE_SPACE_H
virtual const CellType & getCellAtState(const StateVectorType &state) const =0
Returns the cell corresponding to a point in the state space (const)
virtual const CellType & getCell(const IDType id) const =0
Returns the cell with the given ID (const)
virtual const StateVectorType & getCenter() const =0
Base class for classes describing state space discretization.
Definition: css.h:23
virtual const StateVectorType & getWidth() const =0