|
|
@ -6,13 +6,12 @@ namespace pEp { |
|
|
|
namespace PityTest11 { |
|
|
|
bool PityModel::debug_log_enabled = true; |
|
|
|
|
|
|
|
PityModel::PityModel(const std::string& name, int nodesCount) : |
|
|
|
_name{ name }, _nodes_count{ nodesCount }, _root_unit{ nullptr, name, nullptr, this } |
|
|
|
PityModel::PityModel(const std::string& name, int nodeCount) : |
|
|
|
_name{ name }, _root_unit{ nullptr, name, nullptr, this } |
|
|
|
{ |
|
|
|
|
|
|
|
for (int i = 0; i < nodesCount; i++) { |
|
|
|
_nodes.emplace_back(PityNode(*this, i)); |
|
|
|
// _nodes.emplace_back(*this, i);
|
|
|
|
for (int i = 0; i < nodeCount; i++) { |
|
|
|
auto tmp = std::make_shared<PityNode>(*this, i); |
|
|
|
_nodes.emplace_back(tmp); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -21,7 +20,12 @@ namespace pEp { |
|
|
|
return _name; |
|
|
|
} |
|
|
|
|
|
|
|
std::vector<PityNode> PityModel::getNodes() const |
|
|
|
void PityModel::setName(std::string name) |
|
|
|
{ |
|
|
|
_name = name; |
|
|
|
} |
|
|
|
|
|
|
|
std::vector<std::shared_ptr<PityNode>> PityModel::getNodes() const |
|
|
|
{ |
|
|
|
return _nodes; |
|
|
|
} |
|
|
@ -31,5 +35,10 @@ namespace pEp { |
|
|
|
return _root_unit; |
|
|
|
} |
|
|
|
|
|
|
|
PityUnit<PityModel>* PityModel::getNodeUnit(int nr) const |
|
|
|
{ |
|
|
|
return getNodes().at(nr)->getProcessUnit().get(); |
|
|
|
} |
|
|
|
|
|
|
|
} // namespace PityTest11
|
|
|
|
} // namespace pEp
|
|
|
|