Index: anches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/AlgorithmBase.cs
===================================================================
--- /branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/AlgorithmBase.cs	(revision 11790)
+++ 	(revision )
@@ -1,127 +1,0 @@
-﻿#region License Information
-/* HeuristicLab
- * Copyright (C) 2002-2014 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.Threading;
-using System.Threading.Tasks;
-using HeuristicLab.Common;
-using HeuristicLab.Optimization;
-using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
-
-namespace HeuristicLab.Algorithms.ParameterlessPopulationPyramid {
-  [StorableClass]
-  public abstract class AlgorithmBase : Algorithm, IStorableContent {
-    public string Filename { get; set; }
-
-    #region Properties
-    public override Type ProblemType {
-      get { return typeof(BinaryVectorProblem); }
-    }
-    public new BinaryVectorProblem Problem {
-      get { return (BinaryVectorProblem)base.Problem; }
-      set { base.Problem = value; }
-    }
-    [Storable]
-    private ResultCollection results;
-    public override ResultCollection Results {
-      get { return results; }
-    }
-    #endregion
-
-    private DateTime lastUpdateTime;
-
-    [StorableConstructor]
-    protected AlgorithmBase(bool deserializing) : base(deserializing) { }
-    protected AlgorithmBase(AlgorithmBase original, Cloner cloner)
-      : base(original, cloner) {
-      results = cloner.Clone(original.Results);
-    }
-    public AlgorithmBase()
-      : base() {
-      results = new ResultCollection();
-    }
-
-    public override void Prepare() {
-      if (Problem != null) base.Prepare();
-      results.Clear();
-      OnPrepared();
-    }
-
-    public override void Start() {
-      base.Start();
-      var cancellationTokenSource = new CancellationTokenSource();
-
-      OnStarted();
-      Task task = Task.Factory.StartNew(Run, cancellationTokenSource.Token, cancellationTokenSource.Token);
-      task.ContinueWith(t => {
-        try {
-          t.Wait();
-        }
-        catch (AggregateException ex) {
-          try {
-            ex.Flatten().Handle(x => x is OperationCanceledException);
-          }
-          catch (AggregateException remaining) {
-            if (remaining.InnerExceptions.Count == 1) OnExceptionOccurred(remaining.InnerExceptions[0]);
-            else OnExceptionOccurred(remaining);
-          }
-        }
-        cancellationTokenSource.Dispose();
-        cancellationTokenSource = null;
-        OnStopped();
-      });
-    }
-    private void Run(object state) {
-      CancellationToken cancellationToken = (CancellationToken)state;
-      lastUpdateTime = DateTime.UtcNow;
-      System.Timers.Timer timer = new System.Timers.Timer(250);
-      timer.AutoReset = true;
-      timer.Elapsed += new System.Timers.ElapsedEventHandler(timer_Elapsed);
-      timer.Start();
-      try {
-        Run();
-      }
-      finally {
-        timer.Elapsed -= new System.Timers.ElapsedEventHandler(timer_Elapsed);
-        timer.Stop();
-        ExecutionTime += DateTime.UtcNow - lastUpdateTime;
-      }
-
-      cancellationToken.ThrowIfCancellationRequested();
-    }
-    protected abstract void Run();
-    #region Events
-    protected override void OnProblemChanged() {
-      Problem.Reset += new EventHandler(Problem_Reset);
-      base.OnProblemChanged();
-    }
-    private void timer_Elapsed(object sender, System.Timers.ElapsedEventArgs e) {
-      System.Timers.Timer timer = (System.Timers.Timer)sender;
-      timer.Enabled = false;
-      DateTime now = DateTime.UtcNow;
-      ExecutionTime += now - lastUpdateTime;
-      lastUpdateTime = now;
-      timer.Enabled = true;
-    }
-    #endregion
-
-  }
-}
Index: /branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3.csproj
===================================================================
--- /branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3.csproj	(revision 11790)
+++ /branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3.csproj	(revision 11791)
@@ -103,5 +103,4 @@
   </ItemGroup>
   <ItemGroup>
-    <Compile Include="AlgorithmBase.cs" />
     <Compile Include="EnumerableBoolEqualityComparer.cs" />
     <Compile Include="LinkageCrossover.cs" />
Index: /branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HillClimber.cs
===================================================================
--- /branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HillClimber.cs	(revision 11790)
+++ /branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/HillClimber.cs	(revision 11791)
@@ -20,10 +20,11 @@
 #endregion
 
+using System;
 using System.Collections.Generic;
 using System.Linq;
+using System.Threading;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
 using HeuristicLab.Data;
-using HeuristicLab.Encodings.BinaryVectorEncoding;
 using HeuristicLab.Optimization;
 using HeuristicLab.Parameters;
@@ -37,9 +38,17 @@
   [Creatable("Parameterless Population Pyramid")]
   // In the GECCO paper, Section 2.1
-  public class HillClimber : AlgorithmBase {
+  public class HillClimber : BasicAlgorithm {
     [Storable]
     private IRandom random;
 
     private const string IterationsParameterName = "Iterations";
+
+    public override Type ProblemType {
+      get { return typeof(BinaryVectorProblem); }
+    }
+    public new BinaryVectorProblem Problem {
+      get { return (BinaryVectorProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
 
     public IFixedValueParameter<IntValue> IterationsParameter {
@@ -66,5 +75,5 @@
       Parameters.Add(new FixedValueParameter<IntValue>(IterationsParameterName, "", new IntValue(100)));
     }
-    protected override void Run() {
+    protected override void Run(CancellationToken cancellationToken) {
       var BestQuality = new DoubleValue(double.NaN);
       Results.Add(new Result("Best quality", BestQuality));
Index: /branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/ParameterlessPopulationPyramid.cs
===================================================================
--- /branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/ParameterlessPopulationPyramid.cs	(revision 11790)
+++ /branches/Parameter-less Population Pyramid/HeuristicLab.Algorithms.ParameterlessPopulationPyramid/3.3/ParameterlessPopulationPyramid.cs	(revision 11791)
@@ -22,7 +22,5 @@
 using System;
 using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Threading;
 using HeuristicLab.Analysis;
 using HeuristicLab.Common;
@@ -39,6 +37,13 @@
   [StorableClass]
   [Creatable("Parameterless Population Pyramid")]
-
-  public class ParameterlessPopulationPyramid : AlgorithmBase {
+  public class ParameterlessPopulationPyramid : BasicAlgorithm {
+    public override Type ProblemType {
+      get { return typeof(BinaryVectorProblem); }
+    }
+    public new BinaryVectorProblem Problem {
+      get { return (BinaryVectorProblem)base.Problem; }
+      set { base.Problem = value; }
+    }
+
     private readonly IRandom random = new MersenneTwister();
     private List<Population> pyramid;
@@ -51,4 +56,5 @@
     private const string MaximumIterationsParameterName = "Maximum Iterations";
     private const string MaximumEvaluationsParameterName = "Maximum Evaluations";
+    private const string MaximumRuntimeParameterName = "Maximum Runtime";
     private const string SeedParameterName = "Seed";
     private const string SetSeedRandomlyParameterName = "SetSeedRandomly";
@@ -61,4 +67,7 @@
     public IFixedValueParameter<IntValue> MaximumEvaluationsParameter {
       get { return (IFixedValueParameter<IntValue>)Parameters[MaximumEvaluationsParameterName]; }
+    }
+    public IFixedValueParameter<IntValue> MaximumRuntimeParameter {
+      get { return (IFixedValueParameter<IntValue>)Parameters[MaximumRuntimeParameterName]; }
     }
     public IFixedValueParameter<IntValue> SeedParameter {
@@ -75,15 +84,16 @@
       set { MaximumIterationsParameter.Value.Value = value; }
     }
-
     public int MaximumEvaluations {
       get { return MaximumEvaluationsParameter.Value.Value; }
       set { MaximumEvaluationsParameter.Value.Value = value; }
     }
-
+    public int MaximumRuntime {
+      get { return MaximumRuntimeParameter.Value.Value; }
+      set { MaximumRuntimeParameter.Value.Value = value; }
+    }
     public int Seed {
       get { return SeedParameter.Value.Value; }
       set { SeedParameter.Value.Value = value; }
     }
-
     public bool SetSeedRandomly {
       get { return SetSeedRandomlyParameter.Value.Value; }
@@ -151,7 +161,15 @@
     public ParameterlessPopulationPyramid() {
       Parameters.Add(new FixedValueParameter<IntValue>(MaximumIterationsParameterName, "", new IntValue(Int32.MaxValue)));
-      Parameters.Add(new FixedValueParameter<IntValue>(MaximumEvaluationsParameterName, "", new IntValue(10000)));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumEvaluationsParameterName, "", new IntValue(Int32.MaxValue)));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumRuntimeParameterName, "The maximum runtime in seconds after which the algorithm stops. Use -1 to specify no limit for the runtime", new IntValue(3600)));
       Parameters.Add(new FixedValueParameter<IntValue>(SeedParameterName, "The random seed used to initialize the new pseudo random number generator.", new IntValue(0)));
       Parameters.Add(new FixedValueParameter<BoolValue>(SetSeedRandomlyParameterName, "True if the random seed should be set to a random value, otherwise false.", new BoolValue(true)));
+    }
+
+    protected override void OnExecutionTimeChanged() {
+      base.OnExecutionTimeChanged();
+      if (CancellationTokenSource == null) return;
+      if (MaximumRuntime == -1) return;
+      if (ExecutionTime.TotalSeconds > MaximumRuntime) CancellationTokenSource.Cancel();
     }
 
@@ -190,5 +208,5 @@
     }
 
-    protected override void Run() {
+    protected override void Run(CancellationToken cancellationToken) {
       // Set up the algorithm
       if (SetSeedRandomly) Seed = new System.Random().Next();
@@ -225,7 +243,5 @@
         try {
           fitness = iterate();
-        }
-        catch (OperationCanceledException) {
-          throw;
+          cancellationToken.ThrowIfCancellationRequested();
         }
         finally {
