DiaDes
0.1
DIAgnosis of Discrete-Event System
|
#include <StateInfoEncoder.hh>
Public Types | |
using | VariableEncoderId = VariableVector::size_type |
using | StateInfoId = size_t |
Public Member Functions | |
StateInfoEncoder (VariableFactory &varFactory) | |
template<typename StateInfoIdIterator > | |
VariableEncoderId | encodeStateInfoRange (StateInfoIdIterator first, StateInfoIdIterator last) |
Variable & | getVariable (VariableEncoderId id) const |
VariableEncoderId | numberOfEncodedVariables () const |
VariableEncoderId | getVariableId (const Variable &variable) const |
std::vector< StateInfoId > & | getDomain (VariableEncoderId id) |
std::pair< StateInfoId, bool > | getStateInfoId (const Assignment &assignment) const |
Private Member Functions | |
const Value & | encodeStateInfoInVariable (VariableEncoderId varId, StateInfoId id) |
Private Attributes | |
VariableFactory & | _variables |
VariableVector | _encodedVariables |
std::unordered_map< std::string, VariableEncoderId > | _varDictionnary |
std::vector< std::vector< StateInfoId > > | _domains |
std::vector< std::unordered_map< std::string, size_t > > | _valueIndexes |
This class encodes ranges of StateInfo as a Variable with a domain that encode the given range It might encode several ranges. For each range a new Variable is created. To access a Variable and its non-encoded domain (set of StateInfoIds) the encoder provides an Id.
Definition at line 34 of file StateInfoEncoder.hh.
using Diades::Sdmdl::Experimental::StateInfoEncoder::StateInfoId = size_t |
StateInfoId | a classical StateInfoId represented as a size_t |
Definition at line 46 of file StateInfoEncoder.hh.
using Diades::Sdmdl::Experimental::StateInfoEncoder::VariableEncoderId = VariableVector::size_type |
Definition at line 41 of file StateInfoEncoder.hh.
|
inline |
Constructor
varFactory | the permanent reference to a VariableFactory |
Definition at line 90 of file StateInfoEncoder.hh.
|
inlineprivate |
Encode a StateInfoId into predefined variable
varId | the VariableEncoderId that is already created by the encode |
id | a new StateInfoId to encode in the domain of the variable |
Definition at line 107 of file StateInfoEncoder.hh.
Referenced by encodeStateInfoRange().
|
inline |
Encode a range of StateInfoIds. Creation of a new Variable for this range
first | First StateInfoId of the range |
last | Second StateInfoId of the range |
Definition at line 127 of file StateInfoEncoder.hh.
References encodeStateInfoInVariable(), Diades::Sdmdl::VariableFactory::newVariable(), and Diades::Sdmdl::VariableFactory::numberOfAllocatedVariables().
Referenced by runGlobalDiagnosisProblem().
|
inline |
id | a Variable Id given by the StateInfoEncoder |
Definition at line 198 of file StateInfoEncoder.hh.
|
inline |
Return the StateInfoId encoded with the Assignment
assignment | the Assignemt to decode |
Definition at line 210 of file StateInfoEncoder.hh.
References getVariableId(), Diades::Sdmdl::Value::label(), numberOfEncodedVariables(), Diades::Sdmdl::Experimental::Assignment::value(), and Diades::Sdmdl::Experimental::Assignment::variable().
Referenced by printSolution().
|
inline |
id | a Variable Id given by the StateInfoEncoder |
Definition at line 155 of file StateInfoEncoder.hh.
Referenced by getVariableId(), and runGlobalDiagnosisProblem().
|
inline |
variable |
Definition at line 176 of file StateInfoEncoder.hh.
References getVariable(), Diades::Sdmdl::Variable::name(), and numberOfEncodedVariables().
Referenced by getStateInfoId().
|
inline |
Definition at line 165 of file StateInfoEncoder.hh.
Referenced by getStateInfoId(), and getVariableId().
|
private |
Definition at line 75 of file StateInfoEncoder.hh.
|
private |
Definition at line 60 of file StateInfoEncoder.hh.
|
private |
Definition at line 82 of file StateInfoEncoder.hh.
|
private |
Definition at line 67 of file StateInfoEncoder.hh.
|
private |
Definition at line 54 of file StateInfoEncoder.hh.