Changeset 15973 for branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPProblemInstance.cs
- Timestamp:
- 06/28/18 11:13:37 (7 years ago)
- Location:
- branches/2522_RefactorPluginInfrastructure
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2522_RefactorPluginInfrastructure
- Property svn:ignore
-
old new 24 24 protoc.exe 25 25 obj 26 .vs
-
- Property svn:mergeinfo changed
- Property svn:ignore
-
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.VehicleRouting
- Property svn:mergeinfo changed
-
branches/2522_RefactorPluginInfrastructure/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/MultiDepotVRP/MultiDepotVRPProblemInstance.cs
r12012 r15973 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 5Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2018 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; … … 174 175 [StorableConstructor] 175 176 protected MultiDepotVRPProblemInstance(bool deserializing) : base(deserializing) { } 176 177 protected MultiDepotVRPProblemInstance(MultiDepotVRPProblemInstance original, Cloner cloner) 178 : base(original, cloner) { 179 AttachEventHandlers(); 180 } 177 181 public MultiDepotVRPProblemInstance() { 178 182 Parameters.Add(new ValueParameter<IntValue>("Depots", "The number of depots", new IntValue(0))); 179 183 Parameters.Add(new ValueParameter<IntArray>("VehicleDepotAssignment", "The assignment of vehicles to depots", new IntArray())); 184 AttachEventHandlers(); 180 185 } 181 186 … … 184 189 } 185 190 186 protected MultiDepotVRPProblemInstance(MultiDepotVRPProblemInstance original, Cloner cloner) 187 : base(original, cloner) { 188 } 191 [StorableHook(HookType.AfterDeserialization)] 192 private void AfterDeserialization() { 193 AttachEventHandlers(); 194 } 195 196 private void AttachEventHandlers() { 197 DepotsParameter.ValueChanged += DepotsParameter_ValueChanged; 198 Depots.ValueChanged += Depots_ValueChanged; 199 VehicleDepotAssignmentParameter.ValueChanged += VehicleDepotAssignmentParameter_ValueChanged; 200 VehicleDepotAssignment.Reset += VehicleDepotAssignment_Changed; 201 VehicleDepotAssignment.ItemChanged += VehicleDepotAssignment_Changed; 202 } 203 204 #region Event handlers 205 private void DepotsParameter_ValueChanged(object sender, EventArgs e) { 206 Depots.ValueChanged += Depots_ValueChanged; 207 EvalBestKnownSolution(); 208 } 209 private void Depots_ValueChanged(object sender, EventArgs e) { 210 EvalBestKnownSolution(); 211 } 212 private void VehicleDepotAssignmentParameter_ValueChanged(object sender, EventArgs e) { 213 VehicleDepotAssignment.Reset += VehicleDepotAssignment_Changed; 214 VehicleDepotAssignment.ItemChanged += VehicleDepotAssignment_Changed; 215 EvalBestKnownSolution(); 216 } 217 private void VehicleDepotAssignment_Changed(object sender, EventArgs e) { 218 EvalBestKnownSolution(); 219 } 220 #endregion 189 221 } 190 222 }
Note: See TracChangeset
for help on using the changeset viewer.