Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/22/16 15:47:00 (7 years ago)
Author:
mkommend
Message:

#2524:

  • Renamed pausable to SupportsPause
  • Changed SupportsPause field to abstract property that has to be implemented
  • Stored initialization flag in BasicAlgorithm
  • Changed CancellationToken access to use the according property
  • Adapted HillClimber to new pausing mechanism
  • Disable pause for PPP, because it does not work correctly
  • Derived FixedDataAnalysisAlgorithm from BasicAlgorithm
  • Changed base class of all data analysis algorithm from BasicAlgorithm to FixedDataAnalysisAlgorithm
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/ParameterlessPopulationPyramid.cs

    r14517 r14523  
    5656
    5757    // 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());
    5959
    6060    #region ParameterNames
     
    153153    #endregion
    154154
     155    public override bool SupportsPause { get { return true; } }
     156
    155157    [StorableConstructor]
    156158    protected ParameterlessPopulationPyramid(bool deserializing) : base(deserializing) { }
     
    165167
    166168    public ParameterlessPopulationPyramid() {
    167       pausable = true;
    168169      Parameters.Add(new FixedValueParameter<IntValue>(MaximumIterationsParameterName, "", new IntValue(Int32.MaxValue)));
    169170      Parameters.Add(new FixedValueParameter<IntValue>(MaximumEvaluationsParameterName, "", new IntValue(Int32.MaxValue)));
     
    171172      Parameters.Add(new FixedValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
    172173      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.3
    178       #region Backwards compatible code, remove with 3.4
    179       pausable = true;
    180       #endregion
    181174    }
    182175
Note: See TracChangeset for help on using the changeset viewer.