Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/08/10 11:37:00 (14 years ago)
Author:
svonolfe
Message:

Added move operators (WIP) (#1177)

Location:
branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4
Files:
29 added
8 edited

Legend:

Unmodified
Added
Removed
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveEvaluator.cs

    r4369 r4370  
    3535    }
    3636
     37    public override ILookupParameter VRPMoveParameter {
     38      get { return TranslocationMoveParameter; }
     39    }
     40
    3741    [StorableConstructor]
    3842    private AlbaTranslocationMoveEvaluator(bool deserializing) : base(deserializing) { }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs

    r4369 r4370  
    5656    }
    5757
     58    public override ILookupParameter VRPMoveParameter {
     59      get { return TranslocationMoveParameter; }
     60    }
     61
    5862    public ILookupParameter<Permutation> PermutationParameter {
    5963      get {
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveMaker.cs

    r4369 r4370  
    3737    }
    3838
     39    public override ILookupParameter VRPMoveParameter {
     40      get { return TranslocationMoveParameter; }
     41    }
     42
    3943    public ILookupParameter<Permutation> PermutationParameter {
    4044      get { return moveMaker.PermutationParameter; }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/VRPMoveMaker.cs

    r4369 r4370  
    5555    private void UpdateMoveEvaluation() {
    5656      IVRPEvaluator evaluator = ProblemInstance.EvaluatorParameter.Value;
    57       foreach (IParameter parameter in evaluator.Parameters) {
    58         if (parameter is ILookupParameter
    59           && parameter != evaluator.VRPToursParameter
    60           && parameter != evaluator.ProblemInstanceParameter) {
    61           ILookupParameter evaluatorParameter = parameter as ILookupParameter;
     57      ICollection<IParameter> addedParameters = new List<IParameter>();
     58     
     59      try {
     60        foreach (IParameter parameter in evaluator.Parameters) {
     61          if (parameter is ILookupParameter
     62            && parameter != evaluator.VRPToursParameter
     63            && parameter != evaluator.ProblemInstanceParameter) {
     64            ILookupParameter evaluatorParameter = parameter as ILookupParameter;
    6265         
    63           string resultName = evaluatorParameter.ActualName;
    64           if (!this.Parameters.Exists(p => p.Name == resultName)) {
    65             ILookupParameter resultParameter = new LookupParameter<IItem>(resultName);
    66             resultParameter.ExecutionContext = ExecutionContext;
    67             this.Parameters.Add(resultParameter);
     66            string resultName = evaluatorParameter.ActualName;
     67            if (!this.Parameters.Exists(p => p.Name == resultName)) {
     68              ILookupParameter resultParameter = new LookupParameter<IItem>(resultName);
     69              resultParameter.ExecutionContext = ExecutionContext;
     70              this.Parameters.Add(resultParameter);
     71              addedParameters.Add(resultParameter);
     72            }
     73
     74            string moveResultName = VRPMoveEvaluator.MovePrefix + resultName;
     75            if (!this.Parameters.Exists(p => p.Name == moveResultName)) {
     76              ILookupParameter moveResultParameter = new LookupParameter<IItem>(moveResultName);
     77              moveResultParameter.ExecutionContext = ExecutionContext;
     78              this.Parameters.Add(moveResultParameter);
     79              addedParameters.Add(moveResultParameter);
     80            }
     81
     82            ILookupParameter result = Parameters[resultName] as ILookupParameter;
     83            ILookupParameter moveResult = Parameters[moveResultName] as ILookupParameter;
     84            result.ActualValue = moveResult.ActualValue.Clone() as IItem;
    6885          }
    69 
    70           string moveResultName = VRPMoveEvaluator.MovePrefix + resultName;
    71           if (!this.Parameters.Exists(p => p.Name == moveResultName)) {
    72             ILookupParameter moveResultParameter = new LookupParameter<IItem>(moveResultName);
    73             moveResultParameter.ExecutionContext = ExecutionContext;
    74             this.Parameters.Add(moveResultParameter);
    75           }
    76 
    77           ILookupParameter result = Parameters[resultName] as ILookupParameter;
    78           ILookupParameter moveResult = Parameters[moveResultName] as ILookupParameter;
    79           result.ActualValue = moveResult.ActualValue.Clone() as IItem;
     86        }
     87      }
     88      finally {
     89        foreach(IParameter parameter in addedParameters) {
     90          this.Parameters.Remove(parameter);
    8091        }
    8192      }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Moves/VRPMoveOperator.cs

    r4369 r4370  
    3737    }
    3838
     39    public abstract ILookupParameter VRPMoveParameter { get; }
     40
    3941    [StorableConstructor]
    4042    protected VRPMoveOperator(bool deserializing) : base(deserializing) { }
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLab.Problems.VehicleRouting-3.4.csproj

    r4369 r4370  
    124124    <Compile Include="Encodings\Alba\Moves\AlbaMoveMaker.cs" />
    125125    <Compile Include="Encodings\Alba\Moves\AlbaMoveGenerator.cs" />
     126    <Compile Include="Encodings\Alba\Moves\IntraRouteInversion\AlbaExhaustiveIntraRouteInversionMoveGenerator.cs" />
     127    <Compile Include="Encodings\Alba\Moves\IntraRouteInversion\AlbaIntraRouteInversionEvaluator.cs" />
     128    <Compile Include="Encodings\Alba\Moves\IntraRouteInversion\AlbaIntraRouteInversionMove.cs" />
     129    <Compile Include="Encodings\Alba\Moves\IntraRouteInversion\AlbaIntraRouteInversionMoveGenerator.cs" />
     130    <Compile Include="Encodings\Alba\Moves\IntraRouteInversion\AlbaIntraRouteInversionMoveMaker.cs" />
     131    <Compile Include="Encodings\Alba\Moves\IntraRouteInversion\AlbaStochasticIntraRouteInversionMutliMoveGenerator.cs" />
     132    <Compile Include="Encodings\Alba\Moves\IntraRouteInversion\AlbaStochasticIntraRouteInversionSingleMoveGenerator.cs" />
     133    <Compile Include="Encodings\Alba\Moves\IntraRouteInversion\IAlbaIntraRouteInversionMoveOperator.cs" />
     134    <Compile Include="Encodings\Alba\Moves\LambdaInterchange\AlbaExhaustiveLambdaInterchangeMoveGenerator.cs" />
     135    <Compile Include="Encodings\Alba\Moves\LambdaInterchange\AlbaLambdaInterchangeMove.cs" />
     136    <Compile Include="Encodings\Alba\Moves\LambdaInterchange\AlbaLambdaInterchangeMoveEvaluator.cs" />
     137    <Compile Include="Encodings\Alba\Moves\LambdaInterchange\AlbaLambdaInterchangeMoveGenerator.cs" />
     138    <Compile Include="Encodings\Alba\Moves\LambdaInterchange\AlbaLambdaInterchangeMoveMaker.cs" />
     139    <Compile Include="Encodings\Alba\Moves\LambdaInterchange\AlbaStochasticLambdaInterchangeMutliMoveGenerator.cs" />
     140    <Compile Include="Encodings\Alba\Moves\LambdaInterchange\AlbaStochasticLambdaInterchangeSingleMoveGenerator.cs" />
     141    <Compile Include="Encodings\Alba\Moves\LambdaInterchange\IAlbaLambdaInterchangeMoveOperator.cs" />
    126142    <Compile Include="Encodings\Alba\Moves\ThreeOpt\AlbaTranslocationMoveEvaluator.cs" />
    127143    <Compile Include="Encodings\Alba\Moves\ThreeOpt\AlbaTranslocationMoveGenerator.cs" />
     144    <Compile Include="Encodings\Alba\Moves\ThreeOpt\AlbaTranslocationMoveHardTabuCriterion.cs" />
    128145    <Compile Include="Encodings\Alba\Moves\ThreeOpt\AlbaTranslocationMoveMaker.cs" />
     146    <Compile Include="Encodings\Alba\Moves\ThreeOpt\AlbaTranslocationMoveSoftTabuCriterion.cs" />
     147    <Compile Include="Encodings\Alba\Moves\ThreeOpt\AlbaTranslocationMoveTabuMaker.cs" />
    129148    <Compile Include="Encodings\Alba\Moves\ThreeOpt\IAlbaTranslocationMoveOperator.cs" />
    130149    <Compile Include="Encodings\General\Creators\MultiVRPSolutionCreator.cs" />
     
    135154    <Compile Include="Encodings\General\Manipulators\MultiVRPSolutionManipulator.cs" />
    136155    <Compile Include="Encodings\General\Manipulators\VRPManipulator.cs" />
     156    <Compile Include="Encodings\General\Moves\Interfaces\IMultiVRPMoveGenerator.cs" />
     157    <Compile Include="Encodings\General\Moves\Interfaces\IMultiVRPMoveOperator.cs" />
     158    <Compile Include="Encodings\General\Moves\Interfaces\IVRPMove.cs" />
     159    <Compile Include="Encodings\General\Moves\MultiVRPMoveOperator\MultiVRPMoveEvaluator.cs" />
     160    <Compile Include="Encodings\General\Moves\MultiVRPMoveOperator\MultiVRPMoveGenerator.cs" />
     161    <Compile Include="Encodings\General\Moves\MultiVRPMoveOperator\MultiVRPMoveMaker.cs" />
    137162    <Compile Include="Encodings\General\Moves\VRPMoveGenerator.cs" />
    138163    <Compile Include="Encodings\General\Moves\VRPMoveOperator.cs" />
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/HeuristicLabProblemsVehicleRoutingPlugin.cs

    r4369 r4370  
    2626  /// Plugin class for HeuristicLab.Problems.VehicleRouting plugin
    2727  /// </summary>
    28   [Plugin("HeuristicLab.Problems.VehicleRouting", "3.4.0.4365")]
     28  [Plugin("HeuristicLab.Problems.VehicleRouting", "3.4.0.4369")]
    2929  [PluginFile("HeuristicLab.Problems.VehicleRouting-3.4.dll", PluginFileType.Assembly)]
    3030  [PluginDependency("HeuristicLab.Analysis", "3.3")]
  • branches/VRP/HeuristicLab.Problems.VehicleRouting/3.4/Interfaces/IVRPMoveOperator.cs

    r4369 r4370  
    2727  public interface IVRPMoveOperator : IVRPOperator, IMoveOperator {
    2828    ILookupParameter<IVRPEncoding> VRPToursParameter { get; }
     29    ILookupParameter VRPMoveParameter { get; }
    2930  }
    3031}
Note: See TracChangeset for help on using the changeset viewer.