DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#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 |
GraphNodeSet * | nextGraphNodeSet (const set< Edge > &edges) const |
GraphNodeSet * | previousGraphNodeSet (const set< Edge > &edges) const |
const Graph & | graph () 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 |
Definition at line 26 of file BeliefState.hh.
using Diades::Automata::Experimental::BeliefState< StateMachine >::EventPropertyId = typename Fsm::EventPropertyId |
Definition at line 33 of file BeliefState.hh.
using Diades::Automata::Experimental::BeliefState< StateMachine >::Fsm = StateMachine |
Definition at line 30 of file BeliefState.hh.
using Diades::Automata::Experimental::BeliefState< StateMachine >::Gns = Diades::Graph::GraphNodeSet |
Definition at line 29 of file BeliefState.hh.
using Diades::Automata::Experimental::BeliefState< StateMachine >::SharedPtr = std::shared_ptr<BeliefState> |
Definition at line 34 of file BeliefState.hh.
using Diades::Automata::Experimental::BeliefState< StateMachine >::State = typename Fsm::State |
Definition at line 31 of file BeliefState.hh.
using Diades::Automata::Experimental::BeliefState< StateMachine >::Transition = typename Fsm::Transition |
Definition at line 32 of file BeliefState.hh.
|
inline |
Parametrized constructor
fsm | a Finite State Machine Build an empty belief state of the Fsm |
Definition at line 48 of file BeliefState.hh.
|
inline |
Find a state
s | State to find |
Definition at line 93 of file BeliefState.hh.
References Diades::Graph::GraphNodeSet::findNode().
|
inline |
Insert a state
s | the State to insert |
Definition at line 58 of file BeliefState.hh.
References Diades::Graph::GraphNodeSet::insertNode().
|
inline |
Insert a range of states
first | the first state to insert if not first != last |
last | the element after the last state to insert |
Definition at line 71 of file BeliefState.hh.
References Diades::Graph::GraphNodeSet::insertNodes().
|
inline |
Next belief state
e | Event to trigger |
Definition at line 161 of file BeliefState.hh.
References Diades::Automata::Experimental::BeliefState< StateMachine >::_fsm, Diades::Graph::GraphNodeSet::_nodes, Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputEventTransitionBegin(), and Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputEventTransitionEnd().
|
inline |
Next belief state
Definition at line 206 of file BeliefState.hh.
References Diades::Automata::Experimental::BeliefState< StateMachine >::_fsm, Diades::Graph::GraphNodeSet::_nodes, Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionBegin(), and Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionEnd().
|
inline |
Next belief state based on a state predicate
Definition at line 251 of file BeliefState.hh.
References Diades::Automata::Experimental::BeliefState< StateMachine >::_fsm, Diades::Graph::GraphNodeSet::_nodes, Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionBegin(), and Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionEnd().
|
inline |
Next belief state
isGoal | a Predicate P(t) with t a Transition |
Definition at line 109 of file BeliefState.hh.
References Diades::Automata::Experimental::BeliefState< StateMachine >::_fsm, Diades::Graph::GraphNodeSet::_nodes, Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionBegin(), and Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::outputTransitionEnd().
|
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.
isGoal | is 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 |
transInsertIterator | is 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. |
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.
|
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
isGoal | is 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 |
isForbidden | is 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. |
transInsertIterator | is 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. |
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().
|
inline |
Previous belief state
e | Event to trigger |
Definition at line 183 of file BeliefState.hh.
References Diades::Automata::Experimental::BeliefState< StateMachine >::_fsm, Diades::Graph::GraphNodeSet::_nodes, Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::inputEventTransitionBegin(), and Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::inputEventTransitionEnd().
|
inline |
Previous belief state
Definition at line 227 of file BeliefState.hh.
References Diades::Automata::Experimental::BeliefState< StateMachine >::_fsm, Diades::Graph::GraphNodeSet::_nodes, Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::inputEventTransitionBegin(), and Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::inputEventTransitionEnd().
|
inline |
Previous belief state based on a state predicate
Definition at line 277 of file BeliefState.hh.
References Diades::Automata::Experimental::BeliefState< StateMachine >::_fsm, Diades::Graph::GraphNodeSet::_nodes, Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::inputEventTransitionBegin(), and Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::inputEventTransitionEnd().
|
inline |
Next belief state
isGoal | a Predicate P(t) with t a Transition |
Definition at line 136 of file BeliefState.hh.
References Diades::Automata::Experimental::BeliefState< StateMachine >::_fsm, Diades::Graph::GraphNodeSet::_nodes, Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::inputTransitionBegin(), and Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::inputTransitionEnd().
|
inline |
Removal of a state
s | a state |
Definition at line 82 of file BeliefState.hh.
References Diades::Graph::GraphNodeSet::removeNode().
|
private |
Iterator on the nodes
Definition at line 38 of file BeliefState.hh.
Referenced by Diades::Automata::Experimental::BeliefState< StateMachine >::nextBeliefState(), Diades::Automata::Experimental::BeliefState< StateMachine >::nextPredicateBeliefState(), Diades::Automata::Experimental::BeliefState< StateMachine >::nextReachableBeliefState(), Diades::Automata::Experimental::BeliefState< StateMachine >::prevBeliefState(), and Diades::Automata::Experimental::BeliefState< StateMachine >::prevPredicateBeliefState().