-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 == SURF_LINK_SPLITDUPLEX) {
- std::string tmpID = std::string(linkTemplate.id) + "_UP";
- this->up_link_ = resource::LinkImpl::byName(tmpID); // check link?
- tmpID = std::string(linkTemplate.id) + "_DOWN";
- this->down_link_ = resource::LinkImpl::byName(tmpID); // check link ?
- } else {
- this->up_link_ = resource::LinkImpl::byName(linkTemplate.id);
- this->down_link_ = this->up_link_;
- }
- uniqueId++;
-}
-}
-}
-} // namespace