- Timestamp:
- 11/25/15 23:24:01 (9 years ago)
- Location:
- branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveGenerator.cs
r12012 r13403 31 31 [Item("AdditiveMoveGenerator", "Base class for all additive move generators.")] 32 32 [StorableClass] 33 public abstract class AdditiveMoveGenerator : SingleSuccessorOperator, I AdditiveRealVectorMoveOperator, IMoveGenerator, IStochasticOperator {33 public abstract class AdditiveMoveGenerator : SingleSuccessorOperator, IRealVectorAdditiveMoveOperator, IMoveGenerator, IStochasticOperator { 34 34 public override bool CanChangeName { 35 35 get { return false; } … … 43 43 public ILookupParameter<AdditiveMove> AdditiveMoveParameter { 44 44 get { return (LookupParameter<AdditiveMove>)Parameters["AdditiveMove"]; } 45 }46 protected ScopeParameter CurrentScopeParameter {47 get { return (ScopeParameter)Parameters["CurrentScope"]; }48 45 } 49 46 public IValueLookupParameter<DoubleMatrix> BoundsParameter { … … 59 56 Parameters.Add(new LookupParameter<RealVector>("RealVector", "The real vector for which moves should be generated.")); 60 57 Parameters.Add(new LookupParameter<AdditiveMove>("AdditiveMove", "The moves that should be generated in subscopes.")); 61 Parameters.Add(new ScopeParameter("CurrentScope", "The current scope where the moves should be added as subscopes."));62 58 Parameters.Add(new ValueLookupParameter<DoubleMatrix>("Bounds", "A 2 column matrix specifying the lower and upper bound for each dimension. If there are less rows than dimension the bounds vector is cycled.")); 63 59 } … … 72 68 moveScopes[i].Variables.Add(new Variable(AdditiveMoveParameter.ActualName, moves[i])); 73 69 } 74 CurrentScopeParameter.ActualValue.SubScopes.AddRange(moveScopes);70 ExecutionContext.Scope.SubScopes.AddRange(moveScopes); 75 71 return base.Apply(); 76 72 } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveMaker.cs
r12012 r13403 31 31 [Item("AdditiveMoveMaker", "Peforms an additive move on a given real vector and updates the quality.")] 32 32 [StorableClass] 33 public class AdditiveMoveMaker : SingleSuccessorOperator, I AdditiveRealVectorMoveOperator, IMoveMaker, ISingleObjectiveOperator {33 public class AdditiveMoveMaker : SingleSuccessorOperator, IRealVectorAdditiveMoveQualityOperator, IMoveMaker, ISingleObjectiveOperator { 34 34 public override bool CanChangeName { 35 35 get { return false; } … … 63 63 } 64 64 65 public static void Apply(RealVector realVector, AdditiveMove move) { 66 realVector[move.Dimension] += move.MoveDistance; 67 } 68 65 69 public override IOperation Apply() { 66 AdditiveMove move = AdditiveMoveParameter.ActualValue; 67 RealVector realVector = RealVectorParameter.ActualValue; 68 DoubleValue moveQuality = MoveQualityParameter.ActualValue; 69 DoubleValue quality = QualityParameter.ActualValue; 70 Apply(RealVectorParameter.ActualValue, AdditiveMoveParameter.ActualValue); 71 var moveQuality = MoveQualityParameter.ActualValue; 72 var quality = QualityParameter.ActualValue; 70 73 71 realVector[move.Dimension] += move.MoveDistance;72 74 quality.Value = moveQuality.Value; 73 75 -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuChecker.cs
r12012 r13403 32 32 [Item("AdditiveMoveTabuChecker", "Prevents falling back into ranges that have been moved over before.")] 33 33 [StorableClass] 34 public class AdditiveMoveTabuChecker : SingleSuccessorOperator, I AdditiveRealVectorMoveOperator, ITabuChecker {34 public class AdditiveMoveTabuChecker : SingleSuccessorOperator, IRealVectorAdditiveMoveQualityOperator, ITabuChecker { 35 35 public override bool CanChangeName { 36 36 get { return false; } -
branches/ProblemRefactoring/HeuristicLab.Encodings.RealVectorEncoding/3.3/Moves/AdditiveMoveTabuMaker.cs
r12012 r13403 29 29 [Item("AdditiveMoveTabuMaker", "Sets the move tabu.")] 30 30 [StorableClass] 31 public class AdditiveMoveTabuMaker : TabuMaker, I AdditiveRealVectorMoveOperator {31 public class AdditiveMoveTabuMaker : TabuMaker, IRealVectorAdditiveMoveQualityOperator { 32 32 public ILookupParameter<AdditiveMove> AdditiveMoveParameter { 33 33 get { return (ILookupParameter<AdditiveMove>)Parameters["AdditiveMove"]; }
Note: See TracChangeset
for help on using the changeset viewer.