DiaDes  0.1
DIAgnosis of Discrete-Event System
Namespaces | Classes | Typedefs | Functions
Diades::Automata Namespace Reference

Namespaces

 Experimental
 

Classes

class  _ComponentIterator
 
struct  Accuracy
 
class  BeliefState
 
class  BeliefStateInvalid
 
struct  BsAccuracy
 
struct  BsDistance
 
struct  BsPrecision
 
class  Candidate
 
class  ClassicalDiagnoser
 
struct  CommonFaults
 
class  Component
 
class  ComposableModel
 
class  ComposableModelSearch
 
class  ConnectionMap
 
class  ConsistencyBasedDiagnosis
 
class  Diagnose
 
class  Diagnosis
 
class  DiagState
 
class  DisjunctiveFaultPattern
 
struct  Distance
 
class  Event
 
struct  EventData
 
class  EventFactory
 
class  FaultDiagnosis
 
class  FaultDiagProblem
 Definition of a fault diagnosis problem in a discrete-event system. More...
 
class  FaultPattern
 
struct  FcAccuracy
 
struct  FcDistance
 
struct  FcPrecision
 
class  FreeProduct
 
struct  GetEvent
 
class  History
 
class  IncorrectPath
 
class  IsCandidate
 
class  IsIdentifiable
 
class  IsNonIdentifiable
 
class  IsObservable
 
class  IsUnobservable
 
class  MultipleFaultEventOccurrencePattern
 
class  MultipleFaultEventPattern
 
class  NextTransitions
 
struct  NonCommonFaults
 
struct  NonPredecessorFunctor
 
class  ObservableComponent
 An observable Component defined as a automaton. More...
 
class  ObservableMask
 
class  ParametrizedSynchronisation
 
struct  Precision
 
struct  ReturnedType
 
class  SingleFaultEventPattern
 
class  SpecialisedActiveDiagnoser
 
class  SpecialisedActiveDiagnoserInvalid
 
class  StateNode
 
class  StateTable
 
class  StateTableInvalid
 
class  SubConfiguration
 
class  SynchronisationEvent
 
class  SynchronisationRules
 
class  TargetDiagState
 
class  Topology
 
class  TopologyMap
 
class  Trace
 
class  TwinPlantSynchronisation
 
class  VisitedDiagState
 

Typedefs

typedef Diades::Graph::Node State
 
typedef Diades::Graph::GraphNodeSet::Iterator BeliefStateIterator
 
typedef Diades::Graph::Edge Transition
 
typedef pair< time_duration, EventEventOccurrence
 
typedef ComposableModelSearch< Diades::Utils::BFS< NextTransitions, TargetDiagState, list< DiagState >, list< DiagState >, VisitedDiagState, IsCandidate, IncorrectPath > > FBFS
 
typedef ComposableModelSearch< Diades::Utils::DFS< NextTransitions, TargetDiagState, list< DiagState >, list< DiagState >, VisitedDiagState, IsCandidate, IncorrectPath > > FDFS
 
typedef ComposableModelSearch< Diades::Utils::GFS< NextTransitions, TargetDiagState, list< DiagState >, list< DiagState >, VisitedDiagState, IsCandidate, IncorrectPath > > FGFS
 
typedef Diades::Utils::Identifier Identifier
 

Functions

void checkAccuracy (const ObservableComponent &component, const set< Event > &faults, const set< Event > &interactives, string &information, bool &result, set< set< Event > > &minimalCombinations, int depth)
 
void checkSubconfigurationAccuracy (const TopologyMap &topology, const SubConfiguration &subConfiguration, const set< Event > &events, string &information, bool &result, set< set< Event > > &minimalCombinations, int depth, ofstream &toLatex)
 
template<typename InputIterator >
void deleteTransition (Component &comp, InputIterator first, InputIterator last)
 
template<typename InputIterator >
void deleteState (Component &comp, InputIterator first, InputIterator last)
 
template<typename InputIterator , typename Predicate >
void deleteState (Component &comp, InputIterator first, InputIterator last, Predicate pred)
 
template<typename InputIterator >
void purgeNonPredecessors (Component &comp, InputIterator first, InputIterator last)
 
