Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
12/17/19 17:16:03 (4 years ago)
Author:
dpiringe
Message:

#3026:

  • removed classes:
    • CheckedItemListConverter: unnecessary
    • ItemCollectionConverter: unnecessary
    • PrimitiveConverter: not possible to implement because it needs to Extract/Inject from/into objects (but interfaces pretends IItem)
    • StorableConverter: unnecessary
    • ConfigurableConverter: unnecessary
  • removed graphviz code in Heuristiclab.ConfigStarter/Program.cs
  • updated Constants
  • some simple code refactors in BaseConverter
  • in JsonItem:
    • renamed Parameters -> Children
    • removed Properties: Operators, Type, Reference, IsConfigurable, IsParameterizedItem
    • removed unnecessary/old code
  • implemented a new way to get data from an object, which is a matrix, in ValueTypeMatrixConverter method: CopyMatrixData
    • converts the object into an array -> rows: from array.Length, cols: when the length is > 0 pick length of first array of index 0 (it is saved as an array of arrays)
  • created a binding flag const in ValueRangeConverter to prevent duplicates in code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/Heuristiclab.ConfigStarter/Program.cs

    r17374 r17379  
    1717namespace Heuristiclab.ConfigStarter {
    1818  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     }
    4019
    4120    public static void Main(string[] args) {
     
    6443      SymbolicRegressionSingleObjectiveProblem prop = new SymbolicRegressionSingleObjectiveProblem();
    6544     
    66       alg.Problem = prop;
     45      alg.Problem = tsp;
    6746
    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);
    8447      File.WriteAllText(@"C:\Workspace\Template.json", JCGenerator.GenerateTemplate(alg));
    85 
     48      JCInstantiator.Instantiate(@"C:\Workspace\Template.json");
    8649      /*
    8750      List<ICommandLineArgument> arguments = new List<ICommandLineArgument>();
Note: See TracChangeset for help on using the changeset viewer.