コード例 #1
0
 public UnicastDemand(UnicastDemand demand)
 {
     _candidatePaths = new List <Path>(demand._candidatePaths);
     _sourceNode     = demand._sourceNode;
     _numberOfPaths  = demand._numberOfPaths;
     _demandVolume   = demand._demandVolume;
     _numberOfPaths  = demand._candidatePaths.Count;
     _demandPath     = demand._demandPath;
 }
コード例 #2
0
        public List <Demand> CreateUnicastDemands(Scenario demands, PathAllocator pathAllocator)
        {
            List <Demand> unicastDemands = new List <Demand>();
            Dictionary <int, UnicastDemandData> demandsData = demands.UnicastDemands.GetUnicastDemandDataDictionary();

            foreach (var key in demandsData)
            {
                UnicastDemand u = new UnicastDemand(key.Value.SourceNode, key.Value.DestinationNode,
                                                    key.Value.DemandVolume,
                                                    pathAllocator.GetCandidatePaths(key.Value.SourceNode, key.Value.DestinationNode));
                unicastDemands.Add(u);
            }

            return(unicastDemands);
        }