DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <thread>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <regex>
#include <unordered_map>
#include <random>
#include <chrono>
#include <boost/program_options.hpp>
#include <diades/automata/experimental/AutFile.hh>
#include <diades/automata/experimental/DdAutFile.hh>
#include <diades/automata/experimental/DdAutFileDescriptor.hh>
#include <diades/automata/experimental/Io.hh>
#include "../AutomataInterface.hh"
#include "../CmdInterface.hh"
Go to the source code of this file.
Classes | |
struct | DdSimOptions |
Functions | |
const string | program ("dd-sim") |
const string | briefcomment (": dd-sim simulates a model. Given a ddaut file, dd-sim computes some runs of the model") |
void | initialiseOptions (int argc, char *argv[], Poptions::options_description &desc, Poptions::variables_map &vm) |
size_t | setOptions (int argc, char **argv, DdSimOptions &options) |
bool | isThroughState (const ConstManagedDdAutFsm &mfsm, State state, const std::regex ®ularExpression, CstStMap< char > &throughStates) |
check whether the state is matching the 'through-state' expression given by –through More... | |
size_t | prepareSimulation (const DdSimOptions &options) |
int | main (int argc, char **argv) |
Variables | |
const string | detailedcomment |
FileSuffixes | suffixes ({"ddaut"}) |
const string briefcomment | ( | ": dd-sim simulates a model. Given a ddaut | file, |
dd-sim computes some runs of the model" | |||
) |
Referenced by setOptions().
void initialiseOptions | ( | int | argc, |
char * | argv[], | ||
Poptions::options_description & | desc, | ||
Poptions::variables_map & | vm | ||
) |
Initialise the options of the command present in the command line
argc | |
argv | |
desc | |
vm |
Definition at line 121 of file Simulate.cc.
References options().
bool isThroughState | ( | const ConstManagedDdAutFsm & | mfsm, |
State | state, | ||
const std::regex & | regularExpression, | ||
CstStMap< char > & | throughStates | ||
) |
check whether the state
is matching the 'through-state' expression given by –through
throughStates
is a mapping used as a cache. If the result is cached, simply return it if not, then the state label is tested to see whether it matches or not and the cache is updated consequently.
[in] | mfsm | the managed fsm |
[in] | state | the state to check |
[in] | regularExpression | the regular expression given by the through option |
[in,out] | throughStates | the cache |
state
matches regularExpression
. Definition at line 263 of file Simulate.cc.
References Diades::Automata::Experimental::ConstManagedDdAutFsm::fsm, Diades::Automata::Experimental::StatePropertyManager< _StateProperty, _StatePropertyId, NullStProperty, NullStPropertyId, Hash >::getStateProperty(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::getStatePropertyId(), and Diades::Automata::Experimental::ConstManagedDdAutFsm::sMgr.
int main | ( | int | argc, |
char ** | argv | ||
) |
Main file of the dd-dot command
argc | |
argv |
Definition at line 305 of file Simulate.cc.
References Diades::CmdInterface::checkDdAutFile(), DdSimOptions::controllable, DdSimOptions::fileName, Diades::CmdInterface::isOpenableFile(), DdSimOptions::observable, options(), prepareSimulation(), DdSimOptions::seed, setOptions(), and SUCCESS.
size_t prepareSimulation | ( | const DdSimOptions & | options | ) |
Definition at line 283 of file Simulate.cc.
References Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::behaviour(), DdSimOptions::fileName, Diades::CmdInterface::loadFiniteStateMachine(), Diades::Automata::Experimental::StateMachine< _StatePropertyId, _EventPropertyId, _NullStatePropertyId, _NullEventPropertyId >::numberOfStates(), and SUCCESS.
Referenced by main().
const string program | ( | "dd-sim" | ) |
Referenced by setOptions().
size_t setOptions | ( | int | argc, |
char ** | argv, | ||
DdSimOptions & | options | ||
) |
Definition at line 189 of file Simulate.cc.
References briefcomment(), DdSimOptions::controllable, detailedcomment, DdSimOptions::fileName, DdSimOptions::formats, initialiseOptions(), DdSimOptions::observable, DdSimOptions::output, Diades::CmdInterface::printCommandLineError(), printUsage(), program(), DdSimOptions::seed, DdSimOptions::size, SUCCESS, DdSimOptions::through, and DdSimOptions::timer.
Referenced by main().
const string detailedcomment |
Definition at line 69 of file Simulate.cc.
Referenced by setOptions().
FileSuffixes suffixes({"ddaut"}) |