Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/AdaptiveSamplingAlgorithm.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/AdaptiveSamplingAlgorithm.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/AdaptiveSamplingAlgorithm.cs	(revision 15343)
@@ -68,6 +68,4 @@
     private SolutionsCreator SolutionsCreator => OperatorGraph.Iterate().OfType<SolutionsCreator>().First();
     #endregion
-
-
 
     #region Operators
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteAdaptiveSamplingAlgorithm.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteAdaptiveSamplingAlgorithm.cs	(revision 15343)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteAdaptiveSamplingAlgorithm.cs	(revision 15343)
@@ -0,0 +1,550 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading;
+using HeuristicLab.Algorithms.DataAnalysis;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Optimization.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Algorithms.EGO {
+  [Item("Discrete Adaptive Sampling Algorithm (D-EGO)", "A discrete adaptive sampling algorithm.")]
+  [Creatable(CreatableAttribute.Categories.SingleSolutionAlgorithms, Priority = 150)]
+  [StorableClass]
+  public class DiscreteAdaptiveSamplingAlgorithm : HeuristicOptimizationEngineAlgorithm, IStorableContent {
+    public string Filename { get; set; }
+
+    #region Problem Properties
+    public override Type ProblemType => typeof(IHeuristicOptimizationProblem);
+    private ISingleObjectiveHeuristicOptimizationProblem SingleObjectiveProblem => Problem as ISingleObjectiveHeuristicOptimizationProblem;
+    #endregion
+
+    #region Parameter Names
+    private const string InfillCriterionParameterName = "InfillCriterion";
+    private const string InitialEvaluationsParameterName = "Initial Evaluations";
+    private const string TerminatorParameterName = "Terminator";
+    private const string SeedParameterName = "Seed";
+    private const string SetSeedRandomlyParameterName = "SetSeedRandomly";
+    private const string RegressionAlgorithmParameterName = "RegressionAlgorithm";
+    private const string InfillOptimizationAlgorithmParameterName = "InfillOptimizationAlgorithm";
+    private const string AnalyzerParameterName = "Analyzers";
+    private const string RemoveDuplicatesParamterName = "PerturbDuplicates";
+    private const string MaxModelSizeParameterName = "Maximal Model Size";
+    #endregion
+
+    #region Parameter Properties
+    public IFixedValueParameter<IntValue> SeedParameter => (IFixedValueParameter<IntValue>)Parameters[SeedParameterName];
+    public IFixedValueParameter<BoolValue> SetSeedRandomlyParameter => (IFixedValueParameter<BoolValue>)Parameters[SetSeedRandomlyParameterName];
+    public IFixedValueParameter<MultiTerminator> TerminatorParameter => (IFixedValueParameter<MultiTerminator>)Parameters[TerminatorParameterName];
+    public IFixedValueParameter<IntValue> InitialEvaluationsParameter => (IFixedValueParameter<IntValue>)Parameters[InitialEvaluationsParameterName];
+    public IConstrainedValueParameter<IInfillCriterion> InfillCriterionParameter => Parameters[InfillCriterionParameterName] as IConstrainedValueParameter<IInfillCriterion>;
+    public IValueParameter<Algorithm> InfillOptimizationAlgorithmParameter => Parameters[InfillOptimizationAlgorithmParameterName] as IValueParameter<Algorithm>;
+    public IValueParameter<IDataAnalysisAlgorithm<IRegressionProblem>> RegressionAlgorithmParameter => Parameters[RegressionAlgorithmParameterName] as IValueParameter<IDataAnalysisAlgorithm<IRegressionProblem>>;
+    public IFixedValueParameter<MultiAnalyzer> AnalyzerParameter => (IFixedValueParameter<MultiAnalyzer>)Parameters[AnalyzerParameterName];
+    public IFixedValueParameter<BoolValue> RemoveDuplicatesParameter => (IFixedValueParameter<BoolValue>)Parameters[RemoveDuplicatesParamterName];
+    public IFixedValueParameter<IntValue> MaxModelSizeParameter => (IFixedValueParameter<IntValue>)Parameters[MaxModelSizeParameterName];
+    #endregion
+
+    #region Properties
+    public int Seed => SeedParameter.Value.Value;
+    public bool SetSeedRandomly => SetSeedRandomlyParameter.Value.Value;
+    public MultiTerminator Terminator => TerminatorParameter.Value;
+    public MultiAnalyzer Analyzer => AnalyzerParameter.Value;
+    public int InitialEvaluations => InitialEvaluationsParameter.Value.Value;
+    public IInfillCriterion InfillCriterion => InfillCriterionParameter.Value;
+    public Algorithm InfillOptimizationAlgorithm => InfillOptimizationAlgorithmParameter.Value;
+    public IDataAnalysisAlgorithm<IRegressionProblem> RegressionAlgorithm => RegressionAlgorithmParameter.Value;
+    public bool RemoveDuplicates => RemoveDuplicatesParameter.Value.Value;
+    public int MaxModelSize => MaxModelSizeParameter.Value.Value;
+    private SolutionsCreator SolutionsCreator => OperatorGraph.Iterate().OfType<SolutionsCreator>().First();
+    #endregion
+
+
+
+    #region Operators
+
+    [Storable]
+    private OperatorList Operators;
+
+    #region Preconfigured Analyzers
+    [Storable]
+    private BestAverageWorstQualityAnalyzer singleObjectiveQualityAnalyzer;
+    [Storable]
+    private DiscreteCorrelationAnalyzer correlationAnalyzer;
+    [Storable]
+    private DiscreteEvaluatedSolutionsAnalyzer sampleAnalyzer;
+    [Storable]
+    private ModelQualityAnalyzer modelAnalyzer;
+    [Storable]
+    private VariableVariabilityAnalyzer variabilityAnalyzer;
+    [Storable]
+    private FitnessClusteringAnalyzer fitnessClusterAnalyzer;
+    #endregion
+
+    #region Preconfigured Terminators
+    [Storable]
+    private ComparisonTerminator<IntValue> evaluationsTerminator;
+    [Storable]
+    private ExecutionTimeTerminator executionTimeTerminator;
+    [Storable]
+    private SingleObjectiveQualityTerminator qualityTerminator;
+    #endregion
+
+    #region Problem-dependent Operators
+    [Storable]
+    private DiscreteSampleCollector sampleCollector;
+    [Storable]
+    private DiscreteInfillSolver infillSolver;
+    [Storable]
+    private SolutionsCreator infillSolutionsCreator;
+    #endregion
+    #endregion
+
+    #region Constructors
+    [StorableConstructor]
+    protected DiscreteAdaptiveSamplingAlgorithm(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    private void AfterDeserialization() {
+      Initialize();
+    }
+    protected DiscreteAdaptiveSamplingAlgorithm(DiscreteAdaptiveSamplingAlgorithm original, Cloner cloner) : base(original, cloner) {
+      singleObjectiveQualityAnalyzer = cloner.Clone(original.singleObjectiveQualityAnalyzer);
+      evaluationsTerminator = cloner.Clone(original.evaluationsTerminator);
+      qualityTerminator = cloner.Clone(original.qualityTerminator);
+      executionTimeTerminator = cloner.Clone(original.executionTimeTerminator);
+      sampleCollector = cloner.Clone(original.sampleCollector);
+      infillSolver = cloner.Clone(original.infillSolver);
+      infillSolutionsCreator = cloner.Clone(original.infillSolutionsCreator);
+      correlationAnalyzer = cloner.Clone(original.correlationAnalyzer);
+      sampleAnalyzer = cloner.Clone(original.sampleAnalyzer);
+      modelAnalyzer = cloner.Clone(original.modelAnalyzer);
+      fitnessClusterAnalyzer = cloner.Clone(original.fitnessClusterAnalyzer);
+
+      Operators = cloner.Clone(original.Operators);
+      Initialize();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DiscreteAdaptiveSamplingAlgorithm(this, cloner);
+    }
+    public DiscreteAdaptiveSamplingAlgorithm() {
+
+      #region Add parameters
+      var criteria = new ItemSet<IInfillCriterion> {
+        new AugmentedExpectedImprovement(),
+        new ExpectedImprovement(),
+        new ExpectedQuality(),
+        new ExpectedQuantileImprovement(),
+        new MinimalQuantileCriterium(),
+        new NeighbourDistance(),
+        new PluginExpectedImprovement()
+      };
+      var cmaes = new OffspringSelectionGeneticAlgorithm.OffspringSelectionGeneticAlgorithm {
+        MaximumGenerations = new IntValue(300),
+        PopulationSize = new IntValue(50),
+        Problem = new DiscreteInfillProblem()
+      };
+      var model = new GaussianProcessRegression {
+        Problem = new RegressionProblem()
+      };
+      model.CovarianceFunctionParameter.Value = new CovarianceRationalQuadraticIso();
+
+      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)));
+      Parameters.Add(new FixedValueParameter<MultiTerminator>("Terminator", "The termination criteria that defines if the algorithm should continue or stop.", new MultiTerminator()));
+      Parameters.Add(new FixedValueParameter<MultiAnalyzer>(AnalyzerParameterName, "The operator used to analyze the solutions each iteration.", new MultiAnalyzer()));
+      Parameters.Add(new FixedValueParameter<IntValue>(InitialEvaluationsParameterName, "The number of random solutions that are evaluated (in parallel) per iteration.", new IntValue(100)));
+      Parameters.Add(new ConstrainedValueParameter<IInfillCriterion>(InfillCriterionParameterName, "Decision what value should decide the next sample", criteria, criteria.OfType<ExpectedImprovement>().Single()));
+      Parameters.Add(new ValueParameter<IDataAnalysisAlgorithm<IRegressionProblem>>(RegressionAlgorithmParameterName, "The model used to approximate the problem", model));
+      Parameters.Add(new ValueParameter<Algorithm>(InfillOptimizationAlgorithmParameterName, "The algorithm used to solve the expected improvement subproblem", cmaes));
+      Parameters.Add(new FixedValueParameter<BoolValue>(RemoveDuplicatesParamterName, "Whether (almost) duplicate points in the dataset should be perturbed before evaluation (this greatly increases numerical stability for some model types)", new BoolValue(true)));
+      Parameters.Add(new FixedValueParameter<IntValue>("Maximal Model Size", "The maximum number of sample points used to build the model", new IntValue(-1)));
+      #endregion
+
+      #region Create operators
+      Operators = new OperatorList();
+
+      var randomCreator = new RandomCreator();
+      Operators.Add(randomCreator);
+      var variableCreator = new VariableCreator { Name = "Initialize Variables" };
+      Operators.Add(variableCreator);
+      var resultsCollector = new ResultsCollector();
+      Operators.Add(resultsCollector);
+      var solutionCreator = new SolutionsCreator { Name = "Create Initial Solutions" };
+      Operators.Add(solutionCreator);
+      var analyzerPlaceholder = new Placeholder { Name = "Analyzer (Placeholder)" };
+      Operators.Add(analyzerPlaceholder);
+      var evaluationsCounter = new IntCounter { Name = "Increment EvaluatedSolutions" };
+      Operators.Add(evaluationsCounter);
+      var solutionsCollectorProcessor = new UniformSubScopesProcessor { Name = "Collect Samples to Dataset" };
+      Operators.Add(solutionsCollectorProcessor);
+      var phaseChecker = new ConditionalBranch { Name = "Inital Samples evaluated?" };
+      Operators.Add(phaseChecker);
+      var initialPhaseChecker = new Comparator { Name = "Compare Initial Samples to evaluated Solutions" };
+      Operators.Add(initialPhaseChecker);
+      var modelbuilder = new ModelBuilder { Name = "Build Model" };
+      Operators.Add(modelbuilder);
+
+      sampleCollector = new DiscreteSampleCollector { Name = "Collect Sample" };
+      Operators.Add(sampleCollector);
+      infillSolutionsCreator = new SolutionsCreator { Name = "Create Adaptive Solutions" };
+      Operators.Add(infillSolutionsCreator);
+      infillSolver = new DiscreteInfillSolver();
+      Operators.Add(infillSolver);
+
+      var subScopesRemover = new SubScopesRemover();
+      Operators.Add(subScopesRemover);
+      var iterationsCounter = new IntCounter { Name = "Increment Iterations" };
+      Operators.Add(iterationsCounter);
+      var terminationOperator = new TerminationOperator();
+      Operators.Add(terminationOperator);
+      #endregion
+
+      #region Wire operators
+      const string iterationsVariableName = "Iterations";
+      const string evaluatedSolutionsVariableName = "EvaluatedSolutions";
+      const string datasetVariableName = "SampleSet";
+      const string modelVariableName = "Model";
+      const string initialPhaseVariableName = "InitialPhase";
+      const string infillBoundsVariableName = "InfillBounds";
+
+      OperatorGraph.InitialOperator = randomCreator;
+
+      randomCreator.SeedParameter.Value = null;
+      randomCreator.SeedParameter.ActualName = SeedParameter.Name;
+      randomCreator.SetSeedRandomlyParameter.Value = null;
+      randomCreator.SetSeedRandomlyParameter.ActualName = SetSeedRandomlyParameter.Name;
+      randomCreator.Successor = variableCreator;
+
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>(iterationsVariableName, new IntValue(0)));
+      variableCreator.CollectedValues.Add(new ValueParameter<IntValue>(evaluatedSolutionsVariableName, new IntValue(0)));
+      variableCreator.CollectedValues.Add(new ValueParameter<ModifiableDataset>(datasetVariableName, new ModifiableDataset()));
+      variableCreator.CollectedValues.Add(new ValueParameter<IRegressionSolution>(modelVariableName, "The regression solution representing the model for EGO", null));
+      variableCreator.CollectedValues.Add(new FixedValueParameter<BoolValue>(initialPhaseVariableName, new BoolValue(false)));
+      variableCreator.CollectedValues.Add(new ValueParameter<IntMatrix>(infillBoundsVariableName));
+      variableCreator.Successor = resultsCollector;
+
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>(iterationsVariableName, "The current iteration number."));
+      resultsCollector.CollectedValues.Add(new LookupParameter<IntValue>(evaluatedSolutionsVariableName, "The current number of evaluated solutions."));
+      resultsCollector.CollectedValues.Add(new LookupParameter<ModifiableDataset>(datasetVariableName, "A dataset containing all evaluated solutions"));
+      resultsCollector.Successor = phaseChecker;
+
+      phaseChecker.ConditionParameter.ActualName = initialPhaseVariableName;
+      phaseChecker.FalseBranch = solutionCreator;
+      phaseChecker.TrueBranch = modelbuilder;
+
+      #region Adaptive Phase
+      modelbuilder.DatasetParameter.ActualName = datasetVariableName;
+      modelbuilder.ModelParameter.ActualName = modelVariableName;
+      modelbuilder.RegressionAlgorithmParameter.ActualName = RegressionAlgorithmParameter.Name;
+
+      modelbuilder.Successor = infillSolutionsCreator;
+      modelbuilder.MaxModelSizeParameter.ActualName = MaxModelSizeParameter.Name;
+
+      infillSolutionsCreator.SolutionCreatorParameter.Value = infillSolver;
+      infillSolutionsCreator.Successor = evaluationsCounter;
+      infillSolutionsCreator.NumberOfSolutionsParameter.Value = new IntValue(1);
+
+      infillSolver.InfillOptimizationAlgorithmParamter.ActualName = InfillOptimizationAlgorithmParameterName;
+      infillSolver.ModelParameter.ActualName = modelVariableName;
+      infillSolver.RemoveDuplicatesParameter.ActualName = RemoveDuplicatesParameter.Name;
+      infillSolver.InfillBoundsParameter.ActualName = infillBoundsVariableName;
+      #endregion
+
+      #region Initial Phase 
+      solutionCreator.NumberOfSolutionsParameter.Value = new IntValue(1);
+      solutionCreator.ParallelParameter.Value.Value = true;
+      solutionCreator.Successor = evaluationsCounter;
+      #endregion
+
+      evaluationsCounter.ValueParameter.ActualName = evaluatedSolutionsVariableName;
+      evaluationsCounter.Increment = null;
+      evaluationsCounter.IncrementParameter.Value = new IntValue(1);
+      evaluationsCounter.Successor = initialPhaseChecker;
+
+      initialPhaseChecker.Comparison = new Comparison(ComparisonType.GreaterOrEqual);
+      initialPhaseChecker.LeftSideParameter.ActualName = evaluatedSolutionsVariableName;
+      initialPhaseChecker.RightSideParameter.ActualName = InitialEvaluationsParameterName;
+      initialPhaseChecker.ResultParameter.ActualName = initialPhaseVariableName;
+      initialPhaseChecker.Successor = analyzerPlaceholder;
+
+      analyzerPlaceholder.OperatorParameter.ActualName = AnalyzerParameter.Name;
+      analyzerPlaceholder.Successor = solutionsCollectorProcessor;
+
+      solutionsCollectorProcessor.Operator = sampleCollector;
+      solutionsCollectorProcessor.Depth.Value = 1;
+      solutionsCollectorProcessor.Successor = subScopesRemover;
+
+      sampleCollector.DatasetParameter.ActualName = datasetVariableName;
+
+      subScopesRemover.RemoveAllSubScopes = true;
+      subScopesRemover.Successor = iterationsCounter;
+
+      iterationsCounter.ValueParameter.ActualName = "Iterations";
+      iterationsCounter.Increment = new IntValue(1);
+      iterationsCounter.Successor = terminationOperator;
+
+      terminationOperator.TerminatorParameter.ActualName = TerminatorParameter.Name;
+      terminationOperator.ContinueBranch = phaseChecker;
+      #endregion
+
+      #region Create analyzers
+      singleObjectiveQualityAnalyzer = new BestAverageWorstQualityAnalyzer();
+      Operators.Add(singleObjectiveQualityAnalyzer);
+
+      correlationAnalyzer = new DiscreteCorrelationAnalyzer();
+      correlationAnalyzer.ModelParameter.ActualName = modelVariableName;
+      Operators.Add(correlationAnalyzer);
+
+      sampleAnalyzer = new DiscreteEvaluatedSolutionsAnalyzer();
+      sampleAnalyzer.PhaseParameter.ActualName = initialPhaseVariableName;
+      Operators.Add(sampleAnalyzer);
+
+      modelAnalyzer = new ModelQualityAnalyzer();
+      modelAnalyzer.ModelParameter.ActualName = modelVariableName;
+      Operators.Add(modelAnalyzer);
+
+      variabilityAnalyzer = new VariableVariabilityAnalyzer();
+      variabilityAnalyzer.DatasetParameter.ActualName = datasetVariableName;
+      variabilityAnalyzer.InitialEvaluationsParameter.ActualName = InitialEvaluationsParameter.Name;
+      Operators.Add(variabilityAnalyzer);
+
+      fitnessClusterAnalyzer = new FitnessClusteringAnalyzer();
+      fitnessClusterAnalyzer.DatasetParameter.ActualName = datasetVariableName;
+      Operators.Add(fitnessClusterAnalyzer);
+      #endregion
+
+      #region Create terminators
+
+      evaluationsTerminator = new ComparisonTerminator<IntValue>("EvaluatedSolutions", ComparisonType.Less, new IntValue(1000)) { Name = "Evaluated solutions." };
+      Operators.Add(evaluationsTerminator);
+      qualityTerminator = new SingleObjectiveQualityTerminator { Name = "Quality" };
+      Operators.Add(qualityTerminator);
+      executionTimeTerminator = new ExecutionTimeTerminator(this, new TimeSpanValue(TimeSpan.FromMinutes(5)));
+      Operators.Add(executionTimeTerminator);
+      #endregion
+
+      #region Parameterize
+      UpdateAnalyzers();
+      ParameterizeAnalyzers();
+      ParameterizeStochasticOperators(Operators);
+      UpdateTerminators();
+      #endregion
+
+      Initialize();
+    }
+
+    private void Initialize() {
+      if (SingleObjectiveProblem != null) {
+        SingleObjectiveProblem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
+      }
+      singleObjectiveQualityAnalyzer.CurrentBestQualityParameter.NameChanged += QualityAnalyzer_CurrentBestQualityParameter_NameChanged;
+      RegisterParameterEvents();
+    }
+    #endregion
+
+    public override void Start(CancellationToken cancellationToken) {
+      ParameterizeProblemSpecificOperators();
+      ((DiscreteInfillProblem)InfillOptimizationAlgorithm.Problem).InfillCriterion = InfillCriterion;
+      ParameterizeCancellableOperators(cancellationToken);
+      base.Start(cancellationToken);
+    }
+    public override void Stop() {
+      if (InfillOptimizationAlgorithm.ExecutionState == ExecutionState.Started || InfillOptimizationAlgorithm.ExecutionState == ExecutionState.Paused)
+        InfillOptimizationAlgorithm.Stop();
+      if (RegressionAlgorithm.ExecutionState == ExecutionState.Started || RegressionAlgorithm.ExecutionState == ExecutionState.Paused)
+        RegressionAlgorithm.Stop();
+      base.Stop();
+    }
+    public override void Pause() {
+      if (InfillOptimizationAlgorithm.ExecutionState == ExecutionState.Started) InfillOptimizationAlgorithm.Pause();
+      if (RegressionAlgorithm.ExecutionState == ExecutionState.Started) RegressionAlgorithm.Pause();
+      base.Pause();
+    }
+
+    #region Parameterization
+    private void ParameterizeTerminators() {
+      if (SingleObjectiveProblem != null)
+        qualityTerminator.Parameterize(singleObjectiveQualityAnalyzer.CurrentBestQualityParameter,
+          SingleObjectiveProblem);
+    }
+    private void ParameterizeAnalyzers() {
+      foreach (var op in Operators.OfType<IResultsOperator>()) {
+        op.ResultsParameter.ActualName = "Results";
+        op.ResultsParameter.Hidden = true;
+      }
+
+      singleObjectiveQualityAnalyzer.ResultsParameter.ActualName = "Results";
+      singleObjectiveQualityAnalyzer.ResultsParameter.Hidden = true;
+      singleObjectiveQualityAnalyzer.QualityParameter.Depth = 1;
+      correlationAnalyzer.QualityParameter.Depth = 1;
+      correlationAnalyzer.IntegerVectorParameter.Depth = 1;
+      sampleAnalyzer.QualityParameter.Depth = 1;
+      sampleAnalyzer.IntegerVectorParameter.Depth = 1;
+
+      if (SingleObjectiveProblem == null) return;
+      singleObjectiveQualityAnalyzer.MaximizationParameter.ActualName = SingleObjectiveProblem.MaximizationParameter.Name;
+      singleObjectiveQualityAnalyzer.MaximizationParameter.Hidden = true;
+      singleObjectiveQualityAnalyzer.QualityParameter.ActualName = SingleObjectiveProblem.Evaluator.QualityParameter.ActualName;
+      singleObjectiveQualityAnalyzer.QualityParameter.Hidden = true;
+      singleObjectiveQualityAnalyzer.BestKnownQualityParameter.ActualName = SingleObjectiveProblem.BestKnownQualityParameter.Name;
+      singleObjectiveQualityAnalyzer.BestKnownQualityParameter.Hidden = true;
+      correlationAnalyzer.QualityParameter.ActualName = SingleObjectiveProblem.Evaluator.QualityParameter.ActualName;
+      correlationAnalyzer.QualityParameter.Hidden = true;
+      sampleAnalyzer.QualityParameter.ActualName = SingleObjectiveProblem.Evaluator.QualityParameter.ActualName;
+      sampleAnalyzer.QualityParameter.Hidden = true;
+    }
+    private void ParameterizeSolutionsCreators() {
+      SolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      SolutionsCreator.SolutionCreatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
+      infillSolutionsCreator.EvaluatorParameter.ActualName = Problem.EvaluatorParameter.Name;
+      ParameterizeStochasticOperators(new[] { SolutionsCreator, infillSolutionsCreator });
+    }
+    private static void ParameterizeStochasticOperators(IEnumerable<IItem> operators) {
+      foreach (var op in operators.OfType<IStochasticOperator>()) {
+        op.RandomParameter.ActualName = "Random";
+        op.RandomParameter.Hidden = true;
+      }
+    }
+    private void ParameterizeProblemSpecificOperators() {
+      if (SingleObjectiveProblem == null) throw new ArgumentException("Adaptive sampling requires a single objective problem");
+      infillSolver.MaximizationParameter.ActualName = SingleObjectiveProblem.MaximizationParameter.Name;
+      var rcreator = Problem.SolutionCreator as IIntegerVectorCreator;
+      if (rcreator == null) throw new ArgumentException("Discrete Adaptive sampling requires integer vectors as solution candidates");
+
+      infillSolver.LengthParameter.ActualName = rcreator.LengthParameter.ActualName;
+      infillSolver.BoundsParameter.ActualName = rcreator.BoundsParameter.ActualName;
+      infillSolver.LengthParameter.Value = rcreator.LengthParameter.Value;
+      infillSolver.BoundsParameter.Value = rcreator.BoundsParameter.Value;
+      infillSolver.IntegerVectorParameter.ActualName = rcreator.IntegerVectorParameter.ActualName;
+
+      sampleCollector.IntegerVectorParameter.ActualName = rcreator.IntegerVectorParameter.ActualName;
+      sampleCollector.QualityParameter.ActualName = SingleObjectiveProblem.Evaluator.QualityParameter.ActualName;
+
+      correlationAnalyzer.IntegerVectorParameter.ActualName = rcreator.IntegerVectorParameter.ActualName;
+      sampleAnalyzer.IntegerVectorParameter.ActualName = rcreator.IntegerVectorParameter.ActualName;
+    }
+    private void ParameterizeCancellableOperators(CancellationToken cancellation) {
+      foreach (var op in Operators.OfType<ICancellableOperator>())
+        op.Cancellation = cancellation;
+    }
+
+    private void UnParameterizeCancellableOperators(CancellationToken cancellation) {
+      foreach (var op in Operators.OfType<ICancellableOperator>())
+        op.Cancellation = CancellationToken.None;
+    }
+    #endregion
+
+    #region Events
+    private void RegisterParameterEvents() {
+      InfillOptimizationAlgorithmParameter.ValueChanged += OnInfillAlgorithmChanged;
+      InfillOptimizationAlgorithm.ProblemChanged += OnInfillProblemChanged;
+      InfillCriterionParameter.ValueChanged += OnInfillCriterionChanged;
+    }
+    private void OnInfillCriterionChanged(object sender, EventArgs e) {
+      ((DiscreteInfillProblem)InfillOptimizationAlgorithm.Problem).InfillCriterion = InfillCriterion;
+    }
+    private void OnInfillAlgorithmChanged(object sender, EventArgs e) {
+      InfillOptimizationAlgorithm.Problem = new DiscreteInfillProblem { InfillCriterion = InfillCriterion };
+      InfillOptimizationAlgorithm.ProblemChanged -= OnInfillProblemChanged; //avoid double attaching
+      InfillOptimizationAlgorithm.ProblemChanged += OnInfillProblemChanged;
+    }
+    private void OnInfillProblemChanged(object sender, EventArgs e) {
+      //enforce an infill problem for the infill optimization algorithm
+      InfillOptimizationAlgorithm.ProblemChanged -= OnInfillProblemChanged;
+      InfillOptimizationAlgorithm.Problem = new DiscreteInfillProblem { InfillCriterion = InfillCriterion };
+      InfillOptimizationAlgorithm.ProblemChanged += OnInfillProblemChanged;
+    }
+
+    protected override void OnProblemChanged() {
+      base.OnProblemChanged();
+      ParameterizeStochasticOperators(Problem.Operators);
+      UpdateAnalyzers();
+      UpdateTerminators();
+      ParameterizeSolutionsCreators();
+      if (SingleObjectiveProblem != null)
+        SingleObjectiveProblem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
+    }
+    protected override void RegisterProblemEvents() {
+      base.RegisterProblemEvents();
+      var maximizationParameter = (IValueParameter<BoolValue>)SingleObjectiveProblem?.MaximizationParameter;
+      if (maximizationParameter != null) maximizationParameter.ValueChanged += MaximizationParameter_ValueChanged;
+
+    }
+    protected override void DeregisterProblemEvents() {
+      var maximizationParameter = (IValueParameter<BoolValue>)SingleObjectiveProblem?.MaximizationParameter;
+      if (maximizationParameter != null) maximizationParameter.ValueChanged -= MaximizationParameter_ValueChanged;
+      base.DeregisterProblemEvents();
+    }
+    protected override void Problem_SolutionCreatorChanged(object sender, EventArgs e) {
+      base.Problem_SolutionCreatorChanged(sender, e);
+      ParameterizeStochasticOperators(Problem.SolutionCreator.ToEnumerable());
+      SingleObjectiveProblem.Evaluator.QualityParameter.ActualNameChanged += Evaluator_QualityParameter_ActualNameChanged;
+      ParameterizeSolutionsCreators();
+      ParameterizeAnalyzers();
+    }
+    protected override void Problem_EvaluatorChanged(object sender, EventArgs e) {
+      base.Problem_EvaluatorChanged(sender, e);
+      ParameterizeStochasticOperators(Problem.Operators);
+      ParameterizeSolutionsCreators();
+    }
+    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
+      base.Problem_OperatorsChanged(sender, e);
+      UpdateAnalyzers();
+      UpdateTerminators();
+    }
+    private void MaximizationParameter_ValueChanged(object sender, EventArgs e) {
+      ParameterizeAnalyzers();
+      ParameterizeTerminators();
+    }
+    private void Evaluator_QualityParameter_ActualNameChanged(object sender, EventArgs e) {
+      ParameterizeAnalyzers();
+    }
+    private void QualityAnalyzer_CurrentBestQualityParameter_NameChanged(object sender, EventArgs e) {
+      ParameterizeTerminators();
+    }
+
+    #endregion
+
+    #region Updates
+    private void UpdateAnalyzers() {
+      Analyzer.Operators.Clear();
+      if (SingleObjectiveProblem == null) return;
+      foreach (var analyzer in Operators.OfType<IAnalyzer>().Concat(SingleObjectiveProblem.Operators.OfType<IAnalyzer>()))
+        Analyzer.Operators.Add(analyzer, analyzer.EnabledByDefault);
+      ParameterizeAnalyzers();
+    }
+    private void UpdateTerminators() {
+      var newTerminators = new Dictionary<ITerminator, bool> {
+        {
+          evaluationsTerminator,
+          !Terminator.Operators.Contains(evaluationsTerminator) ||
+          Terminator.Operators.ItemChecked(evaluationsTerminator)
+        }, {
+          executionTimeTerminator,
+          Terminator.Operators.Contains(executionTimeTerminator) &&
+          Terminator.Operators.ItemChecked(executionTimeTerminator)
+        }
+      };
+      if (SingleObjectiveProblem != null) {
+        newTerminators.Add(qualityTerminator, Terminator.Operators.Contains(qualityTerminator) && Terminator.Operators.ItemChecked(qualityTerminator));
+        foreach (var terminator in Problem.Operators.OfType<ITerminator>())
+          newTerminators.Add(terminator, !Terminator.Operators.Contains(terminator) || Terminator.Operators.ItemChecked(terminator));
+      }
+      Terminator.Operators.Clear();
+      foreach (var newTerminator in newTerminators)
+        Terminator.Operators.Add(newTerminator.Key, newTerminator.Value);
+      ParameterizeTerminators();
+    }
+    #endregion
+  }
+
+}
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteCorrelationAnalyzer.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteCorrelationAnalyzer.cs	(revision 15343)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteCorrelationAnalyzer.cs	(revision 15343)
@@ -0,0 +1,94 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Algorithms.EGO {
+  [Item("DiscreteCorrelationAnalyzer", "Analyzes the correlation between perdictions and actual fitness values")]
+  [StorableClass]
+  public class DiscreteCorrelationAnalyzer : SingleSuccessorOperator, IAnalyzer, IResultsOperator {
+    public override bool CanChangeName => true;
+    public bool EnabledByDefault => false;
+
+    public IScopeTreeLookupParameter<IntegerVector> IntegerVectorParameter => (IScopeTreeLookupParameter<IntegerVector>)Parameters["IntegerVector"];
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter => (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"];
+    public ILookupParameter<IRegressionSolution> ModelParameter => (ILookupParameter<IRegressionSolution>)Parameters["Model"];
+    public ILookupParameter<ResultCollection> ResultsParameter => (ILookupParameter<ResultCollection>)Parameters["Results"];
+
+    private const string PlotName = "Prediction";
+    private const string RowName = "Samples";
+
+    [StorableConstructor]
+    protected DiscreteCorrelationAnalyzer(bool deserializing) : base(deserializing) { }
+    protected DiscreteCorrelationAnalyzer(DiscreteCorrelationAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public DiscreteCorrelationAnalyzer() {
+      Parameters.Add(new ScopeTreeLookupParameter<IntegerVector>("IntegerVector", "The vector which should be collected."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The quality associated which this vector"));
+      Parameters.Add(new LookupParameter<IRegressionSolution>("Model", "The model of this iteration"));
+      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The collection to store the results in."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DiscreteCorrelationAnalyzer(this, cloner);
+    }
+
+    public sealed override IOperation Apply() {
+      var model = ModelParameter.ActualValue;
+      var results = ResultsParameter.ActualValue;
+      var q = QualityParameter.ActualValue.Select(x => x.Value).ToArray();
+      var p = IntegerVectorParameter.ActualValue.ToArray();
+      if (model == null) return base.Apply();
+      var plot = CreateScatterPlotResult(results);
+      for (var i = 0; i < q.Length; i++) plot.Rows[RowName].Points.Add(new Point2D<double>(model.Model.GetEstimation(p[i]), q[i], p[i]));
+      return base.Apply();
+    }
+
+    private static ScatterPlot CreateScatterPlotResult(ResultCollection results) {
+      ScatterPlot plot;
+      if (!results.ContainsKey(PlotName)) {
+        plot = new ScatterPlot("Fitness-Prediction-Correlation", "The correlation between the predicted and actual fitness values") {
+          VisualProperties = {
+            XAxisTitle = "Predicted Objective Value",
+            YAxisTitle = "True Objective Value"
+          }
+        };
+        results.Add(new Result(PlotName, plot));
+      } else { plot = (ScatterPlot)results[PlotName].Value; }
+      if (!plot.Rows.ContainsKey(RowName)) {
+        plot.Rows.Add(new ScatterPlotDataRow(RowName, RowName, new List<Point2D<double>>()));
+        plot.Rows[RowName].VisualProperties.PointSize = 5;
+      }
+      return plot;
+    }
+
+  }
+}
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteEfficientGlobalOptimizationAlgorithm.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteEfficientGlobalOptimizationAlgorithm.cs	(revision 15343)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteEfficientGlobalOptimizationAlgorithm.cs	(revision 15343)
@@ -0,0 +1,481 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Linq;
+using System.Threading;
+using HeuristicLab.Algorithms.DataAnalysis;
+using HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.Instances;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.Algorithms.EGO {
+  [StorableClass]
+  [Creatable(CreatableAttribute.Categories.Algorithms, Priority = 95)]
+  [Item("DiscreteEfficientGlobalOptimizationAlgorithm", "Solves a problem by sequentially learning a model, solving a subproblem on the model and evaluating the best found solution for this subproblem.")]
+  public class DiscreteEfficientGlobalOptimizationAlgorithm : BasicAlgorithm, ISurrogateAlgorithm<IntegerVector> {
+    #region Basic-Alg-Essentials
+    public override bool SupportsPause => true;
+    public override Type ProblemType => typeof(SingleObjectiveBasicProblem<IEncoding>);
+    public new SingleObjectiveBasicProblem<IEncoding> Problem {
+      get { return (SingleObjectiveBasicProblem<IEncoding>)base.Problem; }
+      set { base.Problem = value; }
+    }
+    #endregion
+
+    #region ParameterNames
+    private const string GenerationSizeParameterName = "GenerationSize";
+    private const string InfillCriterionParameterName = "InfillCriterion";
+    private const string InfillOptimizationAlgorithmParameterName = "InfillOptimizationAlgorithm";
+    private const string InfillOptimizationRestartsParameterName = "InfillOptimizationRestarts";
+    private const string InitialEvaluationsParameterName = "Initial Evaluations";
+    private const string MaximumEvaluationsParameterName = "Maximum Evaluations";
+    private const string MaximumRuntimeParameterName = "Maximum Runtime";
+    private const string RegressionAlgorithmParameterName = "RegressionAlgorithm";
+    private const string SeedParameterName = "Seed";
+    private const string SetSeedRandomlyParameterName = "SetSeedRandomly";
+    private const string MaximalDataSetSizeParameterName = "MaximalDataSetSize";
+    private const string RemoveDuplicatesParamterName = "RemoveDuplicates";
+    private const string InitialSamplesParameterName = "InitialSamplesFile";
+    private const string BaselineVectorParameterName = "BaselineVector";
+    private const string InitialSamplingPlanParamterName = "InitialSamplingPlan";
+    #endregion
+
+    #region ResultNames
+    private const string BestQualityResultName = "Best Quality";
+    private const string BestSolutionResultName = "Best Solution";
+    private const string EvaluatedSoultionsResultName = "EvaluatedSolutions";
+    private const string IterationsResultName = "Iterations";
+    private const string RegressionSolutionResultName = "Model";
+    private const string QualitiesChartResultName = "Qualities";
+    private const string BestQualitiesRowResultName = "Best Quality";
+    private const string CurrentQualitiesRowResultName = "Current Quality";
+    private const string WorstQualitiesRowResultName = "Worst Quality";
+    #endregion
+
+    #region ParameterProperties
+    public IFixedValueParameter<IntValue> GenerationSizeParemeter => Parameters[GenerationSizeParameterName] as IFixedValueParameter<IntValue>;
+    public IConstrainedValueParameter<IInfillCriterion> InfillCriterionParameter => Parameters[InfillCriterionParameterName] as IConstrainedValueParameter<IInfillCriterion>;
+    public IValueParameter<Algorithm> InfillOptimizationAlgorithmParameter => Parameters[InfillOptimizationAlgorithmParameterName] as IValueParameter<Algorithm>;
+    public IFixedValueParameter<IntValue> InfillOptimizationRestartsParemeter => Parameters[InfillOptimizationRestartsParameterName] as IFixedValueParameter<IntValue>;
+    public IFixedValueParameter<IntValue> InitialEvaluationsParameter => Parameters[InitialEvaluationsParameterName] as IFixedValueParameter<IntValue>;
+    public IFixedValueParameter<IntValue> MaximumEvaluationsParameter => Parameters[MaximumEvaluationsParameterName] as IFixedValueParameter<IntValue>;
+    public IFixedValueParameter<IntValue> MaximumRuntimeParameter => Parameters[MaximumRuntimeParameterName] as IFixedValueParameter<IntValue>;
+    public IValueParameter<IDataAnalysisAlgorithm<IRegressionProblem>> RegressionAlgorithmParameter => Parameters[RegressionAlgorithmParameterName] as IValueParameter<IDataAnalysisAlgorithm<IRegressionProblem>>;
+    public IFixedValueParameter<IntValue> SeedParameter => Parameters[SeedParameterName] as IFixedValueParameter<IntValue>;
+    public IFixedValueParameter<BoolValue> SetSeedRandomlyParameter => Parameters[SetSeedRandomlyParameterName] as IFixedValueParameter<BoolValue>;
+    public IFixedValueParameter<IntValue> MaximalDataSetSizeParameter => Parameters[MaximalDataSetSizeParameterName] as IFixedValueParameter<IntValue>;
+    public IFixedValueParameter<BoolValue> RemoveDuplicatesParameter => Parameters[RemoveDuplicatesParamterName] as IFixedValueParameter<BoolValue>;
+    public IFixedValueParameter<FileValue> InitialSamplesParameter => Parameters[InitialSamplesParameterName] as IFixedValueParameter<FileValue>;
+    public IValueParameter<IntegerVector> BaselineVectorParameter => Parameters[BaselineVectorParameterName] as IValueParameter<IntegerVector>;
+    public IConstrainedValueParameter<IInitialSampling<IntegerVector>> InitialSamplingPlanParameter => Parameters[InitialSamplingPlanParamterName] as IConstrainedValueParameter<IInitialSampling<IntegerVector>>;
+    #endregion
+
+    #region Properties
+    public int GenerationSize => GenerationSizeParemeter.Value.Value;
+    public IInfillCriterion InfillCriterion => InfillCriterionParameter.Value;
+    public Algorithm InfillOptimizationAlgorithm => InfillOptimizationAlgorithmParameter.Value;
+    public int InfillOptimizationRestarts => InfillOptimizationRestartsParemeter.Value.Value;
+    public int InitialEvaluations => InitialEvaluationsParameter.Value.Value;
+    public int MaximumEvaluations => MaximumEvaluationsParameter.Value.Value;
+    public int MaximumRuntime => MaximumRuntimeParameter.Value.Value;
+    public IDataAnalysisAlgorithm<IRegressionProblem> RegressionAlgorithm => RegressionAlgorithmParameter.Value;
+    public int Seed => SeedParameter.Value.Value;
+    public bool SetSeedRandomly => SetSeedRandomlyParameter.Value.Value;
+    public int MaximalDatasetSize => MaximalDataSetSizeParameter.Value.Value;
+    private IEnumerable<Tuple<IntegerVector, double>> DataSamples => Samples.Count > MaximalDatasetSize && MaximalDatasetSize > 0
+      ? Samples.Skip(Samples.Count - MaximalDatasetSize)
+      : Samples;
+    private bool RemoveDuplicates => RemoveDuplicatesParameter.Value.Value;
+    private IntegerVector BaselineVector => BaselineVectorParameter.Value;
+    private IInitialSampling<IntegerVector> InitialSamplingPlan => InitialSamplingPlanParameter.Value;
+    #endregion
+
+    #region StorableProperties
+    [Storable]
+    private IRandom Random = new MersenneTwister();
+    [Storable]
+    private List<Tuple<IntegerVector, double>> Samples;
+    [Storable]
+    private List<Tuple<IntegerVector, double>> InitialSamples;
+    #endregion
+
+    #region ResultsProperties
+    private double ResultsBestQuality {
+      get { return ((DoubleValue)Results[BestQualityResultName].Value).Value; }
+      set { ((DoubleValue)Results[BestQualityResultName].Value).Value = value; }
+    }
+    private IntegerVector ResultsBestSolution {
+      get { return (IntegerVector)Results[BestSolutionResultName].Value; }
+      set { Results[BestSolutionResultName].Value = value; }
+    }
+    private int ResultsEvaluations {
+      get { return ((IntValue)Results[EvaluatedSoultionsResultName].Value).Value; }
+      set { ((IntValue)Results[EvaluatedSoultionsResultName].Value).Value = value; }
+    }
+    private int ResultsIterations {
+      get { return ((IntValue)Results[IterationsResultName].Value).Value; }
+      set { ((IntValue)Results[IterationsResultName].Value).Value = value; }
+    }
+    private DataTable ResultsQualities => (DataTable)Results[QualitiesChartResultName].Value;
+    private DataRow ResultsQualitiesBest => ResultsQualities.Rows[BestQualitiesRowResultName];
+    private DataRow ResultsQualitiesWorst => ResultsQualities.Rows[WorstQualitiesRowResultName];
+    private DataRow ResultsQualitiesIteration => ResultsQualities.Rows[CurrentQualitiesRowResultName];
+    private IRegressionSolution ResultsModel {
+      get { return (IRegressionSolution)Results[RegressionSolutionResultName].Value; }
+      set { Results[RegressionSolutionResultName].Value = value; }
+    }
+    #endregion
+
+    #region HLConstructors
+    [StorableConstructor]
+    protected DiscreteEfficientGlobalOptimizationAlgorithm(bool deserializing) : base(deserializing) { }
+    [StorableHook(HookType.AfterDeserialization)]
+    protected void AfterDeseialization() {
+      RegisterEventhandlers();
+    }
+    protected DiscreteEfficientGlobalOptimizationAlgorithm(DiscreteEfficientGlobalOptimizationAlgorithm original, Cloner cloner) : base(original, cloner) {
+      Random = cloner.Clone(Random);
+      if (original.Samples != null) Samples = original.Samples.Select(x => new Tuple<IntegerVector, double>(cloner.Clone(x.Item1), x.Item2)).ToList();
+      if (original.InitialSamples != null) InitialSamples = original.InitialSamples.Select(x => new Tuple<IntegerVector, double>(cloner.Clone(x.Item1), x.Item2)).ToList();
+      RegisterEventhandlers();
+    }
+    public override IDeepCloneable Clone(Cloner cloner) { return new DiscreteEfficientGlobalOptimizationAlgorithm(this, cloner); }
+    public DiscreteEfficientGlobalOptimizationAlgorithm() {
+      IProblemInstanceExporter dummy = new RegressionProblem(); //this variable is irrelevant
+      //the dummy variable enforces a using-Statement for HeuristicLab.Problems.Instances
+      //"new ValueParameter<IDataAnalysisAlgorithm<IRegressionProblem>>" requires no using-Statement, but nontheless it requires HeuristicLab.Problems.Instances to be referenced  
+      //Having HeuristicLab.Problems.Instances referenced but not used, causes the Essential-Unit-tests to fail. 
+
+      var cmaes = new OffspringSelectionGeneticAlgorithm.OffspringSelectionGeneticAlgorithm() {
+        MaximumGenerations = new IntValue(300),
+        PopulationSize = new IntValue(50)
+      };
+      var model = new GaussianProcessRegression {
+        Problem = new RegressionProblem()
+      };
+      model.CovarianceFunctionParameter.Value = new CovarianceRationalQuadraticIso();
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximumEvaluationsParameterName, "", new IntValue(int.MaxValue)));
+      Parameters.Add(new FixedValueParameter<IntValue>(InitialEvaluationsParameterName, "", new IntValue(10)));
+      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(-1)));
+      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)));
+      Parameters.Add(new ValueParameter<IDataAnalysisAlgorithm<IRegressionProblem>>(RegressionAlgorithmParameterName, "The model used to approximate the problem", model));
+      Parameters.Add(new ValueParameter<Algorithm>(InfillOptimizationAlgorithmParameterName, "The algorithm used to solve the expected improvement subproblem", cmaes));
+      Parameters.Add(new FixedValueParameter<IntValue>(InfillOptimizationRestartsParameterName, "Number of restarts of the SubAlgortihm to avoid local optima", new IntValue(1)));
+      Parameters.Add(new FixedValueParameter<IntValue>(GenerationSizeParameterName, "Number points that are sampled every iteration (stadard EGO: 1)", new IntValue(1)));
+      Parameters.Add(new FixedValueParameter<IntValue>(MaximalDataSetSizeParameterName, "The maximum number of sample points used to generate the model. Set 0 or less to use always all samples ", new IntValue(-1)));
+      Parameters.Add(new FixedValueParameter<BoolValue>(RemoveDuplicatesParamterName, "Wether duplicate samples should be replaced by a single sample with an averaged quality. This GREATLY decreases the chance of ill conditioned models (unbuildable models) but is not theoretically sound as the model ignores the increasing certainty in this region"));
+      Parameters.Add(new FixedValueParameter<FileValue>(InitialSamplesParameterName, "The file specifying some initial samples used to jump start the algorithm. These samples are not counted as evaluations. If InitialEvaluations is more than the samples specified in the file, the rest is uniformly random generated and evaluated.", new FileValue()));
+      Parameters.Add(new ValueParameter<IntegerVector>(BaselineVectorParameterName, "A vector used to create a baseline, this vector is evaluated once and is not part of the modeling process (has no influence on algorithm performance)"));
+      var eqi = new ExpectedQuantileImprovement();
+      eqi.MaxEvaluationsParameter.Value = MaximumEvaluationsParameter.Value;
+      var criteria = new ItemSet<IInfillCriterion> { new ExpectedImprovement(), new AugmentedExpectedImprovement(), new ExpectedQuality(), eqi, new MinimalQuantileCriterium(), new PluginExpectedImprovement() };
+      Parameters.Add(new ConstrainedValueParameter<IInfillCriterion>(InfillCriterionParameterName, "Decision what value should decide the next sample", criteria, criteria.First()));
+      var intialSamplingPlans = new ItemSet<IInitialSampling<IntegerVector>> { new UniformRandomDiscreteSampling() };
+      Parameters.Add(new ConstrainedValueParameter<IInitialSampling<IntegerVector>>(InitialSamplingPlanParamterName, "Determies the initial samples from which the first model can be built.", intialSamplingPlans, intialSamplingPlans.First()));
+      SetInfillProblem();
+      RegisterEventhandlers();
+    }
+    #endregion
+    public void SetInitialSamples(IntegerVector[] individuals, double[] qualities) {
+      InitialSamples = individuals.Zip(qualities, (individual, d) => new Tuple<IntegerVector, double>(individual, d)).ToList();
+    }
+    protected override void Initialize(CancellationToken cancellationToken) {
+      base.Initialize(cancellationToken);
+      //encoding
+      var enc = Problem.Encoding as IntegerVectorEncoding;
+      if (enc == null) throw new ArgumentException("The EGO algorithm can only be applied to IntegerVectorEncodings");
+      var infillProblem = InfillOptimizationAlgorithm.Problem as DiscreteInfillProblem;
+      if (infillProblem == null) throw new ArgumentException("InfillOptimizationAlgorithm has no DiscreteInfillProblem. Troubles with Eventhandling?");
+
+      //random
+      if (SetSeedRandomly) SeedParameter.Value.Value = new System.Random().Next();
+      Random.Reset(Seed);
+      Samples = InitialSamples?.ToList() ?? new List<Tuple<IntegerVector, double>>();
+
+      //results
+      Results.Add(new Result(IterationsResultName, new IntValue(0)));
+      Results.Add(new Result(EvaluatedSoultionsResultName, new IntValue(Samples.Count)));
+      Results.Add(new Result(BestSolutionResultName, new IntegerVector(1)));
+      Results.Add(new Result(BestQualityResultName, new DoubleValue(Problem.Maximization ? double.MinValue : double.MaxValue)));
+      Results.Add(new Result(RegressionSolutionResultName, typeof(IRegressionSolution)));
+      var table = new DataTable(QualitiesChartResultName);
+      table.Rows.Add(new DataRow(BestQualitiesRowResultName));
+      table.Rows.Add(new DataRow(WorstQualitiesRowResultName));
+      table.Rows.Add(new DataRow(CurrentQualitiesRowResultName));
+      Results.Add(new Result(QualitiesChartResultName, table));
+      if (BaselineVector != null && BaselineVector.Length == enc.Length) Results.Add(new Result("BaselineValue", new DoubleValue(Evaluate(BaselineVector).Item2)));
+
+
+
+    }
+    protected override void Run(CancellationToken cancellationToken) {
+      //initial samples
+      if (Samples.Count < InitialEvaluations) {
+        var points = InitialSamplingPlan.GetSamples(InitialEvaluations - Samples.Count, Samples.Select(x => x.Item1).ToArray(), (IntegerVectorEncoding)Problem.Encoding, Random);
+        foreach (var t in points) {
+          try {
+            Samples.Add(Evaluate(t));
+            cancellationToken.ThrowIfCancellationRequested();
+          }
+          finally {
+            Analyze();
+          }
+        }
+      }
+      //adaptive samples
+      for (ResultsIterations = 0; ResultsEvaluations < MaximumEvaluations; ResultsIterations++) {
+        try {
+          ResultsModel = BuildModel(cancellationToken);
+          if (ResultsModel == null) break;
+          cancellationToken.ThrowIfCancellationRequested();
+          for (var i = 0; i < GenerationSize; i++) {
+            var samplepoint = OptimizeInfillProblem(cancellationToken);
+            if (RemoveDuplicates) {
+
+            }
+            var sample = Evaluate(samplepoint);
+            Samples.Add(sample);
+            cancellationToken.ThrowIfCancellationRequested();
+          }
+
+        }
+        finally {
+          Analyze();
+        }
+      }
+    }
+
+    #region Eventhandling
+    private void RegisterEventhandlers() {
+      DeregisterEventhandlers();
+      RegressionAlgorithmParameter.ValueChanged += OnModelAlgorithmChanged;
+      InfillOptimizationAlgorithmParameter.ValueChanged += OnInfillOptimizationAlgorithmChanged;
+      InfillOptimizationAlgorithm.ProblemChanged += InfillOptimizationProblemChanged;
+      InfillCriterionParameter.ValueChanged += InfillCriterionChanged;
+      InitialSamplesParameter.ToStringChanged += OnInitialSamplesChanged;
+
+
+    }
+    private void DeregisterEventhandlers() {
+      RegressionAlgorithmParameter.ValueChanged -= OnModelAlgorithmChanged;
+      InfillOptimizationAlgorithmParameter.ValueChanged -= OnInfillOptimizationAlgorithmChanged;
+      InfillOptimizationAlgorithm.ProblemChanged -= InfillOptimizationProblemChanged;
+      InfillCriterionParameter.ValueChanged -= InfillCriterionChanged;
+      InitialSamplesParameter.ToStringChanged -= OnInitialSamplesChanged;
+    }
+    private void OnInfillOptimizationAlgorithmChanged(object sender, EventArgs args) {
+      SetInfillProblem();
+      InfillOptimizationAlgorithm.ProblemChanged += InfillOptimizationProblemChanged;
+    }
+    private void InfillOptimizationProblemChanged(object sender, EventArgs e) {
+      InfillOptimizationAlgorithm.ProblemChanged -= InfillOptimizationProblemChanged;
+      SetInfillProblem();
+      InfillOptimizationAlgorithm.ProblemChanged += InfillOptimizationProblemChanged;
+    }
+    private void InfillCriterionChanged(object sender, EventArgs e) {
+      var infillProblem = InfillOptimizationAlgorithm.Problem as DiscreteInfillProblem;
+      if (infillProblem == null) throw new ArgumentException("InfillOptimizationAlgorithm has no DiscreteInfillProblem. Troubles with Eventhandling?");
+      infillProblem.InfillCriterion = InfillCriterion;
+    }
+    private void OnModelAlgorithmChanged(object sender, EventArgs args) {
+      RegressionAlgorithm.Problem = new RegressionProblem();
+    }
+    private void OnInitialSamplesChanged(object sender, EventArgs args) { }
+    protected override void OnExecutionTimeChanged() {
+      base.OnExecutionTimeChanged();
+      if (CancellationTokenSource == null) return;
+      if (MaximumRuntime == -1) return;
+      if (ExecutionTime.TotalSeconds > MaximumRuntime) CancellationTokenSource.Cancel();
+    }
+    public override void Pause() {
+      if (InfillOptimizationAlgorithm.ExecutionState == ExecutionState.Started || InfillOptimizationAlgorithm.ExecutionState == ExecutionState.Paused) InfillOptimizationAlgorithm.Stop();
+      if (RegressionAlgorithm.ExecutionState == ExecutionState.Started || RegressionAlgorithm.ExecutionState == ExecutionState.Paused) RegressionAlgorithm.Stop();
+      base.Pause();
+    }
+    public override void Stop() {
+      if (InfillOptimizationAlgorithm.ExecutionState == ExecutionState.Started || InfillOptimizationAlgorithm.ExecutionState == ExecutionState.Paused) InfillOptimizationAlgorithm.Stop();
+      if (RegressionAlgorithm.ExecutionState == ExecutionState.Started || RegressionAlgorithm.ExecutionState == ExecutionState.Paused) RegressionAlgorithm.Stop();
+      base.Stop();
+    }
+    #endregion
+
+    #region helpers
+    private IRegressionSolution BuildModel(CancellationToken cancellationToken) {
+      var dataset = EgoUtilities.GetDataSet(DataSamples.ToList());
+      var problemdata = new RegressionProblemData(dataset, dataset.VariableNames.Where(x => !x.Equals("output")), "output");
+      problemdata.TrainingPartition.Start = 0;
+      problemdata.TrainingPartition.End = dataset.Rows;
+      problemdata.TestPartition.Start = dataset.Rows;
+      problemdata.TestPartition.End = dataset.Rows;
+
+      //train 
+      var problem = (RegressionProblem)RegressionAlgorithm.Problem;
+      problem.ProblemDataParameter.Value = problemdata;
+      var i = 0;
+      IRegressionSolution solution = null;
+
+      while (solution == null && i++ < 100) {
+        var results = EgoUtilities.SyncRunSubAlgorithm(RegressionAlgorithm, Random.Next(int.MaxValue), cancellationToken);
+        solution = results.Select(x => x.Value).OfType<IRegressionSolution>().SingleOrDefault();
+        cancellationToken.ThrowIfCancellationRequested();
+      }
+
+      //try creating a model with old hyperparameters and new dataset;
+      var gp = RegressionAlgorithm as GaussianProcessRegression;
+      var oldmodel = ResultsModel as GaussianProcessRegressionSolution;
+      if (gp != null && oldmodel != null) {
+        var n = Samples.First().Item1.Length;
+        var mean = (IMeanFunction)oldmodel.Model.MeanFunction.Clone();
+        var cov = (ICovarianceFunction)oldmodel.Model.CovarianceFunction.Clone();
+        if (mean.GetNumberOfParameters(n) != 0 || cov.GetNumberOfParameters(n) != 0) throw new ArgumentException("DEBUG: assumption about fixed paramters wrong");
+        var noise = 0.0;
+        double[] hyp = { noise };
+        try {
+          var model = new GaussianProcessModel(problemdata.Dataset, problemdata.TargetVariable,
+            problemdata.AllowedInputVariables, problemdata.TrainingIndices, hyp, mean, cov);
+          model.FixParameters();
+          var sol = new GaussianProcessRegressionSolution(model, problemdata);
+          if (solution == null || solution.TrainingMeanSquaredError > sol.TrainingMeanSquaredError) {
+            solution = sol;
+          }
+        }
+        catch (ArgumentException) { }
+      }
+
+
+      if (!ResultsQualities.Rows.ContainsKey("DEBUG: Degenerates")) ResultsQualities.Rows.Add(new DataRow("DEBUG: Degenerates"));
+      var row = ResultsQualities.Rows["DEBUG: Degenerates"];
+      row.Values.Add(i - 1);
+      if (solution == null) Results.Add(new Result("Status", new StringValue("The Algorithm did not return a Model")));
+      else {
+        if (!ResultsQualities.Rows.ContainsKey("DEBUG: RMSE")) ResultsQualities.Rows.Add(new DataRow("DEBUG: RMSE"));
+        row = ResultsQualities.Rows["DEBUG: RMSE"];
+        row.Values.Add(Math.Sqrt(solution.TrainingMeanSquaredError));
+      }
+
+      RegressionAlgorithm.Runs.Clear();
+      return solution;
+    }
+    private IntegerVector OptimizeInfillProblem(CancellationToken cancellationToken) {
+      //parameterize and check InfillProblem
+      var infillProblem = InfillOptimizationAlgorithm.Problem as DiscreteInfillProblem;
+      if (infillProblem == null) throw new ArgumentException("InfillOptimizationAlgorithm does not have an InfillProblem.");
+      if (infillProblem.InfillCriterion != InfillCriterion) throw new ArgumentException("InfillCiriterion for Problem is not correctly set.");
+      var enc = Problem.Encoding as IntegerVectorEncoding;
+      infillProblem.Encoding.Bounds = enc.Bounds;
+      infillProblem.Encoding.Length = enc.Length;
+      infillProblem.Initialize(ResultsModel, Problem.Maximization);
+
+
+
+      IntegerVector bestVector = null;
+      var bestValue = infillProblem.Maximization ? double.NegativeInfinity : double.PositiveInfinity;
+      for (var i = 0; i < InfillOptimizationRestarts; i++) {
+        //optimize
+        var res = EgoUtilities.SyncRunSubAlgorithm(InfillOptimizationAlgorithm, Random.Next(int.MaxValue), cancellationToken);
+        cancellationToken.ThrowIfCancellationRequested();
+        //extract results
+        if (!res.ContainsKey(DiscreteInfillProblem.BestInfillSolutionResultName)) throw new ArgumentException("The InfillOptimizationAlgorithm did not return a best solution");
+        var v = res[DiscreteInfillProblem.BestInfillSolutionResultName].Value as IntegerVector;
+        if (!res.ContainsKey(DiscreteInfillProblem.BestInfillQualityResultName)) throw new ArgumentException("The InfillOptimizationAlgorithm did not return a best quality");
+        var d = res[DiscreteInfillProblem.BestInfillQualityResultName].Value as DoubleValue;
+        if (d == null || v == null) throw new ArgumentException("The InfillOptimizationAlgorithm did not return the expected result types");
+        //check for improvement
+        if (infillProblem.Maximization != d.Value > bestValue) continue;
+        bestValue = d.Value;
+        bestVector = v;
+      }
+      InfillOptimizationAlgorithm.Runs.Clear();
+      return bestVector;
+    }
+
+    private void Analyze() {
+      ResultsEvaluations = Samples.Count;
+      var max = Samples.ArgMax(x => x.Item2);
+      var min = Samples.ArgMin(x => x.Item2);
+      var best = Samples[Problem.Maximization ? max : min];
+      ResultsBestQuality = best.Item2;
+      ResultsBestSolution = best.Item1;
+      ResultsQualitiesBest.Values.Add(ResultsBestQuality);
+      ResultsQualitiesIteration.Values.Add(Samples[Samples.Count - 1].Item2);
+      ResultsQualitiesWorst.Values.Add(Samples[Problem.Maximization ? min : max].Item2);
+      Problem.Analyze(Samples.Select(x => GetIndividual(x.Item1)).ToArray(), Samples.Select(x => x.Item2).ToArray(), Results, Random);
+      if (Samples.Count != 0 && Samples[0].Item1.Length == 2) AnalyzeSampleDistribution();
+      AnalyzePredictionCorrelation();
+    }
+
+    private void AnalyzeSampleDistribution() {
+      const string plotname = "DEBUG:Sample Distribution";
+      const string rowInit = "Initial Samples";
+      const string rowAll = "All Samples";
+      if (!Results.ContainsKey(plotname)) Results.Add(new Result(plotname, new ScatterPlot()));
+      var plot = (ScatterPlot)Results[plotname].Value;
+      if (!plot.Rows.ContainsKey(rowInit) && InitialSamples != null && InitialSamples.Count > 0)
+        plot.Rows.Add(new ScatterPlotDataRow(rowInit, "samples from inital file (already evaulated)", InitialSamples.Select(x => new Point2D<double>(x.Item1[0], x.Item1[1]))));
+      if (!plot.Rows.ContainsKey(rowAll)) plot.Rows.Add(new ScatterPlotDataRow(rowAll, "All samples", new Point2D<double>[0]));
+      else { plot.Rows[rowAll].Points.Clear(); }
+      plot.Rows[rowAll].Points.AddRange(Samples.Select(x => new Point2D<double>(x.Item1[0], x.Item1[1])));
+    }
+
+    private void AnalyzePredictionCorrelation() {
+      const string plotName = "Prediction";
+      const string rowName = "Samples";
+      const string lastrowName = "Last Sample";
+      if (!Results.ContainsKey(plotName)) Results.Add(new Result(plotName, new ScatterPlot()));
+      var plot = (ScatterPlot)Results[plotName].Value;
+      if (!plot.Rows.ContainsKey(rowName)) plot.Rows.Add(new ScatterPlotDataRow(rowName, rowName, new List<Point2D<double>>()));
+      if (!plot.Rows.ContainsKey(lastrowName)) plot.Rows.Add(new ScatterPlotDataRow(lastrowName, lastrowName, new List<Point2D<double>>()));
+      var p = Samples[Samples.Count - 1];
+      if (ResultsModel != null) plot.Rows[rowName].Points.Add(new Point2D<double>(ResultsModel.Model.GetEstimation(p.Item1), p.Item2, p.Item1));
+      plot.VisualProperties.YAxisTitle = "True Objective Value";
+      plot.VisualProperties.XAxisTitle = "Predicted Objective Value";
+
+    }
+
+
+
+    private Individual GetIndividual(IntegerVector r) {
+      var scope = new Scope();
+      scope.Variables.Add(new Variable(Problem.Encoding.Name, r));
+      return new SingleEncodingIndividual(Problem.Encoding, scope);
+    }
+    private Tuple<IntegerVector, double> Evaluate(IntegerVector point) {
+      return new Tuple<IntegerVector, double>(point, Problem.Evaluate(GetIndividual(point), Random));
+    }
+
+    private void SetInfillProblem() {
+      InfillOptimizationAlgorithm.Problem = new DiscreteInfillProblem { InfillCriterion = InfillCriterion };
+    }
+    #endregion
+  }
+}
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteEvaluatedSolutionsAnalyzer.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteEvaluatedSolutionsAnalyzer.cs	(revision 15343)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteEvaluatedSolutionsAnalyzer.cs	(revision 15343)
@@ -0,0 +1,104 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+namespace HeuristicLab.Algorithms.EGO {
+  [Item("DiscreteEvaluatedSolutionsAnalyzer", "Displays the evaluated Solutions for one or two dimensional problems")]
+  [StorableClass]
+  public class DiscreteEvaluatedSolutionsAnalyzer : SingleSuccessorOperator, IAnalyzer, IResultsOperator {
+    public override bool CanChangeName => true;
+    public bool EnabledByDefault => false;
+
+    public IScopeTreeLookupParameter<IntegerVector> IntegerVectorParameter => (IScopeTreeLookupParameter<IntegerVector>)Parameters["IntegerVector"];
+    public IScopeTreeLookupParameter<DoubleValue> QualityParameter => (IScopeTreeLookupParameter<DoubleValue>)Parameters["Quality"];
+    public ILookupParameter<ResultCollection> ResultsParameter => (ILookupParameter<ResultCollection>)Parameters["Results"];
+    public ILookupParameter<BoolValue> PhaseParameter => (ILookupParameter<BoolValue>)Parameters["InitialPhase"];
+
+    private const string PlotName = "Evaluated Solutions Plot";
+    private const string InitialRowName = "Initial Samples";
+    private const string AdaptiveRowName = "Adaptive Samples";
+
+
+    [StorableConstructor]
+    protected DiscreteEvaluatedSolutionsAnalyzer(bool deserializing) : base(deserializing) { }
+    protected DiscreteEvaluatedSolutionsAnalyzer(DiscreteEvaluatedSolutionsAnalyzer original, Cloner cloner) : base(original, cloner) { }
+    public DiscreteEvaluatedSolutionsAnalyzer() {
+      Parameters.Add(new ScopeTreeLookupParameter<IntegerVector>("IntegerVector", "The vector which should be collected."));
+      Parameters.Add(new ScopeTreeLookupParameter<DoubleValue>("Quality", "The quality associated which this vector"));
+      Parameters.Add(new LookupParameter<BoolValue>("InitialPhase", "Whether the initial phase has finished"));
+      Parameters.Add(new LookupParameter<ResultCollection>("Results", "The collection to store the results in."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DiscreteEvaluatedSolutionsAnalyzer(this, cloner);
+    }
+
+    public sealed override IOperation Apply() {
+      var p = IntegerVectorParameter.ActualValue.ToArray();
+      if (p.Length == 0 || p[0].Length > 2 || p[0].Length == 0) return base.Apply();
+      var results = ResultsParameter.ActualValue;
+      var q = QualityParameter.ActualValue.Select(x => x.Value).ToArray();
+
+      var plot = CreateScatterPlotResult(results, p[0].Length);
+      var points = plot.Rows[PhaseParameter.ActualValue.Value ? AdaptiveRowName : InitialRowName].Points;
+      if (p[0].Length == 2)
+        for (var i = 0; i < q.Length; i++) points.Add(new Point2D<double>(p[i][0], p[i][1], q[i]));
+      else
+        for (var i = 0; i < q.Length; i++) points.Add(new Point2D<double>(p[i][0], q[i]));
+      return base.Apply();
+
+    }
+
+    private static ScatterPlot CreateScatterPlotResult(ResultCollection results, int dim) {
+      ScatterPlot plot;
+      if (!results.ContainsKey(PlotName)) {
+        plot = new ScatterPlot("Evaluated Solutions", "The solution evaluated so far") {
+          VisualProperties = {
+            XAxisTitle = "First Dimension",
+            YAxisTitle = dim==2?"Second Dimension":"Quality"
+          }
+        };
+        results.Add(new Result(PlotName, plot));
+      } else { plot = (ScatterPlot)results[PlotName].Value; }
+      if (!plot.Rows.ContainsKey(InitialRowName)) {
+        plot.Rows.Add(new ScatterPlotDataRow(InitialRowName, InitialRowName, new List<Point2D<double>>()));
+        plot.Rows[InitialRowName].VisualProperties.PointSize = 5;
+      }
+      if (!plot.Rows.ContainsKey(AdaptiveRowName)) {
+        plot.Rows.Add(new ScatterPlotDataRow(AdaptiveRowName, AdaptiveRowName, new List<Point2D<double>>()));
+        plot.Rows[AdaptiveRowName].VisualProperties.PointSize = 5;
+      }
+      return plot;
+    }
+
+  }
+}
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteInfillProblem.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteInfillProblem.cs	(revision 15343)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteInfillProblem.cs	(revision 15343)
@@ -0,0 +1,131 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Linq;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Algorithms.EGO {
+  [StorableClass]
+  [Item("DiscreteInfillProblem", "A problem for finding the most interesing potential new sampling Points by optimizing some InfillCriterion")]
+  public sealed class DiscreteInfillProblem : SingleObjectiveBasicProblem<IntegerVectorEncoding> {
+
+    public override bool Maximization => true;
+
+    #region ProblemResultNames
+    public const string BestInfillSolutionResultName = "BestInfillSolution";
+    public const string BestInfillQualityResultName = "BestInfillQuality";
+    #endregion
+
+    #region Properties
+    [Storable]
+    private IInfillCriterion infillCriterion;
+
+    public IInfillCriterion InfillCriterion {
+      get { return infillCriterion; }
+      set {
+        infillCriterion = value;
+        infillCriterion.Encoding = GetRealVectorEncoding(Encoding);
+      }
+    }
+    #endregion
+
+    #region Constructors
+    [StorableConstructor]
+    private DiscreteInfillProblem(bool deserializing) : base(deserializing) { }
+    private DiscreteInfillProblem(DiscreteInfillProblem original, Cloner cloner) : base(original, cloner) {
+      infillCriterion = cloner.Clone(original.infillCriterion);
+    }
+    public DiscreteInfillProblem() { }
+    public override IDeepCloneable Clone(Cloner cloner) { return new DiscreteInfillProblem(this, cloner); }
+    #endregion
+
+    public override double Evaluate(Individual individual, IRandom r) {
+      return !InBounds(individual.IntegerVector(), Encoding.Bounds) ? double.MinValue : InfillCriterion.Evaluate(individual.IntegerVector().ToRealVector());
+    }
+    public override void Analyze(Individual[] individuals, double[] qualities, ResultCollection results, IRandom random) {
+      base.Analyze(individuals, qualities, results, random);
+      var best = qualities.ArgMax(x => x);
+      var newQuality = qualities[best];
+      if (!results.ContainsKey(BestInfillQualityResultName)) {
+        results.Add(new Result(BestInfillSolutionResultName, (IntegerVector)individuals[best].IntegerVector().Clone()));
+        results.Add(new Result(BestInfillQualityResultName, new DoubleValue(newQuality)));
+        return;
+      }
+      var qold = results[BestInfillQualityResultName].Value as DoubleValue;
+      if (qold == null) throw new ArgumentException("Old best quality is not a double value. Conflicting Analyzers?");
+      if (qold.Value >= newQuality) return;
+      results[BestInfillSolutionResultName].Value = (IntegerVector)individuals[best].IntegerVector().Clone();
+      qold.Value = newQuality;
+    }
+    public override IEnumerable<Individual> GetNeighbors(Individual individual, IRandom random) {
+      var bounds = Encoding.Bounds;
+      var michalewiczIteration = 0;
+      var sigma = new DoubleArray(new double[] { 1.0 });
+
+      while (true) {
+        var neighbour = individual.Copy();
+        var r = neighbour.IntegerVector();
+        switch (random.Next(3) % 3) {
+          case 0: HeuristicLab.Encodings.IntegerVectorEncoding.UniformOnePositionManipulator.Apply(random, r, bounds); break;
+          case 1: HeuristicLab.Encodings.IntegerVectorEncoding.RoundedNormalAllPositionsManipulator.Apply(random, r, bounds, sigma); break;//FixedNormalAllPositionsManipulator.Apply(random, r, new RealVector(new[] { 0.1 })); break;
+          case 2: HeuristicLab.Encodings.IntegerVectorEncoding.UniformSomePositionsManipulator.Apply(random, r, bounds, 0.1); break;
+          default: throw new NotImplementedException();
+        }
+        yield return neighbour;
+        michalewiczIteration %= 10000;
+      }
+    }
+
+    public void Initialize(IRegressionSolution model, bool expensiveMaximization) {
+      infillCriterion.RegressionSolution = model;
+      infillCriterion.ExpensiveMaximization = expensiveMaximization;
+      infillCriterion.Encoding = GetRealVectorEncoding(Encoding);
+      infillCriterion.Initialize();
+    }
+
+    #region helpers
+    private static bool InBounds(IntegerVector r, IntMatrix bounds) {
+      return !r.Where((t, i) => t < bounds[i % bounds.Rows, 0] || t > bounds[i % bounds.Rows, 1]).Any();
+    }
+
+    private static RealVectorEncoding GetRealVectorEncoding(IntegerVectorEncoding enc) {
+      var res = new RealVectorEncoding(enc.Length);
+      res.Bounds = new DoubleMatrix(enc.Bounds.Rows, enc.Bounds.Columns);
+      for (int r = 0; r < res.Bounds.Rows; r++)
+        for (int c = 0; c < res.Bounds.Columns; c++)
+          res.Bounds[r, c] = enc.Bounds[r, c];
+      return res;
+
+
+    }
+    #endregion
+
+  }
+}
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteInfillSolver.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteInfillSolver.cs	(revision 15343)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteInfillSolver.cs	(revision 15343)
@@ -0,0 +1,146 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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.Linq;
+using System.Collections.Generic;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Algorithms.EGO {
+  [Item("DiscreteInfillSolver", "An IntegerVectorCreator that creates candidates by optimizing an infill-subproblem")]
+  [StorableClass]
+  public class DiscreteInfillSolver : IntegerVectorCreator, ICancellableOperator {
+
+    public ILookupParameter<IAlgorithm> InfillOptimizationAlgorithmParamter => (ILookupParameter<IAlgorithm>)Parameters["InfillAlgorithm"];
+    public ILookupParameter<IRegressionSolution> ModelParameter => (ILookupParameter<IRegressionSolution>)Parameters["Model"];
+    public ILookupParameter<BoolValue> MaximizationParameter => (ILookupParameter<BoolValue>)Parameters["Maximization"];
+    public ILookupParameter<BoolValue> RemoveDuplicatesParameter => (ILookupParameter<BoolValue>)Parameters["RemoveDuplicates"];
+    public IFixedValueParameter<DoubleValue> DuplicateCutoffParameter => (IFixedValueParameter<DoubleValue>)Parameters["Duplicates Cutoff"];
+    public ILookupParameter<IntMatrix> InfillBoundsParameter => (ILookupParameter<IntMatrix>)Parameters["InfillBounds"];
+
+    public CancellationToken Cancellation { get; set; }
+
+    [StorableConstructor]
+    protected DiscreteInfillSolver(bool deserializing) : base(deserializing) { }
+    protected DiscreteInfillSolver(DiscreteInfillSolver original, Cloner cloner) : base(original, cloner) { }
+    public DiscreteInfillSolver() {
+      Parameters.Add(new LookupParameter<IAlgorithm>("InfillAlgorithm", "The algorithm used to optimize the infill problem") { Hidden = true });
+      Parameters.Add(new LookupParameter<IRegressionSolution>("Model", "The RegressionSolution upon which the InfillProblem operates") { Hidden = true });
+      Parameters.Add(new LookupParameter<BoolValue>("Maximization", "Whether the original problem is a maximization problem") { Hidden = true });
+      Parameters.Add(new LookupParameter<BoolValue>("RemoveDuplicates", "Whether duplicates shall be removed") { Hidden = true });
+      Parameters.Add(new FixedValueParameter<DoubleValue>("Duplicates Cutoff", "The cut off radius for", new DoubleValue(0.01)) { Hidden = false });
+      Parameters.Add(new LookupParameter<IntMatrix>("InfillBounds", "The bounds applied for infill solving") { Hidden = true });
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DiscreteInfillSolver(this, cloner);
+    }
+
+    protected override IntegerVector Create(IRandom random, IntValue length, IntMatrix bounds) {
+      var infillBounds = InfillBoundsParameter.ActualValue;
+      if (infillBounds != null && infillBounds.Rows > 0) {
+        bounds = infillBounds;
+      }
+
+      var alg = InfillOptimizationAlgorithmParamter.ActualValue;
+      var model = ModelParameter.ActualValue;
+      var max = MaximizationParameter.ActualValue.Value;
+      var res = OptimizeInfillProblem(alg, model, max, bounds, length.Value, random);
+      var rad = DuplicateCutoffParameter.Value.Value;
+      if (!RemoveDuplicatesParameter.ActualValue.Value || GetMinDifference(model.ProblemData.Dataset, res) >= rad * rad) return res;
+
+      bool changed = false;
+      var steps = 0;
+      var dims = new List<int>();
+
+      //TODO this may take a long time to compute if many samples have already been evaluated in the surrounding area
+      //as the preferred region can not be sampled denser and denser due to the disceretization, the variance between two sampled points may be impossible to decease
+
+      //TODO speed up GetMinDifferecnce via tree-structure
+      while (!changed || GetMinDifference(model.ProblemData.Dataset, res) < rad * rad) {
+        if (dims.Count == 0) {
+          if (!changed && steps > 0) throw new ArgumentException("Can not avoid duplicate");
+          dims = Enumerable.Range(0, res.Length).ToList();
+          steps++;
+          changed = false;
+        }
+        var i = random.Next(dims.Count);
+        var dim = dims[i];
+        dims.RemoveAt(i);
+        var step = bounds[dim % bounds.Rows, 2] * steps;
+        var low = checkIntBounds(bounds, dim, res[dim] - step);
+        var high = checkIntBounds(bounds, dim, res[dim] + step);
+        if (!low && !high) continue;
+        else if (low && high) res[dim] += (random.NextDouble() < 0.5 ? -step : step);
+        else if (low) res[dim] -= step;
+        else res[dim] += step;
+        changed = true;
+      }
+      return res;
+    }
+
+
+    private bool checkIntBounds(IntMatrix b, int row, int value) {
+      var bi = row % b.Rows;
+      var l = b[bi, 0];
+      var h = b[bi, 1];
+      var s = b[bi, 2];
+      return l <= value && h >= value && (value - l) % s == 0;
+    }
+
+    private IntegerVector OptimizeInfillProblem(IAlgorithm algorithm, IRegressionSolution model, bool maximization, IntMatrix bounds, int length, IRandom random) {
+      var infillProblem = algorithm.Problem as DiscreteInfillProblem;
+      if (infillProblem == null) throw new ArgumentException("The algortihm has no InfillProblem to solve");
+      infillProblem.Encoding.Length = length;
+      infillProblem.Encoding.Bounds = bounds;
+      infillProblem.Initialize(model, maximization);
+      var res = EgoUtilities.SyncRunSubAlgorithm(algorithm, random.Next(int.MaxValue), Cancellation);
+      var v = res[DiscreteInfillProblem.BestInfillSolutionResultName].Value as IntegerVector;
+      algorithm.Runs.Clear();
+      return v;
+    }
+
+    private static double GetMinDifference(IDataset data, IntegerVector r) {
+      var mind = double.MaxValue;
+      for (var i = 0; i < data.Rows; i++) {
+        var d = 0.0;
+        for (var j = 0; j < r.Length; j++) {
+          var d2 = data.GetDoubleValue("input" + j, i) - r[j];
+          d += d2 * d2;
+        }
+        if (!(d < mind)) continue;
+        mind = d;
+      }
+      return mind;
+    }
+
+
+
+  }
+}
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteSampleCollector.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteSampleCollector.cs	(revision 15343)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/DiscreteEGO/DiscreteSampleCollector.cs	(revision 15343)
@@ -0,0 +1,81 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Operators;
+using HeuristicLab.Parameters;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using HeuristicLab.Problems.DataAnalysis;
+
+namespace HeuristicLab.Algorithms.EGO {
+  [Item("DiscreteSampleCollector", "Collects IntegerVectors into a modifiablbe dataset")]
+  [StorableClass]
+  public class DiscreteSampleCollector : InstrumentedOperator {
+    public override bool CanChangeName => true;
+
+    public ILookupParameter<IntegerVector> IntegerVectorParameter => (ILookupParameter<IntegerVector>)Parameters["IntegerVector"];
+    public ILookupParameter<DoubleValue> QualityParameter => (ILookupParameter<DoubleValue>)Parameters["Quality"];
+    public ILookupParameter<ModifiableDataset> DatasetParameter => (ILookupParameter<ModifiableDataset>)Parameters["Dataset"];
+
+    [StorableConstructor]
+    protected DiscreteSampleCollector(bool deserializing) : base(deserializing) { }
+    protected DiscreteSampleCollector(DiscreteSampleCollector original, Cloner cloner) : base(original, cloner) { }
+    public DiscreteSampleCollector() {
+      Parameters.Add(new LookupParameter<IntegerVector>("IntegerVector", "The vector which should be collected."));
+      Parameters.Add(new LookupParameter<DoubleValue>("Quality", "The quality associated which this vector"));
+      Parameters.Add(new LookupParameter<ModifiableDataset>("Dataset", "The Dataset in wich new samples are stored."));
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new DiscreteSampleCollector(this, cloner);
+    }
+
+    public sealed override IOperation InstrumentedApply() {
+      var vector = IntegerVectorParameter.ActualValue;
+      var quality = QualityParameter.ActualValue.Value;
+      var data = DatasetParameter.ActualValue;
+
+      if (data.Columns != vector.Length + 1) {
+        if (data.Columns != 0 || data.Rows != 0) throw new OperatorExecutionException(this, "dataset columns do not match samplesize+1");
+        for (var i = 0; i < vector.Length; i++)
+          data.AddVariable("input" + i, new double[0]);
+        data.AddVariable("output", new double[0]);
+      }
+      AddRow(data, vector, quality);
+      return base.InstrumentedApply(); ;
+    }
+
+
+    private static void AddRow(ModifiableDataset data, IntegerVector vector, double quality) {
+      var row = new object[vector.Length + 1];
+      for (var i = 0; i < vector.Length; i++)
+        row[i] = (double)vector[i];
+      row[vector.Length] = quality;
+      data.AddRow(row);
+    }
+
+
+
+  }
+}
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/EfficientGlobalOptimizationAlgorithm.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/EfficientGlobalOptimizationAlgorithm.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/EfficientGlobalOptimizationAlgorithm.cs	(revision 15343)
@@ -96,5 +96,5 @@
     public IFixedValueParameter<FileValue> InitialSamplesParameter => Parameters[InitialSamplesParameterName] as IFixedValueParameter<FileValue>;
     public IValueParameter<RealVector> BaselineVectorParameter => Parameters[BaselineVectorParameterName] as IValueParameter<RealVector>;
-    public IConstrainedValueParameter<IInitialSampling> InitialSamplingPlanParameter => Parameters[InitialSamplingPlanParamterName] as IConstrainedValueParameter<IInitialSampling>;
+    public IConstrainedValueParameter<IInitialSampling<RealVector>> InitialSamplingPlanParameter => Parameters[InitialSamplingPlanParamterName] as IConstrainedValueParameter<IInitialSampling<RealVector>>;
     #endregion
 
@@ -116,5 +116,5 @@
     private bool RemoveDuplicates => RemoveDuplicatesParameter.Value.Value;
     private RealVector BaselineVector => BaselineVectorParameter.Value;
-    private IInitialSampling InitialSamplingPlan => InitialSamplingPlanParameter.Value;
+    private IInitialSampling<RealVector> InitialSamplingPlan => InitialSamplingPlanParameter.Value;
     #endregion
 
@@ -200,6 +200,6 @@
       var criteria = new ItemSet<IInfillCriterion> { new ExpectedImprovement(), new AugmentedExpectedImprovement(), new ExpectedQuality(), eqi, new MinimalQuantileCriterium(), new PluginExpectedImprovement() };
       Parameters.Add(new ConstrainedValueParameter<IInfillCriterion>(InfillCriterionParameterName, "Decision what value should decide the next sample", criteria, criteria.First()));
-      var intialSamplingPlans = new ItemSet<IInitialSampling> { new UniformRandomSampling(), new LatinHyperCubeDesignCreator() };
-      Parameters.Add(new ConstrainedValueParameter<IInitialSampling>(InitialSamplingPlanParamterName, "Determies the initial samples from which the first model can be built.", intialSamplingPlans, intialSamplingPlans.First()));
+      var intialSamplingPlans = new ItemSet<IInitialSampling<RealVector>> { new UniformRandomSampling(), new LatinHyperCubeDesignCreator() };
+      Parameters.Add(new ConstrainedValueParameter<IInitialSampling<RealVector>>(InitialSamplingPlanParamterName, "Determies the initial samples from which the first model can be built.", intialSamplingPlans, intialSamplingPlans.First()));
       SetInfillProblem();
       RegisterEventhandlers();
@@ -246,5 +246,6 @@
             Samples.Add(Evaluate(t));
             cancellationToken.ThrowIfCancellationRequested();
-          } finally {
+          }
+          finally {
             Analyze();
           }
@@ -264,5 +265,6 @@
           }
 
