Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5610


Ignore:
Timestamp:
03/04/11 18:27:23 (12 years ago)
Author:
svonolfe
Message:

Worked on VNS main loop (#1425)

Location:
branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/LocalSearchImprovement.cs

    r5609 r5610  
    163163
    164164      loop.MoveGeneratorParameter.Value = MoveGeneratorParameter.Value;
     165      if (loop.MoveGeneratorParameter.Value != null && loop.MoveGeneratorParameter.Value.Parameters.ContainsKey("SampleSize")) {
     166        IParameter parameter = loop.MoveGeneratorParameter.Value.Parameters["SampleSize"];
     167        if(parameter is IValueParameter)
     168          (parameter as IValueParameter).Value = SampleSizeParameter.Value;
     169      }
    165170      loop.MoveEvaluatorParameter.Value = MoveEvaluatorParameter.Value;
    166171      loop.MoveMakerParameter.Value = MoveMakerParameter.Value;
  • branches/VNS/HeuristicLab.Algorithms.VariableNeighborhoodSearch/3.3/VariableNeighborhoodSearchMainLoop.cs

    r5609 r5610  
    145145      ConditionalBranch iterationsTermination = new ConditionalBranch();
    146146
    147       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Iterations", new IntValue(0)));
     147      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("OuterIterations", new IntValue(0)));
    148148      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("Index", new DoubleValue(0)));
    149149      variableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("Continue", new BoolValue(false)));
     150      variableCreator.CollectedValues.Add(new ValueParameter<BoolValue>("IsBetter", new BoolValue(false)));
    150151      variableCreator.CollectedValues.Add(new ValueParameter<DoubleValue>("BestQuality", new DoubleValue(0)));
    151152
     
    158159
    159160      resultsCollector1.CopyValue = new BoolValue(false);
    160       resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("Iterations"));
     161      resultsCollector1.CollectedValues.Add(new LookupParameter<IntValue>("OuterIterations"));
    161162      resultsCollector1.CollectedValues.Add(new LookupParameter<DoubleValue>("Best Quality", null, "BestQuality"));
    162163      resultsCollector1.ResultsParameter.ActualName = ResultsParameter.Name;
     
    218219      iterationsCounter.Name = "Iterations Counter";
    219220      iterationsCounter.Increment = new IntValue(1);
    220       iterationsCounter.ValueParameter.ActualName = "Iterations";
     221      iterationsCounter.ValueParameter.ActualName = "OuterIterations";
    221222
    222223      iterationsComparator.Name = "Iterations >= MaximumIterations";
    223224      iterationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
    224       iterationsComparator.LeftSideParameter.ActualName = "Iterations";
     225      iterationsComparator.LeftSideParameter.ActualName = "OuterIterations";
    225226      iterationsComparator.RightSideParameter.ActualName = MaximumIterationsParameter.Name;
    226227      iterationsComparator.ResultParameter.ActualName = "Terminate";
     
    242243      /////////
    243244      resultsCollector1.Successor = iteration;
     245
    244246      iteration.OperatorGraph.InitialOperator = iterationInit;
    245247      iteration.Successor = iterationsCounter;
Note: See TracChangeset for help on using the changeset viewer.