Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17560


Ignore:
Timestamp:
05/26/20 09:39:14 (4 years ago)
Author:
dpiringe
Message:

#3026:

  • added an extra loop to add empty default results in Runner (to prevent not existing results)
  • fixed a bug in JsonItemValidValuesControl, now the dropdown should not reset the default value
Location:
branches/3026_IntegrationIntoSymSpace
Files:
5 edited

Legend:

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

    r17540 r17560  
    4848        arr.Add(obj);
    4949        obj.Add("Run", JToken.FromObject(run.ToString()));
     50
     51        // add empty values for configured results
     52        var emptyToken = JToken.FromObject("");
     53        foreach (var cr in configuredResults) {
     54          obj.Add(cr, emptyToken);
     55        }
     56
     57        // change empty values with calculated values
     58        var formatter = new SymbolicDataAnalysisExpressionMATLABFormatter();
    5059        foreach (var res in run.Results) {
    51           if (configuredResults.Contains(res.Key)) {
     60          if(obj.ContainsKey(res.Key)) {
    5261            if (res.Value is ISymbolicRegressionSolution solution) {
    53               var formatter = new SymbolicDataAnalysisExpressionMATLABFormatter();
    54               var x = formatter.Format(solution.Model.SymbolicExpressionTree);
    55               obj.Add(res.Key, JToken.FromObject(x));
    56             } else
    57               obj.Add(res.Key, JToken.FromObject(res.Value.ToString()));
     62              var formattedModel = formatter.Format(solution.Model.SymbolicExpressionTree);
     63              obj[res.Key] = JToken.FromObject(formattedModel);
     64            } else {
     65              obj[res.Key] = JToken.FromObject(res.Value.ToString());
     66            }
    5867          }
    5968        }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/StringValueVM.cs

    r17519 r17560  
    2525        Item.ConcreteRestrictedItems = value;
    2626        //check if value is still in range
    27         if (!Range.Any(x => x == Value)) {
     27        if (!Range.Contains(Value)) {
    2828          Value = Range.FirstOrDefault();
    2929          if (Range.Count() == 0)
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemValidValuesControl.cs

    r17519 r17560  
    1313      VM = vm;
    1414      if (VM.Item.ConcreteRestrictedItems != null) {
     15        string tmp = VM.Value;
    1516        concreteItemsRestrictor.OnChecked += AddComboOption;
    1617        concreteItemsRestrictor.OnUnchecked += RemoveComboOption;
    1718        concreteItemsRestrictor.Init(VM.Item.ConcreteRestrictedItems);
     19        VM.Value = tmp;
    1820        comboBoxValues.DataBindings.Add("SelectedItem", VM, nameof(StringValueVM.Value));
    1921      } else {
     
    5153      }
    5254      VM.Range = items;
     55
    5356      if (VM.Range.Count() <= 0) {
    5457        comboBoxValues.Enabled = false;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs

    r17540 r17560  
    238238        MaxValue = testPartition.End,
    239239        Minimum = 0,
    240         Maximum = Math.Max(testPartition.End, trainingPartition.End)
     240        Maximum = int.MaxValue //Math.Max(testPartition.End, trainingPartition.End)
    241241      };
    242242    }
     
    251251        MaxValue = trainingPartition.End,
    252252        Minimum = 0,
    253         Maximum = Math.Max(testPartition.End, trainingPartition.End)
     253        Maximum = int.MaxValue //Math.Max(testPartition.End, trainingPartition.End)
    254254      };
    255255    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateInstantiator.cs

    r17519 r17560  
    6565      // get algorithm root item
    6666      IJsonItem rootItem = Objects.First().Value;
    67      
     67
     68      //TODO validate
     69
    6870      // inject configuration
    6971      JsonItemConverter.Inject(optimizer, rootItem);
Note: See TracChangeset for help on using the changeset viewer.