-        } finally {
+        }
+        finally {
           Analyze();
         }
@@ -363,5 +365,6 @@
             solution = sol;
           }
-        } catch (ArgumentException) { }
+        }
+        catch (ArgumentException) { }
       }
 
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/EgoUtilities.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/EgoUtilities.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/EgoUtilities.cs	(revision 15343)
@@ -27,4 +27,5 @@
 using HeuristicLab.Data;
 using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
 using HeuristicLab.Optimization;
 using HeuristicLab.Problems.DataAnalysis;
@@ -54,6 +55,14 @@
       return model.GetEstimatedValues(dataset, new[] { 0 }).First();
     }
+    public static double GetEstimation(this IRegressionModel model, IntegerVector r) {
+      var dataset = GetDataSet(new[] { new Tuple<IntegerVector, double>(r, 0.0) });
+      return model.GetEstimatedValues(dataset, new[] { 0 }).First();
+    }
     public static double GetVariance(this IConfidenceRegressionModel model, RealVector r) {
       var dataset = GetDataSet(new[] { new Tuple<RealVector, double>(r, 0.0) }, false);
+      return model.GetEstimatedVariances(dataset, new[] { 0 }).First();
+    }
+    public static double GetVariance(this IConfidenceRegressionModel model, IntegerVector r) {
+      var dataset = GetDataSet(new[] { new Tuple<IntegerVector, double>(r, 0.0) });
       return model.GetEstimatedVariances(dataset, new[] { 0 }).First();
     }
