public MultiSymbolicExpressionTreeArchitectureManipulator()
            : base()
        {
            Parameters.Add(new LookupParameter <ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
            Parameters.Add(new ValueLookupParameter <IntValue>(MaximumFunctionDefinitionsParameterName, "The maximal allowed number of automatically defined functions."));
            Parameters.Add(new ValueLookupParameter <IntValue>(MaximumFunctionArgumentsParameterName, "The maximal allowed number of arguments of a automatically defined functions."));
            Parameters.Add(new ValueLookupParameter <IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
            Parameters.Add(new ValueLookupParameter <IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));

            List <ISymbolicExpressionTreeManipulator> list = new List <ISymbolicExpressionTreeManipulator>();

            foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeManipulator)))
            {
                if (this.GetType().Assembly != type.Assembly)
                {
                    continue;
                }
                if (typeof(IMultiOperator <ISymbolicExpressionTreeManipulator>).IsAssignableFrom(type))
                {
                    continue;
                }
                list.Add((ISymbolicExpressionTreeManipulator)Activator.CreateInstance(type));
            }
            CheckedItemList <ISymbolicExpressionTreeManipulator> checkedItemList = new CheckedItemList <ISymbolicExpressionTreeManipulator>();

            checkedItemList.AddRange(list.OrderBy(op => op.Name));
            Operators = checkedItemList.AsReadOnly();
            Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs <IndexedItem <ISymbolicExpressionTreeManipulator> >(Operators.CheckedItems));

            SelectedOperatorParameter.ActualName = "SelectedManipulationOperator";
        }
コード例 #2
0
        public MultiSymbolicExpressionTreeCrossover()
            : base()
        {
            Parameters.Add(new LookupParameter <ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
            Parameters.Add(new ValueLookupParameter <IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
            Parameters.Add(new ValueLookupParameter <IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
            Parameters.Add(new ScopeTreeLookupParameter <ISymbolicExpressionTree>(ParentsParameterName, "The parent symbolic expression trees which should be crossed."));

            List <ISymbolicExpressionTreeCrossover> list = new List <ISymbolicExpressionTreeCrossover>();

            foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicExpressionTreeCrossover)))
            {
                if (this.GetType().Assembly != type.Assembly && typeof(SubtreeCrossover).Assembly != type.Assembly)
                {
                    continue;
                }
                if (typeof(IMultiOperator <ISymbolicExpressionTreeCrossover>).IsAssignableFrom(type))
                {
                    continue;
                }
                list.Add((ISymbolicExpressionTreeCrossover)Activator.CreateInstance(type));
            }
            CheckedItemList <ISymbolicExpressionTreeCrossover> checkedItemList = new CheckedItemList <ISymbolicExpressionTreeCrossover>();

            checkedItemList.AddRange(list.OrderBy(op => op.Name));
            Operators = checkedItemList;//.AsReadOnly(); read only is not used because a problem might add more crossover classes
            Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs <IndexedItem <ISymbolicExpressionTreeCrossover> >(Operators.CheckedItems));

            SelectedOperatorParameter.ActualName = "SelectedCrossoverOperator";
        }
コード例 #3
0
        public MultiProportionalSelector()
            : base()
        {
            #region Create parameters
            Parameters.Add(new ValueLookupParameter <BoolValue>("Maximization", "True if the problem is a maximization problem."));
            Parameters.Add(new ScopeTreeLookupParameter <DoubleValue>("Quality", "The quality of the solutions."));
            Parameters.Add(new ScopeTreeLookupParameter <DoubleArray>("CaseQualities", "The quality of every single training case for each individual."));
            Parameters.Add(new ValueLookupParameter <IntValue>("NumberOfSelectedSubScopes", "The number of scopes that should be selected."));
            Parameters.Add(new ValueLookupParameter <BoolValue>("CopySelected", "True if the scopes should be copied, false if they should be moved.", new BoolValue(true)));
            Parameters.Add(new ValueParameter <ICheckedItemList <ISelector> >("Selectors", "The selection operators."));
            Parameters.Add(new LookupParameter <IRandom>("Random", "The random number generator to use."));
            Parameters.Add(new ScopeParameter("CurrentScope", "The current scope from which sub-scopes should be selected."));
            CopySelectedParameter.Hidden = true;
            #endregion

            List <ISelector> list = new List <ISelector>();
            foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISelector)))
            {
                if (this.GetType() == type)
                {
                    continue;
                }
                if (typeof(IMultiOperator <ISelector>).IsAssignableFrom(type))
                {
                    continue;
                }
                list.Add((ISelector)Activator.CreateInstance(type));
            }
            CheckedItemList <ISelector> checkedItemList = new CheckedItemList <ISelector>();
            checkedItemList.AddRange(list.OrderBy(op => op.Name));
            Selectors = checkedItemList.AsReadOnly();

            Initialize();
        }
        public MultiSymbolicDataAnalysisExpressionCreator()
            : base()
        {
            Parameters.Add(new LookupParameter <ISymbolicExpressionTree>(SymbolicExpressionTreeParameterName, "The symbolic expression tree on which the operator should be applied."));
            Parameters.Add(new ValueLookupParameter <IntValue>(MaximumSymbolicExpressionTreeLengthParameterName, "The maximal length (number of nodes) of the symbolic expression tree."));
            Parameters.Add(new ValueLookupParameter <IntValue>(MaximumSymbolicExpressionTreeDepthParameterName, "The maximal depth of the symbolic expression tree (a tree with one node has depth = 0)."));
            Parameters.Add(new ValueLookupParameter <ISymbolicExpressionGrammar>(SymbolicExpressionTreeGrammarParameterName, "The tree grammar that defines the correct syntax of symbolic expression trees that should be created."));
            Parameters.Add(new LookupParameter <ISymbolicExpressionGrammar>(ClonedSymbolicExpressionTreeGrammarParameterName, "An immutable clone of the concrete grammar that is actually used to create and manipulate trees."));

            List <ISymbolicDataAnalysisSolutionCreator> list = new List <ISymbolicDataAnalysisSolutionCreator>();

            foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicDataAnalysisSolutionCreator)))
            {
                if (this.GetType().Assembly != type.Assembly)
                {
                    continue;
                }
                if (typeof(IMultiOperator <ISymbolicDataAnalysisSolutionCreator>).IsAssignableFrom(type))
                {
                    continue;
                }
                list.Add((ISymbolicDataAnalysisSolutionCreator)Activator.CreateInstance(type));
            }
            CheckedItemList <ISymbolicDataAnalysisSolutionCreator> checkedItemList = new CheckedItemList <ISymbolicDataAnalysisSolutionCreator>();

            checkedItemList.AddRange(list.OrderBy(op => op.Name));
            Operators = checkedItemList.AsReadOnly();
            Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs <IndexedItem <ISymbolicDataAnalysisSolutionCreator> >(Operators.CheckedItems));
        }
