Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/19/19 16:33:01 (5 years ago)
Author:
dpiringe
Message:

#3026:

  • relocated GetMaxValue and GetMinValue from ValueTypeValueConverter into BaseConverter
  • fixed a bug in ConstrainedValueParameterConverter (from GetType().Name to ToString())
  • printing now PrettyNames for types
  • added comments
  • added StorableConverter.cs (not finished, maybe not a good converter)
  • added ValueRangeConverter.cs for DoubleRange and IntRange
  • added ParameterConverter.cs for default parameter conversion
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Tests/HeuristicLab.JsonInterface/GeneratorInstantiatorTest.cs

    r17330 r17353  
    2020      GeneticAlgorithm alg = new GeneticAlgorithm();
    2121      alg.Problem = new TravelingSalesmanProblem();
    22       JCGenerator gen = new JCGenerator();
    2322      //File.WriteAllText(@"C:\Workspace\Template.json", gen.GenerateTemplate(alg, tsp));
    24       File.WriteAllText(templateFilePath, gen.GenerateTemplate(alg));
     23      File.WriteAllText(templateFilePath, JCGenerator.GenerateTemplate(alg));
    2524      File.WriteAllText(configFilePath, "["+
    2625        "{\"Name\": \"Seed\",\"Default\": 55555,\"Path\": \"Genetic Algorithm (GA).Seed\"},"+
     
    3837    [TestMethod]
    3938    public void TestInstantiator() {
    40       JCInstantiator configurator = new JCInstantiator();
    41       GeneticAlgorithm alg = (GeneticAlgorithm)configurator.Instantiate(templateFilePath, configFilePath);
     39      GeneticAlgorithm alg = (GeneticAlgorithm)JCInstantiator.Instantiate(templateFilePath, configFilePath);
    4240
    4341      Assert.AreEqual(55555, alg.Seed.Value);
     
    5048    public void TestRangeChangeWithConfig() {
    5149      File.WriteAllText(configFilePath, "[{\"Name\": \"MutationProbability\", \"Path\": \"Genetic Algorithm (GA).MutationProbability\", \"Default\": 2.0,\"Range\":[0.0,2.0]}]");
    52       JCInstantiator configurator = new JCInstantiator();
    53       GeneticAlgorithm alg = (GeneticAlgorithm)configurator.Instantiate(templateFilePath, configFilePath);
     50      GeneticAlgorithm alg = (GeneticAlgorithm)JCInstantiator.Instantiate(templateFilePath, configFilePath);
    5451    }
    5552  }
Note: See TracChangeset for help on using the changeset viewer.