DiaDes
0.1
DIAgnosis of Discrete-Event System
|
Typedefs | |
typedef UnquotedLabel< char, std::char_traits< char >, std::allocator< char > > | UnquotedStringLabel |
typedef UnquotedLabel< wchar_t, std::char_traits< wchar_t >, std::allocator< wchar_t > > | UnquotedWideStringLabel |
typedef QuotedLabel< char, std::char_traits< char >, std::allocator< char > > | QuotedStringLabel |
typedef QuotedLabel< wchar_t, std::char_traits< wchar_t >, std::allocator< wchar_t > > | QuotedWideStringLabel |
typedef LabelGenerator< char, std::char_traits< char >, std::allocator< char > > | UnquotedStringLabelGenerator |
typedef LabelGenerator< wchar_t, std::char_traits< wchar_t >, std::allocator< wchar_t > > | UnquotedWideStringLabelGenerator |
template<typename Key , typename Value > | |
using | Map = std::map< Key, Value > |
template<typename Key , typename Value > | |
using | MapIterator = typename Map< Key, Value >::iterator |
template<typename Key , typename Value > | |
using | ConstMapIterator = typename Map< Key, Value >::const_iterator |
template<typename Key , typename Value > | |
using | UnorderedMap = std::unordered_map< Key, Value > |
template<typename Key , typename Value > | |
using | UnorderedMapIterator = typename UnorderedMap< Key, Value >::iterator |
template<typename Key , typename Value > | |
using | ConstUnorderedMapIterator = typename UnorderedMap< Key, Value >::const_iterator |
typedef basic_substring< char > | Substring |
typedef boost::format | Msg |
Enumerations | |
enum | LogLevel { LgNothing =0, LgOutput =1, LgProcess =2, LgCritical =3, LgError =4, LgWarning =5, LgInfo =6, LgDebug =7 } |
enum | VerboseLevel { VbNothing, VbOutput, VbProcess, VbCritical, VbError, VbWarning, VbInfo, VbDebug } |
Functions | |
template<typename InputIterator > | |
IsIn< InputIterator > | isIn (InputIterator first, InputIterator last) |
template<typename InputIterator > | |
IsNotIn< InputIterator > | isNotIn (InputIterator first, InputIterator last) |
template<typename InputIterator , typename OutputIterator1 , typename OutputIterator2 , typename _UnaryPredicate > | |
void | dispatch (InputIterator first, InputIterator last, OutputIterator1 output1, OutputIterator2 output2, _UnaryPredicate predicate) |
template<class F , class G , class H > | |
CompositionFunctorFGxHx< F, G, H > | fgxhx (const F &f, const G &g, const H &h) |
template<class F , class G > | |
CompositionFunctorFGx< F, G > | fgx (const F &f, const G &g) |
template<class F , class G , class H > | |
CompositionFunctorFGxHy< F, G, H > | fgxhy (const F &f, const G &g, const H &h) |
template<class Predicate1 , class Predicate2 > | |
UnaryAnd< Predicate1, Predicate2 > | unaryAnd (const Predicate1 &p1, const Predicate2 &p2) |
template<class Predicate1 , class Predicate2 > | |
UnaryOr< Predicate1, Predicate2 > | unaryOr (const Predicate1 &p1, const Predicate2 &p2) |
template<class Predicate1 , class Predicate2 > | |
BinaryAnd< Predicate1, Predicate2 > | binaryAnd (const Predicate1 &p1, const Predicate2 &p2) |
template<class Predicate1 , class Predicate2 > | |
BinaryOr< Predicate1, Predicate2 > | binaryOr (const Predicate1 &p1, const Predicate2 &p2) |
istream & | getIdentifierString (istream &is, std::string &identifier) |
std::ostream & | operator<< (std::ostream &os, const Identifier &identifier) |
template<typename CharT , typename Traits , typename Alloc > | |
bool | readLabel (std::basic_istream< CharT > &stream, std::basic_string< CharT, Traits, Alloc > &label) |
template<LogLevel level> | |
Log | log (Logger logger, const string &msg) |
template<LogLevel level> | |
Log | log (const string &msg) |
template<LogLevel level> | |
void | saveLog (Logger logger, ostream &os) |
template<LogLevel level> | |
void | saveLog (ostream &os) |
void | saveAllLogs (ostream &os) |
template<typename InputIterator1 , typename InputIterator2 > | |
int | sequenceHamming (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2) |
template<typename InputIterator1 , typename InputIterator2 > | |
int | orderedHamming (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2) |
template<typename InputIterator1 , typename InputIterator2 > | |
int | intersectionSize (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2) |
template<typename InputIterator1 , typename InputIterator2 > | |
int | differenceSize (InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2) |
double | generateRandomDouble (double lower, double upper) |
long | generateRandomValue (long lower, long upper) |
unsigned | initialiseSeed () |
void | initialiseRandomGenerator (unsigned int seed) |
void | selectNValues (unsigned int min, unsigned int max, unsigned int n, set< unsigned > &result) |
template<typename Iterator > | |
Iterator | selectRandomElement (unsigned number, Iterator first, Iterator last) |
template<typename Iterator , typename Predicate > | |
Iterator | selectRandomElement (Iterator first, Iterator last, Predicate pred) |
template<typename InputIterator , typename Predicate , typename OutputIterator > | |
void | selectNRandomElements (InputIterator first, InputIterator last, Predicate pred, unsigned number, OutputIterator out) |
template<typename CharT > | |
bool | readChars (std::basic_istream< CharT > &is, const std::unordered_set< CharT > &characters, CharT &next) |
template<class CharType , class CharTraits , class InputIterator > | |
InputIterator | getFileExtension (const std::basic_string< CharType, CharTraits > &fileName, InputIterator begin, InputIterator end) |
template<class CharType , class CharTraits > | |
bool | hasOnlyWhiteSpaces (const std::basic_string< CharType, CharTraits > &sequence, typename std::basic_string< CharType, CharTraits >::size_type &index) |
template<typename T > | |
std::vector< T >::size_type | swapRemove (std::vector< T > &myVector, typename std::vector< T >::size_type index) |
template<typename T > | |
std::vector< T >::size_type | swapRemove (std::vector< T > &myVector, typename std::vector< T >::iterator &it) |
template<typename T > | |
std::vector< T >::size_type | swapRemoveFirst (std::vector< T > &myVector, const T &element) |
template<typename T > | |
std::vector< T >::size_type | swapRemove (std::vector< T > &myVector, const T &element) |
using Diades::Utils::ConstMapIterator = typedef typename Map<Key, Value>::const_iterator |
Definition at line 124 of file MapIterators.hh.
using Diades::Utils::ConstUnorderedMapIterator = typedef typename UnorderedMap<Key, Value>::const_iterator |
Definition at line 315 of file MapIterators.hh.
using Diades::Utils::Map = typedef std::map<Key, Value> |
Definition at line 29 of file MapIterators.hh.
using Diades::Utils::MapIterator = typedef typename Map<Key, Value>::iterator |
Definition at line 32 of file MapIterators.hh.
typedef boost::format Diades::Utils::Msg |
Msg
shortest way to write boost::format (recommended to use in Diades)
Definition at line 42 of file Verbose.hh.
typedef QuotedLabel<char, std::char_traits<char>, std::allocator<char> > Diades::Utils::QuotedStringLabel |
typedef QuotedLabel<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > Diades::Utils::QuotedWideStringLabel |
typedef basic_substring<char> Diades::Utils::Substring |
Definition at line 50 of file Substring.hh.
using Diades::Utils::UnorderedMap = typedef std::unordered_map<Key, Value> |
Definition at line 220 of file MapIterators.hh.
using Diades::Utils::UnorderedMapIterator = typedef typename UnorderedMap<Key, Value>::iterator |
Definition at line 223 of file MapIterators.hh.
typedef UnquotedLabel<char, std::char_traits<char>, std::allocator<char> > Diades::Utils::UnquotedStringLabel |
typedef LabelGenerator<char, std::char_traits<char>, std::allocator<char> > Diades::Utils::UnquotedStringLabelGenerator |
typedef UnquotedLabel<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > Diades::Utils::UnquotedWideStringLabel |
typedef LabelGenerator<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > Diades::Utils::UnquotedWideStringLabelGenerator |
LgOutput: normal output of the process LgProcess: output about the behaviour of the process LgCritical: critical output about the behaviour of the process LgError: detected error in the process LgWarning: for the warning LgInfo: other type of information LgDebug: information for debug only
Enumerator | |
---|---|
LgNothing | |
LgOutput | |
LgProcess | |
LgCritical | |
LgError | |
LgWarning | |
LgInfo | |
LgDebug |
Enumerator | |
---|---|
VbNothing | |
VbOutput | |
VbProcess | |
VbCritical | |
VbError | |
VbWarning | |
VbInfo | |
VbDebug |
Definition at line 19 of file Verbose.hh.
|
inline |
p1 | a boolean unary predicate |
p2 | a boolean unary predicate |
Definition at line 540 of file Functors.hh.
|
inline |
p1 | a boolean unary predicate |
p2 | a boolean unary predicate |
Definition at line 554 of file Functors.hh.
int Diades::Utils::differenceSize | ( | InputIterator1 | first1, |
InputIterator1 | last1, | ||
InputIterator2 | first2, | ||
InputIterator2 | last2 | ||
) |
Compute the number of elements that are in the first ordered range but not in the other one. If the same element occurs twice it will be considered as two elements. The elements must be comparable
first1 | iterator on the first element of range 1 |
last1 | iterator on the element after the last one in range 1 |
first2 | iterator on the first element of range 2 |
last2 | iterator on the element after the last one in range 2 |
Definition at line 171 of file Measures.hh.
Referenced by Diades::Automata::NonCommonFaults::operator()().
void Diades::Utils::dispatch | ( | InputIterator | first, |
InputIterator | last, | ||
OutputIterator1 | output1, | ||
OutputIterator2 | output2, | ||
_UnaryPredicate | predicate | ||
) |
Template function for dispatching a range of objects depending on the result of a unary boolean Predicte
first | first iterator of the range to dispatch |
last | last iterator of the range to dispatch |
output1 | output iterator to insert object such that the Predicate is true |
output2 | output iterator to insert object such that the Predicate is false |
predicate | the boolean unary predicate |
Definition at line 245 of file Functors.hh.
|
inline |
f | binary functor |
g | unary functor |
function
for convenience
Definition at line 373 of file Functors.hh.
Referenced by Diades::Automata::randomSimulateState().
|
inline |
f | binary functor |
g | unary functor |
h | unary functor |
function
for convenience
Definition at line 319 of file Functors.hh.
|
inline |
f | binary functor |
g | unary functor |
h | unary functor |
function
for convenience
Definition at line 429 of file Functors.hh.
double Diades::Utils::generateRandomDouble | ( | double | lower, |
double | upper | ||
) |
Generation of a random double in [lower,upper]
long Diades::Utils::generateRandomValue | ( | long | lower, |
long | upper | ||
) |
Generation of a random integer in [lower,upper]
Definition at line 234 of file ModelGenerator.cc.
Referenced by completeObservableComponent(), generateComponent(), generateFaults(), generateSharedEvents(), generateTopology(), generateTopology2(), generateTransitionSystem(), generateTriggerableEvents(), main(), Diades::Utils::GFS< TIncidentEdges, TOpposite, TContainer, TAccumulator, TMark, TSolution, TPathCut >::next(), Diades::Utils::GFS< TIncidentEdges, TOpposite, TContainer, TAccumulator, TMark, TSolution, TPathCut >::pickup(), Diades::Automata::randomSimulateState(), selectRandomElement(), and Diades::Automata::timeStamp().
InputIterator Diades::Utils::getFileExtension | ( | const std::basic_string< CharType, CharTraits > & | fileName, |
InputIterator | begin, | ||
InputIterator | end | ||
) |
Get the extension (suffix) of a filename
fileName | name of a file |
begin | iterator on the first possible extension |
end | iterator on the element after the last possible extension |
Definition at line 57 of file StringTools.hh.
Referenced by Diades::CmdInterface::fileSuffixOk(), getInterface(), Diades::CmdInterface::getParameterList(), main(), and readParameters().
istream& Diades::Utils::getIdentifierString | ( | istream & | is, |
std::string & | identifier | ||
) |
is | input stream |
identifier | the resulting string |
bool Diades::Utils::hasOnlyWhiteSpaces | ( | const std::basic_string< CharType, CharTraits > & | sequence, |
typename std::basic_string< CharType, CharTraits >::size_type & | index | ||
) |
Check whether the given sequence only contains whitespaces (or tabs)
sequence | the sequence to analyse |
index | the returning index of the first character that is not a whitespace in the sequence or npos if such a character does not exist |
Definition at line 92 of file StringTools.hh.
void Diades::Utils::initialiseRandomGenerator | ( | unsigned int | seed | ) |
Initialise the random generator with a seed
Referenced by main().
unsigned Diades::Utils::initialiseSeed | ( | ) |
Initialise a seed for the random generator, note that the random generator must be initialised with the seed with initialiseRandomGenerator
Referenced by main().
int Diades::Utils::intersectionSize | ( | InputIterator1 | first1, |
InputIterator1 | last1, | ||
InputIterator2 | first2, | ||
InputIterator2 | last2 | ||
) |
Compute the number of common elements in the two ordered ranges. If the same element occurs twice it will be considered as two elements. The elements must be comparable
first1 | iterator on the first element of range 1 |
last1 | iterator on the element after the last one in range 1 |
first2 | iterator on the first element of range 2 |
last2 | iterator on the element after the last one in range 2 |
Definition at line 126 of file Measures.hh.
Referenced by Diades::Automata::CommonFaults::operator()(), Diades::Automata::Accuracy::operator()(), Diades::Automata::BsAccuracy::operator()(), and Diades::Automata::FcAccuracy::operator()().
|
inline |
first | first iterator of the range to search in |
last | last iterator of the range to search in |
Definition at line 141 of file Functors.hh.
Referenced by Diades::Automata::Experimental::ComposableModel< Fsm, StateCreator >::checkSynchronisationEvent().
|
inline |
first | first iterator of the range to search in |
last | last iterator of the range to search in |
Definition at line 226 of file Functors.hh.
Referenced by Diades::Automata::randomSimulateState(), and writeFinalPartOfSimulation().
Log a message with a given level to the givn logger
logger | the Logger |
msg | the message |
Definition at line 124 of file Log.hh.
References Diades::Utils::Log::Log().
Referenced by component2Orange(), initialiseDiagnosers(), initialiseModelFromDesComp(), initialiseModelFromSdmdl(), initialiseOptions(), Diades::Automata::ClassicalDiagnoser::initialize(), main(), MealyEncoding(), MealyEncodingV1(), MooreEncoding(), and Diades::Graph::Graph::nodeCapacity().
Log Diades::Utils::log | ( | const string & | msg | ) |
|
inline |
Output Stream operator
os | the output stream |
identifier | the Identifier to print out |
Definition at line 501 of file Identifier.hh.
References Diades::Utils::Identifier::str(), and Diades::Utils::Identifier::valid().
Referenced by Diades::Sdmdl::UnfoldingState::formula(), Diades::Utils::LoggerFactory::getRootLogger(), Diades::Utils::Interval::isUbUnBounded(), Diades::Automata::History::obsEnd(), Diades::Automata::Diagnosis::operator!=(), Diades::Graph::GraphNodeSet::operator==(), Diades::Sdmdl::ComponentType::spontaneousPort(), Diades::Sdmdl::Port::type(), Diades::Petri::Zsl::valid(), and Diades::Utils::LoggerData::~LoggerData().
int Diades::Utils::orderedHamming | ( | InputIterator1 | first1, |
InputIterator1 | last1, | ||
InputIterator2 | first2, | ||
InputIterator2 | last2 | ||
) |
Compute the hamming distance between two ordered ranges. If the same element occurs twice it will be considered as two elements. The elements must be comparable
first1 | iterator on the first element of range 1 |
last1 | iterator on the element after the last one in range 1 |
first2 | iterator on the first element of range 2 |
last2 | iterator on the element after the last one in range 2 |
Definition at line 71 of file Measures.hh.
Referenced by Diades::Automata::Distance::operator()(), Diades::Automata::FcDistance::operator()(), and Diades::Automata::BsDistance::operator()().
bool Diades::Utils::readChars | ( | std::basic_istream< CharT > & | is, |
const std::unordered_set< CharT > & | characters, | ||
CharT & | next | ||
) |
is | an input stream |
characters | a set of characters |
next | the next character in the stream that is not part of 'characters' |
Definition at line 27 of file StreamTools.hh.
Referenced by Diades::Automata::Experimental::AutFileDescriptor< DdAutEventId >::autFileHeader().
bool Diades::Utils::readLabel | ( | std::basic_istream< CharT > & | stream, |
std::basic_string< CharT, Traits, Alloc > & | label | ||
) |
Read a label from a stream
stream | the stream that contain the event |
label | the returned label |
Definition at line 279 of file Label.hh.
References Diades::Utils::GenericLabel< CharT, Traits, Alloc >::isNull(), Diades::Utils::QuotedLabel< CharT, Traits, Alloc >::nudeString(), and Diades::Utils::GenericLabel< CharT, Traits, Alloc >::toString().
Referenced by Diades::Automata::Experimental::ReadEvent< std::string >::operator()().
void Diades::Utils::saveAllLogs | ( | ostream & | os | ) |
void Diades::Utils::saveLog | ( | Logger | logger, |
ostream & | os | ||
) |
Output the logs
logger | the Logger |
os | output stream |
Definition at line 163 of file Log.hh.
References Diades::Utils::Logger::printLevel().
Referenced by main(), readModels(), saveLog(), startInteractiveSimulation(), and startNonInteractiveSimulation().
void Diades::Utils::saveLog | ( | ostream & | os | ) |
Output the logs
logger | the Logger |
os | output stream |
Output the default logs
os | output stream |
Definition at line 180 of file Log.hh.
References Diades::Utils::Logger::printLevel(), saveAllLogs(), and saveLog().
void Diades::Utils::selectNRandomElements | ( | InputIterator | first, |
InputIterator | last, | ||
Predicate | pred, | ||
unsigned | number, | ||
OutputIterator | out | ||
) |
first | An iterator on the first element |
last | An iterator on the element after the last one |
pred | A predicate |
number | The number of elements to select |
out | a set of n selected elements from [first,last( such that pred(Element) is added, no element is added otherwise |
Definition at line 145 of file Random.hh.
References selectNValues().
void Diades::Utils::selectNValues | ( | unsigned int | min, |
unsigned int | max, | ||
unsigned int | n, | ||
set< unsigned > & | result | ||
) |
Select randomly n values in the range [min,max]
min | the minimum of the range |
max | the maximum of the range |
n | the number of selected values |
result | the selected values empty result if the parameters are not compatible. |
Referenced by generateFaults(), main(), and selectNRandomElements().
Iterator Diades::Utils::selectRandomElement | ( | unsigned | number, |
Iterator | first, | ||
Iterator | last | ||
) |
number | The number of elements in [first,last( |
first | An iterator on the first element |
last | An iterator on the element after the last one |
Definition at line 68 of file Random.hh.
References generateRandomValue().
Referenced by Diades::Automata::randomSimulate(), and Diades::Automata::randomSimulateState().
Iterator Diades::Utils::selectRandomElement | ( | Iterator | first, |
Iterator | last, | ||
Predicate | pred | ||
) |
first | An iterator on the first element |
last | An iterator on the element after the last one |
pred | A prdicate |
Definition at line 107 of file Random.hh.
References generateRandomValue().
int Diades::Utils::sequenceHamming | ( | InputIterator1 | first1, |
InputIterator1 | last1, | ||
InputIterator2 | first2, | ||
InputIterator2 | last2 | ||
) |
Compute the hamming distance between two sequences
first1 | iterator on the first element of range 1 |
last1 | iterator on the element after the last one in range 1 |
first2 | iterator on the first element of range 2 |
last2 | iterator on the element after the last one in range 2 |
Definition at line 34 of file Measures.hh.
std::vector<T>::size_type Diades::Utils::swapRemove | ( | std::vector< T > & | myVector, |
typename std::vector< T >::size_type | index | ||
) |
Remove the element from myVector
myVector | |
index |
The
purpose of this function is to remove the element at index of the vector by swapping the element with the last one to avoid the linear complexity of the event shifting/copying of myVector.erase(element). Obsviously the order in myVector is changed if a swap has occurred between the last element of the vector and the element to remove. Definition at line 35 of file VectorTools.hh.
Referenced by Diades::Automata::Experimental::StateMachine< _StatePropertyId, _InputSymbolId, _NullStatePropertyId, _NullInputSymbolId >::eraseEventPropertyId(), swapRemove(), and swapRemoveFirst().
std::vector<T>::size_type Diades::Utils::swapRemove | ( | std::vector< T > & | myVector, |
typename std::vector< T >::iterator & | it | ||
) |
Remove the occurrence of element from myVector
myVector | |
element | an iterator |
The
purpose of this function is to remove the element referenced by the iterator in the vector by swapping the element with the last one to avoid the linear complexity of the event shifting/copying of myVector.erase(element). Obsviously the order in myVector is changed if a swap has occurred between the last element of the vector and the element to remove. Definition at line 74 of file VectorTools.hh.
References swapRemove().
std::vector<T>::size_type Diades::Utils::swapRemove | ( | std::vector< T > & | myVector, |
const T & | element | ||
) |
Remove all the occurrences of element from myVector
myVector | |
element |
The
purpose of this function is to remove any occurrence of an element in the vector by swapping the element with the last one to avoid the linear complexity of the event shifting/copying of myVector.erase(element). Obsviously the order in myVector is changed if a swap has occurred between the last element of the vector and the element to remove. Definition at line 122 of file VectorTools.hh.
References swapRemove().
std::vector<T>::size_type Diades::Utils::swapRemoveFirst | ( | std::vector< T > & | myVector, |
const T & | element | ||
) |
Remove the first occurrence of element from myVector
myVector | |
element |
The
purpose of this function is to remove the first occurrence of an element in the vector by swapping the element with the last one to avoid the linear complexity of the event shifting/copying of myVector.erase(element). Obsviously the order in myVector is changed if a swap has occurred between the last element of the vector and the element to remove. Definition at line 96 of file VectorTools.hh.
References swapRemove().
|
inline |
p1 | a boolean unary predicate |
p2 | a boolean unary predicate |
Definition at line 477 of file Functors.hh.
Referenced by writeFinalPartOfSimulation().
|
inline |
p1 | a boolean unary predicate |
p2 | a boolean unary predicate |
Definition at line 491 of file Functors.hh.