DiaDes  0.1
DIAgnosis of Discrete-Event System
Public Types | Public Member Functions | Private Attributes | List of all members
Diades::Automata::Experimental::BeliefState< StateMachine > Class Template Reference

#include <BeliefState.hh>

Public Types

using Gns = Diades::Graph::GraphNodeSet
 
using Fsm = StateMachine
 
using State = typename Fsm::State
 
using Transition = typename Fsm::Transition
 
using EventPropertyId = typename Fsm::EventPropertyId
 
using SharedPtr = std::shared_ptr< BeliefState >
 
- Public Types inherited from Diades::Graph::GraphNodeSet
using Node = Diades::Graph::Node
 
using Exception = Diades::Utils::Exception< GraphNodeSet >
 
using Iterator = set< Node >::const_iterator
 

Public Member Functions

 BeliefState (const Fsm &fsm)
 
void insertState (State s)
 
template<class InputStateIterator >
void insertStates (InputStateIterator first, InputStateIterator last)
 
void removeState (State s)
 
Iterator findState (State s) const
 
template<typename IsGoal >
SharedPtr nextPredicateBeliefState (IsGoal isGoal)
 
template<typename IsGoal >
SharedPtr prevPredicateBeliefState (IsGoal isGoal)
 
SharedPtr nextBeliefState (const EventPropertyId &event) const
 
SharedPtr prevBeliefState (const EventPropertyId &event) const
 
SharedPtr nextBeliefState () const
 
SharedPtr prevBeliefState () const
 
template<typename Predicate >
SharedPtr nextBeliefState (Predicate predicate) const
 
template<typename Predicate >
SharedPtr prevBeliefState (Predicate predicate) const
 
template<typename TransitionPredicate , typename TransitionInsertIterator >
SharedPtr nextReachableBeliefState (TransitionPredicate isGoal, TransitionInsertIterator transInsertIterator, TransitionInsertIterator targetTransInsertIterator)
 nextReachableBeliefState More...
 
template<typename IsGoal , typename IsForbidden , typename TransitionInsertIterator >
SharedPtr nextReachableBeliefState (IsGoal isGoal, IsForbidden isForbidden, TransitionInsertIterator transInsertIterator, TransitionInsertIterator targetTransInsertIterator)
 nextReachableBeliefState More...
 
- Public Member Functions inherited from Diades::Graph::GraphNodeSet
 GraphNodeSet (const Graph &graph)
 
 GraphNodeSet (const Graph &graph, Node n)
 
 GraphNodeSet (const Graph &graph, const set< Node > &n)
 
 GraphNodeSet (const Graph &graph, const unordered_set< Node > &s)
 
 GraphNodeSet (const GraphNodeSet &ns)
 
void insertNode (Node n)
 
template<class InputNodeIterator >
void insertNodes (InputNodeIterator first, InputNodeIterator last)
 
void removeNode (Node n)
 
Iterator findNode (Node n) const
 
bool isEmpty () const
 
int size () const
 
GraphNodeSetnextGraphNodeSet (const set< Edge > &edges) const
 
GraphNodeSetpreviousGraphNodeSet (const set< Edge > &edges) const
 
const Graphgraph () const
 
Iterator begin () const
 
Iterator end () const
 
set< Node > & setOfNodes ()
 
bool operator== (const GraphNodeSet &ns) const
 

Private Attributes

const Fsm_fsm
 

Additional Inherited Members

- Static Public Member Functions inherited from Diades::Graph::GraphNodeSet
static string typeName ()
 
- Protected Attributes inherited from Diades::Graph::GraphNodeSet
const Graph_grph
 
set< Node_nodes
 

Detailed Description

template<typename StateMachine>
class Diades::Automata::Experimental::BeliefState< StateMachine >

Definition at line 26 of file BeliefState.hh.

Member Typedef Documentation

◆ EventPropertyId

Definition at line 33 of file BeliefState.hh.

◆ Fsm