ostream & operator<< (ostream &os, const DiagState &dstate)
 
void generateCppCode (const ClassicalDiagnoser &diagnoser, const string &filename)
 
template<typename DiagnosisComparisonFunctor >
void historyCompare (const History &history1, const History &history2, DiagnosisComparisonFunctor compare, list< pair< ptime, typename DiagnosisComparisonFunctor::ValueType > > &result)
 
template<typename DiagnosisComparisonFunctor >
void historyCompareWithTimeStep (const History &history1, const History &history2, DiagnosisComparisonFunctor compare, time_duration timeStep, list< pair< ptime, int > > &result)
 
void makeUniversalBehaviour (const string &name, const set< Event > &events, const ObservableMask &mask, ObservableComponent &universalBehaviour)
 
void makeUniversalBehaviour (const ObservableComponent &component, ObservableComponent &universalBehaviour)
 
void project (const Trace &source, const set< Event::Id > &projectedEvents, Trace &target)
 
ostream & operator<< (ostream &os, const SubConfiguration &subconf)
 
const ObservableComponentgetNonRelaxedBehaviour (const SubConfiguration &subConfig, const TopologyMap &wholeSystem, set< Event > &observationEvents, set< Event > &externalEvents, set< Event > &effectiveEvents, SynchronisationRules **rules)
 
void getBehaviour (const SubConfiguration &subConfig, const TopologyMap &wholeSystem, set< Event > &observationEvents, set< Event > &externalEvents, set< Event > &effectiveEvents, set< Event > &relaxedEvents, set< Event > &relaxedSynchronisedEvents, ObservableComponent **component, SynchronisationRules **rules)
 
bool loadSynchronisationRules (const ParametrizedSynchronisation::ComponentVector &models, const string &filename, ParametrizedSynchronisation &sync)
 
Topology::Connection getConnection (const Topology &topology, const set< Topology::Node > &clique, const Identifier &connectionEventLabel)
 
void generateTopology (unsigned nbNode, unsigned connectivity, unsigned cliqueSizeMax, unsigned commonConnectionMax, unsigned seed, Topology &topology)
 
void randomSimulateState (const ObservableComponent &component, State source, const set< Event > &noEvents, unsigned obsMin, unsigned obsMax, unsigned depth, list< Event > &simulation)
 
void randomSimulate (const ObservableComponent &component, const set< Event > &noEvents, unsigned obsMin, unsigned obsMax, list< Event > &simulation)
 
void reallySimulate (const ObservableComponent &component, const set< Event > &noEvents, unsigned obsMin, unsigned obsMax, list< Event > &simulation)
 
bool getEvents (const Component &component, const set< string > &labels, set< Event > &events)
 
bool simulate (const ObservableComponent &component, const set< string > &absentEvents, unsigned obsMin, unsigned obsMax, unsigned seed, list< Event > &simulation)
 
void randomSimulateState (ComposableModel &composable, const ObservableMask &mask, State source, const set< Event > &noEvents, unsigned obsMin, unsigned obsMax, unsigned depth, list< Event > &simulation)
 
void randomSimulate (ComposableModel &composable, const ObservableMask &mask, const set< Event > &noEvents, unsigned obsMin, unsigned obsMax, list< Event > &simulation)
 
void reallySimulate (ComposableModel &composable, const ObservableMask &mask, const set< Event > &noEvents, unsigned obsMin, unsigned obsMax, list< Event > &simulation)
 
bool simulate (ComposableModel &composable, const ObservableMask &mask, const set< string > &absentEvents, unsigned obsMin, unsigned obsMax, unsigned seed, list< Event > &simulation)
 
void printStop (unsigned index)
 
template<typename StateIterator >
void generateStateList (const Component &component, StateIterator first, StateIterator last)
 
template<typename StateIterator >
State getStateOfIndex (const Component &component, StateIterator first, StateIterator last, unsigned index)
 
bool readResponse (istream &in, unsigned &index, unsigned maxValue, bool &stop)
 
bool initialStateSelection (const Component &component, State &result)
 
bool initialStateSelection (ComposableModel &model, State &result)
 
