コード例 #1
0
ファイル: RC.cs プロジェクト: admsbk/tsst2
        public string getExternalPorts(int src, int trg, int connectN, int requieredCapacity)
        {
            string rtn = "";

            RoutingGraph ownTopology = RoutingGraph.MapTopology(manager.Topology, ConnectionController.VirtualPaths, requieredCapacity);
            SetupStore   ss          = new SetupStore(src, trg, ownTopology, connectN, requieredCapacity);
            int          iter        = 1;

            do
            {
                if (ss.ownTopology.EdgeCount != 0)
                {
                    ss = new SetupStore(src, trg, ownTopology, connectN, requieredCapacity);
                    if (this.findBestPath(ss) && this.askLRMs(ss))  //if true -> creating list vcivpi
                    {
                        rtn += getLastLink(ss) + "#";
                        int size = ss.path.Count;
                        ownTopology.RemoveEdge(ss.path[size - 1]);
                    }
                    else
                    {
                        return(null);
                    }
                }
            }while(isExternalLink(ss, trg));

            return(rtn);
        }
コード例 #2
0
ファイル: RC.cs プロジェクト: admsbk/tsst2
        public NetworkConnection getPathViaExternalLink(int src, int trg, int connectN, int requieredCapacity, string link)
        {
            RoutingGraph             ownTopology = RoutingGraph.MapTopology(manager.Topology, ConnectionController.VirtualPaths, requieredCapacity);
            List <RoutingGraph.Link> toRemove    = new List <RoutingGraph.Link>();
            string slot = link.Split(':')[1];

            foreach (var edge in ownTopology.Edges)
            {
                if (edge.tLink.Name != link.Split(':')[0] && edge.tLink.Name.Contains("External"))
                {
                    toRemove.Add(edge);
                }
            }
            foreach (var rm in toRemove)
            {
                ownTopology.RemoveEdge(rm);
            }

            SetupStore ss = new SetupStore(src, trg, ownTopology, connectN, requieredCapacity);


            if (ss.ownTopology.EdgeCount != 0)
            {
                if (this.findBestPath(ss) && this.askLRMs(ss, slot))  //if true -> creating list vcivpi
                {
                    return(this.parseToNetworConnection(ss));
                }
                else
                {
                    return(null);
                }
            }
            return(null);
        }
コード例 #3
0
ファイル: RC.cs プロジェクト: admsbk/tsst2
        public NetworkConnection assignRoute(int src, int trg, int connectN, int requieredCapacity)
        {
            RoutingGraph ownTopology = RoutingGraph.MapTopology(manager.Topology, ConnectionController.VirtualPaths, requieredCapacity);
            SetupStore   ss          = new SetupStore(src, trg, ownTopology, connectN, requieredCapacity);

            if (ss.ownTopology.EdgeCount != 0)
            {
                if (this.findBestPath(ss) && this.askLRMs(ss))  //if true -> creating list vcivpi
                {
                    return(this.parseToNetworConnection(ss));
                }
                else
                {
                    return(null);
                }
            }
            return(null);
        }