DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <ComposableModel.hh>
Public Types | |
typedef Diades::Utils::Exception< ComposableModel > | Exception |
typedef Component::OutputEventTransitionIterator | OutputEventTransitionIterator |
typedef Component::InputEventTransitionIterator | InputEventTransitionIterator |
typedef Component::OutputTransitionIterator | OutputTransitionIterator |
typedef Component::InputTransitionIterator | InputTransitionIterator |
typedef unordered_set< Event >::const_iterator | EventIterator |
typedef Diades::Graph::NodeIterator | StateIterator |
typedef unordered_set< State >::const_iterator | InitialStateIterator |
typedef const ComposableModel * | ConstPointer |
typedef ComposableModel * | Pointer |
Static Public Member Functions | |
static string | typeName () |
Protected Member Functions | |
bool | synchronise () |
the underlying Component (if result from synchronisation) More... | |
void | synchronise (State state, Event event) const |
void | synchronise (State state) const |
Protected Attributes | |
stringstream | _log |
const Component * | _comp |
stream for logging internal messages More... | |
bool | _embeddedResult |
the underlying Component (if associated to a component) More... | |
Component * | _result |
true if the composable model has to manage its own result component More... | |
Private Types | |
typedef vector< const ComposableModel * >::size_type | SizeType |
typedef unordered_map< Event, vector< SizeType > > | SupportMap |
Private Member Functions | |
bool | computeSupport () |
bool | computeInitialStates (list< State > &pendingStates) |
Private Attributes | |
const unsigned | _synchronisationLimit |
const SynchronisationRules *const | _sync |
synchronisation limit (number of states) More... | |
unordered_set< Event > | _usedEvents |
the synchronisation law of the ComposableModel More... | |
unordered_set< State > | _initialStates |
list of the events of the ComposableModel More... | |
vector< Event > | _componentEventOf |
list of initial states More... | |
SupportMap | _support |
ConstNodeMap< vector< State > > | _vectorStateOf |
const vector< ConstPointer > | _models |
StateTable | _stateOfVector |
State | _pendingGlobalState |
vector< const Component * > | _components |
ConstNodeMap< set< Event > > | _visited |
bool | _onTheFly |
This class implements the type of models 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. Either the ComposableModel is not computed on the fly, it means that the composition is performed at construction time. If set to be on the fly, then the computation of the transitions are performed when calling the methods:
Definition at line 35 of file ComposableModel.hh.
typedef const ComposableModel* Diades::Automata::ComposableModel::ConstPointer |
Definition at line 48 of file ComposableModel.hh.
typedef unordered_set<Event>::const_iterator Diades::Automata::ComposableModel::EventIterator |
Definition at line 45 of file ComposableModel.hh.
Definition at line 39 of file ComposableModel.hh.
typedef unordered_set<State>::const_iterator Diades::Automata::ComposableModel::InitialStateIterator |
Definition at line 47 of file ComposableModel.hh.
typedef Component::InputEventTransitionIterator Diades::Automata::ComposableModel::InputEventTransitionIterator |
Definition at line 42 of file ComposableModel.hh.
typedef Component::InputTransitionIterator Diades::Automata::ComposableModel::InputTransitionIterator |
Definition at line 44 of file ComposableModel.hh.
typedef Component::OutputEventTransitionIterator Diades::Automata::ComposableModel::OutputEventTransitionIterator |
Definition at line 41 of file ComposableModel.hh.
typedef Component::OutputTransitionIterator Diades::Automata::ComposableModel::OutputTransitionIterator |
Definition at line 43 of file ComposableModel.hh.
Definition at line 49 of file ComposableModel.hh.
|
private |
Definition at line 53 of file ComposableModel.hh.
Definition at line 46 of file ComposableModel.hh.
|
private |
Definition at line 54 of file ComposableModel.hh.
Diades::Automata::ComposableModel::ComposableModel | ( | const Component & | component, |
const SynchronisationRules & | synchronisation | ||
) |
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.
Referenced by getPointer(), and valid().
Diades::Automata::ComposableModel::ComposableModel | ( | const vector< ConstPointer > & | models, |
const SynchronisationRules & | synchronisation, | ||
bool | onTheFly | ||
) |
Constructor by composition
models | list of ComposableModels |
synchronisation | a SynchronisationRules law. |
onTheFly | the synchronisation is on the fly. |
Create the ComposableModel resulting from the Synchronisation of the ComposableModel in 'models' The operation may fail. In this case, the ComposableModel is empty. Some details about the failure are provided in the log.
Diades::Automata::ComposableModel::ComposableModel | ( | const vector< ConstPointer > & | models, |
const SynchronisationRules & | synchronisation, | ||
bool | onTheFly, | ||
Component * | result | ||
) |
Constructor by composition
models | list of ComposableModels |
synchronisation | a SynchronisationRules law. |
onTheFly | the synchronisation is on the fly. |
result | the Component that will be the result |
Create the ComposableModel resulting from the Synchronisation of the ComposableModel in 'models' The operation may fail. In this case, the ComposableModel is empty. Some details about the failure are provided in the log.
Diades::Automata::ComposableModel::~ComposableModel | ( | ) |
Destructor
Referenced by valid().
|
inline |
Definition at line 211 of file ComposableModel.hh.
|
inline |
Definition at line 274 of file ComposableModel.hh.
Referenced by Diades::Automata::ComposableModelSearch< Algorithm >::initialize(), and Diades::Automata::randomSimulate().
|
inline |
Definition at line 294 of file ComposableModel.hh.
References _comp, and _result.
Referenced by getPointer(), Diades::Automata::initialStateSelection(), inputEventTransitionBegin(), inputEventTransitionEnd(), Diades::Automata::interactiveSimulation(), name(), Diades::Automata::TargetDiagState::next(), Diades::Automata::IncorrectPath::noGood(), numberOfStates(), numberOfTransitions(), outputEventTransitionBegin(), outputEventTransitionEnd(), outputTransitionBegin(), outputTransitionEnd(), Diades::Automata::randomSimulateState(), Diades::Automata::simulate(), startInteractiveSimulation(), startNonInteractiveSimulation(), stateBegin(), and stateEnd().
|
private |
|
private |
|
inline |
Definition at line 221 of file ComposableModel.hh.
|
inline |
Definition at line 283 of file ComposableModel.hh.
Referenced by Diades::Automata::ComposableModelSearch< Algorithm >::initialize(), and Diades::Automata::randomSimulate().
|
inline |
Definition at line 131 of file ComposableModel.hh.
|
inline |
Definition at line 132 of file ComposableModel.hh.
References component(), and ComposableModel().
|
inline |
Definition at line 413 of file ComposableModel.hh.
References Diades::Automata::Component::behaviour(), component(), Diades::Automata::Event::id(), Diades::Automata::Component::inputEventTransitionBegin(), Diades::Automata::Event::isValid(), and require.
|
inline |
Definition at line 423 of file ComposableModel.hh.
References Diades::Automata::Component::behaviour(), component(), Diades::Automata::Event::id(), Diades::Automata::Component::inputEventTransitionEnd(), Diades::Automata::Event::isValid(), and require.
|
inline |
Definition at line 434 of file ComposableModel.hh.
|
inline |
Definition at line 309 of file ComposableModel.hh.
References _models.
Referenced by Diades::Automata::ComposableModelSearch< Algorithm >::diagnosis(), and valid().
|
inline |
Definition at line 197 of file ComposableModel.hh.
References component(), and Diades::Automata::Component::name().
|
inline |
Definition at line 230 of file ComposableModel.hh.
Referenced by Diades::Automata::randomSimulate().
|
inline |
Definition at line 238 of file ComposableModel.hh.
References component(), and Diades::Automata::Component::numberOfStates().
|
inline |
Definition at line 246 of file ComposableModel.hh.
References component(), and Diades::Automata::Component::numberOfTransitions().
|
inline |
s | source state |
e | event to trigger from state s. Event e is a synchronised event from the Synchronization law |
Definition at line 379 of file ComposableModel.hh.
References Diades::Automata::Component::behaviour(), component(), Diades::Automata::Event::id(), Diades::Automata::Event::isValid(), Diades::Automata::Component::outputEventTransitionBegin(), require, and synchronise().
|
inline |
s | source state |
e | event to trigger from state s Event e is a synchronised event from the Synchronization law |
Definition at line 400 of file ComposableModel.hh.
References Diades::Automata::Component::behaviour(), component(), Diades::Automata::Event::id(), Diades::Automata::Event::isValid(), Diades::Automata::Component::outputEventTransitionEnd(), require, and synchronise().
|
inline |
s | source state |
Definition at line 339 of file ComposableModel.hh.
References Diades::Automata::Component::behaviour(), component(), Diades::Automata::Component::outputTransitionBegin(), require, and synchronise().
Referenced by Diades::Automata::NextTransitions::begin(), Diades::Automata::interactiveSimulation(), and Diades::Automata::randomSimulateState().
|
inline |
s | source state |
Definition at line 360 of file ComposableModel.hh.
References Diades::Automata::Component::behaviour(), component(), Diades::Automata::Component::outputTransitionEnd(), require, and synchronise().
Referenced by Diades::Automata::NextTransitions::begin(), Diades::Automata::NextTransitions::end(), Diades::Automata::interactiveSimulation(), and Diades::Automata::randomSimulateState().
|
inline |
Definition at line 255 of file ComposableModel.hh.
References component(), and Diades::Automata::Component::stateBegin().
|
inline |
Definition at line 264 of file ComposableModel.hh.
References component(), and Diades::Automata::Component::stateEnd().
|
inline |
Definition at line 203 of file ComposableModel.hh.
References _sync.
|
protected |
the underlying Component (if result from synchronisation)
This method implements the effective and enumerative composition of ComposableModel objects. The method may fail if the requested operation requires too much computational resources. In case, it fails, the current composable model is invalid. A detailed description about why the composition has failed is given in the log.
Referenced by outputEventTransitionBegin(), outputEventTransitionEnd(), outputTransitionBegin(), and outputTransitionEnd().
|
protected |
On-the-fly synchronisation
state | a State |
|
inlinestatic |
Definition at line 38 of file ComposableModel.hh.
|
inline |
Definition at line 154 of file ComposableModel.hh.
References ComposableModel(), Diades::Automata::Component::isValid(), models(), and ~ComposableModel().
return the vector of local states asociated to the global state
s | the global state |
Definition at line 319 of file ComposableModel.hh.
Referenced by Diades::Automata::ComposableModelSearch< Algorithm >::diagnosis().
|
protected |
stream for logging internal messages
Definition at line 93 of file ComposableModel.hh.
Referenced by component().
|
mutableprivate |
list of initial states
Definition at line 59 of file ComposableModel.hh.
|
private |
Definition at line 72 of file ComposableModel.hh.
|
protected |
the underlying Component (if associated to a component)
Definition at line 94 of file ComposableModel.hh.
|
mutableprivate |
list of the events of the ComposableModel
Definition at line 58 of file ComposableModel.hh.
|
protected |
Definition at line 92 of file ComposableModel.hh.
|
private |
Definition at line 69 of file ComposableModel.hh.
Referenced by models().
|
private |
Definition at line 74 of file ComposableModel.hh.
|
mutableprivate |
Definition at line 71 of file ComposableModel.hh.
|
protected |
true if the composable model has to manage its own result component
Definition at line 95 of file ComposableModel.hh.
Referenced by component().
|
mutableprivate |
Definition at line 70 of file ComposableModel.hh.
|
mutableprivate |
mapping between a synchronised event and a component event if the composable Model is a single component then _componentEventOf[se.id()] == e (i.e. se is a synchronisedEvent and e is the event that correspond to the event e in the component) if the composable Model is a synchronised set of components then _componentEventOf[se.id()] == se where se is a synchronisedEvent rom the synchronisation law
Definition at line 67 of file ComposableModel.hh.
|
private |
synchronisation limit (number of states)
Definition at line 56 of file ComposableModel.hh.
Referenced by synchronisationLaw().
|
private |
Definition at line 55 of file ComposableModel.hh.
|
mutableprivate |
the synchronisation law of the ComposableModel
Definition at line 57 of file ComposableModel.hh.
|
mutableprivate |
Definition at line 68 of file ComposableModel.hh.
|
mutableprivate |
Definition at line 73 of file ComposableModel.hh.