DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <iostream>
#include <fstream>
#include <list>
#include <string>
#include <set>
#include <boost/accumulators/accumulators.hpp>
#include <boost/accumulators/statistics/stats.hpp>
#include <boost/accumulators/statistics/min.hpp>
#include <boost/accumulators/statistics/max.hpp>
#include <boost/accumulators/statistics/mean.hpp>
#include <boost/accumulators/statistics/variance.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <utils/CmdInterface.hh>
#include <automata/Event.hh>
#include <automata/ObservableComponent.hh>
#include <automata/ClassicalDiagnoser.hh>
#include <automata/SyncRulesLoad.hh>
#include <automata/Diagnosis.hh>
#include <automata/History.hh>
#include <FaultDiagnosis.hh>
#include <io/xml/automata/Simulation.hh>
Go to the source code of this file.
Typedefs | |
typedef pair< time_duration, Event > | EventOccurrence |
Functions | |
vector< string > | fileExtensions (numberOfFileExtensions) |
vector< string > | options (numberOfOptions) |
vector< bool > | isSet (numberOfOptions, false) |
void | initialiseOptions () |
void | readParameters (int argc, char *argv[], Algotype &type, list< string > &modelFiles, set< Event > &faults) |
void | readScenario (const string &filename, list< EventOccurrence > &simulation, list< EventOccurrence > &observations) |
void | runDiagnosis (FaultDiagnosis &faultDiagnosis, const list< EventOccurrence > &observations, bool statistics) |
int | main (int argc, char *argv[]) |
Variables | |
unsigned | numberOfOptions = 3 |
unsigned | numberOfFileExtensions = 5 |
string | description ="Usage:\t diagnose --help\n\t diagnose [--statistics] [--faults evt1 evt2] file1.des_comp file2.des_comp [file3.des_comp...] sync.rules scenario.xml\n\t diagnose [--statistics] [--faults evt1 evt2] file1.des_comp scenario.xml\n\t diagnose [--statistics] [--faults evt1 evt2] file.des_comp file.abstraction scenario.xml\n\t diagnose [--statistics] [--faults evt1 evt2] file.diagnoser scenario.xml\n\n\n\t Diagnose the sequence of observations given in the scenarios. Print on the\n\t standard output the final diagnosis. Write the diagnostic history in\n\t a file 'history.archv' and the perfect diagnosis in 'perfect_history.archv'.\n\t The events listed after the --faults option are considered as faults.\n\n\t If the input models are a set of models, 'diagnose' uses a component-based\n\t algorithm. If the input model is a global one, 'diagnose' uses a global \n\t model algorithm. If the input model is a diagnoser, 'diagnose' uses a diagnoser\n\t algorithm.\n\t Options: --statistics write some statistics in a file 'output.statistics'." |
This file is the main file of the command diagnose
.
Usage: diagnose --help diagnose [--statistics] [--faults evt1 evt2] file1.des_comp file2.des_comp [file3.des_comp...] sync.rules scenario.xml diagnose [--statistics] [--faults evt1 evt2] file1.des_comp scenario.xml diagnose [--statistics] [--faults evt1 evt2] file.des_comp file.abstraction scenario.xml diagnose [--statistics] [--faults evt1 evt2] file.diagnoser scenario.xml Diagnose the sequence of observations given in the scenarios. Print on the standard output the final diagnosis. Write the diagnostic history in a file history.archv and the perfect diagnosis in perfectHistory.archv. The events listed after the --faults option are considered as faults. If the input models are a set of models, 'diagnose' uses a component-based algorithm. If the input model is a global one, 'diagnose' uses a global model algorithm. If the input model is a diagnoser, 'diagnose' uses a diagnoser algorithm. Options: --statistics write some statistics in a file 'output.statistics'."
Definition in file Diagnose.cc.
typedef pair<time_duration,Event> EventOccurrence |
Definition at line 82 of file Diagnose.cc.
enum Algotype |
Enumerator | |
---|---|
Unknown | |
Comp | |
Model | |
Abstract | |
Diagnoser |
Definition at line 84 of file Diagnose.cc.
enum FileExtension |
Enumerator | |
---|---|
DESCOMP | |
DESCOMP | |
RULES | |
DESCOMP | |
DESCOMP | |
RULES | |
XML | |
ABSTRACTION | |
DIAGNOSER | |
DESCOMP | |
ARCHV | |
DESCOMP | |
RULES | |
XML | |
DESCOMP | |
RULES | |
XML | |
RULES |
Definition at line 56 of file Diagnose.cc.
enum Option |
Definition at line 55 of file Diagnose.cc.
vector<string> fileExtensions | ( | numberOfFileExtensions | ) |
Referenced by initialiseOptions(), and readParameters().
void initialiseOptions | ( | ) |
Definition at line 66 of file Diagnose.cc.
References ABSTRACTION, DESCOMP, DIAGNOSER, FAULTS, fileExtensions(), HELP, options(), RULES, STATISTICS, and XML.
Referenced by main().
vector<bool> isSet | ( | numberOfOptions | , |
false | |||
) |
Referenced by main(), and readParameters().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Definition at line 95 of file Diagnose.cc.
References Comp, Diagnoser, Diades::Automata::Component::importDesCompModel(), initialiseOptions(), isSet(), Diades::Automata::loadSynchronisationRules(), Diades::Utils::log(), Model, readParameters(), readScenario(), runDiagnosis(), setVerboseLevel(), STATISTICS, Unknown, and Diades::Utils::VbOutput.
vector<string> options | ( | numberOfOptions | ) |
Referenced by initialiseOptions(), and readParameters().
void readParameters | ( | int | argc, |
char * | argv[], | ||
Algotype & | type, | ||
list< string > & | modelFiles, | ||
set< Event > & | faults | ||
) |
Definition at line 169 of file Diagnose.cc.
References Abstract, ABSTRACTION, Comp, DESCOMP, description, DIAGNOSER, Diagnoser, FAULTS, fileExtensions(), Diades::Utils::getFileExtension(), HELP, isSet(), Model, options(), printError(), printUsage(), RULES, STATISTICS, Unknown, and XML.
Referenced by main().
void readScenario | ( | const string & | filename, |
list< EventOccurrence > & | simulation, | ||
list< EventOccurrence > & | observations | ||
) |
void runDiagnosis | ( | FaultDiagnosis & | faultDiagnosis, |
const list< EventOccurrence > & | observations, | ||
bool | statistics | ||
) |
The algorithm took 'algorithmicTime' units of time to provide the result.
Two cases hold here:
Definition at line 391 of file Diagnose.cc.
References Diades::Automata::FaultDiagnosis::diagnose(), Diades::Automata::FaultDiagnosis::getDiagnosis(), Diades::Automata::History::initialTimePoint(), Diades::Automata::History::publishDiagnosis(), and Diades::Automata::History::publishObservation().
Referenced by main().
string description ="Usage:\t diagnose --help\n\t diagnose [--statistics] [--faults evt1 evt2] file1.des_comp file2.des_comp [file3.des_comp...] sync.rules scenario.xml\n\t diagnose [--statistics] [--faults evt1 evt2] file1.des_comp scenario.xml\n\t diagnose [--statistics] [--faults evt1 evt2] file.des_comp file.abstraction scenario.xml\n\t diagnose [--statistics] [--faults evt1 evt2] file.diagnoser scenario.xml\n\n\n\t Diagnose the sequence of observations given in the scenarios. Print on the\n\t standard output the final diagnosis. Write the diagnostic history in\n\t a file 'history.archv' and the perfect diagnosis in 'perfect_history.archv'.\n\t The events listed after the --faults option are considered as faults.\n\n\t If the input models are a set of models, 'diagnose' uses a component-based\n\t algorithm. If the input model is a global one, 'diagnose' uses a global \n\t model algorithm. If the input model is a diagnoser, 'diagnose' uses a diagnoser\n\t algorithm.\n\t Options: --statistics write some statistics in a file 'output.statistics'." |
Definition at line 64 of file Diagnose.cc.
Referenced by readParameters().
unsigned numberOfFileExtensions = 5 |
Definition at line 58 of file Diagnose.cc.
unsigned numberOfOptions = 3 |
Definition at line 57 of file Diagnose.cc.