Index: /branches/3040_VectorBasedGP/HeuristicLab.Common/3.3/TypeExtensions.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Common/3.3/TypeExtensions.cs	(revision 18228)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Common/3.3/TypeExtensions.cs	(revision 18229)
@@ -35,5 +35,5 @@
         sb.Append(x.Namespace).Append(".");
       sb.Append(x.Name);
-      if (x.IsGenericType) {
+      if (x.IsGenericType && x.Name.Contains("`")) {
         Type[] genericParams = x.GetGenericArguments();
         sb.Remove(sb.ToString().LastIndexOf('`'), genericParams.Length.ToString().Length + 1);
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 18228)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.csproj	(revision 18229)
@@ -176,4 +176,5 @@
     <Compile Include="Mutators\MultiSymbolicDataAnalysisExpressionManipulator.cs" />
     <Compile Include="Interfaces\ISymbolicDataAnalysisExpressionManipulator.cs" />
+    <Compile Include="Mutators\NestedOptimizerSubVectorImprovementManipulator.cs" />
     <Compile Include="Mutators\SegmentOptimization\SamplingSegmentOptimizationManipulator.cs" />
     <Compile Include="Mutators\SamplingSubVectorImprovementManipulator.cs" />
@@ -378,4 +379,20 @@
   </ItemGroup>
   <ItemGroup>
+    <ProjectReference Include="..\..\HeuristicLab.Algorithms.EvolutionStrategy\3.3\HeuristicLab.Algorithms.EvolutionStrategy-3.3.csproj">
+      <Project>{e0b45023-cb84-48a1-a1b7-8295b64b7bad}</Project>
+      <Name>HeuristicLab.Algorithms.EvolutionStrategy-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Algorithms.GeneticAlgorithm\3.3\HeuristicLab.Algorithms.GeneticAlgorithm-3.3.csproj">
+      <Project>{a51da44f-cb35-4f6f-99f5-2a2e904ab93b}</Project>
+      <Name>HeuristicLab.Algorithms.GeneticAlgorithm-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm\3.3\HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3.csproj">
+      <Project>{f409dd9e-1e9c-4eb1-aa3a-9f6e987c6e58}</Project>
+      <Name>HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm-3.3</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\..\HeuristicLab.Algorithms.RandomSearch\3.3\HeuristicLab.Algorithms.RandomSearch-3.3.csproj">
+      <Project>{4a15dc1a-51ee-4cb7-ac05-f5afddece1b1}</Project>
+      <Name>HeuristicLab.Algorithms.RandomSearch-3.3</Name>
+    </ProjectReference>
     <ProjectReference Include="..\..\HeuristicLab.Analysis\3.3\HeuristicLab.Analysis-3.3.csproj">
       <Project>{887425B4-4348-49ED-A457-B7D2C26DDBF9}</Project>
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Mutators/NestedOptimizerSubVectorImprovementManipulator.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Mutators/NestedOptimizerSubVectorImprovementManipulator.cs	(revision 18229)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Mutators/NestedOptimizerSubVectorImprovementManipulator.cs	(revision 18229)
@@ -0,0 +1,235 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using HEAL.Attic;
+using HeuristicLab.Algorithms.EvolutionStrategy;
+using HeuristicLab.Algorithms.GeneticAlgorithm;
+using HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm;
+using HeuristicLab.Algorithms.RandomSearch;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.Encodings.IntegerVectorEncoding;
+using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
+using HeuristicLab.Optimization;
+using HeuristicLab.Parameters;
+using HeuristicLab.Random;
+using HeuristicLab.Selection;
+
+namespace HeuristicLab.Problems.DataAnalysis.Symbolic {
+
+  [Item("NestedOptimizerSubVectorImprovementManipulator", "Mutator that optimizes the ranges for a subvector symbol by utilizing a nested optimizer.")]
+  [StorableType("32E58EEE-97B4-4396-98A8-B98AB897E3F0")]
+  public class NestedOptimizerSubVectorImprovementManipulator<T> : SymbolicDataAnalysisExpressionManipulator<T> where T : class, IDataAnalysisProblemData {
+    private const string BestSolutionParameterName = "BestSolution";
+
+    [Item("SubVectorOptimizationProblem", "")]
+    [StorableType("EA3D3221-B274-4F2F-8B58-23CB2D091FD7")]
+    private class SubVectorOptimizationProblem : SingleObjectiveBasicProblem<IntegerVectorEncoding> {
+      #region Fixed Problem Parameters
+      [Storable]
+      private ISymbolicDataAnalysisSingleObjectiveEvaluator<T> evaluator;
+      [Storable]
+      private T problemData;
+      [Storable]
+      private List<int> rows;
+      [Storable]
+      private IExecutionContext executionContext;
+      #endregion
+
+      #region Instance Parameters
+      [Storable]
+      private ISymbolicExpressionTree tree;
+      [Storable]
+      private IList<int> selectedSubVectorNodes;
+      #endregion
+
+      public override bool Maximization { get { return false; } }
+
+      public SubVectorOptimizationProblem() {
+        Encoding = new IntegerVectorEncoding("bounds");
+        Parameters.Add(new ResultParameter<IntegerVector>(BestSolutionParameterName, ""));
+      }
+      private SubVectorOptimizationProblem(SubVectorOptimizationProblem original, Cloner cloner)
+        : base(original, cloner) { }
+      public override IDeepCloneable Clone(Cloner cloner) {
+        return new SubVectorOptimizationProblem(this, cloner);
+      }
+      [StorableConstructor]
+      private SubVectorOptimizationProblem(StorableConstructorFlag _) : base(_) { }
+
+      public override double Evaluate(Individual individual, IRandom random) {
+        var solution = individual.IntegerVector(Encoding.Name);
+
+        var updatedTree = (ISymbolicExpressionTree)tree.Clone();
+        UpdateFromVector(updatedTree, selectedSubVectorNodes, solution, Encoding.Bounds[0, 1]);
+        
+        var quality = evaluator.Evaluate(executionContext, updatedTree, problemData, rows);
+        if (evaluator.Maximization)
+          quality = -quality;
+        return quality;
+      }
+
+      public override void Analyze(Individual[] individuals, double[] qualities, ResultCollection results, IRandom random) {
+        var best = GetBestIndividual(individuals, qualities);
+        var vector = best.Item1.IntegerVector(Encoding.Name);
+
+        results.AddOrUpdateResult(BestSolutionParameterName, vector);
+      }
+
+      public void SetProblemData(ISymbolicDataAnalysisSingleObjectiveEvaluator<T> evaluator, T problemData, List<int> rows, IExecutionContext executionContext) {
+        this.evaluator = evaluator;
+        this.problemData = problemData;
+        this.rows = rows;
+        this.executionContext = executionContext;
+      }
+      public void SetInstanceData(ISymbolicExpressionTree tree, List<int> selectedSubVectorNodes, int vectorLength) {
+        this.tree = tree;
+        this.selectedSubVectorNodes = selectedSubVectorNodes;
+        Encoding.Length = selectedSubVectorNodes.Count * 2;
+        Encoding.Bounds = new IntMatrix(new int[,] { { 0, vectorLength } });
+      }
+    }
+
+
+    #region Parameter Properties
+    public IConstrainedValueParameter<IAlgorithm> NestedOptimizerParameter {
+      get { return (IConstrainedValueParameter<IAlgorithm>)Parameters["NestedOptimizer"]; }
+    }
+
+    public IFixedValueParameter<PercentValue> PercentOptimizedSubVectorNodesParameter {
+      get { return (IFixedValueParameter<PercentValue>)Parameters["PercentOptimizedSubVectorNodes"]; }
+    }
+    #endregion
+
+    #region Properties
+    public IOptimizer NestedOptimizer {
+      get { return NestedOptimizerParameter.Value; }
+    }
+
+    public PercentValue PercentOptimizedSubVectorNodes {
+      get { return PercentOptimizedSubVectorNodesParameter.Value; }
+    }
+    #endregion
+
+    public NestedOptimizerSubVectorImprovementManipulator() : base() {
+      var problem = new SubVectorOptimizationProblem();
+
+      #region Create nested Algorithms
+      var rs = new RandomSearchAlgorithm() {
+        Problem = problem,
+        BatchSize = 10,
+        MaximumEvaluatedSolutions = 100
+      };
+
+      var es = new EvolutionStrategy() {
+        Problem = problem,
+        PlusSelection = new BoolValue(true),
+        PopulationSize = new IntValue(1),
+        Children = new IntValue(10),
+        MaximumGenerations = new IntValue(100)
+      };
+      es.Mutator = es.MutatorParameter.ValidValues.OfType<UniformSomePositionsManipulator>().Single();
+
+      var ga = new GeneticAlgorithm() {
+        Problem = problem,
+        PopulationSize = new IntValue(10),
+        MutationProbability = new PercentValue(0.1),
+        MaximumGenerations = new IntValue(100)
+      };
+      ga.Selector = ga.SelectorParameter.ValidValues.OfType<TournamentSelector>().Single();
+      ga.Crossover = ga.CrossoverParameter.ValidValues.OfType<RoundedBlendAlphaBetaCrossover>().Single();
+      ga.Mutator = ga.MutatorParameter.ValidValues.OfType<UniformOnePositionManipulator>().Single();
+
+      var osga = new OffspringSelectionGeneticAlgorithm() {
+        Problem = problem,
+        PopulationSize = new IntValue(10),
+        ComparisonFactorLowerBound = new DoubleValue(1.0),
+        ComparisonFactorUpperBound = new DoubleValue(1.0),
+        MutationProbability = new PercentValue(0.1),
+        MaximumGenerations = new IntValue(100),
+        MaximumEvaluatedSolutions = new IntValue(1000)
+      };
+      osga.Selector = osga.SelectorParameter.ValidValues.OfType<TournamentSelector>().Single();
+      osga.Crossover = osga.CrossoverParameter.ValidValues.OfType<RoundedBlendAlphaBetaCrossover>().Single();
+      osga.Mutator = osga.MutatorParameter.ValidValues.OfType<UniformOnePositionManipulator>().Single();
+      #endregion
+
+      var optimizers = new ItemSet<IAlgorithm>() { rs, es, ga, osga };
+
+      Parameters.Add(new ConstrainedValueParameter<IAlgorithm>("NestedOptimizer", optimizers, rs));
+      Parameters.Add(new FixedValueParameter<PercentValue>("PercentOptimizedSubVectorNodes", new PercentValue(1.0)));
+    }
+
+    private NestedOptimizerSubVectorImprovementManipulator(NestedOptimizerSubVectorImprovementManipulator<T> original, Cloner cloner) : base(original, cloner) { }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new NestedOptimizerSubVectorImprovementManipulator<T>(this, cloner);
+    }
+
+    [StorableConstructor]
+    private NestedOptimizerSubVectorImprovementManipulator(StorableConstructorFlag _) : base(_) { }
+
+    public override void Manipulate(IRandom random, ISymbolicExpressionTree symbolicExpressionTree) {
+      int vectorLengths = GetVectorLengths(ProblemDataParameter.ActualValue);
+      
+      var selectedSubVectorNodes = GetSelectedSubVectorNodes(symbolicExpressionTree, random);
+      if (selectedSubVectorNodes.Count == 0) 
+        return;
+
+      var algorithm = (IAlgorithm)NestedOptimizer.Clone();
+      PrepareAlgorithm(algorithm, symbolicExpressionTree, selectedSubVectorNodes, vectorLengths);
+
+      algorithm.Start(CancellationToken);
+
+      if (algorithm.ExecutionState != ExecutionState.Stopped)
+        throw new InvalidOperationException("Nested Algorithm did not finish.");
+
+      var solution = (IntegerVector)algorithm.Results[BestSolutionParameterName].Value;
+      UpdateFromVector(symbolicExpressionTree, selectedSubVectorNodes, solution, vectorLengths);
+    }
+
+    private void PrepareAlgorithm(IAlgorithm algorithm, ISymbolicExpressionTree symbolicExpressionTree, List<int> selectedSubVectorNodes, int vectorLengths) {
+      var problem = (SubVectorOptimizationProblem)algorithm.Problem;
+      problem.SetProblemData(EvaluatorParameter.ActualValue, ProblemDataParameter.ActualValue, GenerateRowsToEvaluate().ToList(), ExecutionContext);
+      problem.SetInstanceData(symbolicExpressionTree, selectedSubVectorNodes, vectorLengths);
+    }
+
+    private List<int> GetSelectedSubVectorNodes(ISymbolicExpressionTree symbolicExpressionTree, IRandom random) {
+      var subVectorNodes = GetSubVectorNodes(symbolicExpressionTree).ToList();
+
+      int numSelect = (int)Math.Round(subVectorNodes.Count * PercentOptimizedSubVectorNodes.Value);
+      var selectedSubVectorNodes = Enumerable.Range(0, subVectorNodes.Count).SampleRandomWithoutRepetition(random, numSelect).ToList();
+      return selectedSubVectorNodes;
+    }
+
+    private static int GetVectorLengths(T problemData) {  // ToDo evaluate a tree to get vector length per node
+      var vectorLengths = problemData.Dataset.DoubleVectorVariables
+        .Select(v => problemData.Dataset.GetDoubleVectorValue(v, row: 0).Count)
+        .Distinct();
+      return vectorLengths.Single();
+    }
+
+    private static void UpdateFromVector(ISymbolicExpressionTree tree, IList<int> selectedNodes, IntegerVector solution, int vectorLength) {
+      var nodes = GetSubVectorNodes(tree).ToList();
+
+      int i = 0;
+      foreach (var nodeIdx in selectedNodes) {
+        var node = nodes[nodeIdx];
+        node.Offset = (double)solution[i++] / (vectorLength - 1);
+        node.Length = (double)solution[i++] / (vectorLength - 1);
+      }
+    }
+
+    private static IEnumerable<WindowedSymbolTreeNode> GetSubVectorNodes(ISymbolicExpressionTree tree) {
+      return ActualRoot(tree)
+        .IterateNodesBreadth()
+        .OfType<WindowedSymbolTreeNode>()
+        .Where(n => n.HasLocalParameters);
+    }
+    private static ISymbolicExpressionTreeNode ActualRoot(ISymbolicExpressionTree tree) {
+      return tree.Root.GetSubtree(0).GetSubtree(0);
+    }
+
+  }
+}
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame	(revision 18228)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Plugin.cs.frame	(revision 18229)
@@ -28,4 +28,8 @@
   [Plugin("HeuristicLab.Problems.DataAnalysis.Symbolic","Provides base classes for symbolic data analysis tasks.", "3.4.12.$WCREV$")]
   [PluginFile("HeuristicLab.Problems.DataAnalysis.Symbolic-3.4.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Algorithms.EvolutionStrategy", "3.3")]
