Changeset 1557
- Timestamp:
- 04/14/09 14:50:11 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.SGA.Hardwired/3.3/CreateChildrenHardWired.cs
r1552 r1557 54 54 AddVariableInfo(new VariableInfo("Mutator", "Mutation strategy for SGA", typeof(OperatorBase), VariableKind.In)); 55 55 AddVariableInfo(new VariableInfo("Evaluator", "Evaluation strategy for SGA", typeof(OperatorBase), VariableKind.In)); 56 AddVariableInfo(new VariableInfo("SubScopeIndex", "(Optional) the index of the subscope to remove", typeof(IntData), VariableKind.In));57 56 AddVariableInfo(new VariableInfo("EvaluatedSolutions", "Number of evaluated solutions", typeof(IntData), VariableKind.In | VariableKind.Out)); 58 57 AddVariableInfo(new VariableInfo("Maximization", "Sort in descending order", typeof(BoolData), VariableKind.In)); 59 58 AddVariableInfo(new VariableInfo("Quality", "Sorting value", typeof(DoubleData), VariableKind.In)); 60 GetVariableInfo("SubScopeIndex").Local = true;61 59 } 62 60 … … 88 86 89 87 // subscopes remover 90 IntData index = GetVariableValue<IntData>("SubScopeIndex", s, true, false); 91 if (index == null) { // remove all scopes 92 while (s.SubScopes.Count > 0) { 93 s.RemoveSubScope(s.SubScopes[0]); 94 } 95 } else { 96 if (index.Data < 0 && index.Data >= s.SubScopes.Count) throw new InvalidOperationException("ERROR: no scope with index " + index.Data + " exists"); 97 s.RemoveSubScope(s.SubScopes[index.Data]); 98 } 88 while (s.SubScopes.Count > 0) 89 s.RemoveSubScope(s.SubScopes[0]); 90 99 91 counter++; 100 92 } // foreach
Note: See TracChangeset
for help on using the changeset viewer.