Changeset 17353 for branches/3026_IntegrationIntoSymSpace/HeuristicLab.Tests/HeuristicLab.JsonInterface
- Timestamp:
- 11/19/19 16:33:01 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/HeuristicLab.Tests/HeuristicLab.JsonInterface/GeneratorInstantiatorTest.cs
r17330 r17353 20 20 GeneticAlgorithm alg = new GeneticAlgorithm(); 21 21 alg.Problem = new TravelingSalesmanProblem(); 22 JCGenerator gen = new JCGenerator();23 22 //File.WriteAllText(@"C:\Workspace\Template.json", gen.GenerateTemplate(alg, tsp)); 24 File.WriteAllText(templateFilePath, gen.GenerateTemplate(alg));23 File.WriteAllText(templateFilePath, JCGenerator.GenerateTemplate(alg)); 25 24 File.WriteAllText(configFilePath, "["+ 26 25 "{\"Name\": \"Seed\",\"Default\": 55555,\"Path\": \"Genetic Algorithm (GA).Seed\"},"+ … … 38 37 [TestMethod] 39 38 public void TestInstantiator() { 40 JCInstantiator configurator = new JCInstantiator(); 41 GeneticAlgorithm alg = (GeneticAlgorithm)configurator.Instantiate(templateFilePath, configFilePath); 39 GeneticAlgorithm alg = (GeneticAlgorithm)JCInstantiator.Instantiate(templateFilePath, configFilePath); 42 40 43 41 Assert.AreEqual(55555, alg.Seed.Value); … … 50 48 public void TestRangeChangeWithConfig() { 51 49 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); 54 51 } 55 52 }
Note: See TracChangeset
for help on using the changeset viewer.