|
@@ -132,9 +132,10 @@ struct LevelGraphManagerParameters
|
|
|
{
|
|
|
int index;
|
|
|
std::vector <
|
|
|
- std::pair <
|
|
|
- std::pair < int, int >,
|
|
|
- std::pair < int, int > > > connections;
|
|
|
+ std::vector <
|
|
|
+ std::pair <
|
|
|
+ std::pair < int, int >,
|
|
|
+ std::pair < int, int > > > > parents;
|
|
|
};
|
|
|
|
|
|
class LevelGraphManager :
|
|
@@ -152,29 +153,37 @@ public:
|
|
|
{
|
|
|
add_child(&model);
|
|
|
for (std::vector <
|
|
|
+ std::vector <
|
|
|
std::pair < std::pair < int, int >,
|
|
|
- std::pair < int, int > > >::const_iterator it2 =
|
|
|
- parameters.connections.begin();
|
|
|
- it2 != parameters.connections.end(); ++it2) {
|
|
|
- std::stringstream out_ss;
|
|
|
- std::stringstream in_ss;
|
|
|
-
|
|
|
- if (it2->first.first == parameters.index) {
|
|
|
- out_ss << "out_" << it2->first.second;
|
|
|
- if (not model.exist_out_port(out_ss.str())) {
|
|
|
- model.add_out_port(out_ss.str());
|
|
|
- }
|
|
|
- if (not exist_link(&model, out_ss.str(), coordinator, out_ss.str())) {
|
|
|
- add_link(&model, out_ss.str(), coordinator, out_ss.str());
|
|
|
- }
|
|
|
- }
|
|
|
- if (it2->second.first == parameters.index) {
|
|
|
- in_ss << "in_" << it2->second.second;
|
|
|
- if (not model.exist_in_port(in_ss.str())) {
|
|
|
- model.add_in_port(in_ss.str());
|
|
|
+ std::pair < int, int > > > >::const_iterator it =
|
|
|
+ parameters.parents.begin();
|
|
|
+ it != parameters.parents.end(); ++it) {
|
|
|
+ for (std::vector <
|
|
|
+ std::pair < std::pair < int, int >,
|
|
|
+ std::pair < int, int > > >::const_iterator it2 =
|
|
|
+ it->begin();
|
|
|
+ it2 != it->end(); ++it2) {
|
|
|
+ std::stringstream out_ss;
|
|
|
+ std::stringstream in_ss;
|
|
|
+
|
|
|
+ if (it2->first.first == parameters.index) {
|
|
|
+ out_ss << "out_" << it2->first.second;
|
|
|
+ if (not model.exist_out_port(out_ss.str())) {
|
|
|
+ model.add_out_port(out_ss.str());
|
|
|
+ }
|
|
|
+ if (not exist_link(&model, out_ss.str(), coordinator,
|
|
|
+ out_ss.str())) {
|
|
|
+ add_link(&model, out_ss.str(), coordinator, out_ss.str());
|
|
|
+ }
|
|
|
}
|
|
|
- if (not exist_link(coordinator, in_ss.str(), &model, in_ss.str())) {
|
|
|
- add_link(coordinator, in_ss.str(), &model, in_ss.str());
|
|
|
+ if (it2->second.first == parameters.index) {
|
|
|
+ in_ss << "in_" << it2->second.second;
|
|
|
+ if (not model.exist_in_port(in_ss.str())) {
|
|
|
+ model.add_in_port(in_ss.str());
|
|
|
+ }
|
|
|
+ if (not exist_link(coordinator, in_ss.str(), &model, in_ss.str())) {
|
|
|
+ add_link(coordinator, in_ss.str(), &model, in_ss.str());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -233,7 +242,7 @@ public:
|
|
|
LevelGraphManagerParameters p;
|
|
|
|
|
|
p.index = index;
|
|
|
- p.connections = parameters.parents[index];
|
|
|
+ p.parents = parameters.parents;
|
|
|
ss << "S_" << index;
|
|
|
model = new Coordinator(ss.str(), common::NoParameters(), p);
|
|
|
models.push_back(model);
|