Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7052 for trunk


Ignore:
Timestamp:
11/23/11 09:55:16 (13 years ago)
Author:
mkommend
Message:

#1654: Changed discovery in multi operators as the discovery by specifying a plugin description does not work in the LightWeightApplicationManager and therefore the classes were not useable in unit tests.

Location:
trunk/sources
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/ArchitectureManipulators/MultiSymbolicExpressionTreeArchitectureManipulator.cs

    r7037 r7052  
    9797
    9898      List<ISymbolicExpressionTreeManipulator> list = new List<ISymbolicExpressionTreeManipulator>();
    99       var plugin = ApplicationManager.Manager.GetDeclaringPlugin(this.GetType());
    100       foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeManipulator), plugin)) {
    101         if (!typeof(IMultiOperator<ISymbolicExpressionTreeManipulator>).IsAssignableFrom(type))
    102           list.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type));
     99      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeManipulator))) {
     100        if (this.GetType().Assembly != type.Assembly) continue;
     101        if (typeof(IMultiOperator<ISymbolicExpressionTreeManipulator>).IsAssignableFrom(type)) continue;
     102        list.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type));
    103103      }
    104104      CheckedItemList<ISymbolicExpressionTreeManipulator> checkedItemList = new CheckedItemList<ISymbolicExpressionTreeManipulator>();
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/MultiSymbolicExpressionTreeManipulator.cs

    r7037 r7052  
    7373
    7474      List<ISymbolicExpressionTreeManipulator> list = new List<ISymbolicExpressionTreeManipulator>();
    75       var plugin = ApplicationManager.Manager.GetDeclaringPlugin(this.GetType());
    76       foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeManipulator), plugin)) {
    77         if (!typeof(IMultiOperator<ISymbolicExpressionTreeManipulator>).IsAssignableFrom(type) &&
    78             !typeof(ISymbolicExpressionTreeArchitectureAlteringOperator).IsAssignableFrom(type))
    79           list.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type));
     75      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeManipulator))) {
     76        if (this.GetType().Assembly != type.Assembly) continue;
     77        if (typeof(IMultiOperator<ISymbolicExpressionTreeManipulator>).IsAssignableFrom(type)) continue;
     78        list.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type));
    8079      }
    8180      CheckedItemList<ISymbolicExpressionTreeManipulator> checkedItemList = new CheckedItemList<ISymbolicExpressionTreeManipulator>();
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Creators/MultiSymbolicDataAnalysisExpressionCreator.cs

    r7037 r7052  
    8282      Parameters.Add(new LookupParameter<ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));
    8383
    84       var plugin = ApplicationManager.Manager.GetDeclaringPlugin(this.GetType());
    8584      List<ISymbolicDataAnalysisSolutionCreator> list = new List<ISymbolicDataAnalysisSolutionCreator>();
    86       foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicDataAnalysisSolutionCreator), plugin)) {
    87         if (!typeof(IMultiOperator<ISymbolicDataAnalysisSolutionCreator>).IsAssignableFrom(type))
    88           list.Add((ISymbolicDataAnalysisSolutionCreator)Activator.CreateInstance(type));
     85      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicDataAnalysisSolutionCreator))) {
     86        if (this.GetType().Assembly != type.Assembly) continue;
     87        if (typeof(IMultiOperator<ISymbolicDataAnalysisSolutionCreator>).IsAssignableFrom(type)) continue;
     88        list.Add((ISymbolicDataAnalysisSolutionCreator)Activator.CreateInstance(type));
    8989      }
    9090      CheckedItemList<ISymbolicDataAnalysisSolutionCreator> checkedItemList = new CheckedItemList<ISymbolicDataAnalysisSolutionCreator>();
Note: See TracChangeset for help on using the changeset viewer.