|
@@ -78,7 +78,9 @@ public:
|
|
|
if (not coordinator->exist_in_port(ss.str())) {
|
|
|
coordinator->add_in_port(ss.str());
|
|
|
}
|
|
|
- add_link(coordinator, ss.str(), models[it->second], "in");
|
|
|
+ if (not exist_link(coordinator, ss.str(), models[it->second], "in")) {
|
|
|
+ add_link(coordinator, ss.str(), models[it->second], "in");
|
|
|
+ }
|
|
|
}
|
|
|
for (std::vector < std::pair < int, int > >::const_iterator it =
|
|
|
parameters.outputs.begin(); it != parameters.outputs.end(); ++it) {
|
|
@@ -88,12 +90,16 @@ public:
|
|
|
if (not coordinator->exist_out_port(ss.str())) {
|
|
|
coordinator->add_out_port(ss.str());
|
|
|
}
|
|
|
- add_link(models[it->first], "out", coordinator, ss.str());
|
|
|
+ if (not exist_link(models[it->first], "out", coordinator, ss.str())) {
|
|
|
+ add_link(models[it->first], "out", coordinator, ss.str());
|
|
|
+ }
|
|
|
}
|
|
|
for (std::vector < std::pair < int, int > >::const_iterator it =
|
|
|
parameters.internals.begin(); it != parameters.internals.end();
|
|
|
++it) {
|
|
|
- add_link(models[it->first], "out", models[it->second], "in");
|
|
|
+ if (not exist_link(models[it->first], "out", models[it->second], "in")) {
|
|
|
+ add_link(models[it->first], "out", models[it->second], "in");
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -180,8 +186,11 @@ public:
|
|
|
if (not models[it2->second.first]->exist_in_port(in_ss.str())) {
|
|
|
models[it2->second.first]->add_in_port(in_ss.str());
|
|
|
}
|
|
|
- add_link(models[it2->first.first], out_ss.str(),
|
|
|
- models[it2->second.first], in_ss.str());
|
|
|
+ if (not exist_link(models[it2->first.first], out_ss.str(),
|
|
|
+ models[it2->second.first], in_ss.str())) {
|
|
|
+ add_link(models[it2->first.first], out_ss.str(),
|
|
|
+ models[it2->second.first], in_ss.str());
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|