template<typename TransitionIterator >
void generateTransitionList (const Component &component, const ObservableMask &mask, TransitionIterator first, TransitionIterator last)
 
template<typename TransitionIterator >
Transition getTransitionOfIndex (const Component &component, TransitionIterator first, TransitionIterator last, unsigned index)
 
bool interactiveSimulation (const ObservableComponent &component, State &current, list< Event > &simulation)
 
bool interactiveSimulation (ComposableModel &model, const ObservableMask &mask, State &current, list< Event > &simulation)
 
bool interactiveSimulation (const ObservableComponent &component, list< Event > &simulation)
 
bool interactiveSimulation (ComposableModel &composable, const ObservableMask &mask, list< Event > &simulation)
 
template<typename InputIterator , typename OutputIterator >
void timeStamp (InputIterator first, InputIterator last, time_duration min, time_duration max, OutputIterator result)
 
string tinyXmlTag (const time_duration &t)
 
string tinyXmlTag (const Event &e)
 
string tinyXmlTag (const pair< time_duration, Event > &p)
 
string tinyXmlText (const time_duration &t)
 
string tinyXmlText (const Event &e)
 

Detailed Description

This namespace gathers the classes and functions related to automata (containers + algorithms). This set of classes and functions are in the library libautomata.so.

Typedef Documentation

◆ BeliefStateIterator

Iterator on the states

Definition at line 40 of file BeliefState.hh.

◆ EventOccurrence

typedef std::pair< boost::posix_time::time_duration, Event > Diades::Automata::EventOccurrence

Definition at line 13 of file Diagnose.hh.

◆ FBFS

FBFS Forward Breadh First Search on a FaultDiagProblem, instantiation of a ComposableModelSearch

Definition at line 16 of file FBFS.hh.

◆ FDFS

FDFS Forward Depth First Search on a FaultDiagProblem, instantiation of a ComposableModelSearch

Definition at line 15 of file FDFS.hh.

◆ FGFS

FGFS Forward Greedy First Search on a FaultDiagProblem, instantiation of a ComposableModelSearch

Definition at line 322 of file FGFS.hh.

◆ Identifier

Definition at line 19 of file Topology.hh.

◆ State

Definition at line 36 of file BeliefState.hh.

◆ Transition

Definition at line 46 of file Component.hh.

Function Documentation

◆ checkAccuracy()

void Diades::Automata::checkAccuracy ( const ObservableComponent component,
const set< Event > &  faults,
const set< Event > &  interactives,
string &  information,
bool &  result,
set< set< Event > > &  minimalCombinations,
int  depth 
)

◆ checkSubconfigurationAccuracy()

void Diades::Automata::checkSubconfigurationAccuracy ( const TopologyMap topology,
const SubConfiguration subConfiguration,
const set< Event > &  events,
string &  information,
bool &  result,
set< set< Event > > &  minimalCombinations,
int  depth,
ofstream &  toLatex 
)

Referenced by main().

◆ deleteState() [1/2]

template<typename InputIterator >
void Diades::Automata::deleteState ( Component comp,
InputIterator  first,
InputIterator  last 
)
inline

Definition at line 1390 of file Component.hh.

References Diades::Automata::Component::deleteState().

◆ deleteState() [2/2]

template<typename InputIterator , typename Predicate >
void Diades::Automata::deleteState ( Component comp,
InputIterator  first,
InputIterator  last,
Predicate  pred 
)
inline

Definition at line 1400 of file Component.hh.

References Diades::Automata::Component::deleteState().

◆ deleteTransition()

template<typename InputIterator >
void Diades::Automata::deleteTransition ( Component comp,
InputIterator  first,
InputIterator  last 
)
inline

◆ generateCppCode()

void Diades::Automata::generateCppCode ( const ClassicalDiagnoser diagnoser,
const string &  filename 
)
Parameters
diagnosera diagnoser
filenamea file name Generate c++ code that implement the diagnoser.

Referenced by main().

◆ generateStateList()

template<typename StateIterator >
void Diades::Automata::generateStateList ( const Component component,
StateIterator  first,
StateIterator  last 
)

Definition at line 425 of file Simulator.cc.

References Diades::Automata::Component::getLabel(), and printStop().

Referenced by initialStateSelection().

