Changeset 1557


Ignore:
Timestamp:
04/14/09 14:50:11 (12 years ago)
Author:
dtraxing
Message:

removed variable lookup in hardwired SubScopeRemover, because variable is never used. (ticket #580)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.SGA.Hardwired/3.3/CreateChildrenHardWired.cs

    r1552 r1557  
    5454      AddVariableInfo(new VariableInfo("Mutator", "Mutation strategy for SGA", typeof(OperatorBase), VariableKind.In));
    5555      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));
    5756      AddVariableInfo(new VariableInfo("EvaluatedSolutions", "Number of evaluated solutions", typeof(IntData), VariableKind.In | VariableKind.Out));
    5857      AddVariableInfo(new VariableInfo("Maximization", "Sort in descending order", typeof(BoolData), VariableKind.In));
    5958      AddVariableInfo(new VariableInfo("Quality", "Sorting value", typeof(DoubleData), VariableKind.In));
    60       GetVariableInfo("SubScopeIndex").Local = true;
    6159    }
    6260
     
    8886
    8987        // 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       
    9991        counter++;
    10092      } // foreach
Note: See TracChangeset for help on using the changeset viewer.