+  [PluginDependency("HeuristicLab.Algorithms.GeneticAlgorithm", "3.3")]
+  [PluginDependency("HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm", "3.3")]
+  [PluginDependency("HeuristicLab.Algorithms.RandomSearch", "3.3")]
   [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")]
   [PluginDependency("HeuristicLab.AutoDiff", "1.0")]
Index: /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs
===================================================================
--- /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 18228)
+++ /branches/3040_VectorBasedGP/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/SymbolicDataAnalysisProblem.cs	(revision 18229)
@@ -198,6 +198,8 @@
       ApplyLinearScalingParameter.Hidden = true;
 
-      SymbolicExpressionTreeGrammar = new TypeCoherentExpressionGrammar();
-      SymbolicExpressionTreeInterpreter = new SymbolicDataAnalysisExpressionTreeLinearInterpreter();
+      //SymbolicExpressionTreeGrammar = new TypeCoherentExpressionGrammar();
+      //SymbolicExpressionTreeInterpreter = new SymbolicDataAnalysisExpressionTreeLinearInterpreter();
+      SymbolicExpressionTreeGrammar = new TypeCoherentVectorExpressionGrammar();
+      SymbolicExpressionTreeInterpreter = new SymbolicDataAnalysisExpressionTreeVectorInterpreter();
 
       FitnessCalculationPartition.Start = ProblemData.TrainingPartition.Start;