コード例 #5
0
        public MultiSelector()
            : base()
        {
            Parameters.Add(new ValueParameter <BoolValue>("CopySelected", "True if the selected sub-scopes should be copied, otherwise false.", new BoolValue(true)));
            Parameters.Add(new ValueLookupParameter <IntValue>("NumberOfSelectedSubScopes", "The number of sub-scopes which should be selected."));
            Parameters.Add(new ValueLookupParameter <BoolValue>("Maximization", "True if the current problem is a maximization problem, otherwise false."));
            Parameters.Add(new ScopeTreeLookupParameter <DoubleValue>("Quality", "The quality value contained in each sub-scope which is used for selection."));
            Parameters.Add(new ScopeTreeLookupParameter <DoubleArray>("CaseQualities", "The quality of every single training case for each individual."));
            CopySelectedParameter.Hidden = true;

            List <ISelector> list = new List <ISelector>();

            foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISelector)))
            {
                if (typeof(MultiProportionalSelector) == type)
                {
                    continue;
                }
                if (typeof(IMultiOperator <ISelector>).IsAssignableFrom(type))
                {
                    continue;
                }
                list.Add((ISelector)Activator.CreateInstance(type));
            }
            CheckedItemList <ISelector> checkedItemList = new CheckedItemList <ISelector>();

            checkedItemList.AddRange(list.OrderBy(op => op.Name));
            Operators = checkedItemList.AsReadOnly();
            Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs <IndexedItem <ISelector> >(Operators.CheckedItems));

            SelectedOperatorParameter.ActualName = "SelectedSelectionOperator";
        }
        private void InitializeOperators()
        {
            var list = ApplicationManager.Manager.GetInstances <ISymbolicExpressionTreeCrossover>().ToList();
            var dataAnalysisCrossovers = from type in ApplicationManager.Manager.GetTypes(typeof(ISymbolicDataAnalysisExpressionCrossover <T>))
                                         where this.GetType().Assembly == type.Assembly
                                         where !typeof(IMultiOperator <ISymbolicExpressionTreeCrossover>).IsAssignableFrom(type)
                                         select(ISymbolicDataAnalysisExpressionCrossover <T>) Activator.CreateInstance(type);

            list.AddRange(dataAnalysisCrossovers);

            var checkedItemList = new CheckedItemList <ISymbolicExpressionTreeCrossover>();

            checkedItemList.AddRange(list.OrderBy(op => op.Name));
            Operators = checkedItemList;
            Operators_ItemsAdded(this, new CollectionItemsChangedEventArgs <IndexedItem <ISymbolicExpressionTreeCrossover> >(Operators.CheckedItems));
        }
コード例 #7
0
    public MultiProportionalSelector()
      : base() {
      #region Create parameters
      Parameters.Add(new ValueLookupParameter<BoolValue>("Maximization", "True if the problem is a maximization problem."));
      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The quality of the solutions."));
      Parameters.Add(new ScopeTreeLookupParameter<DoubleArray>("CaseQualities", "The quality of every single training case for each individual."));
      Parameters.Add(new ValueLookupParameter<IntValue>("NumberOfSelectedSubScopes", "The number of scopes that should be selected."));
      Parameters.Add(new ValueLookupParameter<BoolValue>("CopySelected", "True if the scopes should be copied, false if they should be moved.", new BoolValue(true)));
      Parameters.Add(new ValueParameter<ICheckedItemList<ISelector>>("Selectors", "The selection operators."));
      Parameters.Add(new LookupParameter<IRandom>("Random", "The random number generator to use."));
      Parameters.Add(new ScopeParameter("CurrentScope", "The current scope from which sub-scopes should be selected."));
      CopySelectedParameter.Hidden = true;
      #endregion

      List<ISelector> list = new List<ISelector>();
      foreach (Type type in ApplicationManager.Manager.GetTypes(typeof(ISelector))) {
        if (this.GetType() == type) continue;
        if (typeof(IMultiOperator<ISelector>).IsAssignableFrom(type)) continue;
        list.Add((ISelector)Activator.CreateInstance(type));
      }
      CheckedItemList<ISelector> checkedItemList = new CheckedItemList<ISelector>();
      checkedItemList.AddRange(list.OrderBy(op => op.Name));
      Selectors = checkedItemList.AsReadOnly();

      Initialize();
    }