◆ generateTopology()

void Diades::Automata::generateTopology ( unsigned  nbNode,
unsigned  connectivity,
unsigned  cliqueSizeMax,
unsigned  commonConnectionMax,
unsigned  seed,
Topology topology 
)

◆ generateTransitionList()

template<typename TransitionIterator >
void Diades::Automata::generateTransitionList ( const Component component,
const ObservableMask mask,
TransitionIterator  first,
TransitionIterator  last 
)

◆ getBehaviour()

void Diades::Automata::getBehaviour ( const SubConfiguration subConfig,
const TopologyMap wholeSystem,
set< Event > &  observationEvents,
set< Event > &  externalEvents,
set< Event > &  effectiveEvents,
set< Event > &  relaxedEvents,
set< Event > &  relaxedSynchronisedEvents,
ObservableComponent **  component,
SynchronisationRules **  rules 
)

◆ getConnection()

Topology::Connection Diades::Automata::getConnection ( const Topology topology,
const set< Topology::Node > &  clique,
const Identifier connectionEventLabel 
)
Parameters
topologya Topology
cliquea clique in the topology
connectionEventLabelthe event label of a connection
Returns
the Connection in the topology whose clique is 'clique' and whose event label is 'connectionEventLabel', an invalid Connection if this Connection does not exist

Referenced by Diades::Automata::Topology::graph().

◆ getEvents()

bool Diades::Automata::getEvents ( const Component component,
const set< string > &  labels,
set< Event > &  events 
)

Get the events with the corresponding labels (label or nickname) in the component

Parameters
componentthe componnet to look at
labelsthe labels to consider
eventsthe resulting events
Returns
true if all the labels were associated with an event of component

Definition at line 158 of file Simulator.cc.

References Diades::Automata::Component::eventBegin(), and Diades::Automata::Component::eventEnd().

Referenced by simulate().

◆ getNonRelaxedBehaviour()

const ObservableComponent* Diades::Automata::getNonRelaxedBehaviour ( const SubConfiguration subConfig,
const TopologyMap wholeSystem,
set< Event > &  observationEvents,
set< Event > &  externalEvents,
set< Event > &  effectiveEvents,
SynchronisationRules **  rules 
)

◆ getStateOfIndex()

template<typename StateIterator >
State Diades::Automata::getStateOfIndex ( const Component component,
StateIterator  first,
StateIterator  last,
unsigned  index 
)

Definition at line 443 of file Simulator.cc.

References current.

Referenced by initialStateSelection().

◆ getTransitionOfIndex()

template<typename TransitionIterator >
Transition Diades::Automata::getTransitionOfIndex ( const Component component,
TransitionIterator  first,
TransitionIterator  last,
unsigned  index 
)

Definition at line 546 of file Simulator.cc.

References current.

Referenced by interactiveSimulation().

◆ historyCompare()

template<typename DiagnosisComparisonFunctor >
void Diades::Automata::historyCompare ( const History history1,
const History history2,
DiagnosisComparisonFunctor  compare,
list< pair< ptime, typename DiagnosisComparisonFunctor::ValueType > > &  result 
)

historyCompare(const History & history1, const History & history2, list< pair<ptime,int> > & result)

History comparison

Parameters
history1the first History
history2the second History
comparea diagnosis comparison functor
resultResult of the comparison as a list of time-stamped measurements

This function is a template to apply functors of the type

Diagnosis x Diagnosis -> int

to any couple of Diagnosis objects.

Principle of the comparison
First, the temporal offset between the two histories is computed in order then to synchronise their initial time points. Then for any published time points in one history that has an equivalent in the other one, the diagnoses available in both histories at this time point is compared with respect to the functor used. The result of this comparision is inserted in the result list with the time point associated with the first history.
See also
Distance FcDistance BsDistance CommonFaults NonCommonFaults in Diagnosis.hh

Definition at line 303 of file History.hh.

References Diades::Automata::History::begin(), Diades::Automata::History::end(), Diades::Automata::History::getDiagnosis(), Diades::Automata::History::initialTimePoint(), and Diades::Automata::History::lastTimePoint().

Referenced by makeComparison().

◆ historyCompareWithTimeStep()

