- Timestamp:
- 12/06/19 14:39:00 (5 years ago)
- Location:
- branches/3026_IntegrationIntoSymSpace/Heuristiclab.ConfigStarter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/3026_IntegrationIntoSymSpace/Heuristiclab.ConfigStarter/Heuristiclab.ConfigStarter.csproj
r17371 r17374 113 113 <Name>HeuristicLab.Problems.TravelingSalesman-3.3</Name> 114 114 </ProjectReference> 115 <ProjectReference Include="..\HeuristicLab.SequentialEngine\3.3\HeuristicLab.SequentialEngine-3.3.csproj"> 116 <Project>{dc3d7072-7999-4719-b65d-3997744d5dc1}</Project> 117 <Name>HeuristicLab.SequentialEngine-3.3</Name> 118 </ProjectReference> 115 119 </ItemGroup> 116 120 <ItemGroup> -
branches/3026_IntegrationIntoSymSpace/Heuristiclab.ConfigStarter/Program.cs
r17371 r17374 12 12 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression; 13 13 using HeuristicLab.PluginInfrastructure.Manager; 14 using HeuristicLab.SequentialEngine; 15 using System.Threading; 14 16 15 17 namespace Heuristiclab.ConfigStarter { 16 18 public class Program { 19 20 private static string Reduce(string str) => 21 str 22 .Replace(" ", "") 23 .Replace("-", "") 24 .Replace("`", "") 25 .Replace(".", "") 26 .Replace("<", "") 27 .Replace(">", "") 28 .Replace("(", "_") 29 .Replace(")", "_"); 30 31 private static void Visualize(JsonItem item, StringBuilder sb) { 32 sb.Append($" {item.GetHashCode()} [label=\"{item.Name}\"];\n"); 33 foreach (var i in item.Parameters) { 34 sb.Append($" {item.GetHashCode()} -> {i.GetHashCode()};\n"); 35 } 36 foreach(var i in item.Parameters) { 37 Visualize(i, sb); 38 } 39 } 40 17 41 public static void Main(string[] args) { 18 42 … … 32 56 33 57 GeneticAlgorithm alg = new GeneticAlgorithm(); 58 alg.MaximumGenerations.Value = 10000; 34 59 TravelingSalesmanProblem tsp = new TravelingSalesmanProblem(); 35 60 tsp.Coordinates[0, 0] = 123; 61 36 62 37 63 … … 40 66 alg.Problem = prop; 41 67 68 alg.Engine = new SequentialEngine(); 69 Task t = alg.StartAsync(); 70 Thread.Sleep(1000); 71 alg.Stop(); 72 73 StorableConverter storableConverter = new StorableConverter(); 74 JsonItem item = storableConverter.Extract(alg); 75 76 StringBuilder sb = new StringBuilder(); 77 78 //Visualize(item, sb); 79 80 //File.WriteAllText(@"C:\Workspace\item.gv", $"digraph G {{\n{sb.ToString()}}}"); 81 82 83 //Console.WriteLine(alg); 42 84 File.WriteAllText(@"C:\Workspace\Template.json", JCGenerator.GenerateTemplate(alg)); 43 85
Note: See TracChangeset
for help on using the changeset viewer.