Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.Manufacture/Template.cs @ 17263

Last change on this file since 17263 was 17263, checked in by dpiringe, 5 years ago

#3026:

  • added first prototype for:
    • creating templates
    • initialize a optimizer out of a template
  • first attempts to create the option to extend the template generation and initialisation (with Transformers -> json To IItem, IItem to json) without serializing/deserializing the whole IItem
File size: 1.4 KB
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using HeuristicLab.Core;
7using Newtonsoft.Json;
8
9namespace ParameterTest {   
10  public class JCObject {
11    public string Name { get; set; }
12    public IList<ParameterData> Parameters { get; set; }
13    public IList<ParameterData> FreeParameters { get; set; }
14    public IList<ParameterData> StaticParameters { get; set; }
15
16    public override string ToString() {
17      StringBuilder sb = new StringBuilder();
18      sb.Append($"{Name}: [");
19      foreach(var x in StaticParameters) {
20        sb.Append(x.ToString());
21      }
22      sb.Append($"\n]");
23      return sb.ToString();
24    }
25  }
26
27  public class ParameterData {
28    public string Name { get; set; }
29    [JsonIgnore]
30    public string Type { get; set; }
31    public object Default { get; set; }
32    //[JsonIgnore]
33    public string Path { get; set; }
34    public IList<object> Range { get; set; }
35    public IList<ParameterData> Parameters { get; set; }
36    public IList<ParameterData> Operators { get; set; }
37
38    public override string ToString() {
39      StringBuilder sb = new StringBuilder();
40      sb.Append($"\n{Name}, {Default}, Range[");
41      if(Range != null) {
42        foreach (var x in Range) {
43          sb.Append(x.ToString() + ", ");
44        }
45      }
46      sb.Append($"],");
47      return sb.ToString();
48    }
49  }
50
51
52}
Note: See TracBrowser for help on using the repository browser.