Index: trunk/sources/HeuristicLab.FixedOperators/3.2/Copy of FixedOperatorBase.cs
===================================================================
--- trunk/sources/HeuristicLab.FixedOperators/3.2/Copy of FixedOperatorBase.cs	(revision 2075)
+++ 	(revision )
@@ -1,213 +1,0 @@
-﻿//#region License Information
-///* HeuristicLab
-// * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
-// *
-// * This file is part of HeuristicLab.
-// *
-// * HeuristicLab is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * HeuristicLab is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
-// */
-//#endregion
-
-//using System;
-//using System.Collections.Generic;
-//using HeuristicLab.Core;
-//using HeuristicLab.Operators;
-//using HeuristicLab.Data;
-//using System.Threading;
-//using System.Diagnostics;
-
-//namespace HeuristicLab.FixedOperators {
-//  class FixedOperatorBase : CombinedOperator {
-//    protected class SubScopesProcessor : OperatorBase {
-//      public SubScopesProcessor(VirtualScope scope) {
-//        this.scope = scope;
-//      }
-//      private VirtualScope scope;
-//      public IList<IOperator> operators = new List<IOperator>();
-//      public void AddOperator(IOperator op) {
-//        operators.Add(op);
-//      }
-
-//      public void Unwind(Queue<KeyValuePair<IOperator, VirtualScope>> list, int currentOpIdx) {
-//        int i = 0;
-//        //for(int idx = 0; idx < scope.Scope.SubScopes.Count; idx++){
-//        //  foreach (IOperator op in operators) {
-//        //    list.Insert(currentOpIdx+i, new KeyValuePair<IOperator, VirtualScope>(op, new VirtualScope(scope.Scope.SubScopes[idx])));
-//        //    i++;
-//        //  } // foreach  
-//        //} // for idx
-
-//        //for (int idx = scope.Scope.SubScopes.Count - 1; idx >= 0 ; idx--) {
-//        //  for (int y = operators.Count - 1; y >= 0; y-- ) {
-//        //    list.Insert(currentOpIdx, new KeyValuePair<IOperator, VirtualScope>(operators[y], new VirtualScope(scope.Scope.SubScopes[idx])));
-//        //  } // foreach  
-//        //} // for idx
-
-//        for (int idx = 0; idx < scope.Scope.SubScopes.Count; idx++) {
-//          foreach (IOperator op in operators) {
-//            list.Enqueue(new KeyValuePair<IOperator, VirtualScope>(op, new VirtualScope(scope.Scope.SubScopes[idx])));
-//            i++;
-//          } // foreach  
-//        } // for idx
-//      }
-//    } // ForLoop
-    
-//    protected class VirtualScope {
-//      public VirtualScope(VirtualScope parent, int subscopeIndex) {
-//        this.parent = parent;
-//        this.subscope = true;
-//        this.subscopeIndex = subscopeIndex;
-//      }
-      
-//      public VirtualScope(IScope scope, int subscopeIndex) {
-//        this.scope = scope;
-//        this.subscope = true;
-//        this.subscopeIndex = subscopeIndex;
-//      }
-
-//      public VirtualScope(IScope scope) {
-//        this.scope = scope;
-//      }
-//      private IScope scope;
-//      private bool subscope;
-//      private int subscopeIndex;
-//      public IScope Scope {
-//        get { return getScope(); }
-//      }
-//      private IScope getScope() {
-//        IScope s;
-//        if (parent != null)
-//          s = parent.getScope();
-//        else
-//          s = scope;
-
-//        if (subscope)
-//          return s.SubScopes[subscopeIndex];
-//        else
-//          return scope;
-//      }
-
-//      private VirtualScope parent;
-
-//      //public static implicit operator Scope(ScopeDescriptor s) {
-//      //  return (Scope)s.getScope();
-//      //} 
-//    }
-//    /// <summary>
-//    /// true if algorithm is in execution
-//    /// </summary>
-//    protected BoolData inExecution;
-    
-//    /// <summary>
-//    /// Current operator in execution.
-//    /// </summary>
-//    protected IOperator currentOperator;
-
-//    protected IList<KeyValuePair<IOperator, VirtualScope>> operators;
-//    protected Queue<KeyValuePair<IOperator, VirtualScope>> operatorsQueue;
-
-//    public FixedOperatorBase() : base() {
-//      operators = new List<KeyValuePair<IOperator, VirtualScope>>();
-//      operatorsQueue = new Queue<KeyValuePair<IOperator, VirtualScope>>();
-//      //AddVariableInfo(new VariableInfo("ExecutionPointer", "Execution pointer for algorithm abortion", typeof(IntData), VariableKind.New));   
-//    } // FixedOperatorBase
-
-//    protected void Execute() {
-//      inExecution.Data = true;
-//      KeyValuePair<IOperator, VirtualScope> ao;
-//      int currentOpIdx = 0;
-//      while (currentOpIdx < operators.Count && !Canceled) {
-//        //ao = operators.Dequeue();
-//        if (operatorsQueue.Count > 0) {
-//          ao = operatorsQueue.Dequeue();
-//        } else {
-//          ao = operators[currentOpIdx];
-//          currentOpIdx++;
-//        }
-//        if (ao.Key is SubScopesProcessor) {
-//          SubScopesProcessor sp = (SubScopesProcessor)ao.Key;
-//          sp.Unwind(operatorsQueue, currentOpIdx);
-//        } else
-//          ExecuteOperation(ao.Key, ao.Value.Scope);
-//      } // while
-
-//      if (operators.Count == 0)
-//        inExecution.Data = false;
-//    } // Execute()
-    
-//    protected virtual void Execute(IOperator op, VirtualScope scope) {
-//      operators.Add(new KeyValuePair<IOperator, VirtualScope>(op, scope)) ;
-//    } // Execute
-
-//    protected void ExecuteOperation(IOperator op, IScope scope) {
-//      IOperation operation;
-//      currentOperator = op;
-//      operation = op.Execute(scope);
-//      if (operation != null) {
-//        //IOperator currentOperator;
-//        Stack<IOperation> executionStack = new Stack<IOperation>();
-//        executionStack.Push(op.Execute(scope));
-
-//        while (executionStack.Count > 0) {
-//          operation = executionStack.Pop();
-//          if (operation is AtomicOperation) {
-//            AtomicOperation atomicOperation = (AtomicOperation)operation;
-//            IOperation next = null;
-//            try {
-//              currentOperator = atomicOperation.Operator;
-//              next = currentOperator.Execute(atomicOperation.Scope);
-//            }
-//            catch (Exception) {
-//              throw new InvalidOperationException("Invalid Operation occured in FixedBase.Execute");
-//            }
-//            if (next != null)
-//              executionStack.Push(next);
-//          } else if (operation is CompositeOperation) {
-//            CompositeOperation compositeOperation = (CompositeOperation)operation;
-//            for (int i = compositeOperation.Operations.Count - 1; i >= 0; i--)
-//              executionStack.Push(compositeOperation.Operations[i]);
-//          } // else if
-//        } // while
-//      } // if (operation != null)
-//    } // ExecuteOperation
-
-//    public override IOperation Apply(IScope scope) {
-//      try {
-//        inExecution = scope.GetVariableValue<BoolData>("InExecution", false);
-//      }
-//      catch (Exception) {
-//        inExecution = new BoolData(false);
-//        scope.AddVariable(new Variable("InExecution", inExecution));
-//        operators.Clear();
-//      } // catch
-//      return null;
-//    } // Apply
-
-//    public override void Abort() {
-//      base.Abort();
-//      currentOperator.Abort();
-//      //engineThread.Abort();
-//    }
-
-//    public bool InExecution {
-//      get { return inExecution.Data; }
-//    }
-
-
-//  } // class FixedBase
-
-//  class CancelException : Exception { 
-  
-//  } // class CancelException
-//} // namespace HeuristicLab.FixedOperators
Index: trunk/sources/HeuristicLab.FixedOperators/3.2/Copy of FixedSGAMain.cs
===================================================================
--- trunk/sources/HeuristicLab.FixedOperators/3.2/Copy of FixedSGAMain.cs	(revision 2075)
+++ 	(revision )
@@ -1,395 +1,0 @@
-﻿//#region License Information
-///* HeuristicLab
-// * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
-// *
-// * This file is part of HeuristicLab.
-// *
-// * HeuristicLab is free software: you can redistribute it and/or modify
-// * it under the terms of the GNU General Public License as published by
-// * the Free Software Foundation, either version 3 of the License, or
-// * (at your option) any later version.
-// *
-// * HeuristicLab is distributed in the hope that it will be useful,
-// * but WITHOUT ANY WARRANTY; without even the implied warranty of
-// * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// * GNU General Public License for more details.
-// *
-// * You should have received a copy of the GNU General Public License
-// * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
-// */
-//#endregion
-
-//using System;
-//using System.Collections.Generic;
-//using System.Text;
-//using System.Linq;
-//using HeuristicLab.Core;
-//using HeuristicLab.Data;
-//using HeuristicLab.Permutation;
-//using HeuristicLab.Evolutionary;
-//using HeuristicLab.Operators;
-//using HeuristicLab.Routing.TSP;
-//using HeuristicLab.Logging;
-//using System.Diagnostics;
-//using HeuristicLab.Selection;
-//using System.Threading;
-
-//namespace HeuristicLab.FixedOperators {
-//  class FixedSGAMain : FixedOperatorBase {
-//    public override string Description {
-//      get { return @"Implements the functionality of SGAMain with fixed control structures. Operators like selection, crossover, mutation and evaluation are delegated."; }
-//    }
-
-//    // Shared
-//    Sorter sorter;
-
-//    // CreateChildren
-//    Counter counter;
-//    IRandom random;
-//    DoubleData probability;
-//    ChildrenInitializer ci;
-//    OperatorBase crossover;
-//    OperatorBase mutator;
-//    OperatorBase evaluator;
-//    SubScopesRemover sr;
-//    StochasticBranch sb;
-
-//    // CreateReplacement
-//    LeftSelector ls;
-//    RightReducer rr;
-//    RightSelector rs;
-//    LeftReducer lr;
-//    MergingReducer mr;
-
-
-//    //long[] timesExecuteCreateChildren;
-//    public FixedSGAMain()
-//      : base() {
-//      AddVariableInfo(new VariableInfo("Selector", "Selection strategy for SGA", typeof(OperatorBase), VariableKind.In));
-//      AddVariableInfo(new VariableInfo("MaximumGenerations", "Maximum number of generations to create", typeof(IntData), VariableKind.In));
-//      AddVariableInfo(new VariableInfo("Generations", "Number of processed generations", typeof(IntData), VariableKind.In | VariableKind.Out));
-
-//      Name = "FixedSGAMain";
-
-//      sorter = new Sorter();
-//      sorter.GetVariableInfo("Descending").ActualName = "Maximization";
-//      sorter.GetVariableInfo("Value").ActualName = "Quality";
-
-//      InitVariablesForCreateChildren();
-//      InitVariablesForCreateReplacement();
-//    }
-
-//    private void InitVariablesForCreateReplacement() {
-//      ls = new LeftSelector();
-//      rr = new RightReducer();
-//      rs = new RightSelector();
-//      lr = new LeftReducer();
-//      mr = new MergingReducer();
-
-//      ls.GetVariableInfo("Selected").ActualName = "Elites";
-//      rs.GetVariableInfo("Selected").ActualName = "Elites";
-
-//    }
-
-//    protected void InitVariablesForCreateChildren() {
-//      // variables for create children
-//      ci = new ChildrenInitializer();
-
-//      // variables infos
-//      AddVariableInfo(new VariableInfo("Random", "Pseudo random number generator", typeof(IRandom), VariableKind.In));
-//      AddVariableInfo(new VariableInfo("MutationRate", "Probability to choose first branch", typeof(DoubleData), VariableKind.In));
-//      AddVariableInfo(new VariableInfo("Crossover", "Crossover strategy for SGA", typeof(OperatorBase), VariableKind.In));
-//      AddVariableInfo(new VariableInfo("Mutator", "Mutation strategy for SGA", typeof(OperatorBase), VariableKind.In));
-//      AddVariableInfo(new VariableInfo("Evaluator", "Evaluation strategy for SGA", typeof(OperatorBase), VariableKind.In));
-
-//      sr = new SubScopesRemover();
-//      sr.GetVariableInfo("SubScopeIndex").Local = true;
-
-//      counter = new Counter();
-//      counter.GetVariableInfo("Value").ActualName = "EvaluatedSolutions";
-//    }
-
-//    public override IOperation Apply(IScope scope) {
-//      base.Apply(scope);
-//      WorkerMethod(scope);   
-//      if (Canceled) {
-//        return new AtomicOperation(this, scope);
-//      }
-
-//      return null;
-//    } // Apply
-
-//    //private void WorkerMethod(object o) {
-//    private void WorkerMethod(IScope scope)  {
-//      try {
-//        //IScope scope = o as IScope;
-//        Stopwatch swApply = new Stopwatch();
-//        swApply.Start();
-//        for (int i = 0; i < SubOperators.Count; i++) {
-//          if (scope.GetVariable(SubOperators[i].Name) != null)
-//            scope.RemoveVariable(SubOperators[i].Name);
-//          scope.AddVariable(new Variable(SubOperators[i].Name, SubOperators[i]));
-//        }
-
-//        OperatorBase selector = (OperatorBase)GetVariableValue("Selector", scope, true);
-//        QualityLogger ql = new QualityLogger();
-
-//        BestAverageWorstQualityCalculator bawqc = new BestAverageWorstQualityCalculator();
-//        DataCollector dc = new DataCollector();
-//        ItemList<StringData> names = dc.GetVariable("VariableNames").GetValue<ItemList<StringData>>();
-//        names.Add(new StringData("BestQuality"));
-//        names.Add(new StringData("AverageQuality"));
-//        names.Add(new StringData("WorstQuality"));
-
-//        LinechartInjector lci = new LinechartInjector();
-//        lci.GetVariableInfo("Linechart").ActualName = "Quality Linechart";
-//        lci.GetVariable("NumberOfLines").GetValue<IntData>().Data = 3;
-
-//        LessThanComparator ltc = new LessThanComparator();
-//        ltc.GetVariableInfo("LeftSide").ActualName = "Generations";
-//        ltc.GetVariableInfo("RightSide").ActualName = "MaximumGenerations";
-//        ltc.GetVariableInfo("Result").ActualName = "GenerationsCondition";
-
-//        IntData maxGenerations = GetVariableValue<IntData>("MaximumGenerations", scope, true);
-//        IntData nrOfGenerations = GetVariableValue<IntData>("Generations", scope, true);
-//        nrOfGenerations.Data = 0;
-         
-//        // fetch variables from scope for create children
-//        InitializeExecuteCreateChildren(scope);
-//        try {
-//          //for (int i = nrOfGenerations.Data; i < maxGenerations.Data; i++) {
-//          //  Execute(selector, scope, false);
-//          //  ExecuteCreateChildrenWithFixedControlStructures(scope.SubScopes[1]);
-//          //  ExecuteCreateReplacementWithFixedConstrolStructures(scope);
-//          //  ql.Execute(scope);
-//          //  bawqc.Execute(scope);
-//          //  dc.Execute(scope);
-//          //  lci.Execute(scope);
-//          //  nrOfGenerations.Data++;
-//          //} // for i
-//          if (!InExecution) {
-//            for (int i = 0; i < maxGenerations.Data; i++) {
-//              VirtualScope sd = new VirtualScope(scope);
-//              Execute(selector, sd);
-//              ExecuteCreateChildrenWithFixedControlStructures(new VirtualScope(scope, 1));
-//              ExecuteCreateReplacementWithFixedConstrolStructures(sd);
-//              Execute(ql, sd);
-//              Execute(bawqc, sd);
-//              Execute(dc, sd);
-//              Execute(lci, sd);
-//              nrOfGenerations.Data++;
-//            } // for i   
-//          } // if 
-
-//          Execute();
-//        } // try
-//        catch (CancelException) {
-//          Console.WriteLine("Micro engine aborted by cancel flag.");
-//        } // catch
-
-
-//        //for (int i = nrOfGenerations.Data; i < maxGenerations.Data && !Canceled; i++) {
-//        //  if (Canceled) {
-//        //    executionPointer.Data = -1;
-//        //    continue;
-//        //  }
-//        //  if (executionPointer.Data < 0)
-//        //    Execute(selector, scope);
-
-//        //  if (Canceled) {
-//        //    executionPointer.Data = 0;
-//        //    continue;
-//        //  }
-//        //  if (executionPointer.Data < 1)
-//        //    ExecuteCreateChildrenWithFixedControlStructures(scope.SubScopes[1]);
-
-//        //  if (Canceled) {
-//        //    executionPointer.Data = 1;
-//        //    continue;
-//        //  }
-//        //  if (executionPointer.Data < 2)
-//        //    ExecuteCreateReplacementWithFixedConstrolStructures(scope);
-
-//        //  if (Canceled) {
-//        //    executionPointer.Data = 2;
-//        //    continue;
-//        //  }
-//        //  if (executionPointer.Data < 3) {
-//        //    ql.Execute(scope);
-//        //    bawqc.Execute(scope);
-//        //    dc.Execute(scope);
-//        //    lci.Execute(scope);
-//        //    nrOfGenerations.Data++;
-//        //  }
-//        //  executionPointer.Data = -1;
-//        //} // for i
-
-
-//        //Stopwatch watch = new Stopwatch();
-//        //long[] times = new long[10];
-//        //timesExecuteCreateChildren = new long[10];
-//        //for (int i = nrOfGenerations.Data; i < maxGenerations.Data && !Canceled; i++) {
-//        //  watch.Start();
-//        //  selector.Execute(scope);
-//        //  watch.Stop();
-//        //  times[0] += watch.ElapsedTicks;
-//        //  watch.Reset();
-//        //  watch.Start();
-//        //  ExecuteCreateChildrenWithFixedControlStructures(scope.SubScopes[1]);
-//        //  watch.Stop();
-//        //  times[1] += watch.ElapsedTicks;
-//        //  watch.Reset();
-//        //  watch.Start();
-//        //  ExecuteCreateReplacementWithFixedConstrolStructures(scope);
-//        //  watch.Stop();
-//        //  times[2] += watch.ElapsedTicks;
-//        //  watch.Reset();
-//        //  watch.Start();
-//        //  ql.Execute(scope);
-//        //  watch.Stop();
-//        //  times[3] += watch.ElapsedTicks;
-//        //  watch.Reset();
-//        //  watch.Start();
-//        //  bawqc.Execute(scope);
-//        //  watch.Stop();
-//        //  times[4] += watch.ElapsedTicks;
-//        //  watch.Reset();
-//        //  watch.Start();
-//        //  dc.Execute(scope);
-//        //  watch.Stop();
-//        //  times[5] += watch.ElapsedTicks;
-//        //  watch.Reset();
-//        //  watch.Start();
-//        //  lci.Execute(scope);
-//        //  watch.Stop();
-//        //  times[6] += watch.ElapsedTicks;
-//        //  watch.Reset();
-//        //  watch.Start();
-//        //  nrOfGenerations.Data++;
-//        //}
-
-//        swApply.Stop();
-//        Console.WriteLine("SGAMain.Apply(): {0}", swApply.Elapsed);
-
-//        //if (Canceled) {
-//        //  return new AtomicOperation(this, scope);
-//        //}
-
-//        //return null;
-
-//      }
-//      catch (ThreadAbortException) {
-
-//        throw;
-//      }
-//    } // Apply
-
-
-
-//    /// <summary>
-//    /// Initializes some variables needed before the execution of create children
-//    /// </summary>
-//    /// <param name="scope"></param>
-//    private void InitializeExecuteCreateChildren(IScope scope) {
-//      crossover = (OperatorBase)GetVariableValue("Crossover", scope, true);
-//      mutator = (OperatorBase)GetVariableValue("Mutator", scope, true);
-//      evaluator = GetVariableValue<OperatorBase>("Evaluator", scope, true);
-
-//      random = GetVariableValue<IRandom>("Random", scope, true);
-//      probability = GetVariableValue<DoubleData>("MutationRate", scope, true);
-//      ci = new ChildrenInitializer();
-//      sb = new StochasticBranch();
-//      sb.GetVariableInfo("Probability").ActualName = "MutationRate";
-//      sb.AddSubOperator(mutator);
-
-//    }
-
-//    /// <summary>
-//    /// 
-//    /// </summary>
-//    /// <param name="scope"></param>
-    
-//    protected void ExecuteCreateChildrenWithFixedControlStructures(VirtualScope scope) {
-//    //protected void ExecuteCreateChildrenWithFixedControlStructures(IScope scope) {
-//      //// ChildrenInitializer
-//      //ci.Apply(scope);
-//      //// UniformSequentialSubScopesProcessor
-//      //foreach (IScope s in scope.SubScopes) {
-//      //  Execute(crossover, s, false);
-//      //  // Stochastic Branch
-//      //  if (random.NextDouble() < probability.Data)
-//      //    Execute(mutator, s, false);
-//      //  Execute(evaluator, s, false);
-//      //  sr.Execute(s);
-//      //  counter.Execute(s);
-//      //} // foreach
-
-//      //sorter.Execute(scope);
-//      //VirtualScope s;
-      
-//      // ChildrenInitializer
-//      Execute(ci, scope);
-//      // UniformSequentialSubScopesProcessor
-//      //foreach (IScope s in scope.SubScopes) {
-//      //  s = new VirtualScope(scope, i); //scope.SubScopes[i];
-//      //  Execute(crossover, s);
-//      //  // Stochastic Branch
-//      //  //if (random.NextDouble() < probability.Data)
-//      //  //  Execute(mutator, s);
-//      //  Execute(evaluator, s);
-//      //  Execute(sr, s);
-//      //  Execute(counter, s);
-//      //} // foreach
-
-//      SubScopesProcessor fl = new SubScopesProcessor(scope);
-//      fl.AddOperator(crossover);
-//      fl.AddOperator(sb);
-//      fl.AddOperator(evaluator);
-//      fl.AddOperator(sr);
-//      fl.AddOperator(counter);
-//      Execute(fl, scope);
-
-//      Execute(sorter, scope);
-//    } // ExecuteCreateChildrenHWCS
-
-//    private void ExecuteCreateReplacementWithFixedConstrolStructures(VirtualScope scope) {
-//    //private void ExecuteCreateReplacementWithFixedConstrolStructures(IScope scope) {
-//      //// SequentialSubScopesProcessor
-//      //ls.Execute(scope.SubScopes[0]);
-//      //rr.Execute(scope.SubScopes[0]);
-
-//      //rs.Execute(scope.SubScopes[1]);
-//      //lr.Execute(scope.SubScopes[1]);
-
-//      //mr.Execute(scope);
-//      //sorter.Execute(scope);
-
-//      //Execute(ls, scope.SubScopes[0], false);
-//      //Execute(rr, scope.SubScopes[0], false);
-
-//      //Execute(rs, scope.SubScopes[1], false);
-//      //Execute(lr, scope.SubScopes[1], false);
-
-//      //Execute(mr, scope, false);
-//      //Execute(sorter, scope, false);
-//      VirtualScope sd = new VirtualScope(scope, 0);
-//      Execute(ls, sd);
-//      Execute(rr, sd);
-
-//      sd = new VirtualScope(scope, 1);
-//      Execute(rs, sd);
-//      Execute(lr, sd);
-
-//      Execute(mr, scope);
-//      Execute(sorter, scope);
-
-
-//    } // ExecuteCreateReplacementWithFixedConstrolStructures
-
-//    //public override void Abort() {
-//    //  base.Abort();
-//    //  executionThread.Abort();
-//    //} // Abort
-
-//  } // class FixedSGAMain
-//} // namespace HeuristicLab.FixedOperators
Index: trunk/sources/HeuristicLab.FixedOperators/3.2/CreateChildren.cs
===================================================================
--- trunk/sources/HeuristicLab.FixedOperators/3.2/CreateChildren.cs	(revision 2075)
+++ 	(revision )
@@ -1,97 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Permutation;
-using HeuristicLab.Evolutionary;
-using HeuristicLab.Operators;
-using HeuristicLab.Routing.TSP;
-
-namespace HeuristicLab.FixedOperators {
-  class CreateChildren : OperatorBase {
-    ChildrenInitializer ci;
-    OperatorBase crossover;
-    OperatorBase mutator;
-    OperatorBase evaluator;
-    SubScopesRemover sr;
-    Counter counter;
-    Sorter sorter;
-    IRandom random;
-    DoubleData probability;
-    
-    public override string Description {
-      get { return @"Implements the control structures of CreateChildren hard wired. Operators are delegated."; }
-    }
-
-    public CreateChildren()
-      : base() {
-      ci = new ChildrenInitializer();
-  
-      // variables infos
-      AddVariableInfo(new VariableInfo("Random", "Pseudo random number generator", typeof(IRandom), VariableKind.In));
-      AddVariableInfo(new VariableInfo("MutationRate", "Probability to choose first branch", typeof(DoubleData), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Crossover", "Crossover strategy for SGA", typeof(OperatorBase), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Mutator", "Mutation strategy for SGA", typeof(OperatorBase), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Evaluator", "Evaluation strategy for SGA", typeof(OperatorBase), VariableKind.In));
-
-      sr = new SubScopesRemover();
-      sr.GetVariableInfo("SubScopeIndex").Local = true;
-
-      counter = new Counter();
-      counter.GetVariableInfo("Value").ActualName = "EvaluatedSolutions";
-
-      sorter = new Sorter();
-      sorter.GetVariableInfo("Descending").ActualName = "Maximization";
-      sorter.GetVariableInfo("Value").ActualName = "Quality";
-    }
-
-    public override IOperation Apply(IScope scope) {
-      crossover = (OperatorBase)GetVariableValue("Crossover", scope, true);
-      mutator = (OperatorBase)GetVariableValue("Mutator", scope, true);
-      evaluator = GetVariableValue<OperatorBase>("Evaluator", scope, true);
-
-      random = GetVariableValue<IRandom>("Random", scope, true);
-      probability = GetVariableValue<DoubleData>("MutationRate", scope, true);
-
-      // ChildrenInitializer
-      ci.Apply(scope);
-      // UniformSequentialSubScopesProcessor
-      foreach (IScope s in scope.SubScopes) {
-        crossover.Execute(s);
-        // Stochastic Branch
-        if(random.NextDouble() < probability.Data)
-          mutator.Execute(s);
-        evaluator.Execute(s);
-        sr.Execute(s);
-        counter.Execute(s);
-      } // foreach
-
-      sorter.Execute(scope);
-
-      return null;
-    } // Apply
-  } // class CreateChildren
-} // namespace HeuristicLab.FixedOperators
Index: trunk/sources/HeuristicLab.FixedOperators/3.2/CreateChildrenHardWired.cs
===================================================================
--- trunk/sources/HeuristicLab.FixedOperators/3.2/CreateChildrenHardWired.cs	(revision 2075)
+++ 	(revision )
@@ -1,122 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Permutation;
-using HeuristicLab.Evolutionary;
-using HeuristicLab.Operators;
-using HeuristicLab.Routing.TSP;
-
-namespace HeuristicLab.FixedOperators {
-  class CreateChildrenHardWired : OperatorBase {
-    ChildrenInitializer ci;
-    OperatorBase crossover;
-    OperatorBase mutator;
-    OperatorBase evaluator;
-    IRandom random;
-    DoubleData probability;
-
-    public override string Description {
-      get { return @"Implements the functionality CreateChildren hard wired. Operators like Crossover, Mutation and Evaluation are delegated."; }
-    }
-
-    public CreateChildrenHardWired()
-      : base() {
-      ci = new ChildrenInitializer();
-
-      // variables infos
-      AddVariableInfo(new VariableInfo("Random", "Pseudo random number generator", typeof(IRandom), VariableKind.In));
-      AddVariableInfo(new VariableInfo("MutationRate", "Probability to choose first branch", typeof(DoubleData), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Crossover", "Crossover strategy for SGA", typeof(OperatorBase), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Mutator", "Mutation strategy for SGA", typeof(OperatorBase), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Evaluator", "Evaluation strategy for SGA", typeof(OperatorBase), VariableKind.In));
-      AddVariableInfo(new VariableInfo("EvaluatedSolutions", "Number of evaluated solutions", typeof(IntData), VariableKind.In | VariableKind.Out));
-      AddVariableInfo(new VariableInfo("Maximization", "Sort in descending order", typeof(BoolData), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Quality", "Sorting value", typeof(DoubleData), VariableKind.In));
-    }
-
-    public override IOperation Apply(IScope scope) {
-      crossover = (OperatorBase)GetVariableValue("Crossover", scope, true);
-      mutator = (OperatorBase)GetVariableValue("Mutator", scope, true);
-      evaluator = GetVariableValue<OperatorBase>("Evaluator", scope, true);
-
-      random = GetVariableValue<IRandom>("Random", scope, true);
-      probability = GetVariableValue<DoubleData>("MutationRate", scope, true);
-      IntData value = GetVariableValue<IntData>("EvaluatedSolutions", scope, true);
-      int counter = value.Data;
-
-      // ChildrenInitializer
-      ci.Apply(scope);
-      // UniformSequentialSubScopesProcessor
-      foreach (IScope s in scope.SubScopes) {
-        if (crossover.Execute(s) != null)
-          throw new InvalidOperationException("ERROR: no support for combined operators!");
-
-        // Stochastic Branch
-        if (random.NextDouble() < probability.Data) {
-          if (mutator.Execute(s) != null)
-            throw new InvalidOperationException("ERROR: no support for combined operators!");
-        }
-
-        if (evaluator.Execute(s) != null)
-          throw new InvalidOperationException("ERROR: no support for combined operators!");
-
-        // subscopes remover
-        while (s.SubScopes.Count > 0)
-          s.RemoveSubScope(s.SubScopes[0]);
-
-        counter++;
-      } // foreach
-
-      // write back counter variable to evaluated solutions
-      value.Data = counter;
-
-      // sort scopes
-      bool descending = GetVariableValue<BoolData>("Maximization", scope, true).Data;
-      double[] keys = new double[scope.SubScopes.Count];
-      int[] sequence = new int[keys.Length];
-
-      for (int i = 0; i < keys.Length; i++) {
-        keys[i] = scope.SubScopes[i].GetVariableValue<DoubleData>("Quality", false).Data;
-        sequence[i] = i;
-      }
-
-      Array.Sort<double, int>(keys, sequence);
-
-      if (descending) {
-        int temp;
-        for (int i = 0; i < sequence.Length / 2; i++) {
-          temp = sequence[i];
-          sequence[i] = sequence[sequence.Length - 1 - i];
-          sequence[sequence.Length - 1 - i] = temp;
-        }
-      }
-      scope.ReorderSubScopes(sequence);
-
-      return null;
-    } // Apply
-  } // class CreateChildrenHardWired
-} // namespace HeuristicLab.FixedOperators
Index: trunk/sources/HeuristicLab.FixedOperators/3.2/CreateReplacement.cs
===================================================================
--- trunk/sources/HeuristicLab.FixedOperators/3.2/CreateReplacement.cs	(revision 2075)
+++ 	(revision )
@@ -1,78 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Permutation;
-using HeuristicLab.Evolutionary;
-using HeuristicLab.Operators;
-using HeuristicLab.Routing.TSP;
-using HeuristicLab.Selection;
-using System.Collections;
-
-namespace HeuristicLab.FixedOperators {
-  class CreateReplacement : OperatorBase {
-    LeftSelector ls;
-    RightReducer rr;
-    RightSelector rs;
-    LeftReducer lr;
-    MergingReducer mr;
-    Sorter sorter;
-
-    public override string Description {
-      get { return @"Implements the control structures of CreateReplacement hard wired. Operators are delegated."; }
-    }
-
-    public CreateReplacement()
-      : base() {
-      ls = new LeftSelector();
-      rr = new RightReducer();
-      rs = new RightSelector();
-      lr = new LeftReducer();
-      mr = new MergingReducer();
-      sorter = new Sorter();
-
-      sorter.GetVariableInfo("Descending").ActualName = "Maximization";
-      sorter.GetVariableInfo("Value").ActualName = "Quality";
-
-      ls.GetVariableInfo("Selected").ActualName = "Elites";
-      rs.GetVariableInfo("Selected").ActualName = "Elites";
-    }
-
-    public override IOperation Apply(IScope scope) {
-      // SequentialSubScopesProcessor
-      ls.Execute(scope.SubScopes[0]);
-      rr.Execute(scope.SubScopes[0]);
-
-      rs.Execute(scope.SubScopes[1]);
-      lr.Execute(scope.SubScopes[1]);
-
-      mr.Execute(scope);
-      sorter.Execute(scope);
-
-      return null;
-    } // Apply
-  } // class CreateReplacement
-} // namespace HeuristicLab.FixedOperators
Index: trunk/sources/HeuristicLab.FixedOperators/3.2/FixedAllSGAMain.cs
===================================================================
--- trunk/sources/HeuristicLab.FixedOperators/3.2/FixedAllSGAMain.cs	(revision 2075)
+++ 	(revision )
@@ -1,251 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
- *
- * This file is part of HeuristicLab.
- *
- * HeuristicLab is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * HeuristicLab is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
- */
-#endregion
-
-using System;
-using System.Collections.Generic;
-using System.Text;
-using System.Linq;
-using HeuristicLab.Core;
-using HeuristicLab.Data;
-using HeuristicLab.Permutation;
-using HeuristicLab.Evolutionary;
-using HeuristicLab.Operators;
-using HeuristicLab.Routing.TSP;
-using HeuristicLab.Logging;
-using System.Diagnostics;
-
-namespace HeuristicLab.FixedOperators {
-  class FixedAllSGAMain : CombinedOperator {
-    public override string Description {
-      get { return @"Implements the functionality of SGAMain with fixed control structures. Operators like selection, crossover, mutation and evaluation are delegated."; }
-    }
-
-    ChildrenInitializer ci;
-    OperatorBase crossover;
-    OperatorBase mutator;
-    OperatorBase evaluator;
-    IRandom random;
-    DoubleData probability;
-
-    long[] timesExecuteCreateChildren;
-
-    public FixedAllSGAMain()
-      : base() {
-      AddVariableInfo(new VariableInfo("Selector", "Selection strategy for SGA", typeof(OperatorBase), VariableKind.In));
-      AddVariableInfo(new VariableInfo("MaximumGenerations", "Maximum number of generations to create", typeof(IntData), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Generations", "Number of processed generations", typeof(IntData), VariableKind.In | VariableKind.Out));
-      Name = "FixedAllSGAMain";
-      InitCreateChildrenHW();
-
-    }
-
-    private void InitCreateChildrenHW() {
-      // variables infos
-      AddVariableInfo(new VariableInfo("Random", "Pseudo random number generator", typeof(IRandom), VariableKind.In));
-      AddVariableInfo(new VariableInfo("MutationRate", "Probability to choose first branch", typeof(DoubleData), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Crossover", "Crossover strategy for SGA", typeof(OperatorBase), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Mutator", "Mutation strategy for SGA", typeof(OperatorBase), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Evaluator", "Evaluation strategy for SGA", typeof(OperatorBase), VariableKind.In));
-      AddVariableInfo(new VariableInfo("EvaluatedSolutions", "Number of evaluated solutions", typeof(IntData), VariableKind.In | VariableKind.Out));
-      AddVariableInfo(new VariableInfo("Maximization", "Sort in descending order", typeof(BoolData), VariableKind.In));
-      AddVariableInfo(new VariableInfo("Quality", "Sorting value", typeof(DoubleData), VariableKind.In));
-    }
-
-    public override IOperation Apply(IScope scope) {
-      Stopwatch swApply = new Stopwatch();
-      swApply.Start();
-      //base.Apply(scope); // noch nachfragen ob das auch in ordnung wäre
-      for (int i = 0; i < SubOperators.Count; i++) {
-        if (scope.GetVariable(SubOperators[i].Name) != null)
-          scope.RemoveVariable(SubOperators[i].Name);
-        scope.AddVariable(new Variable(SubOperators[i].Name, SubOperators[i]));
-      }
-
-      OperatorBase selector = (OperatorBase)GetVariableValue("Selector", scope, true);
-      OperatorBase createReplacement = new CreateReplacement();
-      QualityLogger ql = new QualityLogger();
-
-      BestAverageWorstQualityCalculator bawqc = new BestAverageWorstQualityCalculator();
-      DataCollector dc = new DataCollector();
-      ItemList<StringData> names = dc.GetVariable("VariableNames").GetValue<ItemList<StringData>>();
-      names.Add(new StringData("BestQuality"));
-      names.Add(new StringData("AverageQuality"));
-      names.Add(new StringData("WorstQuality"));
-
-      LinechartInjector lci = new LinechartInjector();
-      lci.GetVariableInfo("Linechart").ActualName = "Quality Linechart";
-      lci.GetVariable("NumberOfLines").GetValue<IntData>().Data = 3;
-
-      Counter c = new Counter();
-      c.GetVariableInfo("Value").ActualName = "Generations";
-
-      LessThanComparator ltc = new LessThanComparator();
-      ltc.GetVariableInfo("LeftSide").ActualName = "Generations";
-      ltc.GetVariableInfo("RightSide").ActualName = "MaximumGenerations";
-      ltc.GetVariableInfo("Result").ActualName = "GenerationsCondition";
-
-      IntData maxGenerations = GetVariableValue<IntData>("MaximumGenerations", scope, true);
-      IntData nrOfGenerations = GetVariableValue<IntData>("Generations", scope, true);
-
-      InitializeExecuteCreateChildren(scope);
-      IntData evaluatedSolutions = GetVariableValue<IntData>("EvaluatedSolutions", scope, true);
-      Stopwatch watch = new Stopwatch();
-      long[] times = new long[10];
-      timesExecuteCreateChildren = new long[10];
-      for (int i = 0; i < maxGenerations.Data; i++) {
-        watch.Start();
-        selector.Execute(scope);
-        watch.Stop();
-        times[0] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        ExecuteCreateChildren(scope.SubScopes[1], evaluatedSolutions);
-        watch.Stop();
-        times[1] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        createReplacement.Execute(scope);
-        watch.Stop();
-        times[2] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        ql.Execute(scope);
-        watch.Stop();
-        times[3] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        bawqc.Execute(scope);
-        watch.Stop();
-        times[4] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        dc.Execute(scope);
-        watch.Stop();
-        times[5] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        lci.Execute(scope);
-        watch.Stop();
-        times[6] += watch.ElapsedTicks;
-        watch.Reset();
-        watch.Start();
-        nrOfGenerations.Data++;
-      }
-
-      swApply.Stop();
-      Console.WriteLine("SGAMain.Apply(): {0}", swApply.Elapsed);
-      return null;
-    } // Apply
-
-    /// <summary>
-    /// Initializes some variables needed before the execution of create children
-    /// </summary>
-    /// <param name="scope"></param>
-    private void InitializeExecuteCreateChildren(IScope scope) {
-      crossover = (OperatorBase)GetVariableValue("Crossover", scope, true);
-      mutator = (OperatorBase)GetVariableValue("Mutator", scope, true);
-      evaluator = GetVariableValue<OperatorBase>("Evaluator", scope, true);
-
-      random = GetVariableValue<IRandom>("Random", scope, true);
-      probability = GetVariableValue<DoubleData>("MutationRate", scope, true);
-
-      ci = new ChildrenInitializer();
-    }
-
-    private void ExecuteCreateChildren(IScope scope, IntData evaluatedSolutions) {
-      //Stopwatch watch = new Stopwatch();
-      //long[] times = new long[10];
-      // ChildrenInitializer
-      //watch.Start();
-      ci.Apply(scope);
-      //watch.Stop();
-      //timesExecuteCreateChildren[0] += watch.ElapsedTicks;
-      //watch.Reset();
-      // UniformSequentialSubScopesProcessor
-      foreach (IScope s in scope.SubScopes) {
-        //watch.Start();
-        if (crossover.Execute(s) != null)
-          throw new InvalidOperationException("ERROR: no support for combined operators!");
-        //watch.Stop();
-        //timesExecuteCreateChildren[1] += watch.ElapsedTicks;
-        //watch.Reset();
-
-
-        // Stochastic Branch
-        if (random.NextDouble() < probability.Data) {
-          //watch.Start();
-          if (mutator.Execute(s) != null)
-            throw new InvalidOperationException("ERROR: no support for combined operators!");
-          //watch.Stop();
-          //timesExecuteCreateChildren[2] += watch.ElapsedTicks;
-          //watch.Reset();
-
-        }
-
-        //watch.Start();
-        if (evaluator.Execute(s) != null)
-          throw new InvalidOperationException("ERROR: no support for combined operators!");
-        //watch.Stop();
-        //timesExecuteCreateChildren[3] += watch.ElapsedTicks;
-        //watch.Reset();
-
-        // subscopes remover
-        //watch.Start();
-        while (s.SubScopes.Count > 0)
-          s.RemoveSubScope(s.SubScopes[0]);
-        //watch.Stop();
-        //timesExecuteCreateChildren[4] += watch.ElapsedTicks;
-        //watch.Reset();
-
-        evaluatedSolutions.Data++;
-      } // foreach
-
-      // sort scopes
-      bool descending = GetVariableValue<BoolData>("Maximization", scope, true).Data;
-
-      double[] keys = new double[scope.SubScopes.Count];
-      int[] sequence = new int[keys.Length];
-
-      for (int i = 0; i < keys.Length; i++) {
-        keys[i] = scope.SubScopes[i].GetVariableValue<DoubleData>("Quality", false).Data;
-        sequence[i] = i;
-      }
-
-      Array.Sort<double, int>(keys, sequence);
-
-      if (descending) {
-        int temp;
-        for (int i = 0; i < sequence.Length / 2; i++) {
-          temp = sequence[i];
-          sequence[i] = sequence[sequence.Length - 1 - i];
-          sequence[sequence.Length - 1 - i] = temp;
-        }
-      }
-      scope.ReorderSubScopes(sequence);
-      //watch.Stop();
-      //timesExecuteCreateChildren[5] += watch.ElapsedTicks;
-      //watch.Reset();
-
-      return;
-    } // ExecuteCreateChildrenHW
-
-  } // class AllFixedSGAMain
-} // namespace HeuristicLab.FixedOperators
Index: trunk/sources/HeuristicLab.FixedOperators/3.2/FixedOSGA.cs
===================================================================
--- trunk/sources/HeuristicLab.FixedOperators/3.2/FixedOSGA.cs	(revision 2076)
+++ trunk/sources/HeuristicLab.FixedOperators/3.2/FixedOSGA.cs	(revision 2076)
@@ -0,0 +1,132 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+#region Using directives
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Evolutionary;
+using HeuristicLab.Logging;
+using HeuristicLab.Operators;
+using HeuristicLab.Selection;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Selection.OffspringSelection;
+#endregion
+
+namespace HeuristicLab.FixedOperators {
+  class FixedOSGAMain : FixedSGAMain {
+    WeightedOffspringFitnessComparer wofc; 
+
+    public FixedOSGAMain()
+      : base() {
+      Name = "FixeOSGAMain";
+    }
+
+    /// <summary>
+    /// Apply
+    /// </summary>
+    public override IOperation Apply(IScope scope) {
+      base.Apply(scope);
+
+      #region Initialization
+      QualityLogger ql = new QualityLogger();
+
+      BestAverageWorstQualityCalculator bawqc = new BestAverageWorstQualityCalculator();
+      DataCollector dc = new DataCollector();
+      ItemList<StringData> names = dc.GetVariable("VariableNames").GetValue<ItemList<StringData>>();
+      names.Add(new StringData("BestQuality"));
+      names.Add(new StringData("AverageQuality"));
+      names.Add(new StringData("WorstQuality"));
+
+      LinechartInjector lci = new LinechartInjector();
+      lci.GetVariableInfo("Linechart").ActualName = "Quality Linechart";
+      lci.GetVariable("NumberOfLines").GetValue<IntData>().Data = 3;
+
+      IntData maxGenerations = GetVariableValue<IntData>("MaximumGenerations", scope, true);
+      IntData nrOfGenerations = GetVariableValue<IntData>("Generations", scope, true);
+
+      IntData subscopeNr;
+      try {
+        subscopeNr = scope.GetVariableValue<IntData>("SubScopeNr", false);
+      }
+      catch (Exception) {
+        subscopeNr = new IntData(0);
+        scope.AddVariable(new Variable("SubScopeNr", subscopeNr));
+      }
+
+      GetOperatorsFromScope(scope);
+
+      try {
+        sb.RemoveSubOperator(0);
+      }
+      catch (Exception) {
+      }
+      sb.AddSubOperator(mutator);
+
+
+      IScope s;
+      IScope s2;
+      #endregion
+
+
+      
+      
+      Execute(selector, scope);
+
+      ////// Create Children //////
+      // ChildrenInitializer
+      s = scope.SubScopes[1];
+
+      ChildrenInitializer ci = new ChildrenInitializer();
+      Execute(ci, s);
+
+      SaveExecutionPointer();
+      // UniformSequentialSubScopesProcessor
+      for (; subscopeNr.Data < s.SubScopes.Count; subscopeNr.Data++) {
+        SetExecutionPointerToLastSaved();
+
+        s2 = s.SubScopes[subscopeNr.Data];
+        Execute(crossover, s2);
+        // Stochastic Branch
+        Execute(sb, s2);  
+        Execute(evaluator, s2);
+        Execute(sr, s2);
+        Execute(counter, s2);
+        Execute(wofc, s2);
+        Execute(sr, s2);
+
+      } // foreach
+
+      Execute(sorter, s);
+      ////// END Create Children //////
+
+      DoReplacement(scope);
+      Execute(ql, scope);
+      Execute(bawqc, scope);
+      Execute(dc, scope);
+      Execute(lci, scope);
+
+
+    } // Apply
+  } // FixedOSGAMain
+} // namespace HeuristicLab.FixedOperators
Index: trunk/sources/HeuristicLab.FixedOperators/3.2/FixedSGAMain.cs
===================================================================
--- trunk/sources/HeuristicLab.FixedOperators/3.2/FixedSGAMain.cs	(revision 2075)
+++ trunk/sources/HeuristicLab.FixedOperators/3.2/FixedSGAMain.cs	(revision 2076)
@@ -44,35 +44,25 @@
 
     // Shared
-    Sorter sorter;
+    protected Sorter sorter;
 
     // CreateChildren
-    Counter counter;
-    IRandom random;
-    DoubleData probability;
-    ChildrenInitializer ci;
-    OperatorBase crossover;
-    OperatorBase mutator;
-    OperatorBase evaluator;
-    SubScopesRemover sr;
-    StochasticBranch sb;
-
-    OperatorBase selector;
+    protected Counter counter;
+    protected IRandom random;
+    protected DoubleData probability;
+    protected ChildrenInitializer ci;
+    protected OperatorBase crossover;
+    protected OperatorBase mutator;
+    protected OperatorBase evaluator;
+    protected SubScopesRemover sr;
+    protected StochasticBranch sb;
+
+    protected OperatorBase selector;
 
     // CreateReplacement
-    LeftSelector ls;
-    RightReducer rr;
-    RightSelector rs;
-    LeftReducer lr;
-    MergingReducer mr;
-
-    Thread executionThread;
-    Thread cancelThread;
-    
-    // for testing only
-    QualityLogger ql;
-    BestAverageWorstQualityCalculator bawqc;
-    DataCollector dc;
-    ItemList<StringData> names;
-    LinechartInjector lci;
+    protected LeftSelector ls;
+    protected RightReducer rr;
+    protected RightSelector rs;
+    protected LeftReducer lr;
+    protected MergingReducer mr;
 
     //long[] timesExecuteCreateChildren;
@@ -107,5 +97,5 @@
     }
 
-    protected void InitCreateChildren() {
+    private void InitCreateChildren() {
       // variables for create children
       ci = new ChildrenInitializer();
@@ -146,5 +136,5 @@
       IntData maxGenerations = GetVariableValue<IntData>("MaximumGenerations", scope, true);
       IntData nrOfGenerations = GetVariableValue<IntData>("Generations", scope, true);
-    
+
       IntData subscopeNr;
       try {
@@ -157,5 +147,5 @@
 
       ci = new ChildrenInitializer();
-      
+
 
       GetOperatorsFromScope(scope);
@@ -241,5 +231,5 @@
     /// </summary>
     /// <param name="scope"></param>
-    private void GetOperatorsFromScope(IScope scope) {
+    protected void GetOperatorsFromScope(IScope scope) {
       selector = (OperatorBase)GetVariableValue("Selector", scope, true);
       crossover = (OperatorBase)GetVariableValue("Crossover", scope, true);
@@ -272,5 +262,5 @@
     } // CreateChildren
 
-    private void DoReplacement(IScope scope) {
+    protected void DoReplacement(IScope scope) {
       //// SequentialSubScopesProcessor
       Execute(ls, scope.SubScopes[0]);
