Index: /branches/Templates/RegressionProblemInstances/RegressionProblemInstance.sln
===================================================================
--- /branches/Templates/RegressionProblemInstances/RegressionProblemInstance.sln	(revision 14365)
+++ /branches/Templates/RegressionProblemInstances/RegressionProblemInstance.sln	(revision 14365)
@@ -0,0 +1,22 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 14
+VisualStudioVersion = 14.0.25123.0
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RegressionProblemInstance", "RegressionProblemInstance\RegressionProblemInstance.csproj", "{83FB4288-CFF1-4E57-9695-AA85079012BA}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Release|Any CPU = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{83FB4288-CFF1-4E57-9695-AA85079012BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{83FB4288-CFF1-4E57-9695-AA85079012BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{83FB4288-CFF1-4E57-9695-AA85079012BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{83FB4288-CFF1-4E57-9695-AA85079012BA}.Release|Any CPU.Build.0 = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/IRegressionProblemInstanceDescriptor.cs
===================================================================
--- /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/IRegressionProblemInstanceDescriptor.cs	(revision 14365)
+++ /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/IRegressionProblemInstanceDescriptor.cs	(revision 14365)
@@ -0,0 +1,13 @@
+﻿using HeuristicLab.Problems.DataAnalysis;
+
+namespace RegressionProblemInstances {
+  // This interface describes my problem instances.
+  // The instance provider uses the descriptors to generate the problem instances.
+  public interface IRegressionProblemInstanceDescriptor : HeuristicLab.Problems.Instances.IDataDescriptor {
+    // should contain all information that is necessary to produce the problem instance
+    // and could even generate the necessary data
+
+    IRegressionProblemData GenerateData();
+
+  }
+}
Index: /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/Plugin.cs
===================================================================
--- /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/Plugin.cs	(revision 14365)
+++ /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/Plugin.cs	(revision 14365)
@@ -0,0 +1,45 @@
+﻿using HeuristicLab.PluginInfrastructure;
+
+namespace RegressionProblemInstances {
+  [Plugin("RegressionProblemInstances", "1.0")]
+  [PluginFile("RegressionProblemInstances.dll", PluginFileType.Assembly)] // each plugin represents a collection of files. The minimum is one file; the assembly.
+
+  // Usually your plugin references other HeuristicLab dlls. If you are referencing files (e.g. assemblies)
+  // from another plugin the corresponding plugin should be added as a dependency.
+  // Usually, if this information is incorrect you will still be able to use you plugin, but HL functionality
+  // which uses plugin dependency resolution will not work correctly. For instance if plugin dependencies are
+  // not correct then your plugin cannot be used on HeuristicLab.Hive
+  // 
+  [PluginDependency("HeuristicLab.Common", "3.3")]
+  [PluginDependency("HeuristicLab.Core", "3.3")]
+  [PluginDependency("HeuristicLab.Data", "3.3")]
+  [PluginDependency("HeuristicLab.Optimization", "3.3")]
+  [PluginDependency("HeuristicLab.Problems.DataAnalysis", "3.4")]
+  [PluginDependency("HeuristicLab.Problems.Instances", "3.3")]
+  [PluginDependency("HeuristicLab.Random", "3.3")]
+
+  // HL plugin infrastructure discovers plugins on startup by trying to load all .dll and .exe files and looking for 
+  // classes deriving from PluginBase. The meta-information for the plugin class is specified in the attributes
+  // above, and used by plugin infrastructure primarily for plugin dependency resolution.
+
+  // Steps:
+  // (1) Check out HL source code (e.g. the trunk version)
+  // (2) Build external libraries HeuristicLab.ExtLibs.sln using the Build.cmd (in the path of the HL source code)
+  // (3) Build HeuristicLab 3.3.sln using the Build.cmd
+  // (4) Build this project. The output path for binaries is set to "".
+  //     this assumes you have the following folder structure
+  //    <ROOT>
+  //    |..hl
+  //       |..branches
+  //       |  |..Templates
+  //       |     |..EmptyPlugin
+  //       |..trunk
+  //          |..sources
+  //             |.. bin 
+
+  //  (5) Check that the output file has been added to the HL binaries folder (hl/trunk/sources/bin/EmptyPlugin.dll)
+  //  (6) Start hl/trunk/sources/bin/HeuristicLab.exe and open the "Plugin Manager".
+  //      Make sure your EmptyPlugin appears in the list of loaded plugins 
+  public class Plugin : PluginBase {
+  }
+}
Index: /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/Properties/AssemblyInfo.cs
===================================================================
--- /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/Properties/AssemblyInfo.cs	(revision 14365)
+++ /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/Properties/AssemblyInfo.cs	(revision 14365)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("EmptyRegressionProblemInstance")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("HP Inc.")]
+[assembly: AssemblyProduct("EmptyRegressionProblemInstance")]
+[assembly: AssemblyCopyright("Copyright © HP Inc. 2016")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("83fb4288-cff1-4e57-9695-aa85079012ba")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers 
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/RegressionProblemInstance.csproj
===================================================================
--- /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/RegressionProblemInstance.csproj	(revision 14365)
+++ /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/RegressionProblemInstance.csproj	(revision 14365)
@@ -0,0 +1,88 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="14.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>{83FB4288-CFF1-4E57-9695-AA85079012BA}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>RegressionProblemInstances</RootNamespace>
+    <AssemblyName>RegressionProblemInstances</AssemblyName>
+    <TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <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' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>..\..\..\..\trunk\sources\bin\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <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>
+    </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>
+    </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>
+    </Reference>
+    <Reference Include="HeuristicLab.Optimization-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Optimization-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.PluginInfrastructure-3.3">
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.PluginInfrastructure-3.3.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.DataAnalysis-3.4, Version=3.4.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.DataAnalysis-3.4.dll</HintPath>
+    </Reference>
+    <Reference Include="HeuristicLab.Problems.Instances-3.3, Version=3.3.0.0, Culture=neutral, PublicKeyToken=ba48961d6f65dcec, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\..\..\..\trunk\sources\bin\HeuristicLab.Problems.Instances-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>
+    </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.Net.Http" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="IRegressionProblemInstanceDescriptor.cs" />
+    <Compile Include="Plugin.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="RegressionProblemInstanceDescriptor.cs" />
+    <Compile Include="RegressionProblemInstanceProvider.cs" />
+  </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/Templates/RegressionProblemInstances/RegressionProblemInstance/RegressionProblemInstanceDescriptor.cs
===================================================================
--- /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/RegressionProblemInstanceDescriptor.cs	(revision 14365)
+++ /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/RegressionProblemInstanceDescriptor.cs	(revision 14365)
@@ -0,0 +1,56 @@
+﻿using System;
+using System.Linq;
+using HeuristicLab.Core;
+using HeuristicLab.Problems.DataAnalysis;
+
+
+namespace RegressionProblemInstances {
+  // This is a general descriptor for regression problem instances which produces data for a given target expression
+  public class RegressionProblemInstanceDescriptor : IRegressionProblemInstanceDescriptor {
+    private IRandom rand;
+    private int dim;
+    private Func<double[], double> func;
+    private int numRows;
+
+    public string Name { get; }
+    public string Description { get; }
+
+    public RegressionProblemInstanceDescriptor(string name, string desc, IRandom rand, int numRows, int dim, Func<double[], double> func) {
+      this.Name = name;
+      this.Description = desc;
+      this.rand = rand;
+      this.numRows = numRows;
+      this.dim = dim;
+      this.func = func;
+    }
+
+
+    public IRegressionProblemData GenerateData() {
+      var inputs = Enumerable.Range(1, dim).Select(idx => "x" + idx);
+      var target = "y";
+
+      // generate data
+      var x = new double[dim]; // for evaluating the expression
+      var data = new double[numRows, dim + 1];
+      int i = 0;
+      while (i < numRows) {
+        for (int j = 0; j < dim; j++) {
+          // we use the supplied PRND to generate x independently and identically distributed
+          // the PRND could use any kind of probability distribution
+          x[j] = rand.NextDouble();
+          data[i, j] = x[j];
+        }
+        data[i, dim] = func(x); // y = f(x)
+        // only accept reasonable values
+        if (!double.IsInfinity(data[i, dim]) && !double.IsNaN(data[i, dim])) i++;
+      }
+
+      var ds = new Dataset(inputs.Concat(new string[] { target }), data);
+      ds.Name = Name;
+      var probData = new RegressionProblemData(ds, inputs, target);
+      probData.Name = Name;
+      return probData;
+    }
+
+  }
+}
Index: /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/RegressionProblemInstanceProvider.cs
===================================================================
--- /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/RegressionProblemInstanceProvider.cs	(revision 14365)
+++ /branches/Templates/RegressionProblemInstances/RegressionProblemInstance/RegressionProblemInstanceProvider.cs	(revision 14365)
@@ -0,0 +1,53 @@
+﻿using System;
+using System.Collections.Generic;
+using HeuristicLab.Problems.DataAnalysis;
+using HeuristicLab.Problems.Instances;
+using HeuristicLab.Random;
+
+namespace RegressionProblemInstances {
+  public class RegressionProblemInstanceProvider : ProblemInstanceProvider<IRegressionProblemData> {
+    public override IEnumerable<IDataDescriptor> GetDataDescriptors() {
+      // if data is generated randomly then it is recommended to use a fixed random seed for reproducability
+      // Here we even use a random number generator to produce the seeds for the instance specific random number generators
+      var seedRandom = new MersenneTwister(1234);
+      return new[]
+      {
+        new RegressionProblemInstanceDescriptor(
+          name: "Poly-10", desc: "The Poly-10 problem.",
+          rand: new NormalDistributedRandom(new MersenneTwister((uint) seedRandom.Next()), 0, 10), // x ~ N(0,10)
+          dim: 10, numRows: 500,
+          func: (double[] x) => x[0]*x[1] + x[2]*x[3] + x[4]*x[5] + x[0]*x[6]*x[8] + x[2]*x[5]*x[9]
+          ),
+        new RegressionProblemInstanceDescriptor(
+          name: "sqrt(x+1)-sqrt(x)", desc: "Example from Herbie website http://herbie.uwplse.org/",
+          rand: new UniformDistributedRandom(new MersenneTwister((uint) seedRandom.Next()), 0, 1E6),  // x ~ U(0, 1e6)
+          dim: 1, numRows: 5000,
+          func: (double[] x) => Math.Sqrt(x[0]+1) - Math.Sqrt(x[0])
+          ),
+        new RegressionProblemInstanceDescriptor(
+          name: "Quadratic formula (-b/2a - sqrt(b^2 - 4ac)/2a", desc: "Example from Herbie paper http://herbie.uwplse.org/pldi15-paper.pdf",
+          rand: new UniformDistributedRandom(new MersenneTwister((uint) seedRandom.Next()), -1E6, 1E6),  // x ~ U(-1e6, 1e6)
+          dim: 3, numRows: 5000,
+          func: (double[] x) => (-x[1] - Math.Sqrt(-x[1]*x[1]  - 4.0*x[0]*x[2])) / (2*x[0])
+          )
+      };
+    }
+
+    public override IRegressionProblemData LoadData(IDataDescriptor descriptor) {
+      var desc = descriptor as IRegressionProblemInstanceDescriptor;
+      if (desc == null) {
+        throw new ArgumentException();
+      } else {
+        return desc.GenerateData();
+      }
+    }
+
+    public override bool CanExportData { get { return false; } }
+    public override bool CanImportData { get { return false; } }
+
+    public override string Name { get { return "My problem instances"; } }
+    public override string Description { get { return "A set of regression problem instance "; } }
+    public override Uri WebLink { get { return new Uri("https://dev.heuristiclab.com"); } } // if there is a web uri with more information on the problem instances
+    public override string ReferencePublication { get { return string.Empty; } } // if there is an academic publication for these problem instances
+  }
+}