@@ -61,4 +70,8 @@
       return dataset.GetDoubleValue("input" + j, i);
     }
+    public static RealVector ToRealVector(this IntegerVector vector) {
+      return new RealVector(vector.Select(x => (double)x).ToArray());
+    }
+
 
     //Sub-ALgorithms
@@ -80,4 +93,16 @@
     public static Dataset GetDataSet(IReadOnlyList<Tuple<RealVector, double>> samples, bool removeDuplicates) {
       if (removeDuplicates) samples = RemoveDuplicates(samples); //TODO duplicate removal leads to incorrect uncertainty values in models
+      var dimensions = samples[0].Item1.Length + 1;
+      var data = new double[samples.Count, dimensions];
+      var names = new string[dimensions - 1];
+      for (var i = 0; i < names.Length; i++) names[i] = "input" + i;
+      for (var j = 0; j < samples.Count; j++) {
+        for (var i = 0; i < names.Length; i++) data[j, i] = samples[j].Item1[i];
+        data[j, dimensions - 1] = samples[j].Item2;
+      }
+      return new Dataset(names.Concat(new[] { "output" }).ToArray(), data);
+    }
+    //overload for IntegerVectors does not support duplicate removal
+    public static Dataset GetDataSet(IReadOnlyList<Tuple<IntegerVector, double>> samples) {
       var dimensions = samples[0].Item1.Length + 1;
       var data = new double[samples.Count, dimensions];
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/HeuristicLab.Algorithms.EGO-3.4.csproj
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/HeuristicLab.Algorithms.EGO-3.4.csproj	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/HeuristicLab.Algorithms.EGO-3.4.csproj	(revision 15343)
@@ -39,4 +39,8 @@
       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.DataAnalysis-3.4.dll</HintPath>
     </Reference>
+    <Reference Include="HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.dll</HintPath>
+    </Reference>
     <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
       <SpecificVersion>False</SpecificVersion>
@@ -58,4 +62,8 @@
       <SpecificVersion>False</SpecificVersion>
       <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Encodings.IntegerVectorEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\trunk\sources\bin\HeuristicLab.Encodings.IntegerVectorEncoding-3.3.dll</HintPath>
     </Reference>
     <Reference Include="HeuristicLab.Encodings.PermutationEncoding-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
@@ -107,4 +115,10 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="DiscreteEGO\DiscreteCorrelationAnalyzer.cs" />
+    <Compile Include="DiscreteEGO\DiscreteAdaptiveSamplingAlgorithm.cs" />
+    <Compile Include="DiscreteEGO\DiscreteEfficientGlobalOptimizationAlgorithm.cs" />
+    <Compile Include="DiscreteEGO\DiscreteInfillSolver.cs" />
+    <Compile Include="DiscreteEGO\DiscreteSampleCollector.cs" />
+    <Compile Include="DiscreteEGO\DiscreteEvaluatedSolutionsAnalyzer.cs" />
     <Compile Include="EgoUtilities.cs" />
     <Compile Include="EfficientGlobalOptimizationAlgorithm.cs" />
@@ -133,8 +147,10 @@
     <Compile Include="Operators\SampleCollector.cs" />
     <Compile Include="Plugin.cs" />
+    <Compile Include="DiscreteEGO\DiscreteInfillProblem.cs" />
     <Compile Include="Problems\InfillProblem.cs" />
     <Compile Include="Properties\AssemblyInfo.cs" />
     <Compile Include="SamplingMethods\LatinHyperCubeDesignOLD.cs" />
     <Compile Include="SamplingMethods\LatinHyperCubeDesignCreator.cs" />
+    <Compile Include="SamplingMethods\UniformRandomDiscreteSampling.cs" />
     <Compile Include="SamplingMethods\UniformRandomSampling.cs" />
   </ItemGroup>
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Interfaces/IInfillCriterion.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Interfaces/IInfillCriterion.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Interfaces/IInfillCriterion.cs	(revision 15343)
@@ -32,5 +32,4 @@
     RealVectorEncoding Encoding { get; set; }
     double Evaluate(RealVector vector);
-    //bool Maximization();
     void Initialize();
   }
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Interfaces/IInitialSampling.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Interfaces/IInitialSampling.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Interfaces/IInitialSampling.cs	(revision 15343)
@@ -22,9 +22,9 @@
 // ReSharper disable once CheckNamespace
 using HeuristicLab.Core;