template<typename DiagnosisComparisonFunctor >
void Diades::Automata::historyCompareWithTimeStep ( const History history1,
const History history2,
DiagnosisComparisonFunctor  compare,
time_duration  timeStep,
list< pair< ptime, int > > &  result 
)

historyCompareWithTimeStep(const History & history1, const History & history2,time_duration timeStep,list< pair<ptime,int> > & result)

History comparison

Parameters
history1the first History
history2the second History
comparea diagnosis comparison functor
timeStepa time_duratiom
resultResult of the comparison as a list of time-stamped measurements

This function is a template to apply functors of the type Diagnosis x Diagnosis -> int to any couple of Diagnosis objects.

Principle of the comparison
First, the temporal offset between the two histories is computed in order then to synchronise their initial time points. Then for any time points (history1.initialTimePoint(), ..., history1.initialTimePoint() + n * timeStep) in one history that has an equivalent in the other one, the diagnoses available in both histories at this time point is compared with respect to the functor used. The result of this comparision is inserted in the result list with the time point associated with the first history.
See also
Distance FcDistance BsDistance CommonFaults NonCommonFaults in Diagnosis.hh
For time_duration and ptime
See also
time_duration and ptime

Definition at line 405 of file History.hh.

References Diades::Automata::History::getDiagnosis(), Diades::Automata::History::initialTimePoint(), and Diades::Automata::History::lastTimePoint().

◆ initialStateSelection() [1/2]

bool Diades::Automata::initialStateSelection ( const Component component,
State result 
)

◆ initialStateSelection() [2/2]

bool Diades::Automata::initialStateSelection ( ComposableModel model,
State result 
)

Definition at line 506 of file Simulator.cc.

References Diades::Automata::ComposableModel::component().

Referenced by interactiveSimulation().

◆ interactiveSimulation() [1/4]

bool Diades::Automata::interactiveSimulation ( const ObservableComponent component,
State current,
list< Event > &  simulation 
)

interactive simulation of a component

Parameters
componentthe ObservableComponent to simulate
currentthe current state
simulationthe result of the simulation
Returns
true if the simulation did not generate any error any stop. Perform a one-step simulation from the state 'current'. After this simulation the current state becomes the next state.

Definition at line 568 of file Simulator.cc.

References generateTransitionList(), Diades::Automata::Component::getEvent(), Diades::Automata::Component::getLabel(), getTransitionOfIndex(), Diades::Automata::ObservableComponent::mask(), Diades::Automata::ObservableMask::observableBegin(), Diades::Automata::ObservableMask::observableEnd(), Diades::Automata::Component::outputTransitionBegin(), Diades::Automata::Component::outputTransitionEnd(), readResponse(), and toStream().

Referenced by startInteractiveSimulation().

◆ interactiveSimulation() [2/4]

bool Diades::Automata::interactiveSimulation ( ComposableModel model,
const ObservableMask mask,
State current,
list< Event > &  simulation 
)

interactive simulation of a component

Parameters
componentthe ObservableComponent to simulate
currentthe current state
simulationthe result of the simulation
Returns
true if the simulation did not generate any error any stop. Perform a one-step simulation from the state 'current'. After this simulation the current state becomes the next state.

Definition at line 609 of file Simulator.cc.

References Diades::Automata::ComposableModel::component(), generateTransitionList(), Diades::Automata::Component::getEvent(), Diades::Automata::Component::getLabel(), getTransitionOfIndex(), Diades::Automata::ObservableMask::observableBegin(), Diades::Automata::ObservableMask::observableEnd(), Diades::Automata::ComposableModel::outputTransitionBegin(), Diades::Automata::Component::outputTransitionBegin(), Diades::Automata::ComposableModel::outputTransitionEnd(), Diades::Automata::Component::outputTransitionEnd(), readResponse(), and toStream().

◆ interactiveSimulation() [3/4]

bool Diades::Automata::interactiveSimulation ( const ObservableComponent component,
list< Event > &  simulation 
)

interactive simulation of a component

Parameters
componentthe ObservableComponent to simulate
simulationthe result of the simulation
Returns
true if the simulation did not generate any error

Definition at line 659 of file Simulator.cc.