template<typename StateMachine>
using Diades::Automata::Experimental::BeliefState< StateMachine >::Fsm = StateMachine

Definition at line 30 of file BeliefState.hh.

◆ Gns

Definition at line 29 of file BeliefState.hh.

◆ SharedPtr

template<typename StateMachine>
using Diades::Automata::Experimental::BeliefState< StateMachine >::SharedPtr = std::shared_ptr<BeliefState>

Definition at line 34 of file BeliefState.hh.

◆ State

template<typename StateMachine>
using Diades::Automata::Experimental::BeliefState< StateMachine >::State = typename Fsm::State

Definition at line 31 of file BeliefState.hh.

◆ Transition

template<typename StateMachine>
using Diades::Automata::Experimental::BeliefState< StateMachine >::Transition = typename Fsm::Transition

Definition at line 32 of file BeliefState.hh.

Constructor & Destructor Documentation

◆ BeliefState()

template<typename StateMachine>
Diades::Automata::Experimental::BeliefState< StateMachine >::BeliefState ( const Fsm fsm)
inline

Parametrized constructor

Parameters
fsma Finite State Machine Build an empty belief state of the Fsm

Definition at line 48 of file BeliefState.hh.

Member Function Documentation

◆ findState()

template<typename StateMachine>
Iterator Diades::Automata::Experimental::BeliefState< StateMachine >::findState ( State  s) const
inline

Find a state

Parameters
sState to find
Returns
a Iterator it
Postcondition
if s is in the BeliefState then *it == s otherwise it == end()

Definition at line 93 of file BeliefState.hh.

References Diades::Graph::GraphNodeSet::findNode().

◆ insertState()

template<typename StateMachine>
void Diades::Automata::Experimental::BeliefState< StateMachine >::insertState ( State  s)
inline

Insert a state

Parameters
sthe State to insert

Definition at line 58 of file BeliefState.hh.

References Diades::Graph::GraphNodeSet::insertNode().

◆ insertStates()

template<typename StateMachine>
template<class InputStateIterator >
void Diades::Automata::Experimental::BeliefState< StateMachine >::insertStates ( InputStateIterator  first,
InputStateIterator  last 
)
inline

Insert a range of states

Parameters
firstthe first state to insert if not first != last
lastthe element after the last state to insert

Definition at line 71 of file BeliefState.hh.

References Diades::Graph::GraphNodeSet::insertNodes().

◆ nextBeliefState() [1/3]

template<typename StateMachine>
SharedPtr Diades::Automata::Experimental::BeliefState< StateMachine >::nextBeliefState ( const EventPropertyId event) const
inline

◆ nextBeliefState() [2/3]

template<typename StateMachine>
SharedPtr Diades::Automata::Experimental::BeliefState< StateMachine >::nextBeliefState ( ) const
inline

◆ nextBeliefState() [3/3]

template<typename StateMachine>
template<typename Predicate >
SharedPtr Diades::Automata::Experimental::BeliefState< StateMachine >::nextBeliefState ( Predicate  predicate) const
inline

◆ nextPredicateBeliefState()

template<typename StateMachine>
template<typename IsGoal >
SharedPtr Diades::Automata::Experimental::BeliefState< StateMachine >::nextPredicateBeliefState ( IsGoal  isGoal)
inline

◆ nextReachableBeliefState() [1/2]

template<typename StateMachine>
template<typename TransitionPredicate , typename TransitionInsertIterator >
SharedPtr Diades::Automata::Experimental::BeliefState< StateMachine >::nextReachableBeliefState ( TransitionPredicate  isGoal,
TransitionInsertIterator  transInsertIterator,
TransitionInsertIterator  targetTransInsertIterator 
)
inline

nextReachableBeliefState

compute the beliefstate that contains the set of states that are the target of transitions we aim to reach from the current BeliefState with an indefinite transition path. The set of transitions that we aim to reach are the ones such that 'isGoal' is true, and they are called 'goal transitions'. A path from the current BeliefState to the returned one is a path that contains only one goal transition.

