Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/15/12 09:11:17 (13 years ago)
Author:
gkronber
Message:

#1081 merged r7462:7609 from trunk into time series branch

Location:
branches/HeuristicLab.TimeSeries
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.TimeSeries

  • branches/HeuristicLab.TimeSeries/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearch.cs

    r7268 r7615  
    302302    }
    303303    private void UpdateShakingOperators() {
     304      IMultiNeighborhoodShakingOperator oldShakingOperator = ShakingOperator;
     305      IMultiNeighborhoodShakingOperator defaultShakingOperator = Problem.Operators.OfType<IMultiNeighborhoodShakingOperator>().FirstOrDefault();
    304306      ShakingOperatorParameter.ValidValues.Clear();
    305       foreach (IMultiNeighborhoodShakingOperator op in Problem.Operators.OfType<IMultiNeighborhoodShakingOperator>()) {
     307      foreach (IMultiNeighborhoodShakingOperator op in Problem.Operators.OfType<IMultiNeighborhoodShakingOperator>().OrderBy(op => op.Name)) {
    306308        ShakingOperatorParameter.ValidValues.Add(op);
    307309        op.CurrentNeighborhoodIndexParameter.ActualName = "CurrentNeighborhoodIndex";
    308310        op.NeighborhoodCountParameter.ActualName = "NeighborhoodCount";
     311      }
     312      if (oldShakingOperator != null) {
     313        IMultiNeighborhoodShakingOperator shakingOperator = ShakingOperatorParameter.ValidValues.FirstOrDefault(x => x.GetType() == oldShakingOperator.GetType());
     314        if (shakingOperator != null) ShakingOperator = shakingOperator;
     315        else oldShakingOperator = null;
     316      }
     317      if (oldShakingOperator == null && defaultShakingOperator != null) {
     318        ShakingOperator = defaultShakingOperator;
    309319      }
    310320    }
Note: See TracChangeset for help on using the changeset viewer.