STAMINA/STORM 0.1
Infinite state-space truncator which generates a probability within a window
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
stamina::builder::threads::ExplorationThread< StateType, RewardModelType, ValueType > Class Template Referenceabstract
Inheritance diagram for stamina::builder::threads::ExplorationThread< StateType, RewardModelType, ValueType >:
stamina::builder::threads::BaseThread< StateType, RewardModelType, ValueType > stamina::builder::threads::IterativeExplorationThread< StateType, RewardModelType, ValueType >

Classes

struct  StateAndProbability
 
struct  StateIndexAndThread
 

Public Member Functions

 ExplorationThread (StaminaModelBuilder< ValueType, RewardModelType, StateType > *parent, uint8_t threadIndex, ControlThread< StateType, RewardModelType, ValueType > &controlThread, uint32_t stateSize, util::StateIndexArray< StateType, ProbabilityState< StateType > > *stateMap, std::shared_ptr< storm::generator::PrismNextStateGenerator< ValueType, StateType > > const &generator, std::function< StateType(CompressedState const &)> stateToIdCallback)
 
uint8_t getIndex ()
 
uint32_t getNumberOfOwnedStates ()
 
bool isIdling ()
 
void setIsCtmc (bool isCtmc)
 
void requestCrossExploration (CompressedState &state, double deltaPi)
 
void requestCrossExploration (StateType stateIndex, double deltaPi)
 
virtual void mainLoop () override
 
- Public Member Functions inherited from stamina::builder::threads::BaseThread< StateType, RewardModelType, ValueType >
 BaseThread (StaminaModelBuilder< ValueType, RewardModelType, StateType > *parent)
 
virtual void mainLoop ()=0
 
void startThread ()
 
const StaminaModelBuilder< ValueType, RewardModelType, StateType > * getParent ()
 
void join ()
 
void terminate ()
 

Protected Member Functions

virtual void exploreStates ()=0
 
virtual void exploreState (StateAndProbability &stateProbability)=0
 
virtual void enqueueSuccessors (CompressedState &state)=0
 

Protected Attributes

std::shared_mutex crossExplorationQueueMutex
 
std::deque< std::pair< CompressedState, double > > crossExplorationQueue
 
std::deque< StateAndProbabilitymainExplorationQueue
 
uint32_t numberOfOwnedStates
 
bool idling
 
ControlThread< StateType, RewardModelType, ValueType > & controlThread
 
util::StateIndexArray< StateType, ProbabilityState< StateType > > * stateMap
 
storm::storage::sparse::StateStorage< StateType > & stateStorage
 
std::shared_ptr< storm::generator::PrismNextStateGenerator< ValueType, StateType > > const & generator
 
std::deque< StateAndProbabilitystatesTerminatedLastIteration
 
std::function< StateType(CompressedState const &)> stateToIdCallback
 
std::deque< StateIndexAndThreadstatesToRequestCrossExploration
 
- Protected Attributes inherited from stamina::builder::threads::BaseThread< StateType, RewardModelType, ValueType >
bool finished
 

Constructor & Destructor Documentation

◆ ExplorationThread()

template<typename StateType , typename RewardModelType , typename ValueType >
stamina::builder::threads::ExplorationThread< StateType, RewardModelType, ValueType >::ExplorationThread ( StaminaModelBuilder< ValueType, RewardModelType, StateType > *  parent,
uint8_t  threadIndex,
ControlThread< StateType, RewardModelType, ValueType > &  controlThread,
uint32_t  stateSize,
util::StateIndexArray< StateType, ProbabilityState< StateType > > *  stateMap,
std::shared_ptr< storm::generator::PrismNextStateGenerator< ValueType, StateType > > const &  generator,
std::function< StateType(CompressedState const &)>  stateToIdCallback 
)

Constructor. Invokes super's constructor and stores the thread index which cannot change for the life of the thread

Parameters
parentThe model builder who owns this thread
threadIndexThe index of this thread
stateSizeThe size of the states
stateMapAccess to the parent class's stateMap

Member Function Documentation

◆ mainLoop()

template<typename StateType , typename RewardModelType , typename ValueType >
void stamina::builder::threads::ExplorationThread< StateType, RewardModelType, ValueType >::mainLoop
overridevirtual

Does state exploration or idles until worker thread asks to kill it.

Implements stamina::builder::threads::BaseThread< StateType, RewardModelType, ValueType >.

◆ requestCrossExploration()

template<typename StateType , typename RewardModelType , typename ValueType >
void stamina::builder::threads::ExplorationThread< StateType, RewardModelType, ValueType >::requestCrossExploration ( CompressedState &  state,
double  deltaPi 
)

A function called by other threads to request cross exploration of states already explored but encountered by another thread.

Parameters
stateThe state to cross explore.
deltaPiThe difference in reachability to add to that state and push forward to its successors.

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