Index: /branches/Benchmark Generator/Benchmark Generator.sln
===================================================================
--- /branches/Benchmark Generator/Benchmark Generator.sln	(revision 10087)
+++ /branches/Benchmark Generator/Benchmark Generator.sln	(revision 10088)
@@ -2,5 +2,5 @@
 Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 2012
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmark Generator", "Benchmark Generator\Benchmark Generator.csproj", "{9A7A63F2-6990-4257-8CE0-4C240F497500}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmark Generator", "HeuristicLab.BenchmarkGenerator\3.3\Benchmark Generator.csproj", "{9A7A63F2-6990-4257-8CE0-4C240F497500}"
 EndProject
 Global
Index: /branches/Benchmark Generator/Build.cmd
===================================================================
--- /branches/Benchmark Generator/Build.cmd	(revision 10088)
+++ /branches/Benchmark Generator/Build.cmd	(revision 10088)
@@ -0,0 +1,104 @@
+@ECHO OFF
+
+SET CLEANBEFOREBUILD=
+
+SET SELECTED=
+SET CONFIGURATION=
+SET PLATFORM=
+
+IF "%~1"=="" GOTO :prompt_solution
+
+SET SELECTED=%1
+IF NOT EXIST %SELECTED% (
+  ECHO Solution file %SELECTED% could not be found.
+  GOTO :end
+)
+ECHO Building solution %SELECTED% ...
+GOTO :config_selection
+
+:prompt_solution
+SET /A COUNT=0
+FOR /F "tokens=*" %%A IN ('dir /B *.sln') DO (
+  CALL :forloopbody "%%A"
+)
+
+IF "%COUNT%"=="1" (
+  SET SELECTED=%SOLUTIONS.1%
+  ECHO Building %SOLUTIONS.1% as it is the only solution that was found ...
+  GOTO :config_selection
+)
+
+ECHO Found the following solutions:
+FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO ECHO %%A = %%B
+ECHO.
+SET /P SOLUTIONINDEX=Which solution to build? Type the number: 
+
+SET SELECTED=""
+FOR /F "tokens=2* delims=.=" %%A IN ('SET SOLUTIONS.') DO (
+  IF "%%A"=="%SOLUTIONINDEX%" SET SELECTED=%%B
+)
+
+IF %SELECTED%=="" GOTO :eof
+
+:config_selection
+IF "%~2"==""  GOTO :prompt_config
+
+SET CONFIGURATION=%~2
+ECHO Building configuration %CONFIGURATION% ...
+GOTO :platform_selection
+
+:prompt_config
+SET /P CONFIGURATION=Which configuration to build [Release]: 
+IF "%CONFIGURATION%"=="" SET CONFIGURATION=Release
+
+:platform_selection
+IF "%~3"=="" GOTO :prompt_platform
+  
+SET PLATFORM=%~3
+ECHO Building platform %PLATFORM% ...
+GOTO :clean
+
+:prompt_platform
+SET /P PLATFORM=Which platform to build [Any CPU]: 
+IF "%PLATFORM%"=="" SET PLATFORM=Any CPU
+
+:clean
+IF "%~4"=="" GOTO :prompt_clean
+
+SET CLEANBEFOREBUILD=%~4
+GOTO :main
+
+:prompt_clean
+SET /P CLEANBEFOREBUILD=Would you like to clean before building [n]: 
+IF "%CLEANBEFOREBUILD%"=="" SET CLEANBEFOREBUILD=n
+
+:main
+REM First find the path to the msbuild.exe by performing a registry query
+FOR /F "tokens=1,3 delims=	 " %%A IN ('REG QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0"') DO (
+  IF "%%A"=="MSBuildToolsPath" SET MSBUILDPATH=%%B)
+
+REM Then execute msbuild to clean and build the solution
+REM Disable that msbuild creates a cache file of the solution
+SET MSBuildUseNoSolutionCache=1
+REM Run msbuild to clean and then build
+IF "%CLEANBEFOREBUILD%" NEQ "n" (
+  ECHO Cleaning ...
+  %MSBUILDPATH%msbuild.exe %SELECTED% /target:Clean /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /m:2 /nologo /verbosity:q /clp:ErrorsOnly
+)
+ECHO Building ...
+%MSBUILDPATH%msbuild.exe %SELECTED% /target:Build /p:Configuration="%CONFIGURATION%",Platform="%PLATFORM%" /m:2 /nologo /verbosity:q /clp:ErrorsOnly
+
+ECHO.
+ECHO DONE.
+
+:end
+
+PAUSE
+
+GOTO :eof
+
+REM This workaround is necessary so that COUNT gets reevaluated
+:forloopbody
+SET /A COUNT+=1
+SET SOLUTIONS.%COUNT%=%1
+GOTO :eof
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Benchmark Generator.csproj
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Benchmark Generator.csproj	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Benchmark Generator.csproj	(revision 10088)
@@ -0,0 +1,162 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProjectGuid>{9A7A63F2-6990-4257-8CE0-4C240F497500}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.BenchmarkGenerator</RootNamespace>
+    <AssemblyName>HeuristicLab.BenchmarkGenerator</AssemblyName>
+    <TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <PlatformTarget>AnyCPU</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup>
+    <StartupObject />
+  </PropertyGroup>
+  <PropertyGroup>
+    <SignAssembly>true</SignAssembly>
+  </PropertyGroup>
+  <PropertyGroup>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="HeuristicLab.Analysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\Trunk\sources\bin\HeuristicLab.Analysis-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Analysis.Views-3.3">
+      <HintPath>..\..\..\Trunk\sources\bin\HeuristicLab.Analysis.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.CodeEditor-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.CodeEditor-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Collections-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\Trunk\sources\bin\HeuristicLab.Collections-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Common-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\Trunk\sources\bin\HeuristicLab.Common-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\Trunk\sources\bin\HeuristicLab.Core-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Core.Views-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\Trunk\sources\bin\HeuristicLab.Core.Views-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Data-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\Trunk\sources\bin\HeuristicLab.Data-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\Trunk\sources\bin\HeuristicLab.MainForm-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.MainForm.WindowsForms-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\Trunk\sources\bin\HeuristicLab.MainForm.WindowsForms-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="HeuristicLab.Persistence-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Persistence-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances.DataAnalysis-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances.DataAnalysis-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Random-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\Trunk\sources\bin\HeuristicLab.Random-3.3.dll</HintPath>
+      <Private>False</Private>
+    </Reference>
+    <Reference Include="Irony, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ca48ace7223ead47, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>bin\Release\Irony.dll</HintPath>
+    </Reference>
+    <Reference Include="Irony.Interpreter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=ca48ace7223ead47, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>bin\Release\Irony.Interpreter.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="Microsoft.CSharp" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Deployment" />
+    <Reference Include="System.Drawing" />
+    <Reference Include="System.Windows.Forms" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="BenchmarkGenerator.cs" />
+    <Compile Include="BenchmarkGeneratorForm.cs">
+      <SubType>Form</SubType>
+    </Compile>
+    <Compile Include="BenchmarkGeneratorForm.Designer.cs">
+      <DependentUpon>BenchmarkGeneratorForm.cs</DependentUpon>
+    </Compile>
+    <Compile Include="CustomLanguageRuntime.cs" />
+    <Compile Include="ExpressionEvaluator.cs" />
+    <Compile Include="ExpressionGrammar.cs" />
+    <Compile Include="FunctionCallNode.cs" />
+    <Compile Include="Functions.cs" />
+    <Compile Include="Plugin.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <Folder Include="Properties\" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+  </ItemGroup>
+  <ItemGroup>
+    <EmbeddedResource Include="BenchmarkGeneratorForm.resx">
+      <DependentUpon>BenchmarkGeneratorForm.cs</DependentUpon>
+    </EmbeddedResource>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Benchmark Generator.csproj.user
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Benchmark Generator.csproj.user	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Benchmark Generator.csproj.user	(revision 10088)
@@ -0,0 +1,16 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
+    <StartAction>Program</StartAction>
+    <StartProgram>C:\Users\P40913\Projects\HeuristicLab\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
+    <StartArguments>
+    </StartArguments>
+  </PropertyGroup>
+  <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
+    <StartAction>Program</StartAction>
+    <StartProgram>C:\Users\P40913\Projects\HeuristicLab\trunk\sources\bin\HeuristicLab 3.3.exe</StartProgram>
+  </PropertyGroup>
+  <PropertyGroup>
+    <ProjectView>ShowAllFiles</ProjectView>
+  </PropertyGroup>
+</Project>
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGenerator.cs
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGenerator.cs	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGenerator.cs	(revision 10088)
@@ -0,0 +1,103 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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.Analysis;
+using HeuristicLab.Common;
+using HeuristicLab.Core;
+using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
+using Irony.Interpreter;
+using Irony.Parsing;
+
+namespace HeuristicLab.BenchmarkGenerator {
+  [Item("Benchmark Generator", "Utility class to generate artificial datasets based on custom user-defined formulas.")]
+  public class BenchmarkGenerator : Item {
+    private readonly ExpressionEvaluator evaluator;
+    private Parser Parser { get { return evaluator.Parser; } }
+    private ParseTree Tree { get { return Parser.Context.CurrentParseTree; } }
+    private IDictionary<string, object> Globals { get { return evaluator.Globals; } }
+    private DataTable table;
+
+    [StorableConstructor]
+    private BenchmarkGenerator(bool deserializing)
+      : base(deserializing) {
+    }
+
+    protected BenchmarkGenerator(BenchmarkGenerator original, Cloner cloner)
+      : base(original, cloner) {
+      evaluator = original.evaluator;
+    }
+
+    public override IDeepCloneable Clone(Cloner cloner) {
+      return new BenchmarkGenerator(this, cloner);
+    }
+
+    private void AddCustomFunctions() {
+      var runtime = (CustomLanguageRuntime)evaluator.Runtime;
+      runtime.BuiltIns.Clear();
+      runtime.BuiltIns.AddMethod(Functions.NormalDouble, "normal");
+      runtime.BuiltIns.AddMethod(Functions.UniformDouble, "uniform");
+      runtime.BuiltIns.AddMethod(Functions.NormalDistribution, "dnormal");
+      runtime.BuiltIns.AddMethod(Functions.UniformDistribution, "duniform");
+      runtime.BuiltIns.AddMethod(Functions.Steps, "steps");
+      runtime.BuiltIns.AddMethod(Functions.Repeat, "repeat");
+      runtime.BuiltIns.AddMethod(Functions.Sin, "sin");
+      runtime.BuiltIns.AddMethod(Functions.Cos, "cos");
+      runtime.BuiltIns.AddMethod(Functions.Length, "length");
+      runtime.BuiltIns.AddMethod(Functions.Abs, "abs");
+      runtime.BuiltIns.AddMethod(Functions.DotProduct, "dot");
+    }
+
+    public BenchmarkGenerator() {
+      evaluator = new ExpressionEvaluator();
+      AddCustomFunctions();
+      table = new DataTable("Data");
+    }
+
+    public DataTable GenerateDataset(string formula, int nSamples) {
+      Globals.Clear();
+      Parser.Parse(formula);
+      if (Tree.Status == ParseTreeStatus.Error) {
+        throw new Exception("Invalid formula.");
+      }
+      evaluator.Evaluate(Tree);
+      // after the tree is parsed the variables are saved in the global dictionary
+      // because the Globals only grow but never shrink, the values for unused keys are set to null
+      // we check that below in order to remove unused keys from our table
+      foreach (var pair in Globals) {
+        var key = pair.Key;
+        if (pair.Value == null) {
+          table.Rows.Remove(key);
+          continue;
+        }
+        var values = ((object[])Globals[key]).Cast<double>().ToArray();
+        if (!table.Rows.ContainsKey(key)) {
+          table.Rows.Add(new DataRow(key) { VisualProperties = { StartIndexZero = true } });
+        }
+        table.Rows[key].Values.Clear();
+        table.Rows[key].Values.AddRange(values);
+      }
+      return table;
+    }
+  }
+}
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGeneratorForm.Designer.cs
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGeneratorForm.Designer.cs	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGeneratorForm.Designer.cs	(revision 10088)
@@ -0,0 +1,93 @@
+﻿namespace HeuristicLab.BenchmarkGenerator {
+  partial class BenchmarkGeneratorForm {
+    /// <summary>
+    /// Required designer variable.
+    /// </summary>
+    private System.ComponentModel.IContainer components = null;
+
+    /// <summary>
+    /// Clean up any resources being used.
+    /// </summary>
+    /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
+    protected override void Dispose(bool disposing) {
+      if (disposing && (components != null)) {
+        components.Dispose();
+      }
+      base.Dispose(disposing);
+    }
+
+    #region Windows Form Designer generated code
+
+    /// <summary>
+    /// Required method for Designer support - do not modify
+    /// the contents of this method with the code editor.
+    /// </summary>
+    private void InitializeComponent() {
+      this.formulaTextBox = new System.Windows.Forms.RichTextBox();
+      this.viewHost1 = new HeuristicLab.MainForm.WindowsForms.ViewHost();
+      this.generateButton = new System.Windows.Forms.Button();
+      this.SuspendLayout();
+      // 
+      // formulaTextBox
+      // 
+      this.formulaTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left)));
+      this.formulaTextBox.Location = new System.Drawing.Point(141, 52);
+      this.formulaTextBox.Name = "formulaTextBox";
+      this.formulaTextBox.Size = new System.Drawing.Size(353, 431);
+      this.formulaTextBox.TabIndex = 0;
+      this.formulaTextBox.Text = "";
+      // 
+      // viewHost1
+      // 
+      this.viewHost1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) 
+            | System.Windows.Forms.AnchorStyles.Left) 
+            | System.Windows.Forms.AnchorStyles.Right)));
+      this.viewHost1.AutoSize = true;
+      this.viewHost1.Caption = "View";
+      this.viewHost1.Content = null;
+      this.viewHost1.Enabled = false;
+      this.viewHost1.Location = new System.Drawing.Point(500, 52);
+      this.viewHost1.Name = "viewHost1";
+      this.viewHost1.ReadOnly = false;
+      this.viewHost1.Size = new System.Drawing.Size(385, 431);
+      this.viewHost1.TabIndex = 4;
+      this.viewHost1.ViewsLabelVisible = true;
+      this.viewHost1.ViewType = null;
+      // 
+      // generateButton
+      // 
+      this.generateButton.Location = new System.Drawing.Point(12, 52);
+      this.generateButton.Name = "generateButton";
+      this.generateButton.Size = new System.Drawing.Size(123, 24);
+      this.generateButton.TabIndex = 1;
+      this.generateButton.Text = "Generate";
+      this.generateButton.UseVisualStyleBackColor = true;
+      this.generateButton.Click += new System.EventHandler(this.generateButton_Click);
+      // 
+      // BenchmarkGeneratorForm
+      // 
+      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+      this.ClientSize = new System.Drawing.Size(885, 508);
+      this.Controls.Add(this.viewHost1);
+      this.Controls.Add(this.generateButton);
+      this.Controls.Add(this.formulaTextBox);
+      this.Name = "BenchmarkGeneratorForm";
+      this.Text = "BenchmarkGeneratorForm";
+      this.Title = "BenchmarkGeneratorForm";
+      this.Controls.SetChildIndex(this.formulaTextBox, 0);
+      this.Controls.SetChildIndex(this.generateButton, 0);
+      this.Controls.SetChildIndex(this.viewHost1, 0);
+      this.ResumeLayout(false);
+      this.PerformLayout();
+
+    }
+
+    #endregion
+
+    private System.Windows.Forms.RichTextBox formulaTextBox;
+    private MainForm.WindowsForms.ViewHost viewHost1;
+    private System.Windows.Forms.Button generateButton;
+  }
+}
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGeneratorForm.cs
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGeneratorForm.cs	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGeneratorForm.cs	(revision 10088)
@@ -0,0 +1,35 @@
+﻿using System;
+using System.Drawing;
+using HeuristicLab.MainForm.WindowsForms;
+
+namespace HeuristicLab.BenchmarkGenerator {
+  public partial class BenchmarkGeneratorForm : MainForm.WindowsForms.MainForm {
+    public BenchmarkGeneratorForm() {
+      InitializeComponent();
+      formulaTextBox.Font = new Font(FontFamily.GenericMonospace, 10);
+    }
+
+    public BenchmarkGeneratorForm(Type userInterfaceType)
+      : base(userInterfaceType) {
+      InitializeComponent();
+      formulaTextBox.Font = new Font(FontFamily.GenericMonospace, 10);
+    }
+
+    public string FormulaText { get { return formulaTextBox.Text; } }
+    public int Samples {
+      get { return 0; }
+    }
+    public ViewHost ViewHost { get { return viewHost1; } }
+
+    public event EventHandler GenerateButtonClicked;
+    private void OnGenerateButtonClicked(object sender, EventArgs e) {
+      var clicked = GenerateButtonClicked;
+      if (clicked != null)
+        clicked(sender, e);
+    }
+
+    private void generateButton_Click(object sender, EventArgs e) {
+      OnGenerateButtonClicked(this, EventArgs.Empty);
+    }
+  }
+}
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGeneratorForm.resx
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGeneratorForm.resx	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/BenchmarkGeneratorForm.resx	(revision 10088)
@@ -0,0 +1,120 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<root>
+  <!-- 
+    Microsoft ResX Schema 
+    
+    Version 2.0
+    
+    The primary goals of this format is to allow a simple XML format 
+    that is mostly human readable. The generation and parsing of the 
+    various data types are done through the TypeConverter classes 
+    associated with the data types.
+    
+    Example:
+    
+    ... ado.net/XML headers & schema ...
+    <resheader name="resmimetype">text/microsoft-resx</resheader>
+    <resheader name="version">2.0</resheader>
+    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
+    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
+    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
+    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
+    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
+        <value>[base64 mime encoded serialized .NET Framework object]</value>
+    </data>
+    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
+        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
+        <comment>This is a comment</comment>
+    </data>
+                
+    There are any number of "resheader" rows that contain simple 
+    name/value pairs.
+    
+    Each data row contains a name, and value. The row also contains a 
+    type or mimetype. Type corresponds to a .NET class that support 
+    text/value conversion through the TypeConverter architecture. 
+    Classes that don't support this are serialized and stored with the 
+    mimetype set.
+    
+    The mimetype is used for serialized objects, and tells the 
+    ResXResourceReader how to depersist the object. This is currently not 
+    extensible. For a given mimetype the value must be set accordingly:
+    
+    Note - application/x-microsoft.net.object.binary.base64 is the format 
+    that the ResXResourceWriter will generate, however the reader can 
+    read any of the formats listed below.
+    
+    mimetype: application/x-microsoft.net.object.binary.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
+            : and then encoded with base64 encoding.
+    
+    mimetype: application/x-microsoft.net.object.soap.base64
+    value   : The object must be serialized with 
+            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
+            : and then encoded with base64 encoding.
+
+    mimetype: application/x-microsoft.net.object.bytearray.base64
+    value   : The object must be serialized into a byte array 
+            : using a System.ComponentModel.TypeConverter
+            : and then encoded with base64 encoding.
+    -->
+  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
+    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
+    <xsd:element name="root" msdata:IsDataSet="true">
+      <xsd:complexType>
+        <xsd:choice maxOccurs="unbounded">
+          <xsd:element name="metadata">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" />
+              </xsd:sequence>
+              <xsd:attribute name="name" use="required" type="xsd:string" />
+              <xsd:attribute name="type" type="xsd:string" />
+              <xsd:attribute name="mimetype" type="xsd:string" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="assembly">
+            <xsd:complexType>
+              <xsd:attribute name="alias" type="xsd:string" />
+              <xsd:attribute name="name" type="xsd:string" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="data">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
+              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
+              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
+              <xsd:attribute ref="xml:space" />
+            </xsd:complexType>
+          </xsd:element>
+          <xsd:element name="resheader">
+            <xsd:complexType>
+              <xsd:sequence>
+                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
+              </xsd:sequence>
+              <xsd:attribute name="name" type="xsd:string" use="required" />
+            </xsd:complexType>
+          </xsd:element>
+        </xsd:choice>
+      </xsd:complexType>
+    </xsd:element>
+  </xsd:schema>
+  <resheader name="resmimetype">
+    <value>text/microsoft-resx</value>
+  </resheader>
+  <resheader name="version">
+    <value>2.0</value>
+  </resheader>
+  <resheader name="reader">
+    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+  <resheader name="writer">
+    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
+  </resheader>
+</root>
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/CustomLanguageRuntime.cs
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/CustomLanguageRuntime.cs	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/CustomLanguageRuntime.cs	(revision 10088)
@@ -0,0 +1,50 @@
+﻿using System;
+using System.Linq;
+using System.Linq.Expressions;
+using Irony.Interpreter;
+using Irony.Parsing;
+
+namespace HeuristicLab.BenchmarkGenerator {
+  public class CustomLanguageRuntime : LanguageRuntime {
+    public CustomLanguageRuntime(LanguageData data)
+      : base(data) {
+    }
+
+    protected override void InitOperatorImplementations() {
+      base.InitOperatorImplementations();
+      AddBinary(ExpressionType.AddChecked, typeof(Object[]), (x, y) => ComponentSum((object[])x, (object[])y));
+      AddBinary(ExpressionType.SubtractChecked, typeof(Object[]), (x, y) => ComponentDifference((object[])x, (object[])y));
+      AddBinary(ExpressionType.MultiplyChecked, typeof(Object[]), (x, y) => ComponentProduct((object[])x, (object[])y));
+      AddBinary(ExpressionType.Divide, typeof(Object[]), (x, y) => ComponentDivision((object[])x, (object[])y));
+      //      AddBinary(ExpressionType.Multiply, typeof(DoubleArray), (x, y) => (DoubleArray)x * (DoubleArray)y);
+      //      AddBinary(ExpressionType.Add, typeof(DoubleArray), (x, y) => (DoubleArray)x + (DoubleArray)y);
+      //      AddBinary(ExpressionType.Divide, typeof(DoubleArray), (x, y) => (DoubleArray)x / (DoubleArray)y);
+      //      AddBinary(ExpressionType.Subtract, typeof(DoubleArray), (x, y) => (DoubleArray)x - (DoubleArray)y);
+      //      AddConverter(typeof(double[]), typeof(DoubleArray), x => new DoubleArray((double[])x));
+    }
+
+    private object[] ComponentProduct(object[] a, object[] b) {
+      var aa = a.Cast<double>();
+      var bb = b.Cast<double>();
+      return aa.Zip(bb, (v1, v2) => v1 * v2).Cast<object>().ToArray();
+    }
+
+    private object[] ComponentDivision(object[] a, object[] b) {
+      var aa = a.Cast<double>();
+      var bb = b.Cast<double>();
+      return aa.Zip(bb, (v1, v2) => v1 / v2).Cast<object>().ToArray();
+    }
+
+    private object[] ComponentSum(object[] a, object[] b) {
+      var aa = a.Cast<double>();
+      var bb = b.Cast<double>();
+      return aa.Zip(bb, (v1, v2) => v1 + v2).Cast<object>().ToArray();
+    }
+
+    private object[] ComponentDifference(object[] a, object[] b) {
+      var aa = a.Cast<double>();
+      var bb = b.Cast<double>();
+      return aa.Zip(bb, (v1, v2) => v1 - v2).Cast<object>().ToArray();
+    }
+  }
+}
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/ExpressionEvaluator.cs
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/ExpressionEvaluator.cs	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/ExpressionEvaluator.cs	(revision 10088)
@@ -0,0 +1,62 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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 Irony.Interpreter;
+using Irony.Parsing;
+
+namespace HeuristicLab.BenchmarkGenerator {
+  class ExpressionEvaluator {
+    public ExpressionGrammar Grammar { get; private set; }
+    public Parser Parser { get; private set; }
+    public LanguageData Language { get; private set; }
+    public LanguageRuntime Runtime { get; private set; }
+    public ScriptApp App { get; private set; }
+    public IDictionary<string, object> Globals { get { return App.Globals; } }
+
+    public ExpressionEvaluator() : this(new ExpressionGrammar()) { }
+
+    public ExpressionEvaluator(ExpressionGrammar grammar) {
+      Grammar = grammar;
+      Language = new LanguageData(Grammar);
+      Parser = new Parser(Language);
+      Runtime = Grammar.CreateRuntime(Language);
+      App = new ScriptApp(Runtime);
+    }
+
+    public object Evaluate(ParseTree parsedScript) {
+      var result = App.Evaluate(parsedScript);
+      return result;
+    }
+
+    public object Evaluate() {
+      return App.Evaluate();
+    }
+
+    public void ClearOutput() {
+      App.ClearOutputBuffer();
+    }
+
+    public string GetOutput() {
+      return App.GetOutput();
+    }
+  }
+}
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/ExpressionGrammar.cs
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/ExpressionGrammar.cs	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/ExpressionGrammar.cs	(revision 10088)
@@ -0,0 +1,96 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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 Irony.Interpreter;
+using Irony.Interpreter.Ast;
+using Irony.Parsing;
+
+namespace HeuristicLab.BenchmarkGenerator {
+  public class ExpressionGrammar : InterpretedLanguageGrammar {
+    public ExpressionGrammar() : this(caseSensitive: false) { }
+
+    public ExpressionGrammar(bool caseSensitive)
+      : base(caseSensitive) {
+
+      var comma = ToTerm(",");
+      // Define terminals
+      var number = new NumberLiteral("Number") {
+        DefaultIntTypes = new[] { TypeCode.Double },
+        //        DefaultIntTypes = new[] { TypeCode.Int32, TypeCode.Int64 },
+        DefaultFloatType = TypeCode.Double
+      };
+      var identifier = new IdentifierTerminal("Identifier");
+
+      // Define non-terminals
+      var term = new NonTerminal("Term");
+      var binExpr = new NonTerminal("BinExpr", typeof(BinaryOperationNode));
+      var binOp = new NonTerminal("BinOp", "operator");
+      var unExpr = new NonTerminal("UnExpr", typeof(UnaryOperationNode));
+      var unOp = new NonTerminal("UnOp", "operator");
+      var expr = new NonTerminal("Expr");
+      var argList = new NonTerminal("ArgList", typeof(ExpressionListNode));
+      var functionCall = new NonTerminal("FunctionCall", typeof(FunctionCallNode));
+      var parExpr = new NonTerminal("ParExpr");
+      var statement = new NonTerminal("Statement");
+      var assignmentStmt = new NonTerminal("AssignmentStmt", typeof(AssignmentNode));
+      var assignmentOp = new NonTerminal("AssignmentOp", "assignment operator");
+      var program = new NonTerminal("Program", typeof(StatementListNode));
+
+      // BNF rules
+      expr.Rule = term | unExpr | binExpr;
+      term.Rule = number | parExpr | identifier | functionCall;
+      parExpr.Rule = "(" + expr + ")";
+      unExpr.Rule = unOp + term;
+      unOp.Rule = ToTerm("+") | "-";
+      binExpr.Rule = expr + binOp + expr;
+      binOp.Rule = ToTerm("+") | "-" | "*" | "/" | "^"; // add, sub, mul, div, pow
+      argList.Rule = MakeStarRule(argList, comma, expr);
+      functionCall.Rule = identifier + PreferShiftHere() + "(" + argList + ")";
+      assignmentStmt.Rule = identifier + assignmentOp + expr;
+      assignmentOp.Rule = ToTerm("=");
+      statement.Rule = assignmentStmt | expr | Empty;
+      program.Rule = MakePlusRule(program, NewLine, statement);
+      this.Root = program;
+
+      // Caption templates
+      functionCall.NodeCaptionTemplate = "call #{0}(...)";
+
+      // Operators precedence
+      RegisterOperators(1, "+", "-");
+      RegisterOperators(2, "*", "/");
+      RegisterOperators(3, Associativity.Right, "^");
+
+      // Punctuation and braces
+      MarkPunctuation("(", ")", "[", "]");
+      RegisterBracePair("(", ")");
+      RegisterBracePair("[", "]");
+      // Mark transient because these don't have corresponding AST nodes
+      MarkTransient(term, expr, statement, binOp, unOp, assignmentOp, parExpr);
+      // Language flags                         
+      LanguageFlags = LanguageFlags.NewLineBeforeEOF | LanguageFlags.CreateAst;
+    }
+
+    public override LanguageRuntime CreateRuntime(LanguageData data) {
+      return new CustomLanguageRuntime(data);
+    }
+  }
+}
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/FunctionCallNode.cs
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/FunctionCallNode.cs	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/FunctionCallNode.cs	(revision 10088)
@@ -0,0 +1,58 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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 Irony.Ast;
+using Irony.Interpreter;
+using Irony.Interpreter.Ast;
+using Irony.Parsing;
+
+namespace HeuristicLab.BenchmarkGenerator {
+  public class FunctionCallNode : AstNode {
+    private AstNode targetRef;
+    private string targetName;
+    private AstNode arguments;
+
+    public object Result { get; private set; }
+
+    public override void Init(AstContext context, ParseTreeNode treeNode) {
+      base.Init(context, treeNode);
+      var nodes = treeNode.GetMappedChildNodes();
+      targetRef = AddChild("Target", nodes[0]);
+      targetRef.UseType = NodeUseType.CallTarget;
+      targetName = nodes[0].FindTokenAndGetText();
+      arguments = AddChild("Args", nodes[1]);
+      AsString = "Call " + targetName;
+    }
+
+    protected override object DoEvaluate(ScriptThread thread) {
+      thread.CurrentNode = this;
+      var target = targetRef.Evaluate(thread);
+      var iCall = target as ICallTarget;
+      if (iCall == null)
+        thread.ThrowScriptError("Error: ", targetName);
+      var args = (object[])arguments.Evaluate(thread);
+      object result = iCall.Call(thread, args);
+      thread.CurrentNode = Parent;
+      Result = result;
+      return result;
+    }
+  }
+}
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Functions.cs
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Functions.cs	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Functions.cs	(revision 10088)
@@ -0,0 +1,112 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using HeuristicLab.Core;
+using HeuristicLab.Problems.Instances.DataAnalysis;
+using HeuristicLab.Random;
+using Irony.Interpreter;
+
+namespace HeuristicLab.BenchmarkGenerator {
+  public static class Functions {
+    private static readonly IRandom Random = new MersenneTwister();
+
+    public static void SetSeed(int seed) { Random.Reset(seed); }
+
+    public static object NormalDouble(ScriptThread thread, object[] args) {
+      if (args.Length != 2) throw new ArgumentException("The NormalDouble function accepts exactly two arguments.");
+      var mu = (double)args[0];
+      var sigma = (double)args[1];
+      return NormalDouble(mu, sigma);
+    }
+
+    public static object UniformDouble(ScriptThread thread, object[] args) {
+      if (args.Length != 2) throw new ArgumentException("The UniformDouble function accepts exactly two arguments.");
+      var a = (double)args[0];
+      var b = (double)args[1];
+      return UniformDouble(a, b);
+    }
+
+    public static object NormalDistribution(ScriptThread thread, object[] args) {
+      if (args.Length != 3) throw new ArgumentException("The dnormal function accepts exactly three arguments.");
+      var n = (int)(double)args[0];
+      var start = (double)args[1];
+      var end = (double)args[2];
+      return NormalDistribution(n, start, end).Cast<object>().ToArray();
+    }
+
+    public static object UniformDistribution(ScriptThread thread, object[] args) {
+      if (args.Length != 3) throw new ArgumentException("The duniform function accepts exactly three arguments.");
+      var n = (int)(double)args[0];
+      var start = (double)args[1];
+      var end = (double)args[2];
+      return UniformDistribution(n, start, end).Cast<object>().ToArray();
+    }
+
+    public static object[] Steps(ScriptThread thread, object[] args) {
+      if (args.Length != 3) throw new ArgumentException("The Steps function accepts exactly three arguments.");
+      var start = (double)args[0];
+      var end = (double)args[1];
+      var step = (double)args[2];
+      return Steps(start, end, step).Cast<object>().ToArray();
+    }
+
+    public static object[] Sin(ScriptThread thread, object[] args) {
+      if (args.Length != 1) throw new ArgumentException("The Sin function accepts exactly one argument.");
+      var values = (object[])args[0];
+      return values.Cast<double>().Select(Math.Sin).Cast<object>().ToArray();
+    }
+
+    public static object[] Cos(ScriptThread thread, object[] args) {
+      if (args.Length != 1) throw new ArgumentException("The Cos function accepts exactly one argument.");
+      var values = (object[])args[0];
+      return values.Cast<double>().Select(Math.Cos).Cast<object>().ToArray();
+    }
+
+    public static object Length(ScriptThread thread, object[] args) {
+      if (args.Length != 1) throw new ArgumentException("The Length function accepts exactly one argument which must be an object array.");
+      var values = (object[])args[0];
+      return (double)values.Length;
+    }
+
+    public static object DotProduct(ScriptThread thread, object[] args) {
+      if (args.Length != 2) throw new ArgumentException("The DotProduct function accepts exactly two arguments which must be object arrays of the same length.");
+      var a = (object[])args[0];
+      var b = (object[])args[1];
+      return DotProduct(a.Cast<double>(), b.Cast<double>());
+    }
+
+    public static object[] Abs(ScriptThread thread, object[] args) {
+      if (args.Length != 1) throw new ArgumentException("The Length function accepts exactly one argument which must be an object array.");
+      var values = (object[])args[0];
+      return values.Cast<double>().Select(Math.Abs).Cast<object>().ToArray();
+    }
+
+    public static object[] Repeat(ScriptThread thread, object[] args) {
+      if (args.Length != 2) throw new ArgumentException("The Repeat function accepts exactly two arguments.");
+      var n = (int)(double)args[0];
+      var v = (double)args[1];
+      return Enumerable.Repeat(v, n).Cast<object>().ToArray();
+    }
+
+    #region convenience methods for less typing
+    private static double UniformDouble(double min, double max) {
+      return UniformDistributedRandom.NextDouble(Random, min, max);
+    }
+    private static double NormalDouble(double mu, double sigma) {
+      return NormalDistributedRandom.NextDouble(Random, mu, sigma);
+    }
+    private static IEnumerable<double> Steps(double start, double end, double step) {
+      return ValueGenerator.GenerateSteps(start, end, step);
+    }
+    private static IEnumerable<double> UniformDistribution(int n, double start, double end) {
+      return ValueGenerator.GenerateUniformDistributedValues(n, start, end);
+    }
+    private static IEnumerable<double> NormalDistribution(int n, double start, double end) {
+      return ValueGenerator.GenerateNormalDistributedValues(n, start, end);
+    }
+    private static double DotProduct(IEnumerable<double> a, IEnumerable<double> b) {
+      return a.Zip(b, (x, y) => x * y).Sum();
+    }
+    #endregion
+  }
+}
Index: /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Plugin.cs
===================================================================
--- /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Plugin.cs	(revision 10088)
+++ /branches/Benchmark Generator/HeuristicLab.BenchmarkGenerator/3.3/Plugin.cs	(revision 10088)
@@ -0,0 +1,60 @@
+using System;
+using System.Windows.Forms;
+using HeuristicLab.MainForm;
+using HeuristicLab.PluginInfrastructure;
+
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2013 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
+
+namespace HeuristicLab.BenchmarkGenerator {
+  [Plugin("HeuristicLab.BenchmarkGenerator", "1.0.0")]
+  [PluginFile("HeuristicLab.BenchmarkGenerator.dll", PluginFileType.Assembly)]
+  [PluginDependency("HeuristicLab.Analysis", "3.3")]
+  [PluginDependency("HeuristicLab.Analysis.Views", "3.3")]
+  [PluginDependency("HeuristicLab.Collections", "3.3")]
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.MainForm.WindowsForms", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+  [PluginDependency("HeuristicLab.Persistence", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.Instances.DataAnalysis", "3.3")]
+  public class BenchmarkGeneratorPlugin : PluginBase {
+  }
+
+  [Application("Benchmark Generator", "HeuristicLab BenchmarkGenerator 1.0.0.9999")]
+  internal class HeuristicLabBenchmarkGeneratorApplication : ApplicationBase {
+    private BenchmarkGenerator generator;
+
+    public override void Run(ICommandLineArgument[] args) {
+      generator = new BenchmarkGenerator();
+      var form = new BenchmarkGeneratorForm(typeof(IUserInterfaceItem));
+      form.GenerateButtonClicked += Generate;
+      Application.Run(form);
+    }
+
+    private void Generate(object sender, EventArgs e) {
+      var form = (BenchmarkGeneratorForm)sender;
+      var table = generator.GenerateDataset(form.FormulaText, form.Samples);
+      form.ViewHost.Content = table;
+      //      form.Dataset = table;
+    }
+  }
+}
Index: /branches/Benchmark Generator/PreBuildEvent.cmd
===================================================================
--- /branches/Benchmark Generator/PreBuildEvent.cmd	(revision 10088)
+++ /branches/Benchmark Generator/PreBuildEvent.cmd	(revision 10088)
@@ -0,0 +1,2 @@
+IF EXIST "%ProjectDir%\Properties\AssemblyInfo.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Properties\AssemblyInfo.cs.frame" "%ProjectDir%\Properties\AssemblyInfo.cs"
+IF EXIST "%ProjectDir%\Plugin.cs.frame" SubWCRev "%ProjectDir%\" "%ProjectDir%\Plugin.cs.frame" "%ProjectDir%\Plugin.cs"