References current, initialStateSelection(), and interactiveSimulation().

◆ interactiveSimulation() [4/4]

bool Diades::Automata::interactiveSimulation ( ComposableModel composable,
const ObservableMask mask,
list< Event > &  simulation 
)

interactive simulation of a system (lazy synchronisation of components)

Parameters
composablethe system
maskthe observable mask of the system
simulationthe result of the simulation
Returns
true if the simulation did not generate any error

Definition at line 685 of file Simulator.cc.

References current, and initialStateSelection().

Referenced by interactiveSimulation().

◆ loadSynchronisationRules()

bool Diades::Automata::loadSynchronisationRules ( const ParametrizedSynchronisation::ComponentVector models,
const string &  filename,
ParametrizedSynchronisation sync 
)
Parameters
modelsavailable model
filenamefile containing the rules
syncthe object that will contain the rules
Precondition
the filename should only declare components that are in models
Returns
false if a problem has occurred, in this case the rules are empty.

The file containing the rules should be in the following format:

components: comp1, comp2,comp3,..., compN;
rules:
<compi.evti, compj.evtj, compk.evtk>
...
<compl.evtl, comps.evts, ...>;

Referenced by main(), and readModels().

◆ makeUniversalBehaviour() [1/2]

void Diades::Automata::makeUniversalBehaviour ( const string &  name,
const set< Event > &  events,
const ObservableMask mask,
ObservableComponent universalBehaviour 
)
Parameters
namename of the universal behaviour
eventsa set of events
maskan observable Mask
universalBehaviourthe resulting universal behaviour: it consists in a single state and for any type of event Assumption: the observable mask remains unchanged

Referenced by Diades::Automata::ObservableComponent::inputObservableTransitionEnd().

◆ makeUniversalBehaviour() [2/2]

void Diades::Automata::makeUniversalBehaviour ( const ObservableComponent component,
ObservableComponent universalBehaviour 
)
Parameters
componentthe ObservableComponent based on which the universal behaviour is computed
universalBehaviourthe resulting universal behaviour: it consists in a single state and for any type of event of the observable component a transition loop associated with this event
Precondition
component must not be universalBehaviour

◆ operator<<() [1/2]

ostream& Diades::Automata::operator<< ( ostream &  os,
const DiagState dstate 
)
inline

◆ operator<<() [2/2]

ostream& Diades::Automata::operator<< ( ostream &  os,
const SubConfiguration subconf 
)

◆ printStop()

void Diades::Automata::printStop ( unsigned  index)

Definition at line 419 of file Simulator.cc.

Referenced by generateStateList(), and generateTransitionList().

◆ project()

void Diades::Automata::project ( const Trace source,
const set< Event::Id > &  projectedEvents,
Trace target 
)

Referenced by projectAut(), and projectDdaut().

◆ purgeNonPredecessors()

template<typename InputIterator >
void Diades::Automata::purgeNonPredecessors ( Component comp,
InputIterator  first,
InputIterator  last 
)
inline

◆ randomSimulate() [1/2]

void Diades::Automata::randomSimulate ( const ObservableComponent component,
const set< Event > &  noEvents,
unsigned  obsMin,
unsigned  obsMax,
list< Event > &  simulation 
)
Parameters
componentThe component to simulate
obsMinThe lower bound of observations to produce
obsMaxThe upper bound of observations to produce
simulationThe list of simulated events

In case of failure this function throws exceptions

Definition at line 111 of file Simulator.cc.

References Diades::Automata::Component::initialStateBegin(), Diades::Automata::Component::initialStateEnd(), Diades::Automata::Component::numberOfInitialStates(), randomSimulateState(), and Diades::Utils::selectRandomElement().

◆ randomSimulate() [2/2]

void Diades::Automata::randomSimulate ( ComposableModel composable,
const ObservableMask mask,
const set< Event > &  noEvents,
unsigned  obsMin,
unsigned  obsMax,
list< Event > &  simulation 
)
Parameters
composableThe ComposableModel to simulate
maskthe Observablemask associated to composable
obsMinThe lower bound of observations to produce
obsMaxThe upper bound of observations to produce
simulationThe list of simulated events

