Free cookie consent management tool by TermsFeed Policy Generator

Changeset 17843 for branches


Ignore:
Timestamp:
02/23/21 16:36:44 (3 years ago)
Author:
dpiringe
Message:

#3026

  • removed property ConvertableType from all converters
  • removed the option to fixate or loosen the path of JsonItems (obsolete)
  • added a abstract formatter SymbolicRegressionSolutionFormatterBase as base formatter for ISymbolicRegressionSolution
  • unified the construction of exporter controls
  • code cleanup
Location:
branches/3026_IntegrationIntoSymSpace
Files:
1 added
56 edited

Legend:

Unmodified
Added
Removed
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Interfaces/IArrayJsonItemVM.cs

    r17446 r17843  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    6 
    7 namespace HeuristicLab.JsonInterface.OptimizerIntegration {
     1namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    82  public interface IArrayJsonItemVM : IJsonItemVM {
    93    bool Resizable { get; set; }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Interfaces/IJsonItemVM.cs

    r17473 r17843  
    11using System;
    2 using System.Collections.Generic;
    32using System.ComponentModel;
    4 using System.Linq;
    5 using System.Text;
    6 using System.Threading.Tasks;
    73using System.Windows.Forms;
    84
    95namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    10   public interface IJsonItemVM : INotifyPropertyChanged, IDisposable
     6  public interface IJsonItemVM : INotifyPropertyChanged
    117  {
    128    event Action ItemChanged;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Interfaces/ILookupJsonItemVM.cs

    r17471 r17843  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    6 
    7 namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    8   public interface ILookupJsonItemVM : IJsonItemVM {
    9     string ActualName { get; set; }
    10   }
     1namespace HeuristicLab.JsonInterface.OptimizerIntegration {
     2  public interface ILookupJsonItemVM : IJsonItemVM { }
    113}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Interfaces/IMatrixJsonItemVM.cs

    r17471 r17843  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
     1using System.Collections.Generic;
    62
    73namespace HeuristicLab.JsonInterface.OptimizerIntegration {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Interfaces/IValueLookupJsonItemVM.cs

    r17471 r17843  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    6 
    7 namespace HeuristicLab.JsonInterface.OptimizerIntegration {
     1namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    82  public interface IValueLookupJsonItemVM : ILookupJsonItemVM {
    93    IJsonItem JsonItemReference { get; }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ArrayValueVM.cs

    r17828 r17843  
    11using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Linq;
    5 using System.Text;
    6 using System.Threading.Tasks;
    72using System.Windows.Forms;
    83
     
    1712    public ArrayValueVM() { }
    1813   
    19     public abstract T[] Value { get; set; }
    2014    public bool Resizable {
    2115      get => Item.Resizable;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ConcreteRestrictedJsonItemVM.cs

    r17828 r17843  
    1 using System;
    2 using System.Collections.Generic;
     1using System.Collections.Generic;
    32using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    63using System.Windows.Forms;
    74
     
    1714    public override UserControl Control {
    1815      get {
    19         var control = new ConcreteItemsRestrictor();
    20         control.Init(Item.ConcreteRestrictedItems);
     16        var control = ConcreteItemsRestrictor.Create(Item.ConcreteRestrictedItems);
    2117        control.OnChecked += AddComboOption;
    2218        control.OnUnchecked += RemoveComboOption;
    2319        return control;
    24       }
    25     }
    26 
    27     public V Value {
    28       get => Item.Value;
    29       set {
    30         Item.Value = value;
    31         OnPropertyChange(this, nameof(Value));
    3220      }
    3321    }
     
    4028
    4129        if (!RangeContainsValue()) {
    42           Value = GetDefaultValue();
     30          Item.Value = GetDefaultValue();
    4331
    4432          //if no elements exists -> deselect item
    4533          if (Range.Count() == 0)
    4634            base.Selected = false;
    47 
    48           OnPropertyChange(this, nameof(Value));
    4935        }
    5036
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/DoubleVMs.cs

    r17828 r17843  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    6 using System.Windows.Forms;
    7 
    8 namespace HeuristicLab.JsonInterface.OptimizerIntegration {
     1namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    92  public class DoubleRangeVM : RangeVM<double, DoubleRangeJsonItem> {
    103    protected override double MinTypeValue => double.MinValue;
     
    158    protected override double MinTypeValue => double.MinValue;
    169    protected override double MaxTypeValue => double.MaxValue;
    17     public override double[] Value {
    18       get => Item.Value;
    19       set {
    20         Item.Value = value;
    21         OnPropertyChange(this, nameof(Value));
    22       }
    23     }
    2410  }
    2511
    2612  public class DoubleMatrixValueVM : MatrixValueVM<double, DoubleMatrixJsonItem> {
    27     public override double[][] Value {
    28       get => Item.Value;
    29       set {
    30         Item.Value = value;
    31         OnPropertyChange(this, nameof(Value));
    32       }
    33     }
    3413    protected override double MinTypeValue => double.MinValue;
    3514    protected override double MaxTypeValue => double.MaxValue;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/IntVMs.cs

    r17828 r17843  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    6 using System.Windows.Forms;
    7 
    8 namespace HeuristicLab.JsonInterface.OptimizerIntegration {
     1namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    92  public class IntArrayValueVM : ArrayValueVM<int, IntArrayJsonItem> {
    103    protected override int MinTypeValue => int.MinValue;
    114    protected override int MaxTypeValue => int.MaxValue;
    12 
    13     public override int[] Value {
    14       get => Item.Value;
    15       set {
    16         Item.Value = value;
    17         OnPropertyChange(this, nameof(Value));
    18       }
    19     }
    205  }
    216
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs

    r17828 r17843  
    11using System;
    2 using System.Collections.Generic;
    32using System.ComponentModel;
    43using System.Drawing;
    5 using System.Linq;
    6 using System.Text;
    7 using System.Threading.Tasks;
    84using System.Windows.Forms;
    95
     
    2117      get => item;
    2218      set {
    23         item?.LoosenPath();
    2419        item = value;
    25         item.FixatePath();
    2620        ItemChanged?.Invoke();
    2721      }
     
    6559    public event Action SelectedChanged;
    6660
    67 
    6861    protected void OnPropertyChange(object sender, string propertyName) {
    6962      // Make a temporary copy of the event to avoid possibility of
     
    7568      tmp?.Invoke(this, new PropertyChangedEventArgs(propertyName));
    7669    }
    77    
    78     #region IDisposable Support
    79     private bool disposedValue = false; // To detect redundant calls
    80 
    81     protected virtual void Dispose(bool disposing) {
    82       if (!disposedValue) {
    83         if (disposing) {
    84           item.LoosenPath();
    85           item = null;
    86         }
    87         disposedValue = true;
    88       }
    89     }
    90 
    91     // This code added to correctly implement the disposable pattern.
    92     public void Dispose() {
    93       // Do not change this code. Put cleanup code in Dispose(bool disposing) above.
    94       Dispose(true);
    95     }
    96     #endregion
    9770  }
    9871}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/LookupJsonItemVM.cs

    r17828 r17843  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    6 using System.Windows.Forms;
     1using System.Windows.Forms;
    72
    83namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    94  public class LookupJsonItemVM : JsonItemVMBase<LookupJsonItem>, ILookupJsonItemVM {
    105    public override UserControl Control => null;
    11     public string ActualName {
    12       get => Item.ActualName;
    13       set {
    14         Item.ActualName = value;
    15         OnPropertyChange(this, nameof(ActualName));
    16       }
    17     }
    186  }
    197}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/MatrixValueVM.cs

    r17828 r17843  
    11using System;
    22using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Linq;
    5 using System.Text;
    6 using System.Threading.Tasks;
    73using System.Windows.Forms;
    84
     
    1612    public override UserControl Control => CompoundControl.Create(base.Control, MatrixJsonItemControl.Create(this));
    1713
    18     public abstract T[][] Value { get; set; }
    1914    public bool RowsResizable {
    2015      get => Item.RowsResizable;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangeVM.cs

    r17519 r17843  
    11using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Linq;
    5 using System.Text;
    6 using System.Threading.Tasks;
    7 using System.Windows.Forms;
    8 
    92namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    10 
    113  public abstract class RangeVM<T, JsonItemType> : RangedValueBaseVM<T, JsonItemType>
    124    where T : IComparable
    135    where JsonItemType : class, IRangedJsonItem<T>
    14   {
    15 
    16     public T MinValue {
    17       get => Item.MinValue;
    18       set {
    19         Item.MinValue = value;
    20         OnPropertyChange(this, nameof(MinValue));
    21       }
    22     }
    23 
    24     public T MaxValue {
    25       get => Item.MaxValue;
    26       set {
    27         Item.MaxValue = value;
    28         OnPropertyChange(this, nameof(MaxValue));
    29       }
    30     }
    31   }
     6  { }
    327}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangedValueBaseVM.cs

    r17828 r17843  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    62using System.Windows.Forms;
    73
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ResultItemVM.cs

    r17834 r17843  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    62using System.Windows.Forms;
    73
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/SingleValueVM.cs

    r17828 r17843  
    11using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Linq;
    5 using System.Text;
    6 using System.Threading.Tasks;
    72using System.Windows.Forms;
    83
     
    105
    116  public class BoolValueVM : JsonItemVMBase<BoolJsonItem> {
    12 
    13     public bool Value {
    14       get => Item.Value;
    15       set {
    16         Item.Value = value;
    17         OnPropertyChange(this, nameof(Value));
    18       }
    19     }
    20    
    217    public override UserControl Control => null;
    228  }
     
    2511    where T : IComparable
    2612    where JsonItemType : class, IIntervalRestrictedJsonItem<T>, IValueJsonItem<T>
    27   {
    28 
    29     public T Value {
    30       get => Item.Value;
    31       set {
    32         Item.Value = value;
    33         OnPropertyChange(this, nameof(Value));
    34       }
    35     }
    36   }
     13  { }
    3714}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/StringValueVM.cs

    r17828 r17843  
    22
    33namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    4 
    54  public class StringValueVM : ConcreteRestrictedJsonItemVM<StringJsonItem, string, string> {
    65    protected override string GetDefaultValue() => Range.FirstOrDefault();
    7 
    8     protected override bool RangeContainsValue() => Range.Contains(Value);
     6    protected override bool RangeContainsValue() => Range.Contains(Item.Value);
    97  }
    108
    119  public class StringArrayVM : ConcreteRestrictedJsonItemVM<StringArrayJsonItem, string, string[]> {
    1210    protected override string[] GetDefaultValue() => Range.ToArray();
    13 
    14     protected override bool RangeContainsValue() => Value.All(x => Range.Any(y => x == y));
     11    protected override bool RangeContainsValue() => Item.Value.All(x => Range.Any(y => x == y));
    1512  }
    1613}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ValueLookupJsonItemVM.cs

    r17477 r17843  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    62using System.Windows.Forms;
    73
     
    95  public class ValueLookupJsonItemVM : LookupJsonItemVM, IValueLookupJsonItemVM {
    106    public override Type TargetedJsonItemType => typeof(ValueLookupJsonItem);
    11     public override UserControl Control => new ValueLookupJsonItemControl(this);
     7    public override UserControl Control => ValueLookupJsonItemControl.Create(this);
    128    public IJsonItem JsonItemReference => ((IValueLookupJsonItem)Item).ActualValue;
    139
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ArrayJsonItemControl.cs

    r17829 r17843  
    44  public partial class ArrayJsonItemControl : UserControl {
    55
    6     public ArrayJsonItemControl() {
     6    private ArrayJsonItemControl() {
    77      InitializeComponent();
    88    }
    99
    10     public static ArrayJsonItemControl Create(IJsonItemVM vm) {
    11       var control = new ArrayJsonItemControl();
    12       control.checkBoxResizable.DataBindings.Add("Checked", vm, nameof(IArrayJsonItemVM.Resizable));
    13       return control;
     10    protected ArrayJsonItemControl(IJsonItemVM vm) {
     11      InitializeComponent();
     12      checkBoxResizable.DataBindings.Add("Checked", vm, nameof(IArrayJsonItemVM.Resizable));
    1413    }
     14
     15    public static ArrayJsonItemControl Create(IJsonItemVM vm) => new ArrayJsonItemControl(vm);
    1516  }
    1617}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/CompoundControl.cs

    r17829 r17843  
    3232      }
    3333    }
    34     public CompoundControl() {
     34
     35    protected CompoundControl() {
    3536      InitializeComponent();
    3637    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ConcreteItemsRestrictor.cs

    r17829 r17843  
    1515    public event Action<object> OnUnchecked;
    1616
    17     public ConcreteItemsRestrictor() {
     17    protected ConcreteItemsRestrictor() {
    1818      InitializeComponent();
    1919    }
    2020
    21     public void Init<T>(IEnumerable<T> objs) {
    22       if(objs != null) {
    23         foreach(var obj in objs) {
     21    public static ConcreteItemsRestrictor Create<T>(IEnumerable<T> objs) {
     22      ConcreteItemsRestrictor ctrl = new ConcreteItemsRestrictor();
     23      ctrl.Init<T>(objs);
     24      return ctrl;
     25    }
     26
     27    protected void Init<T>(IEnumerable<T> objs) {
     28      if(objs != null)
     29        foreach(var obj in objs)
    2430          SetupOption(obj);
    25         }
    26       }
    2731    }
    2832
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs

    r17828 r17843  
    116116        VMs.Add(vm);
    117117        Node2VM.Add(node, vm);
    118         UserControl control = new JsonItemBaseControl(vm, vm.Control);
     118        UserControl control = JsonItemBaseControl.Create(vm, vm.Control);
    119119        Node2Control.Add(node, control);
    120120        return vm;
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/JsonItemBaseControl.cs

    r17829 r17843  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Drawing;
    5 using System.Data;
    6 using System.Linq;
    7 using System.Text;
    8 using System.Threading.Tasks;
     1using System.ComponentModel;
    92using System.Windows.Forms;
    103
     
    169      InitializeComponent();
    1710    }
    18    
    19     public JsonItemBaseControl(IJsonItemVM vm) {
     11
     12    protected JsonItemBaseControl(IJsonItemVM vm, UserControl control) {
    2013      InitializeComponent();
    2114      VM = vm;
    22       Init();
    23     }
    24 
    25     public JsonItemBaseControl(IJsonItemVM vm, UserControl control) {
    26       InitializeComponent();
    27       VM = vm;
    28       if(control != null) {
     15      if (control != null) {
    2916        control.Margin = new Padding() { All = 0 };
    3017        tableLayoutPanel1.Controls.Add(control, 0, 1);
    3118        control.Dock = DockStyle.Fill;
    3219      }
    33       Init();
    34     }
    35 
    36     private void Init() {
    3720      textBoxName.DataBindings.Add("Text", VM, nameof(IJsonItemVM.Name));
    3821      textBoxDescription.DataBindings.Add("Text", VM, nameof(IJsonItemVM.Description));
     
    4730      }
    4831    }
     32
     33    public static JsonItemBaseControl Create(IJsonItemVM vm, UserControl control) => new JsonItemBaseControl(vm, control);
    4934  }
    5035}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/MatrixJsonItemControl.cs

    r17829 r17843  
    33namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    44  public partial class MatrixJsonItemControl : UserControl {
    5     public MatrixJsonItemControl() {
     5    private MatrixJsonItemControl() {
    66      InitializeComponent();
    77    }
    88
    9     public static MatrixJsonItemControl Create(IJsonItemVM vm) {
    10       var control = new MatrixJsonItemControl();
    11       control.checkBoxRowsResizable.DataBindings.Add("Checked", vm, nameof(IMatrixJsonItemVM.RowsResizable));
    12       control.checkBoxColumnsResizable .DataBindings.Add("Checked", vm, nameof(IMatrixJsonItemVM.ColumnsResizable));
    13       return control;
     9    protected MatrixJsonItemControl(IJsonItemVM vm) {
     10      InitializeComponent();
     11      checkBoxRowsResizable.DataBindings.Add("Checked", vm, nameof(IMatrixJsonItemVM.RowsResizable));
     12      checkBoxColumnsResizable.DataBindings.Add("Checked", vm, nameof(IMatrixJsonItemVM.ColumnsResizable));
    1413    }
     14
     15    public static MatrixJsonItemControl Create(IJsonItemVM vm) => new MatrixJsonItemControl(vm);
    1516  }
    1617}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/NumericRangeControl.cs

    r17829 r17843  
    1616    public CheckBox EnableMinRange { get; set; }
    1717    public CheckBox EnableMaxRange { get; set; }
    18     public NumericRangeControl() {
     18
     19    private NumericRangeControl() {
    1920      InitializeComponent();
     21      Init();
     22    }
     23
     24    protected NumericRangeControl(IJsonItemVM vm) {
     25      InitializeComponent();
     26      Init();
     27      TBMinRange.DataBindings.Add("Text", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.MinRange));
     28      TBMaxRange.DataBindings.Add("Text", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.MaxRange));
     29      EnableMinRange.DataBindings.Add("Checked", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMinRange),
     30        false, DataSourceUpdateMode.OnPropertyChanged);
     31      EnableMaxRange.DataBindings.Add("Checked", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMaxRange),
     32        false, DataSourceUpdateMode.OnPropertyChanged);
     33    }
     34
     35
     36    private void Init() {
    2037      TBMinRange = textBoxFrom;
    2138      TBMaxRange = textBoxTo;
     
    5269    }
    5370
    54     public static UserControl Create(IJsonItemVM vm) {
    55       NumericRangeControl numericRangeControl = new NumericRangeControl();
    56       numericRangeControl.TBMinRange.DataBindings.Add("Text", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.MinRange));
    57       numericRangeControl.TBMaxRange.DataBindings.Add("Text", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.MaxRange));
    58       numericRangeControl.EnableMinRange.DataBindings.Add("Checked", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMinRange),
    59         false, DataSourceUpdateMode.OnPropertyChanged);
    60       numericRangeControl.EnableMaxRange.DataBindings.Add("Checked", vm, nameof(RangedValueBaseVM<int, IntJsonItem>.EnableMaxRange),
    61         false, DataSourceUpdateMode.OnPropertyChanged);
    62       return numericRangeControl;
    63     }
     71    public static UserControl Create(IJsonItemVM vm) => new NumericRangeControl(vm);
    6472  }
    6573}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ResultJsonItemControl.cs

    r17834 r17843  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.ComponentModel;
    4 using System.Data;
    5 using System.Drawing;
    6 using System.Linq;
    7 using System.Text;
    8 using System.Threading.Tasks;
     1using System.Linq;
    92using System.Windows.Forms;
    103
    114namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    125  public partial class ResultJsonItemControl : UserControl {
    13     public ResultJsonItemControl() {
     6    private ResultJsonItemControl() {
    147      InitializeComponent();
    158    }
    169
    17     public static ResultJsonItemControl Create(ResultItemVM vm) {
    18       var control = new ResultJsonItemControl();
     10    protected ResultJsonItemControl(ResultItemVM vm) {
     11      InitializeComponent();
    1912      var formatters = ResultFormatter.ForType(vm.Item.ValueType).ToList();
    20       control.comboBoxFormatter.DataSource = formatters;
    21       control.comboBoxFormatter.DisplayMember = "Name";
    22      
     13      comboBoxFormatter.DataSource = formatters;
     14      comboBoxFormatter.DisplayMember = "Name";
     15
    2316      // set action to override the ResultFormatterType property for changing the selected value
    24       control.comboBoxFormatter.SelectedValueChanged += (s, e) => vm.ResultFormatterType = control.comboBoxFormatter.SelectedValue.GetType().FullName;
    25       control.comboBoxFormatter.SelectedItem = formatters.Last();
     17      comboBoxFormatter.SelectedValueChanged += (s, e) => vm.ResultFormatterType = comboBoxFormatter.SelectedValue.GetType().FullName;
     18      comboBoxFormatter.SelectedItem = formatters.Last();
     19    }
    2620
    27       return control;
    28     }
     21    public static ResultJsonItemControl Create(ResultItemVM vm) => new ResultJsonItemControl(vm);
    2922  }
    3023}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ValueLookupJsonItemControl.cs

    r17828 r17843  
    1212namespace HeuristicLab.JsonInterface.OptimizerIntegration {
    1313  public partial class ValueLookupJsonItemControl : UserControl {
    14     private static IDictionary<Type, Type> JI2VM { get; set; }
    1514
    16     public ValueLookupJsonItemControl(IValueLookupJsonItemVM vm) {
     15    private static IDictionary<Type, Type> ji2vm = null;
     16    private static IDictionary<Type, Type> JI2VM {
     17      get {
     18        if (ji2vm == null) {
     19          ji2vm = new Dictionary<Type, Type>();
     20          foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof(IJsonItemVM))) {
     21            IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType);
     22            ji2vm.Add(vm.TargetedJsonItemType, vmType);
     23          }
     24        }
     25        return ji2vm;
     26      }
     27    }
     28
     29    private ValueLookupJsonItemControl() {
    1730      InitializeComponent();
    18       InitCache();
     31    }
     32
     33    protected ValueLookupJsonItemControl(IValueLookupJsonItemVM vm) {
     34      InitializeComponent();
    1935      if (vm.JsonItemReference != null && JI2VM.TryGetValue(vm.JsonItemReference.GetType(), out Type vmType)) {
    2036        IJsonItemVM tmp = (IJsonItemVM)Activator.CreateInstance(vmType);
     
    2945    }
    3046
    31     private void InitCache() {
    32       if(JI2VM == null) {
    33         JI2VM = new Dictionary<Type, Type>();
    34         foreach (var vmType in ApplicationManager.Manager.GetTypes(typeof(IJsonItemVM))) {
    35           IJsonItemVM vm = (IJsonItemVM)Activator.CreateInstance(vmType);
    36           JI2VM.Add(vm.TargetedJsonItemType, vmType);
    37         }
    38       }
    39     }
     47    public static ValueLookupJsonItemControl Create(IValueLookupJsonItemVM vm) => new ValueLookupJsonItemControl(vm);
    4048  }
    4149}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/AlgorithmConverter.cs

    r17834 r17843  
    1111    public override int Priority => 30;
    1212
    13     public override Type ConvertableType => typeof(IAlgorithm);
    14 
    1513    public override bool CanConvertType(Type t) =>
    16       t.GetInterfaces().Any(x => x == ConvertableType);
     14      t.GetInterfaces().Any(x => x == typeof(IAlgorithm));
    1715
    1816    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/BaseConverter.cs

    r17834 r17843  
    1515    public abstract bool CanConvertType(Type t);
    1616
    17     public abstract Type ConvertableType { get; }
    18 
    1917    public abstract void Inject(IItem item, IJsonItem data, IJsonItemConverter root);
    2018    public abstract IJsonItem Extract(IItem value, IJsonItemConverter root);
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/BatchRunConverter.cs

    r17828 r17843  
    99  public class BatchRunConverter : BaseConverter {
    1010    public override int Priority => 10;
    11     public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("E85407E0-18EC-4198-8321-9CF030FDF6D7"));
    1211
    13     public override bool CanConvertType(Type t) => ConvertableType.IsAssignableFrom(t);
     12    public override bool CanConvertType(Type t) =>
     13      HEAL.Attic.Mapper.StaticCache.GetType(new Guid("E85407E0-18EC-4198-8321-9CF030FDF6D7")).IsAssignableFrom(t);
    1414
    1515    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ConstrainedValueParameterConverter.cs

    r17828 r17843  
    1010  public class ConstrainedValueParameterConverter : BaseConverter {
    1111    public override int Priority => 3;
    12     public override Type ConvertableType => typeof(IConstrainedValueParameter<>);
    1312
    1413    public override bool CanConvertType(Type t) =>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/EnumTypeConverter.cs

    r17828 r17843  
    1010  public class EnumTypeConverter : BaseConverter {
    1111    public override int Priority => 1;
    12     public override Type ConvertableType => typeof(EnumValue<>);
    1312
    1413    public override bool CanConvertType(Type t) =>
    1514      typeof(EnumValue<>).IsAssignableFrom(t) ||
    16       (t.IsGenericType && t.GetGenericTypeDefinition() == ConvertableType);
     15      (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(EnumValue<>));
    1716
    1817    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ExperimentConverter.cs

    r17828 r17843  
    1010  public class ExperimentConverter : BaseConverter {
    1111    public override int Priority => 10;
    12     public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("A8A4536B-54C1-4A17-AB58-A6006F7F394B"));
    1312
    1413    public override bool CanConvertType(Type t) =>
    15       ConvertableType.IsAssignableFrom(t);
     14      HEAL.Attic.Mapper.StaticCache.GetType(new Guid("A8A4536B-54C1-4A17-AB58-A6006F7F394B")).IsAssignableFrom(t);
    1615
    1716    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/LookupParameterConverter.cs

    r17828 r17843  
    99  public class LookupParameterConverter : BaseConverter {
    1010    public override int Priority => 3;
    11     public override Type ConvertableType => typeof(ILookupParameter);
    1211
    1312    public override bool CanConvertType(Type t) =>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/MultiCheckedOperatorConverter.cs

    r17828 r17843  
    1111    public override int Priority => 3;
    1212
    13     public override Type ConvertableType => typeof(ICheckedMultiOperator<>);
    14 
    1513    public override bool CanConvertType(Type t) =>
    16       t.GetInterfaces().Any(x => x.IsGenericType && x.GetGenericTypeDefinition() == ConvertableType);
     14      t.GetInterfaces().Any(x => x.IsGenericType && x.GetGenericTypeDefinition() == typeof(ICheckedMultiOperator<>));
    1715
    1816    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ParameterizedItemConverter.cs

    r17828 r17843  
    99  public class ParameterizedItemConverter : BaseConverter {
    1010    public override int Priority => 2;
    11     public override Type ConvertableType => typeof(IParameterizedItem);
    1211
    1312    public override bool CanConvertType(Type t) =>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs

    r17834 r17843  
    3131    public override int Priority => 20;
    3232
    33     // RegressionProblemData
    34     public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("EE612297-B1AF-42D2-BF21-AF9A2D42791C"));
    35 
    3633    public override bool CanConvertType(Type t) =>
    37       ConvertableType.IsAssignableFrom(t);
     34      HEAL.Attic.Mapper.StaticCache.GetType(new Guid("EE612297-B1AF-42D2-BF21-AF9A2D42791C")).IsAssignableFrom(t);
    3835
    3936    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ResultConverter.cs

    r17834 r17843  
    88    public override int Priority => 1;
    99
    10     public override Type ConvertableType => typeof(IResult);
    11 
    1210    public override bool CanConvertType(Type t) =>
    13       t.GetInterfaces().Any(x => x == ConvertableType);
     11      t.GetInterfaces().Any(x => x == typeof(IResult));
    1412
    1513    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ResultParameterConverter.cs

    r17834 r17843  
    88    public override int Priority => 5;
    99
    10     public override Type ConvertableType => typeof(IResultParameter);
    11 
    1210    public override bool CanConvertType(Type t) =>
    13       t.GetInterfaces().Any(x => x == ConvertableType);
     11      t.GetInterfaces().Any(x => x == typeof(IResultParameter));
    1412
    1513    public override IJsonItem Extract(IItem value, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/StringValueConverter.cs

    r17828 r17843  
    1010  public class StringValueConverter : BaseConverter {
    1111    public override int Priority => 1;
    12     public override Type ConvertableType => typeof(StringValue);
    1312
    1413    public override bool CanConvertType(Type t) =>
    15       ConvertableType.IsAssignableFrom(t);
     14      typeof(StringValue).IsAssignableFrom(t);
    1615
    1716    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs

    r17828 r17843  
    99  public class ValueLookupParameterConverter : BaseConverter {
    1010    public override int Priority => 4;
    11     public override Type ConvertableType => typeof(IValueLookupParameter);
    1211
    1312    public override bool CanConvertType(Type t) =>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs

    r17828 r17843  
    99  public class ValueParameterConverter : BaseConverter {
    1010    public override int Priority => 2;
    11     public override Type ConvertableType => typeof(IValueParameter);
    1211
    1312    public override bool CanConvertType(Type t) =>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueRangeConverter.cs

    r17828 r17843  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Reflection;
    5 using System.Text;
    6 using System.Threading.Tasks;
    7 using HeuristicLab.Common;
    82using HeuristicLab.Core;
    93using HeuristicLab.Data;
     
    137  public class IntRangeConverter : BaseConverter {
    148    public override int Priority => 1;
    15     public override Type ConvertableType => typeof(IntRange);
    169
    1710    public override bool CanConvertType(Type t) =>
    18       ConvertableType.IsAssignableFrom(t);
     11      typeof(IntRange).IsAssignableFrom(t);
    1912
    2013    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    4033  public class DoubleRangeConverter : BaseConverter {
    4134    public override int Priority => 1;
    42     public override Type ConvertableType => typeof(DoubleRange);
    4335
    4436    public override bool CanConvertType(Type t) =>
    45       ConvertableType.IsAssignableFrom(t);
     37      typeof(DoubleRange).IsAssignableFrom(t);
    4638
    4739    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeArrayConverter.cs

    r17828 r17843  
    1212  public class IntArrayConverter : BaseConverter {
    1313    public override int Priority => 1;
    14     public override Type ConvertableType => typeof(IntArray);
    1514
    1615    public override bool CanConvertType(Type t) =>
    17       ConvertableType.IsAssignableFrom(t);
     16      typeof(IntArray).IsAssignableFrom(t);
    1817
    1918    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    4039  public class DoubleArrayConverter : BaseConverter {
    4140    public override int Priority => 1;
    42     public override Type ConvertableType => typeof(DoubleArray);
    4341
    4442    public override bool CanConvertType(Type t) =>
    45       ConvertableType.IsAssignableFrom(t);
     43      typeof(DoubleArray).IsAssignableFrom(t);
    4644
    4745    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    6866  public class PercentArrayConverter : BaseConverter {
    6967    public override int Priority => 2;
    70     public override Type ConvertableType => typeof(PercentArray);
    7168
    7269    public override bool CanConvertType(Type t) =>
    73       ConvertableType.IsAssignableFrom(t);
     70      typeof(PercentArray).IsAssignableFrom(t);
    7471
    7572    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    9693  public class BoolArrayConverter : BaseConverter {
    9794    public override int Priority => 1;
    98     public override Type ConvertableType => typeof(BoolArray);
    9995
    10096    public override bool CanConvertType(Type t) =>
    101       ConvertableType.IsAssignableFrom(t);
     97      typeof(BoolArray).IsAssignableFrom(t);
    10298
    10399    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeMatrixConverter.cs

    r17828 r17843  
    1111  public class IntMatrixConverter : ValueTypeMatrixConverter<IntMatrix, int> {
    1212    public override int Priority => 1;
    13     public override Type ConvertableType => typeof(IntMatrix);
    1413
    1514    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    3130  public class DoubleMatrixConverter : ValueTypeMatrixConverter<DoubleMatrix, double> {
    3231    public override int Priority => 1;
    33     public override Type ConvertableType => typeof(DoubleMatrix);
    3432
    3533    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    5351  public class PercentMatrixConverter : ValueTypeMatrixConverter<PercentMatrix, double> {
    5452    public override int Priority => 2;
    55     public override Type ConvertableType => typeof(PercentMatrix);
    5653
    5754    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    7370  public class BoolMatrixConverter : ValueTypeMatrixConverter<BoolMatrix, bool> {
    7471    public override int Priority => 1;
    75     public override Type ConvertableType => typeof(BoolMatrix);
    7672
    7773    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) {
     
    9490  {
    9591    public override bool CanConvertType(Type t) =>
    96       ConvertableType.IsAssignableFrom(t);
     92      typeof(MatrixType).IsAssignableFrom(t);
    9793
    9894    #region Helper
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeValueConverter.cs

    r17828 r17843  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    62using HeuristicLab.Core;
    73using HeuristicLab.Data;
     
    117  public class IntValueConverter : BaseConverter {
    128    public override int Priority => 1;
    13     public override Type ConvertableType => typeof(IntValue);
    149
    1510    public override bool CanConvertType(Type t) =>
    16       ConvertableType.IsAssignableFrom(t);
     11      typeof(IntValue).IsAssignableFrom(t);
    1712
    1813    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
     
    3126  public class DoubleValueConverter : BaseConverter {
    3227    public override int Priority => 1;
    33     public override Type ConvertableType => typeof(DoubleValue);
    3428
    3529    public override bool CanConvertType(Type t) =>
    36       ConvertableType.IsAssignableFrom(t);
     30      typeof(DoubleValue).IsAssignableFrom(t);
    3731
    3832    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
     
    5145  public class PercentValueConverter : BaseConverter {
    5246    public override int Priority => 2;
    53     public override Type ConvertableType => typeof(PercentValue);
    5447
    5548    public override bool CanConvertType(Type t) =>
    56       ConvertableType.IsAssignableFrom(t);
     49      typeof(PercentValue).IsAssignableFrom(t);
    5750
    5851    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
     
    7164  public class BoolValueConverter : BaseConverter {
    7265    public override int Priority => 1;
    73     public override Type ConvertableType => typeof(BoolValue);
    7466
    7567    public override bool CanConvertType(Type t) =>
    76       ConvertableType.IsAssignableFrom(t);
     68      typeof(BoolValue).IsAssignableFrom(t);
    7769
    7870    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
     
    8981  public class DateTimeValueConverter : BaseConverter {
    9082    public override int Priority => 1;
    91     public override Type ConvertableType => typeof(DateTimeValue);
    9283
    9384    public override bool CanConvertType(Type t) =>
    94       ConvertableType.IsAssignableFrom(t);
     85      typeof(DateTimeValue).IsAssignableFrom(t);
    9586
    9687    public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) =>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/HeuristicLab.JsonInterface.csproj

    r17834 r17843  
    6868    <Compile Include="Converters\ResultConverter.cs" />
    6969    <Compile Include="Converters\ResultParameterConverter.cs" />
    70     <Compile Include="Converters\SymbolicRegressionSolutionConverter.cs" />
    7170    <Compile Include="Converters\ValueLookupParameterConverter.cs" />
    7271    <Compile Include="Converters\ValueRangeConverter.cs" />
     
    106105    <Compile Include="ResultFormatter\ResultFormatter.cs" />
    107106    <Compile Include="ResultFormatter\StringResultFormatter.cs" />
     107    <Compile Include="ResultFormatter\SymbolicRegressionSolutionFormatterBase.cs" />
    108108    <Compile Include="SingleLineArrayJsonWriter.cs" />
    109109    <Compile Include="JsonTemplateGenerator.cs" />
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItem.cs

    r17519 r17843  
    5858
    5959    /// <summary>
    60     /// This method fixates the path.
    61     /// After calling, the path cannot be changed by changing the name or parent.
    62     /// </summary>
    63     void FixatePath();
    64 
    65     /// <summary>
    66     /// This method looses the path again after a call of FixatePath.
    67     /// After calling, the path is calculated by the position in item tree again.
    68     /// </summary>
    69     void LoosenPath();
    70 
    71     /// <summary>
    7260    /// Method to generate a Newtonsoft JObject, which describes the JsonItem.
    7361    /// </summary>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItemConverter.cs

    r17828 r17843  
    2121
    2222    /// <summary>
    23     /// The targeted type for the converter.
    24     /// </summary>
    25     Type ConvertableType { get; }
    26 
    27     /// <summary>
    2823    /// A given priority, higher numbers are prior.
    2924    /// </summary>
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItemConverter.cs

    r17828 r17843  
    88  /// </summary>
    99  public class JsonItemConverter : IJsonItemConverter {
    10    
     10
    1111    #region Properties
    12     private IDictionary<Type, IJsonItemConverter> Converters { get; set; }
    13       = new Dictionary<Type, IJsonItemConverter>();
     12    private IEnumerable<IJsonItemConverter> Converters { get; set; }
     13      = Enumerable.Empty<IJsonItemConverter>();
    1414
    1515    private IDictionary<int, IJsonItem> InjectCache { get; set; }
     
    3535     
    3636      foreach (var x in Converters) {
    37         if (x.Value.CanConvertType(type))
    38           possibleConverters.Add(x.Value);
     37        if (x.CanConvertType(type))
     38          possibleConverters.Add(x);
    3939      }
    40        
    4140
    4241      if(possibleConverters.Count > 0) {
     
    8685    /// Static constructor for default converter configuration.
    8786    /// </summary>
    88     internal JsonItemConverter(IDictionary<Type, IJsonItemConverter> converters) {
     87    internal JsonItemConverter(IEnumerable<IJsonItemConverter> converters) {
    8988      Converters = converters;
    9089    }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItemConverterFactory.cs

    r17519 r17843  
    55namespace HeuristicLab.JsonInterface {
    66  public static class JsonItemConverterFactory {
    7     private static IDictionary<Type, IJsonItemConverter> ConverterCache { get; set; }
     7    private static IEnumerable<IJsonItemConverter> ConverterCache { get; set; }
    88
    99    public static JsonItemConverter Create() {
     
    1414
    1515    private static void InitCache() {
    16       ConverterCache = new Dictionary<Type, IJsonItemConverter>();
     16      IList<IJsonItemConverter> cache = new List<IJsonItemConverter>();
    1717      foreach (var converter in ApplicationManager.Manager.GetInstances<IJsonItemConverter>()) {
    18         ConverterCache.Add(converter.ConvertableType, converter);
     18        cache.Add(converter);
    1919      }
     20      ConverterCache = cache;
    2021    }
    2122  }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItems/JsonItem.cs

    r17834 r17843  
    6464    public virtual string Description { get; set; }
    6565
    66     private string fixedPath = "";
    6766    public virtual string Path {
    6867      get {
    69         if (!string.IsNullOrWhiteSpace(fixedPath))
    70           return fixedPath;
    71 
    7268        IJsonItem tmp = Parent;
    7369        StringBuilder builder = new StringBuilder(this.Name);
     
    115111    public IJsonItemValidator GetValidator() => new JsonItemValidator(this);
    116112
    117     public void FixatePath() => fixedPath = Path;
    118     public void LoosenPath() => fixedPath = "";
    119 
    120113    public virtual JObject GenerateJObject() =>
    121114      JObject.FromObject(this, new JsonSerializer() {
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItems/ResultJsonItem.cs

    r17834 r17843  
    11using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    42using Newtonsoft.Json.Linq;
    53
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateGenerator.cs

    r17828 r17843  
    7373    private static void PopulateJsonItems(IJsonItem item, IList<IJsonItem> jsonItems) {
    7474      foreach(var x in item) {
    75         if (x.Active && !(x is EmptyJsonItem)) {
     75        if (x.Active && !(x is EmptyJsonItem) && !(x is UnsupportedJsonItem)) {
    7676          jsonItems.Add(x);
    7777        }
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/ResultFormatter/MatlabResultFormatter.cs

    r17834 r17843  
    1 using System;
    2 using System.Collections.Generic;
    3 using System.Linq;
    4 using System.Text;
    5 using System.Threading.Tasks;
    6 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
     1using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding;
    72using HeuristicLab.Problems.DataAnalysis.Symbolic;
    8 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;
    93
    104namespace HeuristicLab.JsonInterface {
    11   public class MatlabResultFormatter : ResultFormatter {
    12     public override int Priority => 5;
    13 
    14     public override bool CanFormatType(Type t) {
    15       var interfaces = t.GetInterfaces();
    16       return t.GetInterfaces().Any(x => x == typeof(ISymbolicRegressionSolution));
    17     }
    18      
    19     private ISymbolicExpressionTreeStringFormatter MatlabFormatter => new SymbolicDataAnalysisExpressionMATLABFormatter();
    20 
    21     public override string Format(object o) => MatlabFormatter.Format((ISymbolicExpressionTree)((ISymbolicRegressionSolution)o).Model.SymbolicExpressionTree);
     5  public class MatlabResultFormatter : SymbolicRegressionSolutionFormatterBase {
     6    protected override ISymbolicExpressionTreeStringFormatter SymbolicExpressionTreeStringFormatter
     7      => new SymbolicDataAnalysisExpressionMATLABFormatter();
    228  }
    239}
  • branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/ResultFormatter/ResultFormatter.cs

    r17834 r17843  
    1212  public abstract class ResultFormatter : IResultFormatter {
    1313    public abstract int Priority { get; }
    14 
    1514    public abstract bool CanFormatType(Type t);
    1615    public abstract string Format(object o);
Note: See TracChangeset for help on using the changeset viewer.