Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
04/23/11 10:00:31 (13 years ago)
Author:
abeham
Message:

#1465

  • updated branch with trunk changes
Location:
branches/histogram
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/histogram

  • branches/histogram/HeuristicLab.Algorithms.LocalSearch/3.3/LocalSearchMainLoop.cs

    r5753 r6046  
    4646      get { return (LookupParameter<DoubleValue>)Parameters["Quality"]; }
    4747    }
    48     public LookupParameter<DoubleValue> BestQualityParameter {
     48    public LookupParameter<DoubleValue> BestLocalQualityParameter {
    4949      get { return (LookupParameter<DoubleValue>)Parameters["BestLocalQuality"]; }
    5050    }
     
    5656    }
    5757    public LookupParameter<IntValue> IterationsParameter {
    58       get { return (LookupParameter<IntValue>)Parameters["LocalIterations"]; }
     58      get { return (LookupParameter<IntValue>)Parameters["Iterations"]; }
    5959    }
    6060    public ValueLookupParameter<IntValue> MaximumIterationsParameter {
     
    8585    public LocalSearchMainLoop()
    8686      : base() {
    87         Initialize();
     87      Initialize();
    8888    }
    8989    private LocalSearchMainLoop(LocalSearchMainLoop original, Cloner cloner)
     
    100100      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The value which represents the quality of a solution."));
    101101      Parameters.Add(new LookupParameter<DoubleValue>("BestLocalQuality", "The value which represents the best quality found so far."));
    102       Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The best known quality value found so far."));
     102      Parameters.Add(new ValueLookupParameter<DoubleValue>("BestKnownQuality", "The problem's best known quality value found so far."));
    103103      Parameters.Add(new LookupParameter<DoubleValue>("MoveQuality", "The value which represents the quality of a move."));
    104       Parameters.Add(new LookupParameter<IntValue>("LocalIterations", "The number of generations."));
     104      Parameters.Add(new LookupParameter<IntValue>("Iterations", "The number of iterations performed."));
    105105      Parameters.Add(new ValueLookupParameter<IntValue>("MaximumIterations", "The maximum number of generations which should be processed."));
    106106      Parameters.Add(new ValueLookupParameter<VariableCollection>("Results", "The variable collection where results should be stored."));
     
    140140
    141141      bestQualityInitializer.Name = "Initialize BestQuality";
    142       bestQualityInitializer.LeftSideParameter.ActualName = BestQualityParameter.Name;
     142      bestQualityInitializer.LeftSideParameter.ActualName = BestLocalQualityParameter.Name;
    143143      bestQualityInitializer.RightSideParameter.ActualName = QualityParameter.Name;
    144144
     
    148148      resultsCollector1.CopyValue = new BoolValue(false);
    149149      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>(IterationsParameter.Name));
    150       resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>(BestQualityParameter.Name, null, BestQualityParameter.Name));
     150      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>(BestLocalQualityParameter.Name, null, BestLocalQualityParameter.Name));
    151151      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
    152152
     
    177177
    178178      bestQualityUpdater.Name = "Update BestQuality";
    179       bestQualityUpdater.LeftSideParameter.ActualName = BestQualityParameter.Name;
     179      bestQualityUpdater.LeftSideParameter.ActualName = BestLocalQualityParameter.Name;
    180180      bestQualityUpdater.RightSideParameter.ActualName = QualityParameter.Name;
    181181
    182182      resultsCollector2.CopyValue = new BoolValue(false);
    183       resultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>(BestQualityParameter.Name, null, BestQualityParameter.Name));
     183      resultsCollector2.CollectedValues.Add(new LookupParameter<DoubleValue>(BestLocalQualityParameter.Name, null, BestLocalQualityParameter.Name));
    184184      resultsCollector2.ResultsParameter.ActualName = ResultsParameter.Name;
    185185
     
    204204
    205205      #region Create operator graph
    206       OperatorGraph.InitialOperator = subScopesProcessor0;
     206      OperatorGraph.InitialOperator = subScopesProcessor0; // don't change this without adapting the constructor of LocalSearchImprovementOperator
    207207      subScopesProcessor0.Operators.Add(bestQualityInitializer);
    208208      subScopesProcessor0.Successor = resultsCollector1;
     
    243243      return base.Apply();
    244244    }
     245
     246    [StorableHook(HookType.AfterDeserialization)]
     247    private void AfterDeserialization() {
     248      // BackwardsCompatibility3.3
     249      #region Backwards compatible code, remove with 3.4
     250      if (!Parameters.ContainsKey("BestLocalQuality"))
     251        Parameters.Add(new LookupParameter<DoubleValue>("BestLocalQuality", "The value which represents the best quality found so far."));
     252      if (!Parameters.ContainsKey("Iterations"))
     253        Parameters.Add(new LookupParameter<IntValue>("Iterations", "The number of iterations performed."));
     254      #endregion
     255    }
    245256  }
    246257}
Note: See TracChangeset for help on using the changeset viewer.