Changeset 5178 for branches/ParallelEngine/HeuristicLab.Selection/3.3
- Timestamp:
- 12/28/10 01:44:33 (14 years ago)
- Location:
- branches/ParallelEngine/HeuristicLab.Selection/3.3
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ParallelEngine/HeuristicLab.Selection/3.3/GenderSpecificSelector.cs
r5177 r5178 140 140 /// <exception cref="InvalidOperationException">Thrown when <see cref="NumberOfSelectedSubScopesParameter"/> returns an odd number.</exception> 141 141 /// <returns>Returns Apply of <see cref="AlgorithmOperator"/>.</returns> 142 public override IOperation Apply( IExecutionContext context) {142 public override IOperation Apply() { 143 143 int count = NumberOfSelectedSubScopesParameter.ActualValue.Value; 144 144 if (count % 2 > 0) throw new InvalidOperationException(Name + ": There must be an equal number of sub-scopes to be selected."); 145 145 FemaleSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(count / 2); 146 146 MaleSelector.NumberOfSelectedSubScopesParameter.Value = new IntValue(count / 2); 147 return base.Apply( context);147 return base.Apply(); 148 148 } 149 149 -
branches/ParallelEngine/HeuristicLab.Selection/3.3/OffspringSelector.cs
r5177 r5178 80 80 } 81 81 82 public override IOperation Apply( IExecutionContext context) {82 public override IOperation Apply() { 83 83 double maxSelPress = MaximumSelectionPressureParameter.ActualValue.Value; 84 84 double successRatio = SuccessRatioParameter.ActualValue.Value; 85 IScope scope = context.Scope;85 IScope scope = ExecutionContext.Scope; 86 86 IScope parents = scope.SubScopes[0]; 87 87 IScope offspring = scope.SubScopes[1]; … … 162 162 IOperator moreOffspring = OffspringCreatorParameter.ActualValue as IOperator; 163 163 if (moreOffspring == null) throw new InvalidOperationException(Name + ": More offspring are required, but no operator specified for creating them."); 164 return context.CreateOperation(moreOffspring);164 return ExecutionContext.CreateOperation(moreOffspring); 165 165 } else { 166 166 // enough children generated … … 170 170 scope.Variables.Remove(OffspringPopulationParameter.TranslatedName); 171 171 scope.Variables.Remove(OffspringPopulationWinnersParameter.TranslatedName); 172 return base.Apply( context);172 return base.Apply(); 173 173 } 174 174 } -
branches/ParallelEngine/HeuristicLab.Selection/3.3/Reducer.cs
r5177 r5178 52 52 } 53 53 54 public sealed override IOperation Apply( IExecutionContext context) {54 public sealed override IOperation Apply() { 55 55 List<IScope> scopes = new List<IScope>(CurrentScope.SubScopes); 56 56 List<IScope> reduced = Reduce(scopes); … … 59 59 CurrentScope.SubScopes.AddRange(reduced); 60 60 61 return base.Apply( context);61 return base.Apply(); 62 62 } 63 63 -
branches/ParallelEngine/HeuristicLab.Selection/3.3/Replacer.cs
r5177 r5178 75 75 } 76 76 77 public override IOperation Apply( IExecutionContext context) {78 if ( context.Scope.SubScopes.Count != 2) throw new InvalidOperationException(Name + ": There must be two sub-scopes which should be replaced/merged.");79 int remaining = context.Scope.SubScopes[0].SubScopes.Count;80 int selected = context.Scope.SubScopes[1].SubScopes.Count;77 public override IOperation Apply() { 78 if (ExecutionContext.Scope.SubScopes.Count != 2) throw new InvalidOperationException(Name + ": There must be two sub-scopes which should be replaced/merged."); 79 int remaining = ExecutionContext.Scope.SubScopes[0].SubScopes.Count; 80 int selected = ExecutionContext.Scope.SubScopes[1].SubScopes.Count; 81 81 82 82 ISelector replacedSelector = ReplacedSelectorParameter.ActualValue; … … 92 92 } 93 93 94 return base.Apply( context);94 return base.Apply(); 95 95 } 96 96 } -
branches/ParallelEngine/HeuristicLab.Selection/3.3/Selector.cs
r5177 r5178 54 54 } 55 55 56 public sealed override IOperation Apply( IExecutionContext context) {56 public sealed override IOperation Apply() { 57 57 List<IScope> scopes = new List<IScope>(CurrentScope.SubScopes); 58 58 IScope[] selected = Select(scopes); … … 66 66 CurrentScope.SubScopes.Add(selectedScope); 67 67 68 return base.Apply( context);68 return base.Apply(); 69 69 } 70 70
Note: See TracChangeset
for help on using the changeset viewer.