Changeset 13035
- Timestamp:
- 10/19/15 16:27:05 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ALPS/HeuristicLab.Algorithms.ALPS/3.3/AlpsGeneticAlgorithmMainLoop.cs
r13031 r13035 179 179 mainLoop.OperatorGraph.InitialOperator = numberOfSubScopesBranch; 180 180 181 // Remove unused operators182 while (oldInitialOp != selector) {183 mainLoop.OperatorGraph.Operators.Remove(oldInitialOp);184 var op = oldInitialOp as SingleSuccessorOperator;185 oldInitialOp = op != null ? op.Successor : null;186 }187 188 181 numberOfSubScopesBranch.ConditionParameter.ActualName = "PlusSelection"; 189 182 numberOfSubScopesBranch.TrueBranch = numberOfSelectedSubScopesPlusCalculator; … … 254 247 stochasticBranch.RandomParameter.ActualName = "LocalRandom"; 255 248 249 // Remove unused operators 250 var usedOperators = mainLoop.OperatorGraph.Iterate(); 251 var unusedOperators = mainLoop.OperatorGraph.Operators.Except(usedOperators); 252 foreach (var op in unusedOperators.ToList()) 253 mainLoop.OperatorGraph.Operators.Remove(op); 254 256 255 return mainLoop; 257 256 }
Note: See TracChangeset
for help on using the changeset viewer.