Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
06/25/10 15:01:48 (14 years ago)
Author:
svonolfe
Message:

Fixed some problems in the VRP implementation (#1039)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs

    r3938 r3947  
    2929using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    3030using HeuristicLab.Parameters;
     31using HeuristicLab.Data;
    3132
    3233namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba {
    3334  [Item("AlbaTranslocationMoveGenerator", "An operator which generates translocation moves for the alba representation.")]
    3435  [StorableClass]
    35   public sealed class AlbaTranslocationMoveGenerator : AlbaMoveOperator, IPermutationTranslocationMoveOperator, IMoveGenerator {
     36  public sealed class AlbaTranslocationMoveGenerator : AlbaMoveOperator, IPermutationTranslocationMoveOperator, IMultiMoveGenerator {
    3637    public IValueLookupParameter<TranslocationMoveGenerator> TranslocationMoveGeneratorParameter {
    3738      get { return (IValueLookupParameter<TranslocationMoveGenerator>)Parameters["TranslocationMoveGenerator"]; }
     
    4041    protected override IPermutationMoveOperator PermutationMoveOperatorParameter {
    4142      get { return TranslocationMoveGeneratorParameter.Value; }
    42       set { TranslocationMoveGeneratorParameter.Value = value as TranslocationMoveGenerator; }
     43      set {
     44        TranslocationMoveGeneratorParameter.Value = value as TranslocationMoveGenerator;
     45        if (TranslocationMoveGeneratorParameter.Value is IMultiMoveGenerator) {
     46          ((IMultiMoveGenerator)TranslocationMoveGeneratorParameter.Value).SampleSizeParameter.ActualName = SampleSizeParameter.Name;
     47        }
     48      }
    4349    }
    4450
     
    6167    }
    6268
     69    public IValueLookupParameter<IntValue> SampleSizeParameter {
     70      get { return (IValueLookupParameter<IntValue>)Parameters["SampleSize"]; }
     71    }
     72
    6373    public AlbaTranslocationMoveGenerator(): base() {
    6474      Parameters.Add(new ValueLookupParameter<TranslocationMoveGenerator>("TranslocationMoveGenerator", "The move generator.",
    6575        new StochasticTranslocationMultiMoveGenerator()));
     76      Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate."));
     77
     78      ((IMultiMoveGenerator)TranslocationMoveGeneratorParameter.Value).SampleSizeParameter.ActualName = SampleSizeParameter.Name;
    6679    }
    6780
Note: See TracChangeset for help on using the changeset viewer.