Changeset 8007
- Timestamp:
- 06/14/12 10:52:35 (13 years ago)
- Location:
- branches/VRP
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4 merged: 7967
- Property svn:mergeinfo changed
-
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4/VRPImportDialog.Designer.cs
r7882 r8007 169 169 this.AcceptButton = this.okButton; 170 170 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 171 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode. Font;171 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 172 172 this.CancelButton = this.cancelButton; 173 173 this.ClientSize = new System.Drawing.Size(586, 104); -
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting.Views/3.4/VRPInstanceProviderView.designer.cs
r7881 r8007 25 25 private void InitializeComponent() { 26 26 components = new System.ComponentModel.Container(); 27 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode. Font;27 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 28 28 } 29 29 -
branches/VRP/HeuristicLab.Problems.Instances.VehicleRouting/3.4
- Property svn:mergeinfo changed (with no actual effect on merging)
-
branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting.Views/3.4 merged: 7967
- Property svn:mergeinfo changed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/VRPImportDialog.Designer.cs
r6851 r8007 173 173 this.AcceptButton = this.okButton; 174 174 this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); 175 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode. Font;175 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 176 176 this.CancelButton = this.cancelButton; 177 177 this.ClientSize = new System.Drawing.Size(586, 104); -
branches/VRP/HeuristicLab.Problems.VehicleRouting.Views/3.4/VehicleRoutingProblemView.Designer.cs
r7871 r8007 25 25 private void InitializeComponent() { 26 26 components = new System.ComponentModel.Container(); 27 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode. Font;27 this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Inherit; 28 28 } 29 29 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4 merged: 7999,8006
- Property svn:mergeinfo changed
-
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Interfaces/IVRPProblemInstance.cs
r7852 r8007 31 31 namespace HeuristicLab.Problems.VehicleRouting.Interfaces { 32 32 public interface IVRPProblemInstance: IItem { 33 IVRPEvaluator SolutionEvaluator { get; }33 IVRPEvaluator SolutionEvaluator { get; set; } 34 34 IVRPEvaluator MoveEvaluator { get; } 35 35 IEnumerable<IOperator> Operators { get; } -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/ProblemInstances/VRPProblemInstance.cs
r7958 r8007 174 174 return evaluator; 175 175 } 176 177 set { 178 moveEvaluator = null; 179 evaluator = value; 180 EvalBestKnownSolution(); 181 } 176 182 } 177 183 -
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/VehicleRoutingProblem.cs
r8003 r8007 41 41 [Creatable("Problems")] 42 42 [StorableClass] 43 public sealed class VehicleRoutingProblem : P arameterizedNamedItem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent, IProblemInstanceConsumer<IVRPData> {43 public sealed class VehicleRoutingProblem : Problem, ISingleObjectiveHeuristicOptimizationProblem, IStorableContent, IProblemInstanceConsumer<IVRPData> { 44 44 public string Filename { get; set; } 45 45 … … 107 107 public ISolutionCreator SolutionCreator { 108 108 get { return SolutionCreatorParameter.Value; } 109 }110 111 [Storable]112 private List<IItem> operators;113 114 public IEnumerable<IItem> Operators {115 get { return operators; }116 109 } 117 110 #endregion … … 131 124 EvaluatorParameter.Hidden = true; 132 125 133 operators = new List<IItem>();134 135 126 InitializeRandomVRPInstance(); 136 127 InitializeOperators(); … … 147 138 private VehicleRoutingProblem(VehicleRoutingProblem original, Cloner cloner) 148 139 : base(original, cloner) { 149 this.operators = original.operators.Select(x => (IItem)cloner.Clone(x)).ToList();150 140 this.AttachEventHandlers(); 151 141 } … … 162 152 if (handler != null) handler(this, EventArgs.Empty); 163 153 } 164 public event EventHandler OperatorsChanged;165 private void OnOperatorsChanged() {166 EventHandler handler = OperatorsChanged;167 if (handler != null) handler(this, EventArgs.Empty);168 }169 public event EventHandler Reset;170 private void OnReset() {171 EventHandler handler = Reset;172 if (handler != null) handler(this, EventArgs.Empty);173 }174 154 #endregion 175 155 … … 181 161 } 182 162 163 [Storable(Name = "operators", AllowOneWay = true)] 164 private List<IOperator> StorableOperators { 165 set { Operators.AddRange(value); } 166 } 167 183 168 private void AttachEventHandlers() { 184 169 ProblemInstanceParameter.ValueChanged += new EventHandler(ProblemInstanceParameter_ValueChanged); 185 170 BestKnownSolutionParameter.ValueChanged += new EventHandler(BestKnownSolutionParameter_ValueChanged); 171 EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged); 172 SolutionCreatorParameter.ValueChanged += new EventHandler(SolutionCreatorParameter_ValueChanged); 186 173 } 187 174 … … 193 180 EvaluatorParameter.Value = ProblemInstance.SolutionEvaluator; 194 181 IVRPCreator defaultCreator = null; 195 foreach (IVRPCreator creator in operators.Where(o => o is IVRPCreator)) {182 foreach (IVRPCreator creator in Operators.Where(o => o is IVRPCreator)) { 196 183 solutionCreatorParameter.ValidValues.Add(creator); 197 184 if (creator is Encodings.Alba.RandomCreator) … … 220 207 221 208 void ProblemInstance_EvaluationChanged(object sender, EventArgs e) { 209 EvaluatorParameter.Value = ProblemInstance.SolutionEvaluator; 222 210 EvalBestKnownSolution(); 223 211 } … … 245 233 246 234 private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) { 247 ParameterizeSolutionCreator();248 249 235 OnSolutionCreatorChanged(); 250 236 } 251 237 private void EvaluatorParameter_ValueChanged(object sender, EventArgs e) { 238 if (ProblemInstance != null) 239 ProblemInstance.SolutionEvaluator = EvaluatorParameter.Value; 252 240 OnEvaluatorChanged(); 253 241 } 254 242 255 243 private void InitializeOperators() { 256 operators = new List<IItem>();244 Operators.Clear(); 257 245 258 246 if (ProblemInstance != null) { 259 operators.AddRange(247 Operators.AddRange( 260 248 ProblemInstance.Operators.Concat( 261 249 ApplicationManager.Manager.GetInstances<IGeneralVRPOperator>().Cast<IOperator>()).OrderBy(op => op.Name)); … … 265 253 } 266 254 267 private void ParameterizeSolutionCreator() {268 if (SolutionCreator is IMultiVRPOperator) {269 (SolutionCreator as IMultiVRPOperator).SetOperators(Operators.OfType<IOperator>());270 }271 }272 273 255 private void ParameterizeOperators() { 274 foreach (IOperator op in Operators ) {256 foreach (IOperator op in Operators.OfType<IOperator>()) { 275 257 if (op is IMultiVRPOperator) { 276 258 (op as IMultiVRPOperator).SetOperators(Operators.OfType<IOperator>());
Note: See TracChangeset
for help on using the changeset viewer.