Free cookie consent management tool by TermsFeed Policy Generator

Changeset 18040


Ignore:
Timestamp:
08/04/21 17:19:05 (3 years ago)
Author:
dpiringe
Message:

#3026

  • added some test cases for JsonInterface
  • deleted the HeuristicLab namespace part in a lot of test classes (this caused a lot of compile errors)
  • enhanced the OS path logic for absolute and relative path in JsonTemplateGenerator and JsonTemplateInstantiator
  • fixed a bug in ValueParameterConverter -> the injection logic was not working correctly
  • changed the folder determination in Main.cs for the HeadlessRun method
  • added a new abstract type of JsonItem IntervalRestrictedJsonItem for JsonItems with a need of Minimum and Maximum bounds but without a specific value
    • changed in RangedJsonItem the base class from IntervalRestrictedValueJsonItem to IntervalRestrictedJsonItem
Location:
branches/3026_IntegrationIntoSymSpace
Files:
2 added
1 deleted
17 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Algorithms.OffspringSelectionGeneticAlgorithm/3.3/OffspringSelectionGeneticAlgorithm.cs

    r17198 r18040  
    269269      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorLowerBound", "The lower bound of the comparison factor (start).", new DoubleValue(0)));
    270270      Parameters.Add(new ValueLookupParameter<DoubleValue>("ComparisonFactorUpperBound", "The upper bound of the comparison factor (end).", new DoubleValue(1)));
    271       Parameters.Add(new OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>("ComparisonFactorModifier", "The operator used to modify the comparison factor.", new ItemSet<IDiscreteDoubleValueModifier>(new IDiscreteDoubleValueModifier[] { new LinearDiscreteDoubleValueModifier() }), new LinearDiscreteDoubleValueModifier()));
     271      Parameters.Add(new OptionalConstrainedValueParameter<IDiscreteDoubleValueModifier>("ComparisonFactorModifier", "The operator used to modify the comparison factor.", new ItemSet<IDiscreteDoubleValueModifier>()));
    272272      Parameters.Add(new ValueLookupParameter<DoubleValue>("MaximumSelectionPressure", "The maximum selection pressure that terminates the algorithm.", new DoubleValue(100)));
    273273      Parameters.Add(new ValueLookupParameter<BoolValue>("OffspringSelectionBeforeMutation", "True if the offspring selection step should be applied before mutation, false if it should be applied after mutation.", new BoolValue(false)));
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs

    r17843 r18040  
    1616      IParameter parameter = value as IParameter;
    1717
    18       if (parameter.ActualValue == null)
    19         parameter.ActualValue = Instantiate(parameter.DataType);
    20 
    21       if(parameter.ActualValue != null) {
    22           if (data.Children == null || data.Children.Count() == 0)
    23             root.Inject(parameter.ActualValue, data, root);
    24           else
    25             root.Inject(parameter.ActualValue, data, root);
    26          
     18      if (!(data is EmptyJsonItem)) {
     19        if (parameter.ActualValue == null)
     20          parameter.ActualValue = Instantiate(parameter.DataType);
     21        root.Inject(parameter.ActualValue, data, root);
    2722      }
    2823    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/HeuristicLab.JsonInterface.csproj

    r17924 r18040  
    9090    <Compile Include="JsonItems\EmptyJsonItem.cs" />
    9191    <Compile Include="JsonItems\IntervalRestrictedArrayJsonItem.cs" />
     92    <Compile Include="JsonItems\IntervalRestrictedJsonItem.cs" />
    9293    <Compile Include="JsonItems\IntervalRestrictedMatrixJsonItem.cs" />
    9394    <Compile Include="JsonItems\IntervalRestrictedValueJsonItem.cs" />
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItems/IntervalRestrictedValueJsonItem.cs

    r17828 r18040  
    33
    44namespace HeuristicLab.JsonInterface {
    5   public abstract class IntervalRestrictedValueJsonItem<T> : ValueJsonItem<T>, IIntervalRestrictedJsonItem<T>
     5  public abstract class IntervalRestrictedValueJsonItem<T> : ValueJsonItem<T>, IIntervalRestrictedJsonItem<T> // TODO: intervalrestriction before value?
    66    where T : IComparable {
    77    public T Minimum { get; set; }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItems/RangedJsonItem.cs

    r18031 r18040  
    44
    55namespace HeuristicLab.JsonInterface {
    6   public abstract class RangedJsonItem<T> : IntervalRestrictedValueJsonItem<T>, IRangedJsonItem<T>
     6  public abstract class RangedJsonItem<T> : IntervalRestrictedJsonItem<T>, IRangedJsonItem<T>
    77    where T : IComparable {
    88    public T MinValue { get; set; }
     9   
    910    public T MaxValue { get; set; }
    1011
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateGenerator.cs

    r18030 r18040  
    5050      serializer.Serialize(optimizer, hlFilePath);
    5151      // overwrite string for relative path
    52       hlFilePath = Path.Combine($".{Path.DirectorySeparatorChar}", $"{templateName}.hl");
     52      hlFilePath = Path.Combine($".", $"{templateName}.hl");
    5353      #endregion
    5454
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs

    r18039 r18040  
    5050
    5151      #region Parse Files
     52      string templateFileFullPath = Path.GetFullPath(templateFile);
    5253      Template = JToken.Parse(File.ReadAllText(templateFile));
    5354      if(!string.IsNullOrEmpty(configFile))
    54         Config = JArray.Parse(File.ReadAllText(configFile));
     55        Config = JArray.Parse(File.ReadAllText(Path.GetFullPath(configFile)));
    5556      #endregion
    5657
     
    6162        relativePath = relativePath.Remove(0, 2); // remove first 2 chars -> indicates the current directory
    6263
    63       string hLFileLocation = $"{Path.GetDirectoryName(templateFile)}{Path.DirectorySeparatorChar}{relativePath}";
    64 
     64      string hLFileLocation = Path.Combine(Path.GetDirectoryName(templateFileFullPath), relativePath);
    6565      #region Deserialize HL File
    6666      ProtoBufSerializer serializer = new ProtoBufSerializer();
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.PluginInfrastructure/3.3/Main.cs

    r18035 r18040  
    2323using System.IO;
    2424using System.Linq;
     25using System.Reflection;
    2526using System.Windows.Forms;
    2627using HeuristicLab.PluginInfrastructure.Manager;
     
    5556
    5657    public static void HeadlessRun(string[] args) {
    57       string pluginPath = Path.GetFullPath(Application.StartupPath);
     58      string pluginPath = Path.GetFullPath(Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));
    5859      var pluginManager = new PluginManager(pluginPath);
    5960      pluginManager.DiscoverAndCheckPlugins();
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Tests/HeuristicLab-3.3/ContentViewTests.cs

    r17180 r18040  
    3939        // jkarder: skip this test for the SymbolicDataAnalysisModelMathView (and for views that derive from it)
    4040        // reason: our new build agent cannot create an instance of this view due to the use of System.Windows.Forms.WebBrowser
    41         if (typeof(HeuristicLab.Problems.DataAnalysis.Symbolic.Views.SymbolicDataAnalysisModelMathView).IsAssignableFrom(viewType))
     41        if (typeof(Problems.DataAnalysis.Symbolic.Views.SymbolicDataAnalysisModelMathView).IsAssignableFrom(viewType))
    4242          continue;
    4343
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Tests/HeuristicLab-3.3/DeepCloneableCloningTest.cs

    r17180 r18040  
    4444    public DeepCloneableCloningTest() {
    4545      excludedTypes = new HashSet<Type> {
    46         typeof (HeuristicLab.Problems.DataAnalysis.Dataset),
    47         typeof (HeuristicLab.Problems.TravelingSalesman.DistanceMatrix),
    48         typeof (HeuristicLab.Problems.DataAnalysis.ClassificationEnsembleSolution),
    49         typeof (HeuristicLab.Problems.DataAnalysis.RegressionEnsembleSolution),
    50         typeof (HeuristicLab.Problems.Orienteering.DistanceMatrix),
    51         typeof (HeuristicLab.Problems.PTSP.DistanceMatrix)
     46        typeof (Problems.DataAnalysis.Dataset),
     47        typeof (Problems.TravelingSalesman.DistanceMatrix),
     48        typeof (Problems.DataAnalysis.ClassificationEnsembleSolution),
     49        typeof (Problems.DataAnalysis.RegressionEnsembleSolution),
     50        typeof (Problems.Orienteering.DistanceMatrix),
     51        typeof (Problems.PTSP.DistanceMatrix)
    5252      };
    5353      excludedTypes.Add(typeof(SymbolicExpressionGrammar).Assembly.GetType("HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.EmptySymbolicExpressionTreeGrammar"));
    54 
    55       foreach (var symbolType in ApplicationManager.Manager.GetTypes(typeof(HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.Symbol)))
     54     
     55      foreach (var symbolType in ApplicationManager.Manager.GetTypes(typeof(Encodings.SymbolicExpressionTreeEncoding.Symbol)))
    5656        excludedTypes.Add(symbolType);
    5757      // SimpleSymbol is a non-discoverable type and thus needs to be added manually
    58       excludedTypes.Add(typeof(HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.SimpleSymbol));
    59       foreach (var grammarType in ApplicationManager.Manager.GetTypes(typeof(HeuristicLab.Encodings.SymbolicExpressionTreeEncoding.SymbolicExpressionGrammarBase)))
     58      excludedTypes.Add(typeof(Encodings.SymbolicExpressionTreeEncoding.SimpleSymbol));
     59      foreach (var grammarType in ApplicationManager.Manager.GetTypes(typeof(Encodings.SymbolicExpressionTreeEncoding.SymbolicExpressionGrammarBase)))
    6060        excludedTypes.Add(grammarType);
    6161    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GPMultiplexerSampleTest.cs

    r17180 r18040  
    5757
    5858    public static OffspringSelectionGeneticAlgorithm CreateGpMultiplexerSample() {
    59       var problem = new HeuristicLab.Problems.GeneticProgramming.Boolean.MultiplexerProblem();
     59      var problem = new Problems.GeneticProgramming.Boolean.MultiplexerProblem();
    6060      problem.Name = "11-Multiplexer Problem";
    6161      problem.Encoding.TreeLength = 50;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Tests/HeuristicLab-3.3/Samples/GeSymbolicRegressionSampleTest.cs

    r17180 r18040  
    6060
    6161      #region Problem Configuration
    62       var problem = new HeuristicLab.Problems.GrammaticalEvolution.GEArtificialAntProblem();
     62      var problem = new Problems.GrammaticalEvolution.GEArtificialAntProblem();
    6363      #endregion
    6464      #region Algorithm Configuration
     
    9999
    100100      #region Problem Configuration
    101       var problem = new HeuristicLab.Problems.GrammaticalEvolution.GESymbolicRegressionSingleObjectiveProblem();
     101      var problem = new Problems.GrammaticalEvolution.GESymbolicRegressionSingleObjectiveProblem();
    102102
    103103      #endregion
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Tests/HeuristicLab-3.3/Samples/LocalSearchKnapsackSampleTest.cs

    r17180 r18040  
    6161      KnapsackProblem problem = new KnapsackProblem();
    6262      problem.BestKnownQuality = new DoubleValue(362);
    63       problem.BestKnownSolution = new HeuristicLab.Encodings.BinaryVectorEncoding.BinaryVector(new bool[] {
     63      problem.BestKnownSolution = new Encodings.BinaryVectorEncoding.BinaryVector(new bool[] {
    6464       true , false, false, true , true , true , true , true , false, true , true , true , true , true , true , false, true , false, true , true , false, true , true , false, true , false, true , true , true , false, true , true , false, true , true , false, true , false, true , true , true , true , true , true , true , true , true , true , true , true , true , false, true , false, false, true , true , false, true , true , true , true , true , true , true , true , false, true , false, true , true , true , true , false, true , true , true , true , true , true , true , true});
    6565      problem.EvaluatorParameter.Value = new KnapsackEvaluator();
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Tests/HeuristicLab.Algorithms.DataAnalysis-3.4/SupportVectorMachineTest.cs

    r17180 r18040  
    5959      var cv = new CrossValidation();
    6060      cv.Algorithm = new SupportVectorRegression();
    61       var rand = new HeuristicLab.Random.MersenneTwister();
     61      var rand = new Random.MersenneTwister();
    6262      double[,] data = GenerateData(1000, rand);
    6363      List<string> variables = new List<string>() { "x1", "x2", "x3", "x4", "x5", "x6", "x7", "x8", "x9", "x10", "y" };
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Tests/HeuristicLab.JsonInterface/GeneratorInstantiatorTest.cs

    r17353 r18040  
    11using System;
     2using System.Collections.Generic;
    23using System.IO;
    34using System.Linq;
     
    78using HeuristicLab.Operators;
    89using HeuristicLab.Optimization;
     10using HeuristicLab.PluginInfrastructure.Manager;
    911using HeuristicLab.Problems.TravelingSalesman;
    1012using Microsoft.VisualStudio.TestTools.UnitTesting;
     13using Newtonsoft.Json.Linq;
    1114
    1215namespace HeuristicLab.JsonInterface.Tests {
    1316  [TestClass]
    1417  public class GeneratorInstantiatorTest {
    15     private string templateFilePath = Directory.GetCurrentDirectory()+"\\Template.json";
    16     private string configFilePath = Directory.GetCurrentDirectory() + "\\Config.json";
     18    private string TmpDirectoryPath => Path.Combine(Directory.GetCurrentDirectory(), "JsonInterfaceTestEnvironment");
     19    private string TemplateName => Path.Combine(TmpDirectoryPath, "Template");
     20    private string TemplateFilePath => $"{TemplateName}.json";
     21    private string ConfigFilePath => Path.Combine(TmpDirectoryPath, "Config.json");
     22    private string OutFilePath => Path.Combine(TmpDirectoryPath, "out.json");
    1723
    1824    [TestInitialize()]
    1925    public void CreateTempFiles() {
     26      string pluginPath = Path.GetFullPath(Directory.GetCurrentDirectory());
     27      var pluginManager = new PluginManager(pluginPath);
     28      pluginManager.DiscoverAndCheckPlugins();
     29
     30
     31      Directory.CreateDirectory(TmpDirectoryPath);
     32
    2033      GeneticAlgorithm alg = new GeneticAlgorithm();
     34      alg.PopulationSize.Value = 200;
    2135      alg.Problem = new TravelingSalesmanProblem();
    22       //File.WriteAllText(@"C:\Workspace\Template.json", gen.GenerateTemplate(alg, tsp));
    23       File.WriteAllText(templateFilePath, JCGenerator.GenerateTemplate(alg));
    24       File.WriteAllText(configFilePath, "["+
    25         "{\"Name\": \"Seed\",\"Default\": 55555,\"Path\": \"Genetic Algorithm (GA).Seed\"},"+
    26         "{\"Name\": \"Crossover\", \"Path\": \"Genetic Algorithm (GA).Crossover\", \"Default\": \"MultiPermutationCrossover\"}," +
    27         "{\"Name\": \"Elites\", \"Path\": \"Genetic Algorithm (GA).Elites\", \"Default\": 5,\"Range\":[-2147483648,2147483647]}" +
    28         "]");
     36     
     37      var rootItem = JsonItemConverter.Extract(alg);
     38      foreach (var item in rootItem)
     39        item.Active = true; //activate all items
     40      JsonTemplateGenerator.GenerateTemplate(TemplateName, alg, rootItem);
     41
     42
     43      var populationItem =
     44        (IntJsonItem)rootItem.Where(x => x.Name.Contains("PopulationSize")).FirstOrDefault();
     45
     46      populationItem.Value = 500;
     47
     48      JArray configItems = new JArray();
     49      configItems.Add(populationItem.GenerateJObject());
     50
     51      File.WriteAllText(ConfigFilePath, SingleLineArrayJsonWriter.Serialize(configItems));
     52
    2953    }
    30    
    31     [TestCleanup()]
    32     public void ClearTempFiles() {
    33       File.Delete(templateFilePath);
    34       File.Delete(configFilePath);
     54
     55    private void CreateTestEnvironment(IOptimizer optimizer, Func<IJsonItem,IEnumerable<IJsonItem>> selectConfigItems, Action body) {
     56      // initialization
     57      Directory.CreateDirectory(TmpDirectoryPath);
     58
     59      var rootItem = JsonItemConverter.Extract(optimizer);
     60      foreach (var item in rootItem)
     61        item.Active = true; //activate all items
     62      JsonTemplateGenerator.GenerateTemplate(TemplateName, optimizer, rootItem);
     63
     64      JArray configItemsJArray = new JArray();
     65      var configItems = selectConfigItems(rootItem);
     66
     67      foreach(var item in configItems) {
     68        configItemsJArray.Add(item.GenerateJObject());
     69      }
     70      File.WriteAllText(ConfigFilePath, SingleLineArrayJsonWriter.Serialize(configItemsJArray));
     71
     72      // execute test
     73      body();
     74
     75      // cleanup
     76      var files = Directory.GetFiles(TmpDirectoryPath);
     77      foreach (var file in files)
     78        File.Delete(file);
     79      Directory.Delete(TmpDirectoryPath);
    3580    }
    3681
    3782    [TestMethod]
    38     public void TestInstantiator() {
    39       GeneticAlgorithm alg = (GeneticAlgorithm)JCInstantiator.Instantiate(templateFilePath, configFilePath);
     83    public void TestGATSP() {
     84      var ga = new GeneticAlgorithm();
     85      ga.PopulationSize.Value = 200;
     86      ga.Problem = new TravelingSalesmanProblem();
    4087
    41       Assert.AreEqual(55555, alg.Seed.Value);
    42       Assert.IsTrue(alg.Crossover is MultiPermutationCrossover);
    43       Assert.AreEqual(5, alg.Elites.Value);
     88      CreateTestEnvironment(ga,
     89        r => r.Where(x => x.Name.Contains("PopulationSize"))
     90              .Cast<IntJsonItem>()
     91              .Select(x => { x.Value = 500; return x; }),
     92        () => {
     93          var result = JsonTemplateInstantiator.Instantiate(TemplateFilePath, ConfigFilePath);
     94          var optimizer = (GeneticAlgorithm)result.Optimizer;
     95          Assert.AreEqual(500, optimizer.PopulationSize.Value);
     96
     97          PluginInfrastructure.Main.HeadlessRun(new string[] { "/start:JsonInterface", TemplateFilePath, ConfigFilePath, OutFilePath });
     98          Assert.IsTrue(File.Exists(OutFilePath));
     99
     100          var runs = JArray.Parse(File.ReadAllText(OutFilePath));
     101          var results = (JObject)runs[0];
     102          results.Property("Generations");
     103        });
    44104    }
    45105
    46106    [TestMethod]
    47     [ExpectedException(typeof(ArgumentOutOfRangeException))]
    48     public void TestRangeChangeWithConfig() {
    49       File.WriteAllText(configFilePath, "[{\"Name\": \"MutationProbability\", \"Path\": \"Genetic Algorithm (GA).MutationProbability\", \"Default\": 2.0,\"Range\":[0.0,2.0]}]");
    50       GeneticAlgorithm alg = (GeneticAlgorithm)JCInstantiator.Instantiate(templateFilePath, configFilePath);
     107    public void TestGASymReg() {
     108      var ga = new GeneticAlgorithm();
     109      ga.PopulationSize.Value = 200;
     110      ga.Problem = new Problems.DataAnalysis.Symbolic.Regression.SymbolicRegressionSingleObjectiveProblem();
     111
     112      CreateTestEnvironment(ga,
     113        r => r.Where(x => x.Name.Contains("PopulationSize"))
     114              .Cast<IntJsonItem>()
     115              .Select(x => { x.Value = 500; return x; }),
     116        () => {
     117          var result = JsonTemplateInstantiator.Instantiate(TemplateFilePath, ConfigFilePath);
     118          var optimizer = (GeneticAlgorithm)result.Optimizer;
     119          Assert.AreEqual(500, optimizer.PopulationSize.Value);
     120
     121          PluginInfrastructure.Main.HeadlessRun(new string[] { "/start:JsonInterface", TemplateFilePath, ConfigFilePath, OutFilePath });
     122          Assert.IsTrue(File.Exists(OutFilePath));
     123
     124          var runs = JArray.Parse(File.ReadAllText(OutFilePath));
     125          var results = (JObject)runs[0];
     126          results.Property("Generations");
     127        });
     128    }
     129
     130    [TestMethod]
     131    public void TestOSGASymReg() {
     132      var osga = new Algorithms.OffspringSelectionGeneticAlgorithm.OffspringSelectionGeneticAlgorithm();
     133      osga.PopulationSize.Value = 200;
     134      osga.Problem = new Problems.DataAnalysis.Symbolic.Regression.SymbolicRegressionSingleObjectiveProblem();
     135
     136      CreateTestEnvironment(osga,
     137        r => r.Where(x => x.Name.Contains("PopulationSize"))
     138              .Cast<IntJsonItem>()
     139              .Select(x => { x.Value = 500; return x; }),
     140        () => {
     141          var result = JsonTemplateInstantiator.Instantiate(TemplateFilePath, ConfigFilePath);
     142          var optimizer = (Algorithms.OffspringSelectionGeneticAlgorithm.OffspringSelectionGeneticAlgorithm)result.Optimizer;
     143          Assert.AreEqual(500, optimizer.PopulationSize.Value);
     144
     145          PluginInfrastructure.Main.HeadlessRun(new string[] { "/start:JsonInterface", TemplateFilePath, ConfigFilePath, OutFilePath });
     146          Assert.IsTrue(File.Exists(OutFilePath));
     147
     148          var runs = JArray.Parse(File.ReadAllText(OutFilePath));
     149          var results = (JObject)runs[0];
     150          results.Property("Generations");
     151        });
     152    }
     153
     154    [TestMethod]
     155    public void TestOSGATSP() {
     156      var osga = new Algorithms.OffspringSelectionGeneticAlgorithm.OffspringSelectionGeneticAlgorithm();
     157      osga.PopulationSize.Value = 200;
     158      osga.Problem = new TravelingSalesmanProblem();
     159
     160      CreateTestEnvironment(osga,
     161        r => r.Where(x => x.Name.Contains("PopulationSize"))
     162              .Cast<IntJsonItem>()
     163              .Select(x => { x.Value = 500; return x; }),
     164        () => {
     165          var result = JsonTemplateInstantiator.Instantiate(TemplateFilePath, ConfigFilePath);
     166          var optimizer = (Algorithms.OffspringSelectionGeneticAlgorithm.OffspringSelectionGeneticAlgorithm)result.Optimizer;
     167          Assert.AreEqual(500, optimizer.PopulationSize.Value);
     168
     169          PluginInfrastructure.Main.HeadlessRun(new string[] { "/start:JsonInterface", TemplateFilePath, ConfigFilePath, OutFilePath });
     170          Assert.IsTrue(File.Exists(OutFilePath));
     171
     172          var runs = JArray.Parse(File.ReadAllText(OutFilePath));
     173          var results = (JObject)runs[0];
     174          results.Property("Generations");
     175        });
    51176    }
    52177  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Tests/HeuristicLab.Tests.csproj

    r18027 r18040  
    443443    <Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
    444444      <Private>false</Private>
     445    </Reference>
     446    <Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
     447      <HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
    445448    </Reference>
    446449    <Reference Include="System" />
     
    596599    <Compile Include="HeuristicLab.IGraph\IGraphWrappersVectorTest.cs" />
    597600    <Compile Include="HeuristicLab.JsonInterface\GeneratorInstantiatorTest.cs" />
    598     <Compile Include="HeuristicLab.JsonInterface\ConvertableChecks.cs" />
    599601    <Compile Include="HeuristicLab.Persistence-3.3\StorableAttributeTests.cs" />
    600602    <Compile Include="HeuristicLab.Persistence-3.3\UseCases.cs" />
     
    695697    </None>
    696698    <None Include="HeuristicLab.snk" />
     699    <None Include="packages.config" />
    697700    <None Include="Test Resources\GA_SymbReg.hl">
    698701      <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab/3.3/Program.cs

    r18035 r18040  
    2121
    2222using System;
     23using System.IO;
     24using System.Reflection;
    2325
    2426namespace HeuristicLab {
     
    2729    static void Main(string[] args) {
    2830      if ((args.Length >= 1) && (args[0] == "/start:JsonInterface")) {
    29         HeuristicLab.PluginInfrastructure.Main.HeadlessRun(args);
     31        try {
     32          HeuristicLab.PluginInfrastructure.Main.HeadlessRun(args);
     33        } catch (Exception e) {
     34          File.WriteAllText(@"C:\Users\David\Desktop\GP_JsonInterface_Example\log.txt", e.Message);
     35        }
     36        File.WriteAllText(@"C:\Users\David\Desktop\GP_JsonInterface_Example\done.txt", Path.GetDirectoryName(Assembly.GetEntryAssembly().Location));
    3037      } else {
    3138        HeuristicLab.PluginInfrastructure.Main.Run(args);
Note: See TracChangeset for help on using the changeset viewer.