-using HeuristicLab.Encodings.RealVectorEncoding;
+using HeuristicLab.Optimization;
 
 namespace HeuristicLab.Algorithms.EGO {
-  public interface IInitialSampling : INamedItem {
-    RealVector[] GetSamples(int noSamples, RealVector[] existingSamples, RealVectorEncoding encoding, IRandom random);
+  public interface IInitialSampling<T> : INamedItem where T : class {
+    T[] GetSamples(int noSamples, T[] existingSamples, IEncoding encoding, IRandom random);
   }
 }
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/EvaluatedSolutionsAnalyzer.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/EvaluatedSolutionsAnalyzer.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/EvaluatedSolutionsAnalyzer.cs	(revision 15343)
@@ -33,7 +33,4 @@
 
 namespace HeuristicLab.Algorithms.EGO {
-  /// <summary>
-  /// A base class for operators that manipulate real-valued vectors.
-  /// </summary>
   [Item("EvaluatedSolutionsAnalyzer", "Displays the evaluated Solutions for one or two dimensional problems")]
   [StorableClass]
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/InfillSolver.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/InfillSolver.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/InfillSolver.cs	(revision 15343)
@@ -32,7 +32,4 @@
 
 namespace HeuristicLab.Algorithms.EGO {
-  /// <summary>
-  /// A base class for operators that manipulate real-valued vectors.
-  /// </summary>
   [Item("InfillSolver", "A RealVectorCreator that creates candidates by optimizing an infill-subproblem")]
   [StorableClass]
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/ModelBuilder.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/ModelBuilder.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/ModelBuilder.cs	(revision 15343)
@@ -32,10 +32,6 @@
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
 using HeuristicLab.Problems.DataAnalysis;
-using HeuristicLab.Problems.SurrogateProblem;
 
 namespace HeuristicLab.Algorithms.EGO {
-  /// <summary>
-  /// A base class for operators that manipulate real-valued vectors.
-  /// </summary>
   [Item("ModelBuilder", "Builds a model from a dataset and a given RegressionAlgorithm")]
   [StorableClass]
@@ -120,6 +116,5 @@
         solution = SanitizeGaussianProcess(oldSolution as GaussianProcessRegressionSolution, solution as GaussianProcessRegressionSolution, Cancellation);
 
-      if (regressionAlgorithm is M5RegressionTree && oldSolution != null)
-        solution = SanitizeM5Regression(oldSolution.Model as M5Model, solution, random, Cancellation);
+      //if (regressionAlgorithm is M5RegressionTree && oldSolution != null) solution = SanitizeM5Regression(oldSolution.Model as M5Model, solution, random, Cancellation);
 
 
@@ -129,11 +124,11 @@
     }
 
-    private static IRegressionSolution SanitizeM5Regression(M5Model oldmodel, IRegressionSolution newSolution, IRandom random, CancellationToken cancellation) {
-      var problemdata = newSolution.ProblemData;
-      oldmodel.UpdateLeafModels(problemdata, problemdata.AllIndices, random, cancellation);
-      var oldSolution = oldmodel.CreateRegressionSolution(problemdata);
-      var magicDecision = newSolution.TrainingRSquared < oldSolution.TrainingRSquared - 0.05;
-      return magicDecision ? newSolution : oldmodel.CreateRegressionSolution(problemdata);
-    }
+    //private static IRegressionSolution SanitizeM5Regression(M5Model oldmodel, IRegressionSolution newSolution, IRandom random, CancellationToken cancellation) {
+    //  var problemdata = newSolution.ProblemData;
+    //  oldmodel.UpdateLeafModels(problemdata, problemdata.AllIndices, random, cancellation);
+    //  var oldSolution = oldmodel.CreateRegressionSolution(problemdata);
+    //  var magicDecision = newSolution.TrainingRSquared < oldSolution.TrainingRSquared - 0.05;
+    //  return magicDecision ? newSolution : oldmodel.CreateRegressionSolution(problemdata);
+    //}
 
     //try creating a model with old hyperparameters and new dataset;
@@ -150,5 +145,6 @@
           newSolution = sol;
         }
-      } catch (ArgumentException) { }
+      }
+      catch (ArgumentException) { }
       return newSolution;
     }
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/ModelQualityAnalyzer.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/ModelQualityAnalyzer.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/ModelQualityAnalyzer.cs	(revision 15343)
@@ -30,7 +30,4 @@
 
 namespace HeuristicLab.Algorithms.EGO {
-  /// <summary>
-  /// A base class for operators that manipulate real-valued vectors.
-  /// </summary>
   [Item("ModelQualityAnalyzer", "Collects RealVectors into a modifiablbe dataset")]
   [StorableClass]
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/SampleCollector.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/SampleCollector.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/Operators/SampleCollector.cs	(revision 15343)
@@ -30,7 +30,4 @@
 
 namespace HeuristicLab.Algorithms.EGO {
-  /// <summary>
-  /// A base class for operators that manipulate real-valued vectors.
-  /// </summary>
   [Item("SampleCollector", "Collects RealVectors into a modifiablbe dataset")]
   [StorableClass]
@@ -59,5 +56,4 @@
       var quality = QualityParameter.ActualValue.Value;
       var data = DatasetParameter.ActualValue;
-
       if (data.Columns != vector.Length + 1) {
         if (data.Columns != 0 || data.Rows != 0) throw new OperatorExecutionException(this, "dataset columns do not match samplesize+1");
@@ -70,5 +66,4 @@
     }
 
-
     private static void AddRow(ModifiableDataset data, RealVector vector, double quality) {
       var row = new object[vector.Length + 1];
@@ -78,7 +73,4 @@
       data.AddRow(row);
     }
-
-
-
   }
 }
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/SamplingMethods/LatinHyperCubeDesignCreator.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/SamplingMethods/LatinHyperCubeDesignCreator.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/SamplingMethods/LatinHyperCubeDesignCreator.cs	(revision 15343)
@@ -26,4 +26,5 @@
 using HeuristicLab.Core;
 using HeuristicLab.Data;
