11 #include "elementary_language.hh"
12 #include "renaming_relation.hh"
43 return this->domain == elementaryLanguage;
59 juxtaposedCondition.addRenaming(this->renaming);
60 juxtaposedCondition.canonize();
61 assert(juxtaposedCondition.isSatisfiableNoCanonize());
63 const auto values = juxtaposedCondition.sample();
64 std::vector<double> durations;
65 durations.resize(codomain.
wordSize() + 1);
66 for (
int i =
static_cast<int>(codomain.
wordSize()); i >= 0; --i) {
67 if (i ==
static_cast<int>(codomain.
wordSize())) {
68 durations.at(i) = values.back();
70 durations.at(i) = values.at(i + 1 + domain.
wordSize()) - values.at(i + 2 + domain.
wordSize());
74 return TimedWord{this->codomain.getWord(), durations};
78 return domain == rhs.domain &&
79 codomain == rhs.codomain &&
80 renaming == rhs.renaming;
84 return !(rhs == *
this);
87 friend std::ostream &operator<<(std::ostream &os,
const SingleMorphism &morphism) {
88 os <<
"domain: " << morphism.domain <<
" codomain: " << morphism.codomain <<
" renaming: " << morphism.renaming;
An elementary language.
Definition: elementary_language.hh:23
std::size_t wordSize() const
Returns the number of the events in this elementary language.
Definition: elementary_language.hh:73
bool contains(const TimedWord &testedWord) const
Check if the given the timed word is a member of this elementary languages.
Definition: elementary_language.hh:185
Definition: renaming_relation.hh:16
Morphism from an external elementary language to an internal one.
Definition: single_morphism.hh:18
TimedWord maps(const TimedWord &word) const
Apply this single morphism to the given timed word.
Definition: single_morphism.hh:55
bool isDomain(const ElementaryLanguage &elementaryLanguage) const
Check if the given timed word is in the domain of this morphism.
Definition: single_morphism.hh:42
bool inDomain(const TimedWord &word) const
Check if the given timed word is in the domain of this morphism.
Definition: single_morphism.hh:35
SingleMorphism(ElementaryLanguage domain, ElementaryLanguage codomain, RenamingRelation renaming)
Definition: single_morphism.hh:28
static TimedCondition makeExact(const std::vector< double > &accumulatedDuration)
Construct a timed condition from concrete values of T_{i,j}. The generated timed condition only conta...
Definition: timed_condition.hh:61
A timed word.
Definition: timed_word.hh:25
std::vector< double > getAccumulatedDurations() const
Construct and return the (tail) accumulated duration.
Definition: timed_word.hh:123
Definition: experiment_runner.hh:23
Definition: external_transition_maker.hh:149