-FatTreeLink::FatTreeLink(ClusterCreationArgs* cluster, FatTreeNode* downNode, FatTreeNode* upNode)
- : up_node_(upNode), down_node_(downNode)
-{
- static int uniqueId = 0;
- LinkCreationArgs linkTemplate;
- linkTemplate.bandwidth = cluster->bw;
- linkTemplate.latency = cluster->lat;
- linkTemplate.policy = cluster->sharing_policy; // sthg to do with that ?
- linkTemplate.id =
- "link_from_" + std::to_string(downNode->id) + "_" + std::to_string(upNode->id) + "_" + std::to_string(uniqueId);
- sg_platf_new_link(&linkTemplate);
-
- if (cluster->sharing_policy == s4u::Link::SharingPolicy::SPLITDUPLEX) {
- this->up_link_ = s4u::Link::by_name(linkTemplate.id + "_UP")->get_impl(); // check link?
- this->down_link_ = s4u::Link::by_name(linkTemplate.id + "_DOWN")->get_impl(); // check link ?
- } else {
- this->up_link_ = s4u::Link::by_name(linkTemplate.id)->get_impl();
- this->down_link_ = this->up_link_;
- }
- uniqueId++;
-}
-}
-}
-} // namespace