+using HeuristicLab.Optimization;
 using HeuristicLab.Encodings.PermutationEncoding;
 using HeuristicLab.Encodings.RealVectorEncoding;
@@ -36,5 +37,5 @@
   [StorableClass]
   [Item("LatinHyperCubeDesignCreator", "A latin hypercube sampling strategy for real valued optimization")]
-  public class LatinHyperCubeDesignCreator : RealVectorCreator, IInitialSampling {
+  public class LatinHyperCubeDesignCreator : RealVectorCreator, IInitialSampling<RealVector> {
     private IValueLookupParameter<IntValue> DesignSize => (IValueLookupParameter<IntValue>)Parameters["DesignSize"];
     [Storable]
@@ -54,6 +55,9 @@
     }
 
-    public RealVector[] GetSamples(int noSamples, RealVector[] existingSamples, RealVectorEncoding encoding, IRandom random) {
-      return GetSamples(random, encoding.Length, encoding.Bounds, noSamples);
+    public RealVector[] GetSamples(int noSamples, RealVector[] existingSamples, IEncoding encoding, IRandom random) {
+      var enc = encoding as RealVectorEncoding;
+
+
+      return GetSamples(random, enc.Length, enc.Bounds, noSamples);
     }
 
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/SamplingMethods/UniformRandomDiscreteSampling.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/SamplingMethods/UniformRandomDiscreteSampling.cs	(revision 15343)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/SamplingMethods/UniformRandomDiscreteSampling.cs	(revision 15343)
@@ -0,0 +1,70 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2016 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 HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Optimization;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+
+// ReSharper disable once CheckNamespace
+namespace HeuristicLab.Algorithms.EGO {
+
+  [StorableClass]
+  [Item("UniformRandomDiscreteSampling", "A uniform random sampling strategy for real valued optimization")]
+  public class UniformRandomDiscreteSampling : ParameterizedNamedItem, IInitialSampling<IntegerVector> {
+
+    #region HL-Constructors, Serialization and Cloning 
+    [StorableConstructor]
+    protected UniformRandomDiscreteSampling(bool deserializing) : base(deserializing) { }
+    protected UniformRandomDiscreteSampling(UniformRandomDiscreteSampling original, Cloner cloner) : base(original, cloner) { }
+    public UniformRandomDiscreteSampling() {
+    }
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new UniformRandomDiscreteSampling(this, cloner);
+    }
+
+    public IntegerVector[] GetSamples(int noSamples, IntegerVector[] existingSamples, IEncoding encoding, IRandom random) {
+      var enc = encoding as IntegerVectorEncoding;
+      var res = new IntegerVector[noSamples];
+      for (var i = 0; i < noSamples; i++) {
+        var r = new IntegerVector(enc.Length);
+        res[i] = r;
+        for (var j = 0; j < enc.Length; j++) {
+          var b = j % enc.Bounds.Rows;
+          r[j] = UniformRandom(enc.Bounds[b, 0], enc.Bounds[b, 1], random);
+        }
+      }
+      return res;
+    }
+    private static int UniformRandom(int min, int max, IRandom rand) {
+      return rand.Next(min, max + 1);  //TODO check wether max is inclusive or exclusive
+    }
+  }
+
+
+
+
+  #endregion
+
+
+}
+
Index: /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/SamplingMethods/UniformRandomSampling.cs
===================================================================
--- /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/SamplingMethods/UniformRandomSampling.cs	(revision 15342)
+++ /branches/EfficientGlobalOptimization/HeuristicLab.Algorithms.EGO/SamplingMethods/UniformRandomSampling.cs	(revision 15343)
@@ -22,4 +22,5 @@
 using HeuristicLab.Common;
 using HeuristicLab.Core;
+using HeuristicLab.Optimization;
 using HeuristicLab.Encodings.RealVectorEncoding;
 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
@@ -30,5 +31,5 @@
   [StorableClass]
   [Item("UniformRandomSampling", "A uniform random sampling strategy for real valued optimization")]
-  public class UniformRandomSampling : ParameterizedNamedItem, IInitialSampling {
+  public class UniformRandomSampling : ParameterizedNamedItem, IInitialSampling<RealVector> {
 
     #region HL-Constructors, Serialization and Cloning 
@@ -42,12 +43,13 @@
     }
 
-    public RealVector[] GetSamples(int noSamples, RealVector[] existingSamples, RealVectorEncoding encoding, IRandom random) {
+    public RealVector[] GetSamples(int noSamples, RealVector[] existingSamples, IEncoding encoding, IRandom random) {
+      var enc = encoding as RealVectorEncoding;
       var res = new RealVector[noSamples];
       for (var i = 0; i < noSamples; i++) {
-        var r = new RealVector(encoding.Length);
+        var r = new RealVector(enc.Length);
         res[i] = r;
-        for (var j = 0; j < encoding.Length; j++) {
-          var b = j % encoding.Bounds.Rows;
-          r[j] = UniformRandom(encoding.Bounds[b, 0], encoding.Bounds[b, 1], random);
+        for (var j = 0; j < enc.Length; j++) {
+          var b = j % enc.Bounds.Rows;
+          r[j] = UniformRandom(enc.Bounds[b, 0], enc.Bounds[b, 1], random);
         }
       }
