DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <History.hh>
Public Types | |
typedef const Diagnosis * | DiagPtr |
typedef pair< ptime, Event > | Observation |
typedef map< ptime, Event >::const_iterator | ObservationIterator |
typedef set< ptime >::const_iterator | TimeIterator |
typedef Candidate::StateId | StateId |
typedef vector< unordered_map< StateId, unordered_set< StateId > > > | Dict |
Public Member Functions | |
History () | |
History (const History &hist, const Dict &dict) | |
void | publishObservation (ptime t, const Event &e) |
void | publishDiagnosis (ptime t, const Diagnosis &d) |
ptime | initialTimePoint () const |
ptime | lastTimePoint () const |
TimeIterator | begin (ptime t) const |
TimeIterator | end (ptime t) const |
const Diagnosis & | getDiagnosis (ptime t) const |
ObservationIterator | obsBegin (ptime t) const |
ObservationIterator | obsEnd (ptime t) const |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Private Attributes | |
ptime | _initialTimePoint |
vector< ptime > | _timePoints |
vector< Diagnosis > | _diags |
map< ptime, Event > | _obs |
set< ptime > | _hist |
Diagnosis | _nullDiagnosis |
Friends | |
class | boost::serialization::access |
ostream & | operator<< (ostream &os, const History &history) |
This class represents an history of diagnosis computations. The basic idea here is to record in such an object the sequence of observations received by a diagnostic algorithm as well as the diagnosis that this algorithm provides through the time. To record into the History, first the History is created, that automatically initialises the starting time of the History with the local time of the computer. To record an observation, it is required to publish it into the History. The same for Diagnosis results coming from the algorithms. It is the responsability of the user to initialise the history at the right time and time-stamped the received observations and the produced Diagnosis objects. The class History does not store the Diagnosis that are published. Some operations are available to compare with different indicators the different porduced Histories. History is serializable so it can be saved in a file and loaded from a file, independently from the environment where the History was created. With this capacity, it is then possible to perform algorithm analyses off-line.
This class has an extensive use of the boost_date_time library.
Definition at line 56 of file History.hh.
typedef const Diagnosis* Diades::Automata::History::DiagPtr |
The way History is linked with Diagnosis objects
Definition at line 64 of file History.hh.
typedef vector< unordered_map<StateId,unordered_set<StateId> > > Diades::Automata::History::Dict |
Definition at line 102 of file History.hh.
typedef pair<ptime,Event> Diades::Automata::History::Observation |
History::Observation
An Observation is a Event that is time-stamped.
Definition at line 70 of file History.hh.
typedef map<ptime,Event>::const_iterator Diades::Automata::History::ObservationIterator |
History::ObservationIterator
iterator on the Observation
Definition at line 75 of file History.hh.
Definition at line 101 of file History.hh.
typedef set<ptime>::const_iterator Diades::Automata::History::TimeIterator |
History::TimeIterator
iterator on the time points
Definition at line 81 of file History.hh.
|
inline |
Default and unique constructor Once the History constructor is called the initialTimePoint() is set to the time of the creation of the History in microseconds
Definition at line 97 of file History.hh.
Constructor
hist | a state-abstracted History |
dict | the state abstractions |
|
inline |
Iterator on time points
t | a time point |
Definition at line 169 of file History.hh.
Referenced by Diades::Automata::historyCompare().
|
inline |
Iterator on time points
t | a time point |
Definition at line 186 of file History.hh.
Referenced by Diades::Automata::historyCompare().
const Diagnosis& Diades::Automata::History::getDiagnosis | ( | ptime | t | ) | const |
Get the diagnosis at time t
t | a time point t that does not necessary be a published time point |
Referenced by Diades::Automata::historyCompare(), and Diades::Automata::historyCompareWithTimeStep().
|
inline |
Definition at line 146 of file History.hh.
Referenced by Diades::Automata::historyCompare(), Diades::Automata::historyCompareWithTimeStep(), main(), makeComparison(), and runDiagnosis().
|
inline |
Definition at line 156 of file History.hh.
Referenced by Diades::Automata::historyCompare(), and Diades::Automata::historyCompareWithTimeStep().
|
inline |
Iterator on observations
t | a time point |
Definition at line 213 of file History.hh.
|
inline |
Iterator on observations
t | a time point |
Definition at line 231 of file History.hh.
References Diades::Utils::operator<<().
|
inline |
Publication of a Diagnosis
t | the time-stamp associated with the Event to record |
d | the Diagnosis that is produced at time t and handled by the diagnostic algorithm that publishes the Diagnosis |
Definition at line 134 of file History.hh.
Referenced by Diades::Automata::Diagnose< ALG >::Diagnose(), main(), and runDiagnosis().
|
inline |
Publication of an Observation
t | the time-stamp associated with the Event to record |
e | the event that is observed at time t and handled by the diagnostic algorithm that publishes the observation |
Definition at line 121 of file History.hh.
Referenced by runDiagnosis().
|
inlineprivate |
Serialisation method
ar | the Archive to use |
version | the version |
Definition at line 264 of file History.hh.
|
friend |
Definition at line 253 of file History.hh.
|
friend |
Output stream operator
os | output stream |
history | the History to print |
|
private |
Definition at line 85 of file History.hh.
|
private |
Definition at line 87 of file History.hh.
|
private |
Definition at line 83 of file History.hh.
|
private |
Definition at line 88 of file History.hh.
|
private |
Definition at line 86 of file History.hh.
|
private |
Definition at line 84 of file History.hh.