Changeset 3520 for trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove
- Timestamp:
- 04/24/10 15:22:22 (14 years ago)
- Location:
- trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/OneBitflipMoveGenerator.cs
r3376 r3520 32 32 [StorableClass] 33 33 public abstract class OneBitflipMoveGenerator : SingleSuccessorOperator, IOneBitflipMoveOperator, IMoveGenerator { 34 public override bool CanChangeName { 35 get { return false; } 36 } 34 37 public ILookupParameter<BinaryVector> BinaryVectorParameter { 35 38 get { return (ILookupParameter<BinaryVector>)Parameters["BinaryVector"]; } … … 62 65 63 66 protected abstract OneBitflipMove[] GenerateMoves(BinaryVector binaryVector); 64 65 public override bool CanChangeName {66 get { return false; }67 }68 67 } 69 68 } -
trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/OneBitflipMoveMaker.cs
r3376 r3520 33 33 [StorableClass] 34 34 public class OneBitflipMoveMaker : SingleSuccessorOperator, IOneBitflipMoveOperator, IMoveMaker { 35 public override bool CanChangeName { 36 get { return false; } 37 } 35 38 public ILookupParameter<DoubleValue> QualityParameter { 36 39 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } … … 66 69 return base.Apply(); 67 70 } 68 69 public override bool CanChangeName {70 get { return false; }71 }72 71 } 73 72 } -
trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/OneBitflipMoveTabuChecker.cs
r3376 r3520 33 33 [StorableClass] 34 34 public class OneBitflipMoveTabuChecker : SingleSuccessorOperator, IOneBitflipMoveOperator, ITabuChecker { 35 public override bool CanChangeName { 36 get { return false; } 37 } 35 38 public ILookupParameter<OneBitflipMove> OneBitflipMoveParameter { 36 39 get { return (LookupParameter<OneBitflipMove>)Parameters["OneBitflipMove"]; } … … 94 97 return base.Apply(); 95 98 } 96 97 public override bool CanChangeName {98 get { return false; }99 }100 99 } 101 100 } -
trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/OneBitflipMoveTabuMaker.cs
r3418 r3520 52 52 return new OneBitflipMoveAttribute(OneBitflipMoveParameter.ActualValue.Index, baseQuality); 53 53 } 54 55 public override bool CanChangeName {56 get { return false; }57 }58 54 } 59 55 } -
trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/Moves/OneBitflipMove/StochasticOneBitflipMultiMoveGenerator.cs
r3376 r3520 24 24 using HeuristicLab.Core; 25 25 using HeuristicLab.Data; 26 using HeuristicLab.Operators; 26 27 using HeuristicLab.Optimization; 27 28 using HeuristicLab.Parameters; … … 31 32 [Item("StochasticOneBitflipMultiMoveGenerator", "Randomly samples n from all possible one bitflip moves from a given BinaryVector.")] 32 33 [StorableClass] 33 public class StochasticOneBitflipMultiMoveGenerator : StochasticOneBitflipSingleMoveGenerator, IMultiMoveGenerator { 34 public class StochasticOneBitflipMultiMoveGenerator : OneBitflipMoveGenerator, IMultiMoveGenerator { 35 public ILookupParameter<IRandom> RandomParameter { 36 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } 37 } 34 38 public IValueLookupParameter<IntValue> SampleSizeParameter { 35 39 get { return (IValueLookupParameter<IntValue>)Parameters["SampleSize"]; } … … 43 47 public StochasticOneBitflipMultiMoveGenerator() 44 48 : base() { 49 Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator.")); 45 50 Parameters.Add(new ValueLookupParameter<IntValue>("SampleSize", "The number of moves to generate.")); 46 51 } … … 49 54 OneBitflipMove[] moves = new OneBitflipMove[sampleSize]; 50 55 for (int i = 0; i < sampleSize; i++) { 51 moves[i] = Apply(binaryVector, random);56 moves[i] = StochasticOneBitflipSingleMoveGenerator.Apply(binaryVector, random); 52 57 } 53 58 return moves;
Note: See TracChangeset
for help on using the changeset viewer.