DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <ComposableModel.hh>
Static Public Member Functions | |
static string | typeName () |
Private Member Functions | |
void | createInitialStates () const |
void | completeSynchronisation () |
void | initInitialStateEnumeration () |
bool | computeSynchronisationEventsInUse () |
bool | checkSynchronisationEvent (const SyncEvent &syncEvent) |
Private Attributes | |
vector< typename Ptr< ComposableModel >::ConstP > | _models |
std::unordered_map< typename Ptr< Component >::ConstP, size_t > | _compIds |
Ptr< Component >::ConstP | _comp |
Ptr< Component >::P | _synchronisedFsm |
Ptr< SyncRules >::ConstP | _sync |
StateOfVector | _stateOfVector |
VectorOfState | _vectorOfState |
InitialStateEnumerator | _initialStateEnumerator |
std::unordered_map< typename Ptr< SyncEvent >::ConstP, std::unordered_set< size_t > > | _synchronisationEventsInUse |
std::unordered_map< Event, typename Ptr< SyncEvent >::ConstP > | _synchronisationEventsOfSynchronisedEvent |
std::unordered_map< State, std::unordered_set< Event > > | _pendingOutputs |
std::unordered_map< State, std::unordered_set< Event > > | _pendingInputs |
bool | _valid |
bool | _notStarted |
Ptr< StateCreator >::P | _creator |
This class implements the type of Fsms that can be composed by applying a Synchronisation law. In order to compose two models, it is required that they have the same Synchronisation law. This class can be used in two different manners. To fully compute a synchronised automaton or to compute it on the fly. If set to be on the fly, then the computation of the transitions are performed when calling the methods:
Definition at line 43 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::Component = Fsm |
Definition at line 53 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::Event = typename Component::EventPropertyId |
Definition at line 54 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::Exception = Diades::Utils::Exception<ComposableModel> |
Definition at line 52 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::InitialStateEnumerator = Diades::Utils::RangesEnumeration<InitialStateIterator> |
Definition at line 67 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::InitialStateIterator = typename Component::InitialStateIterator |
Definition at line 59 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::InputEventTransitionIterator = typename Component::InputEventTransitionIterator |
Definition at line 56 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::InputTransitionIterator = typename Component::InputTransitionIterator |
Definition at line 58 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::OutputEventTransitionIterator = typename Component::OutputEventTransitionIterator |
Definition at line 55 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::OutputTransitionIterator = typename Component::OutputTransitionIterator |
Definition at line 57 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::State = typename Component::State |
Definition at line 62 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::StateIterator = typename Component::StateIterator |
Definition at line 60 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::StateOfVector = Diades::Utils::NAryTree<State, State, std::unordered_map> |
Definition at line 65 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::StateVector = std::vector<State> |
Definition at line 64 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::SyncEvent = typename SyncRules::SyncEvent |
Definition at line 69 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::SyncRules = SynchronisationRules<Fsm> |
Definition at line 68 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::Transition = typename Component::Transition |
Definition at line 63 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::TransitionIterator = typename Component::TransitionIterator |
Definition at line 61 of file ComposableModel.hh.
using Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::VectorOfState = std::unordered_map<State, StateVector> |
Definition at line 66 of file ComposableModel.hh.
|
default |
Default constructor
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::isValid().
|
default |
Copy constructor (default)
other |
|
default |
Move constructor (default)
other |
|
virtualdefault |
Destructor
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::isValid().
|
inline |
Basic constructor
component | a Component |
synchronisation | a SynchronisationRules law. |
Create a ComposableModel from a Component. The behaviour of the ComposableModel relies on the behaviour of the Component from the initial states in component. The ComposableModel can be synchronised with any other ComposableModel that has the same Synchronisation law. Note that the SynchronisationRules must be encoded before the ComposableModel start perform synchronisation. It is not the responsability of the ComposableModel to encode the event associated with involved in SynchronisationEvent of the SynchronisationRules.
Definition at line 198 of file ComposableModel.hh.
|
inline |
Constructor by composition
models | list of ComposableModels |
synchronisation | a SynchronisationRules law. |
Initialise the ComposableModel resulting from the Synchronisation of the ComposableModel in 'models' It actually does not perform the synchronisation
Definition at line 226 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::component(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::computeSynchronisationEventsInUse(), Diades::Utils::Ptr< T >::get(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::models().
|
inline |
Constructor by composition
models | list of ComposableModels |
synchronisation | a SynchronisationRules law. |
result | the underlying Fsm which will contain the result of the synchronisation operation. |
Initialise the ComposableModel resulting from the Synchronisation of the ComposableModel in 'models' It actually does not perform the synchronisation
Definition at line 259 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::component(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::computeSynchronisationEventsInUse(), Diades::Utils::Ptr< T >::get(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::initInitialStateEnumeration(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::models().
|
inlineprivate |
syncEvent | the SynchronisationEvent to add if required (compute internal support) |
A
compatible SynchronisationEvent is such that its support is either fully in the ComposableModel or is fully involving Component not in the ComposableModel. Such a compatible event will be stored in _synchronisationEventsInUse associated with its support Definition at line 979 of file ComposableModel.hh.
References Diades::Utils::Ptr< T >::get(), and Diades::Utils::isIn().
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::computeSynchronisationEventsInUse().
|
inline |
Compute the complete synchronisation from the models (from scratch) and returns it as the Fsm 'synchronisedFsm'
synchronisedFsm | is the resulting synchronised fsm as a whole |
Definition at line 294 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::completeSynchronisation(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::init(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::isValid().
|
inlineprivate |
complete the synchronisation that is on the go
Definition at line 313 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::createInitialStates(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchroniseOutputs().
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::completeSynchronisation(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::stateBegin(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::stateEnd(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::transitionBegin(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::transitionEnd().
|
inline |
Definition at line 474 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::_comp, and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::_synchronisedFsm.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::ComposableModel(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::name().
|
inlineprivate |
Called by the constructor, this method looks in the SynchronisationRules to see which SynchronisationEvent will be effectively in use in this ComposableModel
Definition at line 954 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::checkSynchronisationEvent().
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::ComposableModel().
|
inlineprivate |
Create all the initial states
Definition at line 93 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::newInitialState().
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::completeSynchronisation(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::initialStateBegin().
|
inline |
Initialise the ComposableModel with an Fsm that will explicitely contains the synchronisation of the component models in the ComposableModel
synchronisedFsm | the Fsm that will result for the synchronisation |
Definition at line 428 of file ComposableModel.hh.
References Diades::Utils::NAryTree< Node, Leaf, _Map >::clear(), Diades::Utils::Ptr< T >::get(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::initInitialStateEnumeration().
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::completeSynchronisation().
|
inline |
Definition at line 109 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::createInitialStates().
|
inline |
Definition at line 124 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::newInitialState().
|
inlineprivate |
Initialise the initial state enumeration
Definition at line 452 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::models(), Diades::Utils::RangesEnumeration< T >::setup(), and start.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::ComposableModel(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::init().
|
inline |
s | source state |
e | event to trigger from state s. Event e is a synchronised event from the Synchronization law |
Note
that the computation of the set of input transitions might be effectively done at this stage, but then only these ones
Definition at line 781 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchroniseInputs().
|
inline |
s | source state |
e | event to trigger from state s Event e is a synchronised event from the Synchronization law |
Note
that the computation of the set of input transitions might be effectively done at this stage, but then only these ones Definition at line 808 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchroniseInputs().
|
inline |
s | source state |
Definition at line 888 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchroniseInputs().
|
inline |
s | source state |
Definition at line 917 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchroniseInputs().
|
inline |
Definition at line 145 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::_valid, Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::ComposableModel(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::operator=(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::~ComposableModel().
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::completeSynchronisation().
|
inline |
Definition at line 490 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::_models.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::ComposableModel(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::initInitialStateEnumeration().
|
inline |
Definition at line 502 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::_models.
|
inline |
Definition at line 512 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::component().
|
inline |
initialStates | the StateVector associated with the created new initial state |
initialState | a new initial state in the resulting synchronised Fsm if not all of them have been already created |
Definition at line 554 of file ComposableModel.hh.
References Diades::Utils::RangesEnumeration< T >::completed(), Diades::Utils::RangesEnumeration< T >::current(), Diades::Utils::RangesEnumeration< T >::hasNext(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::newState().
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::createInitialStates(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::initialStateEnd().
|
inline |
states | a vector of components'states (states.at(i) is a State of models().at(i)) |
result | the State associated with states in the resulting synchronised Fsm |
Definition at line 525 of file ComposableModel.hh.
References Diades::Utils::NAryTree< Node, Leaf, _Map >::getLeaf(), Diades::Utils::NAryTree< Node, Leaf, _Map >::insertSuccessiveBranches(), and states.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::newInitialState(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchroniseInputs(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchroniseOutputs().
|
default |
Assignement (default)
other |
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::isValid().
|
default |
|
inline |
s | source state |
e | event to trigger from state s. Event e is a synchronised event from the Synchronization law |
Note
that the computation of the set of output transitions might be effectively done at this stage, but then only these ones Definition at line 728 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchroniseOutputs().
|
inline |
s | source state |
e | event to trigger from state s Event e is a synchronised event from the Synchronization law |
Note
that the computation of the set of output transitions might be effectively done at this stage, but then only these ones Definition at line 754 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchroniseOutputs().
|
inline |
s | source state |
Note
that the computation of the set of output transitions might be effectively done at this stage, but then only these ones Definition at line 833 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchroniseOutputs().
|
inline |
s | source state |
Note
that the computation of the set of output transitions might be effectively done at this stage, but then only these ones Definition at line 861 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchroniseOutputs().
|
inline |
If
the synchronisation is not fully performed at this stage, it will be computed before stateBegin() returns an iterator on the full set of states Definition at line 336 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::completeSynchronisation().
|
inline |
If
the synchronisation is not fully performed at this stage, it will be computed before stateEnd() returns an iterator on the full set of states Definition at line 356 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::completeSynchronisation().
|
inline |
Definition at line 413 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::_sync.
|
inline |
Synchronisation of the input transitions of a given state labelled with the synchronised event 'event' (potential creation of new states for the source states)
state | a global state (a state of component() created by newState only) |
event | a synchronised event (an event for the set of SynchronisationEvents in the rules), i.e. event = synchroEvent.synchronisedEvent() with synchroEvent part of the SynchronisationLaw() |
Definition at line 661 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::newState(), and start.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::inputEventTransitionBegin(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::inputEventTransitionEnd(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::inputTransitionBegin(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::inputTransitionEnd().
|
inline |
Synchronisation of the output transitions of a given state labelled with the synchronised event 'event' (potential creation of new states for the target states)
state | a global state (a state of component() created by newState only) |
event | a synchronised event (an event for the set of SynchronisationEvents in the rules), i.e. event = synchroEvent.synchronisedEvent() with synchroEvent part of the SynchronisationLaw() |
Definition at line 595 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::newState(), and start.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::completeSynchronisation(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::outputEventTransitionBegin(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::outputEventTransitionEnd(), Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::outputTransitionBegin(), and Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::outputTransitionEnd().
|
inline |
If
the synchronisation is not fully performed at this stage, it will be computed before transitionBegin() returns an iterator on the full set of transitions Definition at line 376 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::completeSynchronisation().
|
inline |
If
the synchronisation is not fully performed at this stage, it will be computed before transitionEnd() returns an iterator on the full set of transitions Definition at line 396 of file ComposableModel.hh.
References Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::completeSynchronisation().
|
inlinestatic |
Definition at line 48 of file ComposableModel.hh.
|
private |
Definition at line 73 of file ComposableModel.hh.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::component().
|
private |
Definition at line 72 of file ComposableModel.hh.
|
mutableprivate |
Definition at line 85 of file ComposableModel.hh.
|
mutableprivate |
Definition at line 78 of file ComposableModel.hh.
|
private |
Definition at line 71 of file ComposableModel.hh.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::models().
|
mutableprivate |
Definition at line 84 of file ComposableModel.hh.
|
mutableprivate |
Definition at line 82 of file ComposableModel.hh.
|
mutableprivate |
Definition at line 81 of file ComposableModel.hh.
|
mutableprivate |
Definition at line 76 of file ComposableModel.hh.
|
private |
Definition at line 75 of file ComposableModel.hh.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::synchronisationLaw().
|
private |
Definition at line 79 of file ComposableModel.hh.
|
private |
Definition at line 80 of file ComposableModel.hh.
|
private |
Definition at line 74 of file ComposableModel.hh.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::component().
|
private |
Definition at line 83 of file ComposableModel.hh.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::isValid().
|
mutableprivate |
Definition at line 77 of file ComposableModel.hh.