Changeset 18056


Ignore:
Timestamp:
09/17/21 16:25:19 (6 weeks ago)
Author:
dpiringe
Message:

#3026

  • fixed a wrong description for the invert parameter in RunCollectionValueRemover
  • fixed the usage of a wrong formatter in RunCollectionSRSolutionGraphVizFormatter
  • fixed a bug in ListJsonItem where an empty guid field can cause an exception
  • started to rework the RegressionProblemDataConverter -> it causes a bug with the symbol Variable of the TypeCorherentGrammar (maybe more grammars)
    • the reasons for the rework: this converter was already the source of some problems in the past; it uses a lot of reflection and dynamic objects -> it is very complicated to read/understand
  • added an official description property Description in the metadata part of a template + entry in Constants.cs
Location:
branches/3026_IntegrationIntoSymSpace
Files:
6 edited

Legend:

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

    r18055 r18056  
    88    internal const string TemplateName = "TemplateName";
    99    internal const string HLFileLocation = "HLFileLocation";
     10    internal const string OptimizerDescription = "OptimizerDescription";
    1011    internal const string Parameters = "Parameters";
    1112    internal const string Results = "Results";
     
    1516      '" + Metadata + @"': {
    1617        '" + TemplateName + @"':'',
    17         '" + HLFileLocation + @"':''
     18        '" + HLFileLocation + @"':'',
     19        '" + OptimizerDescription + @"':''
    1820      },
    1921      '" + Parameters + @"': [],
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs

    r18045 r18056  
    2828    #endregion
    2929
    30     public override int Priority => 20;
    31 
    32     public override bool CanConvertType(Type t) =>
    33       HEAL.Attic.Mapper.StaticCache.GetType(new Guid("EE612297-B1AF-42D2-BF21-AF9A2D42791C")).IsAssignableFrom(t);
     30    public override int Priority => 20;//20;
     31
     32    public override bool CanConvertType(Type t) => t == typeof(ValueParameter<IRegressionProblemData>);
     33      //HEAL.Attic.Mapper.StaticCache.GetType(new Guid("EE612297-B1AF-42D2-BF21-AF9A2D42791C")).IsAssignableFrom(t); // IRegressionProblemData
    3434
    3535    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     36
     37      var tmp = item as IRegressionProblemData; //ModifiableDataset
     38      //tmp.InputVariables
     39     
    3640
    3741      dynamic regressionProblemData = (dynamic)item;
     
    141145    private void SetAllowedInputVariables(dynamic regressionProblemData, StringArrayJsonItem item, IMatrixJsonItem matrix) {
    142146      if (item != null && regressionProblemData is IParameterizedItem p) {
     147       
    143148        var regProbDataType = ((ParameterizedNamedItem)regressionProblemData).GetType(); //RegressionProblemData
    144149
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItems/ListJsonItem.cs

    r18055 r18056  
    2020
    2121    public override void SetJObject(JObject jObject) {
    22       TargetTypeGUID = jObject[nameof(IListJsonItem.TargetTypeGUID)].ToString();
    23       var targetType = Mapper.StaticCache.GetType(new Guid(TargetTypeGUID));
     22      var guidJObj = jObject[nameof(IListJsonItem.TargetTypeGUID)];
    2423      IList<IJsonItem> items = new List<IJsonItem>();
    25       foreach (JObject obj in jObject[nameof(IValueJsonItem.Value)]) {
    26         items.Add((IJsonItem)obj.ToObject(targetType));
     24      if (guidJObj != null) {
     25        TargetTypeGUID = jObject[nameof(IListJsonItem.TargetTypeGUID)].ToString();
     26        var targetType = Mapper.StaticCache.GetType(new Guid(TargetTypeGUID));
     27        foreach (JObject obj in jObject[nameof(IValueJsonItem.Value)]) {
     28          items.Add((IJsonItem)obj.ToObject(targetType));
     29        }
    2730      }
    2831      Value = items.ToArray();
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateGenerator.cs

    r18055 r18056  
    8484      template[Constants.Metadata][Constants.TemplateName] = templateName;
    8585      template[Constants.Metadata][Constants.HLFileLocation] = hlFilePath;
     86      template[Constants.Metadata][Constants.OptimizerDescription] = optimizer.Description;
    8687      template[Constants.Parameters] = parameterItems;
    8788      template[Constants.Results] = resultItems;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/ResultCollectionProcessors/RunCollectionSRSolutionGraphVizFormatter.cs

    r18055 r18056  
    99  [StorableType("55A9B87B-65AC-4160-ACA0-53FD1EBB1AB7")]
    1010  public class RunCollectionSRSolutionGraphVizFormatter : RunCollectionSRSolutionFormatter {
    11     protected override ISymbolicExpressionTreeStringFormatter Formatter => 
    12       new SymbolicDataAnalysisExpressionLatexFormatter();
     11    protected override ISymbolicExpressionTreeStringFormatter Formatter =>
     12      new SymbolicExpressionTreeGraphvizFormatter();
    1313
    1414    #region Constructors & Cloning
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.Optimization/3.3/RunCollectionModification/RunCollectionValueRemover.cs

    r18055 r18056  
    5757    public RunCollectionValueRemover() {
    5858      Parameters.Add(new ValueParameter<CheckedItemCollection<StringValue>>("Values", "The result or parameter values to be removed from each run."));
    59       Parameters.Add(new FixedValueParameter<BoolValue>("Invert", "Inverts the filter strategy: Blackbox <-> Whitebox (Default: Blackbox)", new BoolValue(false)));
     59      Parameters.Add(new FixedValueParameter<BoolValue>("Invert", "Inverts the filter strategy: Blacklist <-> Whitelist (Default: Blacklist)", new BoolValue(false)));
    6060    }
    6161    public override IDeepCloneable Clone(Cloner cloner) {
Note: See TracChangeset for help on using the changeset viewer.