Changeset 8053 for trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Manipulators/PrinsStochasticLSManipulator.cs
- Timestamp:
- 06/19/12 13:17:29 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Prins/Manipulators/PrinsStochasticLSManipulator.cs
r4752 r8053 1 1 #region License Information 2 2 /* HeuristicLab 3 * Copyright (C) 2002-201 0Heuristic and Evolutionary Algorithms Laboratory (HEAL)3 * Copyright (C) 2002-2012 Heuristic and Evolutionary Algorithms Laboratory (HEAL) 4 4 * 5 5 * This file is part of HeuristicLab. … … 20 20 #endregion 21 21 22 using System.Collections.Generic; 23 using HeuristicLab.Common; 22 24 using HeuristicLab.Core; 23 using HeuristicLab. Encodings.PermutationEncoding;25 using HeuristicLab.Data; 24 26 using HeuristicLab.Parameters; 25 27 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 26 using HeuristicLab.Data;27 using System.Collections.Generic;28 using HeuristicLab.Common;29 28 30 29 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Prins { … … 35 34 get { return (IValueParameter<IntValue>)Parameters["SampleSize"]; } 36 35 } 37 36 38 37 [StorableConstructor] 39 38 private PrinsStochasticLSManipulator(bool deserializing) : base(deserializing) { } … … 41 40 public PrinsStochasticLSManipulator() 42 41 : base() { 43 42 Parameters.Add(new ValueParameter<IntValue>("SampleSize", "The sample size.", new IntValue(200))); 44 43 } 45 44 … … 65 64 while (!improvement && 66 65 samples < SampleSize.Value.Value) { 67 68 66 int u = random.Next(ProblemInstance.Cities.Value); 67 int v = random.Next(ProblemInstance.Cities.Value); 69 68 70 71 69 child = Manipulate(individual, 70 originalQuality, u, v); 72 71 73 72 improvement = child != null; 74 73 75 74 samples++; 76 75 } 77 76 … … 83 82 84 83 iterations++; 85 } while (improvement && 84 } while (improvement && 86 85 iterations < Iterations.Value.Value); 87 86 }
Note: See TracChangeset
for help on using the changeset viewer.