Changeset 3947 for trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs
- Timestamp:
- 06/25/10 15:01:48 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.VehicleRouting/3.3/Encodings/Alba/Moves/ThreeOpt/AlbaTranslocationMoveGenerator.cs
r3938 r3947 29 29 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 30 30 using HeuristicLab.Parameters; 31 using HeuristicLab.Data; 31 32 32 33 namespace HeuristicLab.Problems.VehicleRouting.Encodings.Alba { 33 34 [Item("AlbaTranslocationMoveGenerator", "An operator which generates translocation moves for the alba representation.")] 34 35 [StorableClass] 35 public sealed class AlbaTranslocationMoveGenerator : AlbaMoveOperator, IPermutationTranslocationMoveOperator, IM oveGenerator {36 public sealed class AlbaTranslocationMoveGenerator : AlbaMoveOperator, IPermutationTranslocationMoveOperator, IMultiMoveGenerator { 36 37 public IValueLookupParameter<TranslocationMoveGenerator> TranslocationMoveGeneratorParameter { 37 38 get { return (IValueLookupParameter<TranslocationMoveGenerator>)Parameters["TranslocationMoveGenerator"]; } … … 40 41 protected override IPermutationMoveOperator PermutationMoveOperatorParameter { 41 42 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 } 43 49 } 44 50 … … 61 67 } 62 68 69 public IValueLookupParameter<IntValue> SampleSizeParameter { 70 get { return (IValueLookupParameter<IntValue>)Parameters["SampleSize"]; } 71 } 72 63 73 public AlbaTranslocationMoveGenerator(): base() { 64 74 Parameters.Add(new ValueLookupParameter<TranslocationMoveGenerator>("TranslocationMoveGenerator", "The move generator.", 65 75 new StochasticTranslocationMultiMoveGenerator())); 76 Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate.")); 77 78 ((IMultiMoveGenerator)TranslocationMoveGeneratorParameter.Value).SampleSizeParameter.ActualName = SampleSizeParameter.Name; 66 79 } 67 80
Note: See TracChangeset
for help on using the changeset viewer.