Changeset 14610 for branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.LocationRouting
- Timestamp:
- 01/26/17 14:12:39 (8 years ago)
- Location:
- branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.LocationRouting/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.LocationRouting/3.3/LrpNetwork1.cs
r14604 r14610 130 130 public TimeSpan ExecutionTime { get { return MetaSolver.Algorithm.ExecutionTime; } } 131 131 132 public void Prepare(bool clearRuns) { Prepare(); } 133 public void Prepare() { Orchestrator.Prepare(); } 134 public void Start() { 135 if (MetaSolver.Algorithm.ExecutionState == ExecutionState.Prepared) 136 Orchestrator.Prepare(); 137 Orchestrator.StartAsync(); 138 } 132 public void Prepare() { Prepare(false); } 133 public void Prepare(bool clearRuns) { Orchestrator.Prepare(clearRuns); } 134 public void Start() { Orchestrator.StartAsync(); } 139 135 public void Pause() { Orchestrator.Pause(); } 140 136 public void Stop() { Orchestrator.Stop(); } -
branches/OptimizationNetworks/HeuristicLab.Networks.IntegratedOptimization.LocationRouting/3.3/LrpOrchestratorNode1.cs
r14607 r14610 61 61 int nrOfDepots, nrOfCustomers; 62 62 [Storable] 63 double[,] depotCoordinates , customerCoordinates;63 double[,] depotCoordinates = new double[0, 0], customerCoordinates = new double[0, 0]; 64 64 [Storable] 65 65 LrpUtils.DistanceType distanceType; 66 66 [Storable] 67 double[] depotCapacities , customerDemands, depotCosts;67 double[] depotCapacities = new double[0], customerDemands = new double[0], depotCosts = new double[0]; 68 68 [Storable] 69 69 double vehicleCapacity, vehicleCost; … … 187 187 foreach (var m in mutator.Operators) 188 188 mutator.Operators.SetItemCheckedState(m, Regex.IsMatch(m.Name, @"Potvin(One|Two).*")); 189 } 190 191 public override void Prepare() { 189 190 Prepare(); 191 } 192 193 public override void Prepare(bool clearRuns = false) { 192 194 Results.Clear(); 193 195 194 196 var metaMsg = MetaSolverOrchestrationPort.PrepareMessage(); 195 metaMsg["OrchestrationMessage"] = new EnumValue<OrchestrationMessage>(OrchestrationMessage.Prepare | OrchestrationMessage.QualityAdaption); 197 var msgFlags = OrchestrationMessage.Prepare | OrchestrationMessage.SetEvalHook; 198 if (clearRuns) msgFlags |= OrchestrationMessage.ClearRuns; 199 metaMsg["OrchestrationMessage"] = new EnumValue<OrchestrationMessage>(msgFlags); 196 200 var problem = new VariegationProblem(); 197 201 problem.Encoding.Length = FlpParameter.Value.Encoding.Length * 2; … … 204 208 cts = new CancellationTokenSource(); 205 209 206 try { 207 var metaMsg = MetaSolverOrchestrationPort.PrepareMessage(); 208 metaMsg["OrchestrationMessage"] = new EnumValue<OrchestrationMessage>(OrchestrationMessage.Start); 209 MetaSolverOrchestrationPort.SendMessage(metaMsg); 210 } catch (Exception e) { } 210 var metaMsg = MetaSolverOrchestrationPort.PrepareMessage(); 211 metaMsg["OrchestrationMessage"] = new EnumValue<OrchestrationMessage>(OrchestrationMessage.Start); 212 MetaSolverOrchestrationPort.SendMessage(metaMsg); 211 213 } 212 214 … … 272 274 273 275 var flpMsg = FlpSolverOrchestrationPort.PrepareMessage(); 274 flpMsg["OrchestrationMessage"] = new EnumValue<OrchestrationMessage>(OrchestrationMessage.Prepare | OrchestrationMessage. Start);276 flpMsg["OrchestrationMessage"] = new EnumValue<OrchestrationMessage>(OrchestrationMessage.Prepare | OrchestrationMessage.ClearRuns | OrchestrationMessage.Start); 275 277 flpMsg["Problem"] = flp; 276 278 FlpSolverOrchestrationPort.SendMessage(flpMsg); … … 279 281 var bestFlpSolution = (IntegerVector)flpResults["Best Solution"].Value; 280 282 var flpSolution = FlpParameter.Value.GetSolution(bestFlpSolution); 281 283 282 284 var depots = bestFlpSolution.Select((x, i) => Tuple.Create(x, i)).GroupBy(x => x.Item1, x => x.Item2); 283 285 var vrpSolutions = new ResultCollection(depots.Count()); … … 296 298 297 299 var vrpMsg = VrpSolverOrchestrationPort.PrepareMessage(); 298 vrpMsg["OrchestrationMessage"] = new EnumValue<OrchestrationMessage>(OrchestrationMessage.Prepare | OrchestrationMessage. Start);300 vrpMsg["OrchestrationMessage"] = new EnumValue<OrchestrationMessage>(OrchestrationMessage.Prepare | OrchestrationMessage.ClearRuns | OrchestrationMessage.Start); 299 301 vrpMsg["Problem"] = vrp; 300 302 VrpSolverOrchestrationPort.SendMessage(vrpMsg);
Note: See TracChangeset
for help on using the changeset viewer.