STAMINA/STORM 0.1
Infinite state-space truncator which generates a probability within a window
Public Member Functions | Protected Member Functions | List of all members
stamina::util::StateIndexArray< StateType, ProbabilityStateType > Class Template Reference

Public Member Functions

 StateIndexArray (uint8_t blockSizeExponent=15)
 
void clear ()
 
void reserve (uint32_t numToReserve)
 
ProbabilityStateType * get (StateType index)
 
void put (StateType index, ProbabilityStateType *probabilityState)
 
std::vector< StateType > getPerimeterStates ()
 
uint32_t getNumberTerminal ()
 

Protected Member Functions

uint32_t sizeToActualSize (uint32_t size)
 

Member Function Documentation

◆ clear()

template<typename StateType , typename ProbabilityStateType >
void stamina::util::StateIndexArray< StateType, ProbabilityStateType >::clear

Clears all elements from the StateIndexArray and frees all memory

◆ get()

template<typename StateType , typename ProbabilityStateType >
ProbabilityStateType * stamina::util::StateIndexArray< StateType, ProbabilityStateType >::get ( StateType  index)

Gets a pointer to the ProbabilityState stored in the array. If the index does not exist, or is greater than the amount stored, returns a nullptr

Parameters
indexThe index to find
Returns
The ProbabilityState or nullptr if does not exist

◆ getNumberTerminal()

template<typename StateType , typename ProbabilityStateType >
uint32_t stamina::util::StateIndexArray< StateType, ProbabilityStateType >::getNumberTerminal

Gets the actual number of terminal states in the map

◆ getPerimeterStates()

template<typename StateType , typename ProbabilityStateType >
std::vector< StateType > stamina::util::StateIndexArray< StateType, ProbabilityStateType >::getPerimeterStates

Gets a vector of all of the terminal states in the stateIndexArray

Returns
A vector of all perimeter states

◆ put()

template<typename StateType , typename ProbabilityStateType >
void stamina::util::StateIndexArray< StateType, ProbabilityStateType >::put ( StateType  index,
ProbabilityStateType *  probabilityState 
)

Puts a ProbabilityState in at index and if needed, expands the array to accomodate

Parameters
probabilityStateThe state to emplace

◆ reserve()

template<typename StateType , typename ProbabilityStateType >
void stamina::util::StateIndexArray< StateType, ProbabilityStateType >::reserve ( uint32_t  numToReserve)

Reserves a certain number of states into the StateIndexArray

Parameters
numToReserveThe minimum number to reserve

◆ sizeToActualSize()

template<typename StateType , typename ProbabilityStateType >
uint32_t stamina::util::StateIndexArray< StateType, ProbabilityStateType >::sizeToActualSize ( uint32_t  size)
protected

Gets a size that is a multiple of blockSize

Parameters
sizeThe size you want
Returns
The next size of a multiple of blockSize

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