Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/03/10 06:46:30 (15 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • implemented reviewers' comments
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.TSP/3.3/TSP.cs

    r2906 r2917  
    9494      EvaluatorParameter.ValueChanged += new EventHandler(EvaluatorParameter_ValueChanged);
    9595
    96       var ops = ApplicationManager.Manager.GetInstances<IPermutationOperator>();
    97       foreach (IPermutationCrossover op in ops.OfType<IPermutationCrossover>()) {
    98         op.ParentsParameter.ActualName = creator.PermutationParameter.ActualName;
    99         op.ChildParameter.ActualName = creator.PermutationParameter.ActualName;
     96      operators = new OperatorSet();
     97      if (ApplicationManager.Manager != null) {
     98        var ops = ApplicationManager.Manager.GetInstances<IPermutationOperator>();
     99        foreach (IPermutationCrossover op in ops.OfType<IPermutationCrossover>()) {
     100          op.ParentsParameter.ActualName = creator.PermutationParameter.ActualName;
     101          op.ChildParameter.ActualName = creator.PermutationParameter.ActualName;
     102        }
     103        foreach (IPermutationManipulator op in ops.OfType<IPermutationManipulator>()) {
     104          op.PermutationParameter.ActualName = creator.PermutationParameter.ActualName;
     105        }
     106        foreach (IPermutationOperator op in ops)
     107          operators.Add(op);
    100108      }
    101       foreach (IPermutationManipulator op in ops.OfType<IPermutationManipulator>()) {
    102         op.PermutationParameter.ActualName = creator.PermutationParameter.ActualName;
    103       }
    104       operators = new OperatorSet(ops.Cast<IOperator>());
    105109    }
    106110
Note: See TracChangeset for help on using the changeset viewer.