Parameters
isGoalis a Predicate that takes as input a transition and returns true if the transition is a goal transition, that is the set of transitions that the method attempts to reach
transInsertIteratoris an output_iterator see cplusplus.com/reference/iterator/OutputIterator This iterator is used to insert the set of transitions such that every of them is part of a path from the current Beliefstate to a goal transition from the current BeliefState. This set also includes the effective set of reached transitions among the goal transitions.
Returns
return the set of states that are the targets of the goal transitions that could be effectively reached from the current BeliefState by a transition path made of only one goal transition.

This method is typically used to look for a certain type of observable transitions from the current belief state.

Definition at line 330 of file BeliefState.hh.

◆ nextReachableBeliefState() [2/2]

template<typename StateMachine>
template<typename IsGoal , typename IsForbidden , typename TransitionInsertIterator >
SharedPtr Diades::Automata::Experimental::BeliefState< StateMachine >::nextReachableBeliefState ( IsGoal  isGoal,
IsForbidden  isForbidden,
TransitionInsertIterator  transInsertIterator,
TransitionInsertIterator  targetTransInsertIterator 
)
inline

nextReachableBeliefState

compute the beliefstate that contains the set of states that are the target of transitions we aim to reach from the current BeliefState with an indefinite transition path. The set of transitions that we aim to reach are the ones such that 'isGoal' is true, and they are called 'goal transitions'. A path from the current BeliefState to the returned one is a path that contains only one goal transition and does not contain any forbidden transition

Parameters
isGoalis a Predicate that takes as input a transition and returns true if the transition is a goal transition, that is the set of transitions that the method attempts to reach
isForbiddenis a Predicate that takes as input a transition and returns true if the trigger of the transition is forbidden during the search for reachable states.
transInsertIteratoris an output_iterator see cplusplus.com/reference/iterator/OutputIterator This iterator is used to insert the set of transitions such that every of them is part of a path from the current Beliefstate to a goal transition from the current BeliefState. This set also includes the effective set of reached transitions among the goal transitions.
Returns
return the set of states that are the targets of the goal transitions that could be effectively reached from the current BeliefState by a transition path made of only one goal transition.

This method is typically used to look for a certain type of observable transitions from the current belief state.

Definition at line 378 of file BeliefState.hh.

References Diades::Automata::Experimental::BeliefState< StateMachine >::_fsm, Diades::Graph::GraphNodeSet::begin(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::behaviour(), current, Diades::Graph::GraphNodeSet::end(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::inputTransitionBegin(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::inputTransitionEnd(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionBegin(), and Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionEnd().

◆ prevBeliefState() [1/3]

template<typename StateMachine>
SharedPtr Diades::Automata::Experimental::BeliefState< StateMachine >::prevBeliefState ( const EventPropertyId event) const
inline

◆ prevBeliefState() [2/3]

template<typename StateMachine>
SharedPtr Diades::Automata::Experimental::BeliefState< StateMachine >::prevBeliefState ( ) const
inline

◆ prevBeliefState() [3/3]

template<typename StateMachine>
template<typename Predicate >
SharedPtr Diades::Automata::Experimental::BeliefState< StateMachine >::prevBeliefState ( Predicate  predicate) const
inline

◆ prevPredicateBeliefState()

template<typename StateMachine>
template<typename IsGoal >
SharedPtr Diades::Automata::Experimental::BeliefState< StateMachine >::prevPredicateBeliefState ( IsGoal  isGoal)
inline

◆ removeState()

template<typename StateMachine>
void Diades::Automata::Experimental::BeliefState< StateMachine >::removeState ( State  s)
inline

Removal of a state

Parameters
sa state
Precondition
s is a State of the fsm

Definition at line 82 of file BeliefState.hh.

References Diades::Graph::GraphNodeSet::removeNode().

Member Data Documentation

◆ _fsm

template<typename StateMachine>
const Fsm& Diades::Automata::Experimental::BeliefState< StateMachine >::_fsm
private

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