DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <fstream>
#include <sstream>
#include <unordered_set>
#include <diades/automata/Event.hh>
#include <diades/automata/ClassicalDiagnoser.hh>
#include <diades/automata/CppGenerator.hh>
#include "CmdInterface.hh"
Go to the source code of this file.
Functions | |
vector< string > | fileExtensions (numberOfFileExtensions) |
vector< string > | options (numberOfOptions) |
vector< bool > | isSet (numberOfOptions, false) |
void | initialiseOptions () |
bool | getFailuresFromFileModel (const string &infileName, unordered_set< Event > &failures, string &log) |
int | main (int argc, char *argv[]) |
Variables | |
unsigned | numberOfOptions = 8 |
unsigned | numberOfFileExtensions = 1 |
string | description ="DiaDes: Diagnoser computation\nLAAS-CNRS, 2006-2012, 7 avenue du Colonel Roche, Toulouse, France\nContact: yannick.pencole@laas.fr\n\nUsage: diagnoser\n\t [--with-silent-closure]\n\t [--no-failures | --failures evt1 [evt2 ...]]\n\t [--observables obs1 [obs2 ...]]\n\t [--hd filename1]\n\t [--dot filename2]\n\tinfile.des_comp \n\n\nCompute an explicit representation of the diagnoser from the model \ninfile.des_comp and saves it into modelName.diagnoser (diades format). \nThe diagnoser can be extended with the silent closure or not. \nIf --no-failures is set, it returns a state observer. If --observables \n(resp. --failures) is set, then only the listed events are considered as observable \n(resp. faulty). The tag --hd exports the diagnoser is HyDiag format, the tag --dot \nexports the diagnoser in graphviz format, the tag --cpp exports the diagnoser \nin standalone and compilable C++ file. The option --help displays this message" |
This file is the main file of the command Diagnoser
.
Usage: diagnoser [--with-silent-closure] [--no-failure | --failures evt1 [evt2 ...]] [--observables obs1 [obs2 ...]] [--hd filename1] [--dot filename2] infile.comp_des
This program computes a deterministic diagnoser. If no option is provided it computes the classical one with the observable events from the model and the failure events from the model (no communicating event is observable). The result is saved in modelName.diagnoser. Here are the options:
–with-silent-closure
the diagnoser is computed with silent closure (in this case the diagnoser state also contains the set of states in which the system could be after the occurrence of non-observable events AFTER the occurrence of the LAST observable event. –no-failures
the diagnoser is computed without any failure consideration (in this case, it is an observer defined from the given observable events –failures
list of events from the model that will be considered as a failure event in the diagnoser –observables
list of events from the model that will be considered as a observable event in the diagnoser –output
filename Name of the output file Validation of the option interface of the command
Force the writing of an interactive diagnoser in a ".diagnoser" suffixed file
Definition in file Diagnoser.cc.
enum Option |
Definition at line 47 of file Diagnoser.cc.
vector<string> fileExtensions | ( | numberOfFileExtensions | ) |
Referenced by getFailuresFromFileModel(), initialiseOptions(), and main().
bool getFailuresFromFileModel | ( | const string & | infileName, |
unordered_set< Event > & | failures, | ||
string & | log | ||
) |
get the failure events from the model in "oldmodel" format
Name acquisition
Parsing State Part but useless
Definition at line 386 of file Diagnoser.cc.
References fileExtensions().
Referenced by initialiseOptions(), and main().
void initialiseOptions | ( | ) |
Definition at line 60 of file Diagnoser.cc.
References CPPFILE, DOTFILE, FAILURES, fileExtensions(), getFailuresFromFileModel(), HDFILE, HELP, Diades::Utils::log(), NOFAILURES, OBSERVABLES, options(), and WITHSILENTCLOSURE.
Referenced by main().
vector<bool> isSet | ( | numberOfOptions | , |
false | |||
) |
Referenced by main().
int main | ( | int | argc, |
char * | argv[] | ||
) |
Main function of the program diagnoser
Basically, this function analyses the parameters to initiate the diagnoser computation.
argc | the number of parameters |
argv | the list of parameters |
Definition at line 95 of file Diagnoser.cc.
References Diades::Automata::ObservableMask::addMask(), CPPFILE, description, DOTFILE, FAILURES, fileExtensions(), Diades::CmdInterface::fileSuffixOk(), Diades::Automata::generateCppCode(), getFailuresFromFileModel(), HDFILE, HELP, initialiseOptions(), isSet(), Diades::Utils::log(), NOFAILURES, numberOfOptions, OBSERVABLES, options(), Diades::CmdInterface::printCommandLineError(), printUsage(), Diades::Utils::saveLog(), and WITHSILENTCLOSURE.
vector<string> options | ( | numberOfOptions | ) |
Referenced by initialiseOptions(), and main().
string description ="DiaDes: Diagnoser computation\nLAAS-CNRS, 2006-2012, 7 avenue du Colonel Roche, Toulouse, France\nContact: yannick.pencole@laas.fr\n\nUsage: diagnoser\n\t [--with-silent-closure]\n\t [--no-failures | --failures evt1 [evt2 ...]]\n\t [--observables obs1 [obs2 ...]]\n\t [--hd filename1]\n\t [--dot filename2]\n\tinfile.des_comp \n\n\nCompute an explicit representation of the diagnoser from the model \ninfile.des_comp and saves it into modelName.diagnoser (diades format). \nThe diagnoser can be extended with the silent closure or not. \nIf --no-failures is set, it returns a state observer. If --observables \n(resp. --failures) is set, then only the listed events are considered as observable \n(resp. faulty). The tag --hd exports the diagnoser is HyDiag format, the tag --dot \nexports the diagnoser in graphviz format, the tag --cpp exports the diagnoser \nin standalone and compilable C++ file. The option --help displays this message" |
Definition at line 57 of file Diagnoser.cc.
Referenced by main().
unsigned numberOfFileExtensions = 1 |
Definition at line 50 of file Diagnoser.cc.
unsigned numberOfOptions = 8 |
Definition at line 49 of file Diagnoser.cc.
Referenced by main().