Beispiel #1
0
 protected SubScopesMixer(SubScopesMixer original, Cloner cloner)
     : base(original, cloner)
 {
 }
Beispiel #2
0
 protected SubScopesMixer(SubScopesMixer original, Cloner cloner)
   : base(original, cloner) {
 }
    public GenderSpecificSelector()
      : 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 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 LookupParameter<IRandom>("Random", "The random number generator to use."));
      Parameters.Add(new ValueParameter<ISelector>("FemaleSelector", "The selection operator to select the first parent."));
      Parameters.Add(new ValueParameter<ISelector>("MaleSelector", "The selection operator to select the second parent."));
      CopySelectedParameter.Hidden = true;
      #endregion

      #region Create operators
      Placeholder femaleSelector = new Placeholder();
      SubScopesProcessor maleSelection = new SubScopesProcessor();
      Placeholder maleSelector = new Placeholder();
      EmptyOperator empty = new EmptyOperator();
      RightChildReducer rightChildReducer = new RightChildReducer();
      SubScopesMixer subScopesMixer = new SubScopesMixer();

      femaleSelector.OperatorParameter.ActualName = "FemaleSelector";

      maleSelector.OperatorParameter.ActualName = "MaleSelector";

      subScopesMixer.Partitions = new IntValue(2);
      #endregion

      #region Create operator graph
      OperatorGraph.InitialOperator = femaleSelector;
      femaleSelector.Successor = maleSelection;
      maleSelection.Operators.Add(maleSelector);
      maleSelection.Operators.Add(empty);
      maleSelection.Successor = rightChildReducer;
      rightChildReducer.Successor = subScopesMixer;
      #endregion

      Initialize();
    }