Free cookie consent management tool by TermsFeed Policy Generator

source: branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ParameterConverter.cs @ 17353

Last change on this file since 17353 was 17353, checked in by dpiringe, 4 years ago

#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 size: 733 bytes
Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using System.Threading.Tasks;
6using HeuristicLab.Core;
7
8namespace HeuristicLab.JsonInterface {
9  public class ParameterConverter : ParameterBaseConverter {
10    public override JsonItem ExtractData(IParameter value) {
11      JsonItem item = new JsonItem() {
12        Name = value.Name 
13      };
14      if(value.ActualValue != null) {
15        item.Parameters = new List<JsonItem>();
16        item.Parameters.Add(JsonItemConverter.Extract(value.ActualValue));
17      }
18      return item;
19    }
20
21    public override void InjectData(IParameter parameter, JsonItem data) {
22      throw new NotImplementedException();
23    }
24  }
25}
Note: See TracBrowser for help on using the repository browser.