Changeset 6929


Ignore:
Timestamp:
10/14/11 14:07:54 (9 years ago)
Author:
mkommend
Message:

#1653: Ordered nested operators in multip symbolic expression manipulators by name.

Location:
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4
Files:
2 edited

Legend:

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

    r5809 r6929  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Linq;
    2425using HeuristicLab.Collections;
     
    9596      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
    9697
    97       CheckedItemList<ISymbolicExpressionTreeManipulator> list = new CheckedItemList<ISymbolicExpressionTreeManipulator>();
     98      List<ISymbolicExpressionTreeManipulator> list = new List<ISymbolicExpressionTreeManipulator>();
    9899      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeManipulator))) {
    99100        if (!typeof(IMultiOperator<ISymbolicExpressionTreeManipulator>).IsAssignableFrom(type))
    100           list.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type), true);
     101          list.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type));
    101102      }
    102       Operators = list.AsReadOnly();
     103      CheckedItemList<ISymbolicExpressionTreeManipulator> checkedItemList = new CheckedItemList<ISymbolicExpressionTreeManipulator>();
     104      checkedItemList.AddRange(list.OrderBy(op => op.Name));
     105      Operators = checkedItemList.AsReadOnly();
    103106      Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeManipulator>>(Operators.CheckedItems));
    104107    }
  • trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/MultiSymbolicExpressionTreeManipulator.cs

    r5809 r6929  
    2121
    2222using System;
     23using System.Collections.Generic;
    2324using System.Linq;
    2425using HeuristicLab.Collections;
     
    7172      Parameters.Add(new ValueLookupParameter<IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
    7273
    73       CheckedItemList<ISymbolicExpressionTreeManipulator> list = new CheckedItemList<ISymbolicExpressionTreeManipulator>();
     74      List<ISymbolicExpressionTreeManipulator> list = new List<ISymbolicExpressionTreeManipulator>();
    7475      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeManipulator))) {
    7576        if (!typeof(IMultiOperator<ISymbolicExpressionTreeManipulator>).IsAssignableFrom(type) &&
    7677            !typeof(ISymbolicExpressionTreeArchitectureAlteringOperator).IsAssignableFrom(type))
    77           list.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type), true);
     78          list.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type));
    7879      }
    79       Operators = list.AsReadOnly();
     80      CheckedItemList<ISymbolicExpressionTreeManipulator> checkedItemList = new CheckedItemList<ISymbolicExpressionTreeManipulator>();
     81      checkedItemList.AddRange(list.OrderBy(op => op.Name));
     82      Operators = checkedItemList.AsReadOnly();
    8083      Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs<IndexedItem<ISymbolicExpressionTreeManipulator>>(Operators.CheckedItems));
    8184    }
Note: See TracChangeset for help on using the changeset viewer.