15 mModPath_(hn.mModPath_),
35 if (
mModPath_[mMod].back() >= mMod->getNumberOfModels())
40 shared_ptr<MixedTransitionModelInterface> mMod2)
43 throw Exception(
"ModelPath::changeModel : Unknown model " + mMod1->getName());
70 if (mpath2.find(ipath.first) != mpath2.end() &&
71 !(ipath.second <= mpath2.at(ipath.first)))
89 if (mpath2.find(ipath.first) == mpath2.end() ||
90 ipath.second.intersects(mpath2.at(ipath.first)))
94 for (
const auto& ipath : mpath2)
107 for (
const auto& ipath : mpath2)
119 for (
const auto& ipath : mpath2)
134 vector< shared_ptr<MixedTransitionModelInterface>> models;
139 std::back_inserter(models),
140 [](
const map<shared_ptr<MixedTransitionModelInterface>,
PathNode>::value_type& pair){
156 auto model = mod.first;
160 std::string name =
"";
166 for (
auto nb:mod.second)
168 name = name + (com ?
", " :
"") + pMS->AbstractMixedTransitionModel::nModel(nb - 1).
getName();
179 name +=
"." + eM.
getName() +
"[" + mod.second.to_string() +
"]";
184 output += model->getName() +
"[" + mod.second.to_string() +
"]";
197 for (
const auto& it2 : vn)
199 vector<uint>::const_iterator it(begin());
201 for ( ; it != end(); it++)
215 erase(std::remove_if(begin(), end(),
216 [vn](
const uint x) ->
bool {
217 return std::find(vn.begin(), vn.end(), x) != vn.end();
223 vector<uint>::const_iterator it2(n.begin());
225 for (
const auto& it : *
this)
227 while (it2 != n.end() && (*it2 < it))
229 if (it2 == n.end() || (*it2 > it))
242 vector<uint>::const_iterator it2(n.begin());
244 for (
const auto& it : *
this)
246 while (it2 != n.end() && (*it2 < it))
Abstract class for mixture models based on the bibliography.
virtual std::string getName() const =0
Get the name of the model.
Transition models defined as a mixture of nested substitution models.
Transition models defined as a mixture of several substitution models.
std::string getName() const override
Get the name of the model.
A vector<int> where all elements are different and in INCREASING ORDER. So inclusion should be done t...
void insertN(const Vuint &vn)
Insert elements.
bool operator>=(const PathNode &) const
checks if this PathNode includes another one.
bool intersects(const PathNode &) const
checks if this PathNode intersects another one.
void removeN(const Vuint &vn)
Remove elements.
bool operator<=(const PathNode &) const
checks if this PathNode is included in another one.
std::string to_string() const
Output.
Organization of submodels in mixed substitution models in a path. See class ModelScenario for a thoro...
ModelPath & operator-=(const ModelPath &)
Remove from the PathNodes of this object the matching ones of the ModelPath.
std::shared_ptr< MixedTransitionModelInterface > leadMod_
bool intersects(const ModelPath &) const
checks if this ModelPath intersects another one. Which means that one submodel explicitly declared in...
std::string toString() const
string description
std::map< std::shared_ptr< MixedTransitionModelInterface >, PathNode > mModPath_
void changeModel(std::shared_ptr< MixedTransitionModelInterface > mMod1, std::shared_ptr< MixedTransitionModelInterface > mMod2)
change from a model to another
ModelPath & operator=(const ModelPath &)
std::vector< std::shared_ptr< MixedTransitionModelInterface > > getModels() const
gets the MixedTransitionModel used in the ModelPath
void setModel(std::shared_ptr< MixedTransitionModelInterface > mMod, const Vuint &vnS)
sets submodel numbers in the mixed model. Checks if all the numbers are valid.
ModelPath & operator+=(const ModelPath &)
Cumulates the PathNodes of the given ModelPath into this one.
void addToModel(std::shared_ptr< MixedTransitionModelInterface > mMod, const Vuint &vnS)
adds submodel numbers to the mixed model. Checks if all the numbers are valid.
bool operator<=(const ModelPath &) const
checks if this ModelPath is included in another one. Which means that all submodels of this path are ...
double proba_
probability of this ModelPath.
bool operator>=(const ModelPath &) const
checks if this ModelPath includes another one.
Interface for all transition models.
Defines the basic types of data flow nodes.
std::string to_string(const NoDimension &)
std::vector< unsigned int > Vuint