- Timestamp:
- 12/22/16 15:47:00 (7 years ago)
- Location:
- trunk/sources/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HillClimber.cs
r14517 r14523 54 54 get { return typeof(BinaryProblem); } 55 55 } 56 57 public override bool SupportsPause { get { return false; } } 58 56 59 public new BinaryProblem Problem { 57 60 get { return (BinaryProblem)base.Problem; } … … 90 93 public HillClimber() 91 94 : base() { 92 pausable = true;93 95 random = new MersenneTwister(); 94 96 Parameters.Add(new FixedValueParameter<IntValue>(IterationsParameterName, "", new IntValue(100))); 95 97 } 96 98 97 [StorableHook(HookType.AfterDeserialization)]98 private void AfterDeserialization() {99 // BackwardsCompatibility3.3100 #region Backwards compatible code, remove with 3.4101 pausable = true;102 #endregion103 }104 99 105 100 protected override void Initialize(CancellationToken cancellationToken) { -
trunk/sources/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/ParameterlessPopulationPyramid.cs
r14517 r14523 56 56 57 57 // Tracks all solutions in Pyramid for quick membership checks 58 private HashSet<BinaryVector> seen = new HashSet<BinaryVector>(new EnumerableBoolEqualityComparer());58 private readonly HashSet<BinaryVector> seen = new HashSet<BinaryVector>(new EnumerableBoolEqualityComparer()); 59 59 60 60 #region ParameterNames … … 153 153 #endregion 154 154 155 public override bool SupportsPause { get { return true; } } 156 155 157 [StorableConstructor] 156 158 protected ParameterlessPopulationPyramid(bool deserializing) : base(deserializing) { } … … 165 167 166 168 public ParameterlessPopulationPyramid() { 167 pausable = true;168 169 Parameters.Add(new FixedValueParameter<IntValue>(MaximumIterationsParameterName, "", new IntValue(Int32.MaxValue))); 169 170 Parameters.Add(new FixedValueParameter<IntValue>(MaximumEvaluationsParameterName, "", new IntValue(Int32.MaxValue))); … … 171 172 Parameters.Add(new FixedValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0))); 172 173 Parameters.Add(new FixedValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true))); 173 }174 175 [StorableHook(HookType.AfterDeserialization)]176 private void AfterDeserialization() {177 // BackwardsCompatibility3.3178 #region Backwards compatible code, remove with 3.4179 pausable = true;180 #endregion181 174 } 182 175
Note: See TracChangeset
for help on using the changeset viewer.