Changeset 10507 for stable/HeuristicLab.Optimization.Operators
- Timestamp:
- 02/25/14 14:00:47 (11 years ago)
- Location:
- stable
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 10149,10231,10261,10291-10292,10295,10298
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Optimization.Operators/3.3/ParentCopyCrossover.cs
r9456 r10507 29 29 [Item("ParentCopyCrossover", "This operator creates an offspring by creating a clone of a randomly chosen parent. It can be used in situations where no crossover should occur after selection.")] 30 30 [StorableClass] 31 public class ParentCopyCrossover : SingleSuccessorOperator, ICrossover, IStochasticOperator {31 public class ParentCopyCrossover : InstrumentedOperator, ICrossover, IStochasticOperator { 32 32 public ILookupParameter<IRandom> RandomParameter { 33 33 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } … … 43 43 } 44 44 45 public override IOperation Apply() {45 public override IOperation InstrumentedApply() { 46 46 IScope scope = ExecutionContext.Scope; 47 47 int index = RandomParameter.ActualValue.Next(scope.SubScopes.Count); … … 51 51 scope.Variables.Add((IVariable)var.Clone()); 52 52 53 return base. Apply();53 return base.InstrumentedApply(); 54 54 } 55 55 -
stable/HeuristicLab.Optimization.Operators/3.3/ShakingOperator.cs
r9456 r10507 56 56 } 57 57 58 public override IOperation Apply() {58 public override IOperation InstrumentedApply() { 59 59 if (NeighborhoodCountParameter.ActualValue == null) 60 60 NeighborhoodCountParameter.ActualValue = new IntValue(Operators.CheckedItems.Count()); … … 64 64 var shaker = base.Operators.CheckedItems.SingleOrDefault(x => x.Index == index); 65 65 66 OperationCollection next = new OperationCollection(base. Apply());66 OperationCollection next = new OperationCollection(base.InstrumentedApply()); 67 67 if (shaker.Value != null) 68 68 next.Insert(0, ExecutionContext.CreateChildOperation(shaker.Value)); -
stable/HeuristicLab.Optimization.Operators/3.3/UserDefinedOperator.cs
r9456 r10507 35 35 public UserDefinedOperator() : base() { } 36 36 37 public override IOperation Apply() {37 public override IOperation InstrumentedApply() { 38 38 OperationCollection result = new OperationCollection(); 39 39 foreach (IOperator op in Operators.CheckedItems.OrderBy(x => x.Index).Select(x => x.Value)) { 40 40 result.Add(ExecutionContext.CreateOperation(op)); 41 41 } 42 result.Add(base. Apply());42 result.Add(base.InstrumentedApply()); 43 43 return result; 44 44 }
Note: See TracChangeset
for help on using the changeset viewer.