- Timestamp:
- 02/20/14 14:56:39 (11 years ago)
- Location:
- branches/LogResidualEvaluator
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/LogResidualEvaluator
- Property svn:mergeinfo changed
-
branches/LogResidualEvaluator/HeuristicLab.Optimization.Operators/3.3/ParentCopyCrossover.cs
r9456 r10483 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 -
branches/LogResidualEvaluator/HeuristicLab.Optimization.Operators/3.3/ShakingOperator.cs
r9456 r10483 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)); -
branches/LogResidualEvaluator/HeuristicLab.Optimization.Operators/3.3/UserDefinedOperator.cs
r9456 r10483 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.