Index: /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj
===================================================================
--- /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj	(revision 12303)
+++ /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj	(revision 12304)
@@ -199,4 +199,10 @@
     </BootstrapperPackage>
   </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Termination\3.3\HeuristicLab.Termination-3.3.csproj">
+      <Project>{5AB79EEE-33AC-4E7A-8AF1-E409AB63A3D3}</Project>
+      <Name>HeuristicLab.Termination-3.3</Name>
+    </ProjectReference>
+  </ItemGroup>
   <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
   <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
Index: /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs
===================================================================
--- /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs	(revision 12303)
+++ /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs	(revision 12304)
@@ -33,4 +33,5 @@
 using HeuristicLab.PluginInfrastructure;
 using HeuristicLab.Random;
+using HeuristicLab.Termination;
 
 namespace HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm {
@@ -114,4 +115,7 @@
     private IFixedValueParameter<BoolValue> FillPopulationWithParentsParameter {
       get { return (IFixedValueParameter<BoolValue>)Parameters["FillPopulationWithParents"]; }
+    }
+    private IValueParameter<MultiTerminationCriterion> TerminationCriteriaParameter {
+      get { return (IValueParameter<MultiTerminationCriterion>)Parameters["TerminationCriteria"]; }
     }
     #endregion
@@ -264,4 +268,5 @@
       Parameters.Add(new ValueParameter<IntValue>("MaximumEvaluatedSolutions", "The maximum number of evaluated solutions (approximately).", new IntValue(int.MaxValue)));
       Parameters.Add(new FixedValueParameter<BoolValue>("FillPopulationWithParents", "True if the population should be filled with parent individual or false if worse children should be used when the maximum selection pressure is exceeded.", new BoolValue(false)) { Hidden = true });
+      Parameters.Add(new ValueParameter<MultiTerminationCriterion>("TerminationCriteria", "The termination criteria which sould be checked.", new MultiTerminationCriterion()));
 
       RandomCreator randomCreator = new RandomCreator();
@@ -321,4 +326,9 @@
       ParameterizeComparisonFactorModifiers();
 
+      var maximumGenerationsTerminationCriteria = new MaximumIterationsTerminationCriterion();
+      maximumGenerationsTerminationCriteria.IterationsParameter.ActualName = "Generations";
+      maximumGenerationsTerminationCriteria.MaximumIterationsParameter.ActualName = "MaximumGenerations";
+      TerminationCriteriaParameter.Value.Operators.Add(maximumGenerationsTerminationCriteria);
+
       qualityAnalyzer = new BestAverageWorstQualityAnalyzer();
       selectionPressureAnalyzer = new ValueAnalyzer();
Index: /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs
===================================================================
--- /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs	(revision 12303)
+++ /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithmMainLoop.cs	(revision 12304)
@@ -27,4 +27,5 @@
 using HeuristicLab.Parameters;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Termination;
 
 namespace HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm {
@@ -159,12 +160,13 @@
       OffspringSelectionGeneticAlgorithmMainOperator mainOperator = new OffspringSelectionGeneticAlgorithmMainOperator();
       IntCounter generationsCounter = new IntCounter();
-      Comparator maxGenerationsComparator = new Comparator();
-      Comparator maxSelectionPressureComparator = new Comparator();
-      Comparator maxEvaluatedSolutionsComparator = new Comparator();
+      //Comparator maxGenerationsComparator = new Comparator();
+      //Comparator maxSelectionPressureComparator = new Comparator();
+      //Comparator maxEvaluatedSolutionsComparator = new Comparator();
       Placeholder comparisonFactorModifier = new Placeholder();
       Placeholder analyzer2 = new Placeholder();
-      ConditionalBranch conditionalBranch1 = new ConditionalBranch();
-      ConditionalBranch conditionalBranch2 = new ConditionalBranch();
-      ConditionalBranch conditionalBranch3 = new ConditionalBranch();
+      var termination = new TerminationOperator();
+      //ConditionalBranch conditionalBranch1 = new ConditionalBranch();
+      //ConditionalBranch conditionalBranch2 = new ConditionalBranch();
+      //ConditionalBranch conditionalBranch3 = new ConditionalBranch();
 
       variableCreator.CollectedValues.Add(new ValueParameter<IntValue>("Generations", new IntValue(0))); // Class OffspringSelectionGeneticAlgorithm expects this to be called Generations
@@ -208,18 +210,18 @@
       generationsCounter.ValueParameter.ActualName = "Generations";
 
-      maxGenerationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
-      maxGenerationsComparator.LeftSideParameter.ActualName = "Generations";
-      maxGenerationsComparator.ResultParameter.ActualName = "TerminateMaximumGenerations";
-      maxGenerationsComparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;
-
-      maxSelectionPressureComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
-      maxSelectionPressureComparator.LeftSideParameter.ActualName = "SelectionPressure";
-      maxSelectionPressureComparator.ResultParameter.ActualName = "TerminateSelectionPressure";
-      maxSelectionPressureComparator.RightSideParameter.ActualName = MaximumSelectionPressureParameter.Name;
-
-      maxEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
-      maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = EvaluatedSolutionsParameter.Name;
-      maxEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions";
-      maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions";
+      //maxGenerationsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      //maxGenerationsComparator.LeftSideParameter.ActualName = "Generations";
+      //maxGenerationsComparator.ResultParameter.ActualName = "TerminateMaximumGenerations";
+      //maxGenerationsComparator.RightSideParameter.ActualName = MaximumGenerationsParameter.Name;
+
+      //maxSelectionPressureComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      //maxSelectionPressureComparator.LeftSideParameter.ActualName = "SelectionPressure";
+      //maxSelectionPressureComparator.ResultParameter.ActualName = "TerminateSelectionPressure";
+      //maxSelectionPressureComparator.RightSideParameter.ActualName = MaximumSelectionPressureParameter.Name;
+
+      //maxEvaluatedSolutionsComparator.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      //maxEvaluatedSolutionsComparator.LeftSideParameter.ActualName = EvaluatedSolutionsParameter.Name;
+      //maxEvaluatedSolutionsComparator.ResultParameter.ActualName = "TerminateEvaluatedSolutions";
+      //maxEvaluatedSolutionsComparator.RightSideParameter.ActualName = "MaximumEvaluatedSolutions";
 
       comparisonFactorModifier.Name = "Update ComparisonFactor (placeholder)";
@@ -229,12 +231,12 @@
       analyzer2.OperatorParameter.ActualName = AnalyzerParameter.Name;
 
-      conditionalBranch1.Name = "MaximumSelectionPressure reached?";
-      conditionalBranch1.ConditionParameter.ActualName = "TerminateSelectionPressure";
-
-      conditionalBranch2.Name = "MaximumGenerations reached?";
-      conditionalBranch2.ConditionParameter.ActualName = "TerminateMaximumGenerations";
-
-      conditionalBranch3.Name = "MaximumEvaluatedSolutions reached?";
-      conditionalBranch3.ConditionParameter.ActualName = "TerminateEvaluatedSolutions";
+      //conditionalBranch1.Name = "MaximumSelectionPressure reached?";
+      //conditionalBranch1.ConditionParameter.ActualName = "TerminateSelectionPressure";
+
+      //conditionalBranch2.Name = "MaximumGenerations reached?";
+      //conditionalBranch2.ConditionParameter.ActualName = "TerminateMaximumGenerations";
+
+      //conditionalBranch3.Name = "MaximumEvaluatedSolutions reached?";
+      //conditionalBranch3.ConditionParameter.ActualName = "TerminateEvaluatedSolutions";
       #endregion
 
@@ -246,19 +248,20 @@
       resultsCollector1.Successor = mainOperator;
       mainOperator.Successor = generationsCounter;
-      generationsCounter.Successor = maxGenerationsComparator;
-      maxGenerationsComparator.Successor = maxSelectionPressureComparator;
-      maxSelectionPressureComparator.Successor = maxEvaluatedSolutionsComparator;
-      maxEvaluatedSolutionsComparator.Successor = comparisonFactorModifier;
+      generationsCounter.Successor = comparisonFactorModifier; //maxGenerationsComparator;
+      //maxGenerationsComparator.Successor = maxSelectionPressureComparator;
+      //maxSelectionPressureComparator.Successor = maxEvaluatedSolutionsComparator;
+      //maxEvaluatedSolutionsComparator.Successor = comparisonFactorModifier;
       comparisonFactorModifier.Successor = analyzer2;
-      analyzer2.Successor = conditionalBranch1;
-      conditionalBranch1.FalseBranch = conditionalBranch2;
-      conditionalBranch1.TrueBranch = null;
-      conditionalBranch1.Successor = null;
-      conditionalBranch2.FalseBranch = conditionalBranch3;
-      conditionalBranch2.TrueBranch = null;
-      conditionalBranch2.Successor = null;
-      conditionalBranch3.FalseBranch = mainOperator;
-      conditionalBranch3.TrueBranch = null;
-      conditionalBranch3.Successor = null;
+      analyzer2.Successor = termination; //conditionalBranch1;
+      //conditionalBranch1.FalseBranch = conditionalBranch2;
+      //conditionalBranch1.TrueBranch = null;
+      //conditionalBranch1.Successor = null;
+      //conditionalBranch2.FalseBranch = conditionalBranch3;
+      //conditionalBranch2.TrueBranch = null;
+      //conditionalBranch2.Successor = null;
+      //conditionalBranch3.FalseBranch = mainOperator;
+      //conditionalBranch3.TrueBranch = null;
+      //conditionalBranch3.Successor = null;
+      termination.ContinueBranch = mainOperator;
       #endregion
     }
Index: /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/Plugin.cs.frame
===================================================================
--- /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/Plugin.cs.frame	(revision 12303)
+++ /branches/TerminationCriteria/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/Plugin.cs.frame	(revision 12304)
@@ -40,4 +40,5 @@
   [PluginDependency("HeuristicLab.Random", "3.3")]
   [PluginDependency("HeuristicLab.Selection", "3.3")]
+  [PluginDependency("HeuristicLab.Termination", "3.3")]
   public class HeuristicLabAlgorithmsOffspringSelectionGeneticAlgorithmPlugin : PluginBase {
   }