In case of failure this function throws exceptions

Definition at line 329 of file Simulator.cc.

References Diades::Automata::ComposableModel::beginOfInitialStates(), Diades::Automata::ComposableModel::endOfInitialStates(), Diades::Automata::ComposableModel::numberOfInitialStates(), randomSimulateState(), and Diades::Utils::selectRandomElement().

Referenced by reallySimulate().

◆ randomSimulateState() [1/2]

void Diades::Automata::randomSimulateState ( const ObservableComponent component,
State  source,
const set< Event > &  noEvents,
unsigned  obsMin,
unsigned  obsMax,
unsigned  depth,
list< Event > &  simulation 
)
Parameters
componentThe component to simulate
sourceSource state of the simulation
obsMinThe lower bound of observations to produce
obsMaxThe upper bound of observations to produce
depthThe number of unobservable events since the last occurrence of an observable event
simulationThe list of simulated events

In case of failure this function throws exceptions. A failure here is if the simulation cannot find the constained amount of observations. As we do not want to introduce any biais in this simulation, we prefer make it failing than controlling it. We suppose the simulation has failed when the depth is greater than twice the number of transitions in the component. By the way, as the list 'simulation' is updated on the fly, the result of the simulation is still available and updated.

Definition at line 42 of file Simulator.cc.

References Diades::Utils::fgx(), generateRandomValue(), Diades::Automata::Component::getEvent(), Diades::Automata::Component::getLabel(), Diades::Utils::isNotIn(), Diades::Automata::ObservableMask::isObservable(), Diades::Automata::ObservableComponent::mask(), Diades::Automata::Component::numberOfTransitions(), Diades::Automata::Component::outputTransitionBegin(), Diades::Automata::Component::outputTransitionEnd(), randomSimulateState(), and Diades::Utils::selectRandomElement().

◆ randomSimulateState() [2/2]

void Diades::Automata::randomSimulateState ( ComposableModel composable,
const ObservableMask mask,
State  source,
const set< Event > &  noEvents,
unsigned  obsMin,
unsigned  obsMax,
unsigned  depth,
list< Event > &  simulation 
)
Parameters
composableThe ComposableModel to simulate
maskthe Observablemask associated to composable
sourceSource state of the simulation
obsMinThe lower bound of observations to produce
obsMaxThe upper bound of observations to produce
depthThe number of unobservable events since the last occurrence of an observable event
simulationThe list of simulated events

In case of failure this function throws exceptions. A failure here is if the simulation cannot find the constained amount of observations. As we do not want to introduce any biais in this simulation, we prefer make it failing than controlling it. We suppose the simulation has failed when the depth is greater than twice the number of transitions in the component. By the way, as the list 'simulation' is updated on the fly, the result of the simulation is still available and updated.

Definition at line 252 of file Simulator.cc.

References Diades::Automata::ComposableModel::component(), Diades::Utils::fgx(), generateRandomValue(), Diades::Automata::Component::getEvent(), Diades::Automata::Component::getLabel(), Diades::Utils::isNotIn(), Diades::Automata::ObservableMask::isObservable(), Diades::Automata::ComposableModel::outputTransitionBegin(), Diades::Automata::Component::outputTransitionBegin(), Diades::Automata::ComposableModel::outputTransitionEnd(), Diades::Automata::Component::outputTransitionEnd(), and Diades::Utils::selectRandomElement().

Referenced by randomSimulate(), and randomSimulateState().

◆ readResponse()

bool Diades::Automata::readResponse ( istream &  in,
unsigned &  index,
unsigned  maxValue,
bool &  stop 
)

Definition at line 460 of file Simulator.cc.

Referenced by initialStateSelection(), and interactiveSimulation().

◆ reallySimulate() [1/2]

void Diades::Automata::reallySimulate ( const ObservableComponent component,
const set< Event > &  noEvents,
unsigned  obsMin,
unsigned  obsMax,
list< Event > &  simulation 
)
Parameters
componentThe component to simulate
eventsThe events of component that must occur at least once during the simulation
noEventsThe events of component that must not occur during the simulation
obsMinThe lower bound of observations to produce
obsMaxThe upper bound of observations to produce
simulationThe list of simulated events

