Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
03/23/20 11:58:38 (4 years ago)
Author:
dpiringe
Message:

#3026:

  • added readme JsonInterfaceReadMe.txt
  • removed dead code
  • fixed a bug in JsonItemConverter -> now the type comparison should work as intended
Location:
branches/3026_IntegrationIntoSymSpace
Files:
1 added
1 deleted
12 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ConstrainedValueParameterConverter.cs

    r17477 r17483  
    2121      if (parameter.ActualValue != null && parameter.ActualValue is IParameterizedItem && cdata.Children != null) {
    2222        foreach(var child in cdata.Children) {
    23           if(child.Name == parameter.ActualValue.ItemName) // name kann verändert werden? egal da bei inject der original name vorhanden ist
     23          if(child.Name == cdata.Value || child.Path.EndsWith(cdata.Value))
    2424            root.Inject(parameter.ActualValue, child, root);
    2525        }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/StringValueConverter.cs

    r17473 r17483  
    1717    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    1818      new StringJsonItem() {
    19         //Name = "[OverridableParamName]",
    2019        Name = value.ItemName,
    2120        Description = value.ItemDescription,
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs

    r17477 r17483  
    2222      IValueLookupParameter param = value as IValueLookupParameter;
    2323
    24       IValueLookupJsonItem item = new ValueLookupJsonItem() {};
     24      IValueLookupJsonItem item = new ValueLookupJsonItem();
    2525
    2626      if (param.Value != null) {
    2727        IJsonItem tmp = root.Extract(param.Value, root);
    2828        tmp.Parent = item;
    29         //item.AddChildren(tmp.Children);
    3029        item.ActualValue = tmp;
    3130      }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs

    r17473 r17483  
    2121            root.Inject(parameter.ActualValue, data, root);
    2222          else
    23             root.Inject(parameter.ActualValue, /*data.Children?.First()*/ data, root);
     23            root.Inject(parameter.ActualValue, data, root);
    2424         
    2525      }
     
    4040          tmp.Description = parameter.Description;
    4141          item = tmp;
    42           /*
    43           if (tmp.Name == "[OverridableParamName]") {
    44             tmp.Name = parameter.Name;
    45             tmp.Description = parameter.Description;
    46             item = tmp;
    47             //JsonItem.Merge(item as JsonItem, tmp as JsonItem);
    48           } else
    49             item.AddChildren(tmp);
    50             */
    5142        }
    5243      }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueRangeConverter.cs

    r17473 r17483  
    2525      IntRange range = value as IntRange;
    2626      return new IntRangeJsonItem() {
    27         //Name = "[OverridableParamName]",
    2827        Name = value.ItemName,
    2928        Description = value.ItemDescription,
     
    5049      DoubleRange range = value as DoubleRange;
    5150      return new DoubleRangeJsonItem() {
    52         //Name = "[OverridableParamName]",
    5351        Name = value.ItemName,
    5452        Description = value.ItemDescription,
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeMatrixConverter.cs

    r17473 r17483  
    2020    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    2121      new IntMatrixJsonItem() {
    22         Name = "[OverridableParamName]",
     22        Name = value.ItemName,
    2323        Description = value.ItemDescription,
    2424        Value = Transform((IntMatrix)value),
     
    4040    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    4141      new DoubleMatrixJsonItem() {
    42         Name = "[OverridableParamName]",
     42        Name = value.ItemName,
    4343        Description = value.ItemDescription,
    4444        Value = Transform((DoubleMatrix)value),
     
    6262    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    6363      new DoubleMatrixJsonItem() {
    64         Name = "[OverridableParamName]",
     64        Name = value.ItemName,
    6565        Description = value.ItemDescription,
    6666        Value = Transform((PercentMatrix)value),
     
    8282    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    8383      new BoolMatrixJsonItem() {
    84         //Name = "[OverridableParamName]",
    8584        Name = value.ItemName,
    8685        Description = value.ItemDescription,
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeValueConverter.cs

    r17473 r17483  
    1818    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    1919      new IntJsonItem() {
    20         //Name = "[OverridableParamName]",
    2120        Name = value.ItemName,
    2221        Description = value.ItemDescription,
     
    3635    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    3736      new DoubleJsonItem() {
    38         //Name = "[OverridableParamName]",
    3937        Name = value.ItemName,
    4038        Description = value.ItemDescription,
     
    5452    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    5553      new DoubleJsonItem() {
    56         //Name = "[OverridableParamName]",
    5754        Name = value.ItemName,
    5855        Description = value.ItemDescription,
    5956        Value = ((PercentValue)value).Value,
    60         Minimum = double.MinValue,
    61         Maximum = double.MaxValue
     57        Minimum = 0.0d,
     58        Maximum = 1.0d
    6259      };
    6360  }
     
    7269    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    7370      new BoolJsonItem() {
    74         //Name = "[OverridableParamName]",
    7571        Name = value.ItemName,
    7672        Description = value.ItemDescription,
     
    8884    public override IJsonItem Extract(IItem value, IJsonItemConverter root) =>
    8985      new DateTimeJsonItem() {
    90         //Name = "[OverridableParamName]",
    9186        Name = value.ItemName,
    9287        Description = value.ItemDescription,
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/HeuristicLab.JsonInterface.csproj

    r17478 r17483  
    6161  </ItemGroup>
    6262  <ItemGroup>
    63     <Compile Include="AdvancedTypeComparer.cs" />
    6463    <Compile Include="Constants.cs" />
    6564    <Compile Include="Converters\AlgorithmConverter.cs" />
     
    166165    </ProjectReference>
    167166  </ItemGroup>
    168   <ItemGroup>
    169     <Folder Include="Extensions\" />
    170   </ItemGroup>
     167  <ItemGroup />
    171168  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
    172169  <PropertyGroup>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItemConverter.cs

    r17478 r17483  
    9393
    9494    private bool CompareGenericTypes(Type t1, Type t2) =>
    95       (t1.IsGenericType && t1.GetGenericTypeDefinition() == t2) ||
    96       (t2.IsGenericType && t2.GetGenericTypeDefinition() == t1);
     95      (t1.IsGenericType && t1.GetGenericTypeDefinition() == t2) /*||
     96      (t2.IsGenericType && t2.GetGenericTypeDefinition() == t1)*/;
    9797
    9898    private bool CompareTypes(Type t1, Type t2) =>
    99       t1 == t2 || t1.IsAssignableFrom(t2) ||
     99      t1 == t2 || /*t1.IsAssignableFrom(t2) ||*/
    100100      t1.GetInterfaces().Any(
    101101        i => i == t2 || CompareGenericTypes(i, t2)
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs

    r17481 r17483  
    110110        // override default value
    111111        if (Objects.TryGetValue(path, out IJsonItem param)) {
    112           // remove fixed template parameter => dont allow to copy them from concrete config
     112          // remove fixed template parameter from config => dont allow to copy them from concrete config
    113113          obj.Property(nameof(IIntervalRestrictedJsonItem<int>.Minimum))?.Remove();
    114114          obj.Property(nameof(IIntervalRestrictedJsonItem<int>.Maximum))?.Remove();
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Models/ValueLookupJsonItem.cs

    r17481 r17483  
    99namespace HeuristicLab.JsonInterface {
    1010  public class ValueLookupJsonItem : LookupJsonItem, IValueLookupJsonItem {
    11    
    1211    public IJsonItem ActualValue { get; set; }
    1312
     
    2019      var obj = base.GenerateJObject();
    2120      if(ActualValue != null) {
    22         var actualValue = ActualValue.GenerateJObject();
    23         obj.Add(nameof(IValueLookupJsonItem.ActualValue), actualValue);
     21        obj.Add(nameof(IValueLookupJsonItem.ActualValue), ActualValue.Path);
    2422      }
    2523      return obj;
  • branches/3026_IntegrationIntoSymSpace/Heuristiclab.ConfigStarter/Program.cs

    r17477 r17483  
    2424        var pluginManager = new PluginManager(pluginPath);
    2525        pluginManager.DiscoverAndCheckPlugins();
    26        
    2726      } catch(Exception e) {
    2827        Console.WriteLine(e);
Note: See TracChangeset for help on using the changeset viewer.