Ignore:
Timestamp:
02/17/20 15:13:17 (14 months ago)
Author:
dpiringe
Message:

#3026:

  • fixed a bug in HeuristicLab.JsonInterface.App -> now the Runner checks if the instantiated optimizer is an EngineAlgorithm, if true: Engine = SequentialEngine (engine can be configured in later versions)
  • added a TabControl in ExportJsonDialog for parameters and results
  • updated parameter tree view with checkboxes (and linked them with VM)
  • renamed ActivatedResults to Results for templates
  • fixed a bug with injection of operators in MultiCheckedOperatorConverter -> now operators of an ValueParameter get set correctly
  • updated MultiCheckedOperatorConverter to extract/inject parameters of operators
  • fixed bug with path for template -> removed usage of method Path.GetDirectoryName, returned wrong results
  • splitted cache for JsonItemConverter into a cache for injection and extraction
  • JsonTemplateInstantiator now uses first item in objects array instead of searching for an object with template name
File:
1 edited

Legend:

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

    r17410 r17439  
    2020      = new Dictionary<Type, IJsonItemConverter>();
    2121
    22     private IDictionary<int, IJsonItem> Cache { get; set; }
     22    private IDictionary<int, IJsonItem> InjectCache { get; set; }
     23      = new Dictionary<int, IJsonItem>();
     24
     25    private IDictionary<int, IJsonItem> ExtractCache { get; set; }
    2326      = new Dictionary<int, IJsonItem>();
    2427
     
    5255   
    5356    public void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
    54       if(item != null && !Cache.ContainsKey(item.GetHashCode())) {
     57      if (item != null && !InjectCache.ContainsKey(item.GetHashCode())) {
    5558        IJsonItemConverter converter = GetConverter(item.GetType());
    5659        if(converter != null) converter.Inject(item, data, root);
     60        InjectCache.Add(item.GetHashCode(), data);
    5761      }
    5862    }
     
    6064    public IJsonItem Extract(IItem item, IJsonItemConverter root) {
    6165      int hash = item.GetHashCode();
    62       if (Cache.TryGetValue(hash, out IJsonItem val))
     66      if (ExtractCache.TryGetValue(hash, out IJsonItem val))
    6367        return val;
    6468      else {
     
    6670        if (converter == null) return new UnsupportedJsonItem();
    6771        IJsonItem tmp = GetConverter(item.GetType()).Extract(item, root);
    68         Cache.Add(hash, tmp);
     72        ExtractCache.Add(hash, tmp);
    6973        return tmp;
    7074      }
Note: See TracChangeset for help on using the changeset viewer.