In case of failure this function throws exceptions

Definition at line 138 of file Simulator.cc.

References randomSimulate().

◆ reallySimulate() [2/2]

void Diades::Automata::reallySimulate ( ComposableModel composable,
const ObservableMask mask,
const set< Event > &  noEvents,
unsigned  obsMin,
unsigned  obsMax,
list< Event > &  simulation 
)
Parameters
composableThe ComposableModel to simulate
maskthe Observablemask associated to composable
eventsThe events of component that must occur at least once during the simulation
noEventsThe events of component that must not occur during the simulation
obsMinThe lower bound of observations to produce
obsMaxThe upper bound of observations to produce
simulationThe list of simulated events

In case of failure this function throws exceptions

Definition at line 359 of file Simulator.cc.

References randomSimulate().

Referenced by simulate().

◆ simulate() [1/2]

bool Diades::Automata::simulate ( const ObservableComponent component,
const set< string > &  absentEvents,
unsigned  obsMin,
unsigned  obsMax,
unsigned  seed,
list< Event > &  simulation 
)
Parameters
componentThe component to simulate
absentEventsThe events that must not occur during the simulation
obsMinThe lower bound of observations to produce
obsMaxThe upper bound of observations to produce
seedThe seed to initialise the random generator
simulationThe list of simulated events
Returns
true if the simulation has succeeded. false otherwise
Parameters
componentThe component to simulate
absentEventsThe events that must not occur during the simulation
obsMinThe lower bound of observations to produce
obsMaxThe upper bound of observations to produce
seedThe seed to initialise the random generator
simulationList of the simulated event
Returns
true if the simulation has succeeded. false otherwise

Definition at line 192 of file Simulator.cc.

References getEvents(), initialiseRandomGenerator(), and reallySimulate().

Referenced by startNonInteractiveSimulation().

◆ simulate() [2/2]

bool Diades::Automata::simulate ( ComposableModel composable,
const ObservableMask mask,
const set< string > &  absentEvents,
unsigned  obsMin,
unsigned  obsMax,
unsigned  seed,
list< Event > &  simulation 
)
Parameters
compsableThe composable model to simulate
maskthe Observablemask associated to composable
absentEventsThe events that must not occur during the simulation
obsMinThe lower bound of observations to produce
obsMaxThe upper bound of observations to produce
seedThe seed to initialise the random generator
simulationList of the simulated event
Returns
true if the simulation has succeeded. false otherwise

Definition at line 382 of file Simulator.cc.

References Diades::Automata::ComposableModel::component(), getEvents(), initialiseRandomGenerator(), and reallySimulate().

◆ timeStamp()

template<typename InputIterator , typename OutputIterator >
void Diades::Automata::timeStamp ( InputIterator  first,
InputIterator  last,
time_duration  min,
time_duration  max,
OutputIterator  result 
)

Time Stamp a sequence of object randomly

Parameters
firstFirst object to time stamp
lastelement after the last object to stamp
minthe minimal delay between two consecutive time stamps
maxthe maximal delay between two consecutive time stamps
resulta sequence of pair<time_duration,object>
Precondition
the random generator must be initialised

Definition at line 90 of file Simulator.hh.

References Diades::Utils::generateRandomValue().

Referenced by writeTimedSimulation().

◆ tinyXmlTag() [1/3]

string Diades::Automata::tinyXmlTag ( const time_duration &  t)
inline

Definition at line 22 of file XmlTag.hh.

◆ tinyXmlTag() [2/3]

string Diades::Automata::tinyXmlTag ( const Event e)
inline

Definition at line 30 of file XmlTag.hh.

◆ tinyXmlTag() [3/3]

string Diades::Automata::tinyXmlTag ( const pair< time_duration, Event > &  p)
inline

Definition at line 37 of file XmlTag.hh.

◆ tinyXmlText() [1/2]

string Diades::Automata::tinyXmlText ( const time_duration &  t)
inline

Definition at line 45 of file XmlTag.hh.

◆ tinyXmlText() [2/2]

string Diades::Automata::tinyXmlText ( const Event e)
inline

Definition at line 56 of file XmlTag.hh.

References Diades::Automata::Event::label().