Changeset 17843 for branches/3026_IntegrationIntoSymSpace
- Timestamp:
- 02/23/21 16:36:44 (4 years ago)
- 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 { 1 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 8 2 public interface IArrayJsonItemVM : IJsonItemVM { 9 3 bool Resizable { get; set; } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Interfaces/IJsonItemVM.cs
r17473 r17843 1 1 using System; 2 using System.Collections.Generic;3 2 using System.ComponentModel; 4 using System.Linq;5 using System.Text;6 using System.Threading.Tasks;7 3 using System.Windows.Forms; 8 4 9 5 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 10 public interface IJsonItemVM : INotifyPropertyChanged , IDisposable6 public interface IJsonItemVM : INotifyPropertyChanged 11 7 { 12 8 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 } 1 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 2 public interface ILookupJsonItemVM : IJsonItemVM { } 11 3 } -
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; 1 using System.Collections.Generic; 6 2 7 3 namespace 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 { 1 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 8 2 public interface IValueLookupJsonItemVM : ILookupJsonItemVM { 9 3 IJsonItem JsonItemReference { get; } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ArrayValueVM.cs
r17828 r17843 1 1 using System; 2 using System.Collections.Generic;3 using System.ComponentModel;4 using System.Linq;5 using System.Text;6 using System.Threading.Tasks;7 2 using System.Windows.Forms; 8 3 … … 17 12 public ArrayValueVM() { } 18 13 19 public abstract T[] Value { get; set; }20 14 public bool Resizable { 21 15 get => Item.Resizable; -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ConcreteRestrictedJsonItemVM.cs
r17828 r17843 1 using System; 2 using System.Collections.Generic; 1 using System.Collections.Generic; 3 2 using System.Linq; 4 using System.Text;5 using System.Threading.Tasks;6 3 using System.Windows.Forms; 7 4 … … 17 14 public override UserControl Control { 18 15 get { 19 var control = new ConcreteItemsRestrictor(); 20 control.Init(Item.ConcreteRestrictedItems); 16 var control = ConcreteItemsRestrictor.Create(Item.ConcreteRestrictedItems); 21 17 control.OnChecked += AddComboOption; 22 18 control.OnUnchecked += RemoveComboOption; 23 19 return control; 24 }25 }26 27 public V Value {28 get => Item.Value;29 set {30 Item.Value = value;31 OnPropertyChange(this, nameof(Value));32 20 } 33 21 } … … 40 28 41 29 if (!RangeContainsValue()) { 42 Value = GetDefaultValue();30 Item.Value = GetDefaultValue(); 43 31 44 32 //if no elements exists -> deselect item 45 33 if (Range.Count() == 0) 46 34 base.Selected = false; 47 48 OnPropertyChange(this, nameof(Value));49 35 } 50 36 -
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 { 1 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 9 2 public class DoubleRangeVM : RangeVM<double, DoubleRangeJsonItem> { 10 3 protected override double MinTypeValue => double.MinValue; … … 15 8 protected override double MinTypeValue => double.MinValue; 16 9 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 }24 10 } 25 11 26 12 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 }34 13 protected override double MinTypeValue => double.MinValue; 35 14 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 { 1 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 9 2 public class IntArrayValueVM : ArrayValueVM<int, IntArrayJsonItem> { 10 3 protected override int MinTypeValue => int.MinValue; 11 4 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 }20 5 } 21 6 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/JsonItemVMBase.cs
r17828 r17843 1 1 using System; 2 using System.Collections.Generic;3 2 using System.ComponentModel; 4 3 using System.Drawing; 5 using System.Linq;6 using System.Text;7 using System.Threading.Tasks;8 4 using System.Windows.Forms; 9 5 … … 21 17 get => item; 22 18 set { 23 item?.LoosenPath();24 19 item = value; 25 item.FixatePath();26 20 ItemChanged?.Invoke(); 27 21 } … … 65 59 public event Action SelectedChanged; 66 60 67 68 61 protected void OnPropertyChange(object sender, string propertyName) { 69 62 // Make a temporary copy of the event to avoid possibility of … … 75 68 tmp?.Invoke(this, new PropertyChangedEventArgs(propertyName)); 76 69 } 77 78 #region IDisposable Support79 private bool disposedValue = false; // To detect redundant calls80 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 #endregion97 70 } 98 71 } -
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; 1 using System.Windows.Forms; 7 2 8 3 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 9 4 public class LookupJsonItemVM : JsonItemVMBase<LookupJsonItem>, ILookupJsonItemVM { 10 5 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 }18 6 } 19 7 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/MatrixValueVM.cs
r17828 r17843 1 1 using System; 2 2 using System.Collections.Generic; 3 using System.ComponentModel;4 using System.Linq;5 using System.Text;6 using System.Threading.Tasks;7 3 using System.Windows.Forms; 8 4 … … 16 12 public override UserControl Control => CompoundControl.Create(base.Control, MatrixJsonItemControl.Create(this)); 17 13 18 public abstract T[][] Value { get; set; }19 14 public bool RowsResizable { 20 15 get => Item.RowsResizable; -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangeVM.cs
r17519 r17843 1 1 using 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 9 2 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 10 11 3 public abstract class RangeVM<T, JsonItemType> : RangedValueBaseVM<T, JsonItemType> 12 4 where T : IComparable 13 5 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 { } 32 7 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/RangedValueBaseVM.cs
r17828 r17843 1 1 using System; 2 using System.Collections.Generic;3 using System.Linq;4 using System.Text;5 using System.Threading.Tasks;6 2 using System.Windows.Forms; 7 3 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ResultItemVM.cs
r17834 r17843 1 1 using System; 2 using System.Collections.Generic;3 using System.Linq;4 using System.Text;5 using System.Threading.Tasks;6 2 using System.Windows.Forms; 7 3 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/SingleValueVM.cs
r17828 r17843 1 1 using System; 2 using System.Collections.Generic;3 using System.ComponentModel;4 using System.Linq;5 using System.Text;6 using System.Threading.Tasks;7 2 using System.Windows.Forms; 8 3 … … 10 5 11 6 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 21 7 public override UserControl Control => null; 22 8 } … … 25 11 where T : IComparable 26 12 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 { } 37 14 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/StringValueVM.cs
r17828 r17843 2 2 3 3 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 4 5 4 public class StringValueVM : ConcreteRestrictedJsonItemVM<StringJsonItem, string, string> { 6 5 protected override string GetDefaultValue() => Range.FirstOrDefault(); 7 8 protected override bool RangeContainsValue() => Range.Contains(Value); 6 protected override bool RangeContainsValue() => Range.Contains(Item.Value); 9 7 } 10 8 11 9 public class StringArrayVM : ConcreteRestrictedJsonItemVM<StringArrayJsonItem, string, string[]> { 12 10 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)); 15 12 } 16 13 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/ViewModels/ValueLookupJsonItemVM.cs
r17477 r17843 1 1 using System; 2 using System.Collections.Generic;3 using System.Linq;4 using System.Text;5 using System.Threading.Tasks;6 2 using System.Windows.Forms; 7 3 … … 9 5 public class ValueLookupJsonItemVM : LookupJsonItemVM, IValueLookupJsonItemVM { 10 6 public override Type TargetedJsonItemType => typeof(ValueLookupJsonItem); 11 public override UserControl Control => new ValueLookupJsonItemControl(this);7 public override UserControl Control => ValueLookupJsonItemControl.Create(this); 12 8 public IJsonItem JsonItemReference => ((IValueLookupJsonItem)Item).ActualValue; 13 9 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ArrayJsonItemControl.cs
r17829 r17843 4 4 public partial class ArrayJsonItemControl : UserControl { 5 5 6 p ublicArrayJsonItemControl() {6 private ArrayJsonItemControl() { 7 7 InitializeComponent(); 8 8 } 9 9 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)); 14 13 } 14 15 public static ArrayJsonItemControl Create(IJsonItemVM vm) => new ArrayJsonItemControl(vm); 15 16 } 16 17 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/CompoundControl.cs
r17829 r17843 32 32 } 33 33 } 34 public CompoundControl() { 34 35 protected CompoundControl() { 35 36 InitializeComponent(); 36 37 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ConcreteItemsRestrictor.cs
r17829 r17843 15 15 public event Action<object> OnUnchecked; 16 16 17 p ublicConcreteItemsRestrictor() {17 protected ConcreteItemsRestrictor() { 18 18 InitializeComponent(); 19 19 } 20 20 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) 24 30 SetupOption(obj); 25 }26 }27 31 } 28 32 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ExportJsonDialog.cs
r17828 r17843 116 116 VMs.Add(vm); 117 117 Node2VM.Add(node, vm); 118 UserControl control = new JsonItemBaseControl(vm, vm.Control);118 UserControl control = JsonItemBaseControl.Create(vm, vm.Control); 119 119 Node2Control.Add(node, control); 120 120 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; 1 using System.ComponentModel; 9 2 using System.Windows.Forms; 10 3 … … 16 9 InitializeComponent(); 17 10 } 18 19 p ublic JsonItemBaseControl(IJsonItemVM vm) {11 12 protected JsonItemBaseControl(IJsonItemVM vm, UserControl control) { 20 13 InitializeComponent(); 21 14 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) { 29 16 control.Margin = new Padding() { All = 0 }; 30 17 tableLayoutPanel1.Controls.Add(control, 0, 1); 31 18 control.Dock = DockStyle.Fill; 32 19 } 33 Init();34 }35 36 private void Init() {37 20 textBoxName.DataBindings.Add("Text", VM, nameof(IJsonItemVM.Name)); 38 21 textBoxDescription.DataBindings.Add("Text", VM, nameof(IJsonItemVM.Description)); … … 47 30 } 48 31 } 32 33 public static JsonItemBaseControl Create(IJsonItemVM vm, UserControl control) => new JsonItemBaseControl(vm, control); 49 34 } 50 35 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/MatrixJsonItemControl.cs
r17829 r17843 3 3 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 4 4 public partial class MatrixJsonItemControl : UserControl { 5 p ublicMatrixJsonItemControl() {5 private MatrixJsonItemControl() { 6 6 InitializeComponent(); 7 7 } 8 8 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)); 14 13 } 14 15 public static MatrixJsonItemControl Create(IJsonItemVM vm) => new MatrixJsonItemControl(vm); 15 16 } 16 17 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/NumericRangeControl.cs
r17829 r17843 16 16 public CheckBox EnableMinRange { get; set; } 17 17 public CheckBox EnableMaxRange { get; set; } 18 public NumericRangeControl() { 18 19 private NumericRangeControl() { 19 20 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() { 20 37 TBMinRange = textBoxFrom; 21 38 TBMaxRange = textBoxTo; … … 52 69 } 53 70 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); 64 72 } 65 73 } -
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; 1 using System.Linq; 9 2 using System.Windows.Forms; 10 3 11 4 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 12 5 public partial class ResultJsonItemControl : UserControl { 13 p ublicResultJsonItemControl() {6 private ResultJsonItemControl() { 14 7 InitializeComponent(); 15 8 } 16 9 17 p ublic static ResultJsonItemControl Create(ResultItemVM vm) {18 var control = new ResultJsonItemControl();10 protected ResultJsonItemControl(ResultItemVM vm) { 11 InitializeComponent(); 19 12 var formatters = ResultFormatter.ForType(vm.Item.ValueType).ToList(); 20 co ntrol.comboBoxFormatter.DataSource = formatters;21 co ntrol.comboBoxFormatter.DisplayMember = "Name";22 13 comboBoxFormatter.DataSource = formatters; 14 comboBoxFormatter.DisplayMember = "Name"; 15 23 16 // 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 } 26 20 27 return control; 28 } 21 public static ResultJsonItemControl Create(ResultItemVM vm) => new ResultJsonItemControl(vm); 29 22 } 30 23 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface.OptimizerIntegration/Views/ValueLookupJsonItemControl.cs
r17828 r17843 12 12 namespace HeuristicLab.JsonInterface.OptimizerIntegration { 13 13 public partial class ValueLookupJsonItemControl : UserControl { 14 private static IDictionary<Type, Type> JI2VM { get; set; }15 14 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() { 17 30 InitializeComponent(); 18 InitCache(); 31 } 32 33 protected ValueLookupJsonItemControl(IValueLookupJsonItemVM vm) { 34 InitializeComponent(); 19 35 if (vm.JsonItemReference != null && JI2VM.TryGetValue(vm.JsonItemReference.GetType(), out Type vmType)) { 20 36 IJsonItemVM tmp = (IJsonItemVM)Activator.CreateInstance(vmType); … … 29 45 } 30 46 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); 40 48 } 41 49 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/AlgorithmConverter.cs
r17834 r17843 11 11 public override int Priority => 30; 12 12 13 public override Type ConvertableType => typeof(IAlgorithm);14 15 13 public override bool CanConvertType(Type t) => 16 t.GetInterfaces().Any(x => x == ConvertableType);14 t.GetInterfaces().Any(x => x == typeof(IAlgorithm)); 17 15 18 16 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/BaseConverter.cs
r17834 r17843 15 15 public abstract bool CanConvertType(Type t); 16 16 17 public abstract Type ConvertableType { get; }18 19 17 public abstract void Inject(IItem item, IJsonItem data, IJsonItemConverter root); 20 18 public abstract IJsonItem Extract(IItem value, IJsonItemConverter root); -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/BatchRunConverter.cs
r17828 r17843 9 9 public class BatchRunConverter : BaseConverter { 10 10 public override int Priority => 10; 11 public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("E85407E0-18EC-4198-8321-9CF030FDF6D7"));12 11 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); 14 14 15 15 public override IJsonItem Extract(IItem value, IJsonItemConverter root) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ConstrainedValueParameterConverter.cs
r17828 r17843 10 10 public class ConstrainedValueParameterConverter : BaseConverter { 11 11 public override int Priority => 3; 12 public override Type ConvertableType => typeof(IConstrainedValueParameter<>);13 12 14 13 public override bool CanConvertType(Type t) => -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/EnumTypeConverter.cs
r17828 r17843 10 10 public class EnumTypeConverter : BaseConverter { 11 11 public override int Priority => 1; 12 public override Type ConvertableType => typeof(EnumValue<>);13 12 14 13 public override bool CanConvertType(Type t) => 15 14 typeof(EnumValue<>).IsAssignableFrom(t) || 16 (t.IsGenericType && t.GetGenericTypeDefinition() == ConvertableType);15 (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(EnumValue<>)); 17 16 18 17 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) => -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ExperimentConverter.cs
r17828 r17843 10 10 public class ExperimentConverter : BaseConverter { 11 11 public override int Priority => 10; 12 public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("A8A4536B-54C1-4A17-AB58-A6006F7F394B"));13 12 14 13 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); 16 15 17 16 public override IJsonItem Extract(IItem value, IJsonItemConverter root) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/LookupParameterConverter.cs
r17828 r17843 9 9 public class LookupParameterConverter : BaseConverter { 10 10 public override int Priority => 3; 11 public override Type ConvertableType => typeof(ILookupParameter);12 11 13 12 public override bool CanConvertType(Type t) => -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/MultiCheckedOperatorConverter.cs
r17828 r17843 11 11 public override int Priority => 3; 12 12 13 public override Type ConvertableType => typeof(ICheckedMultiOperator<>);14 15 13 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<>)); 17 15 18 16 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ParameterizedItemConverter.cs
r17828 r17843 9 9 public class ParameterizedItemConverter : BaseConverter { 10 10 public override int Priority => 2; 11 public override Type ConvertableType => typeof(IParameterizedItem);12 11 13 12 public override bool CanConvertType(Type t) => -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/RegressionProblemDataConverter.cs
r17834 r17843 31 31 public override int Priority => 20; 32 32 33 // RegressionProblemData34 public override Type ConvertableType => HEAL.Attic.Mapper.StaticCache.GetType(new Guid("EE612297-B1AF-42D2-BF21-AF9A2D42791C"));35 36 33 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); 38 35 39 36 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ResultConverter.cs
r17834 r17843 8 8 public override int Priority => 1; 9 9 10 public override Type ConvertableType => typeof(IResult);11 12 10 public override bool CanConvertType(Type t) => 13 t.GetInterfaces().Any(x => x == ConvertableType);11 t.GetInterfaces().Any(x => x == typeof(IResult)); 14 12 15 13 public override IJsonItem Extract(IItem value, IJsonItemConverter root) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ResultParameterConverter.cs
r17834 r17843 8 8 public override int Priority => 5; 9 9 10 public override Type ConvertableType => typeof(IResultParameter);11 12 10 public override bool CanConvertType(Type t) => 13 t.GetInterfaces().Any(x => x == ConvertableType);11 t.GetInterfaces().Any(x => x == typeof(IResultParameter)); 14 12 15 13 public override IJsonItem Extract(IItem value, IJsonItemConverter root) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/StringValueConverter.cs
r17828 r17843 10 10 public class StringValueConverter : BaseConverter { 11 11 public override int Priority => 1; 12 public override Type ConvertableType => typeof(StringValue);13 12 14 13 public override bool CanConvertType(Type t) => 15 ConvertableType.IsAssignableFrom(t);14 typeof(StringValue).IsAssignableFrom(t); 16 15 17 16 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) => -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueLookupParameterConverter.cs
r17828 r17843 9 9 public class ValueLookupParameterConverter : BaseConverter { 10 10 public override int Priority => 4; 11 public override Type ConvertableType => typeof(IValueLookupParameter);12 11 13 12 public override bool CanConvertType(Type t) => -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueParameterConverter.cs
r17828 r17843 9 9 public class ValueParameterConverter : BaseConverter { 10 10 public override int Priority => 2; 11 public override Type ConvertableType => typeof(IValueParameter);12 11 13 12 public override bool CanConvertType(Type t) => -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueRangeConverter.cs
r17828 r17843 1 1 using 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;8 2 using HeuristicLab.Core; 9 3 using HeuristicLab.Data; … … 13 7 public class IntRangeConverter : BaseConverter { 14 8 public override int Priority => 1; 15 public override Type ConvertableType => typeof(IntRange);16 9 17 10 public override bool CanConvertType(Type t) => 18 ConvertableType.IsAssignableFrom(t);11 typeof(IntRange).IsAssignableFrom(t); 19 12 20 13 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { … … 40 33 public class DoubleRangeConverter : BaseConverter { 41 34 public override int Priority => 1; 42 public override Type ConvertableType => typeof(DoubleRange);43 35 44 36 public override bool CanConvertType(Type t) => 45 ConvertableType.IsAssignableFrom(t);37 typeof(DoubleRange).IsAssignableFrom(t); 46 38 47 39 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeArrayConverter.cs
r17828 r17843 12 12 public class IntArrayConverter : BaseConverter { 13 13 public override int Priority => 1; 14 public override Type ConvertableType => typeof(IntArray);15 14 16 15 public override bool CanConvertType(Type t) => 17 ConvertableType.IsAssignableFrom(t);16 typeof(IntArray).IsAssignableFrom(t); 18 17 19 18 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { … … 40 39 public class DoubleArrayConverter : BaseConverter { 41 40 public override int Priority => 1; 42 public override Type ConvertableType => typeof(DoubleArray);43 41 44 42 public override bool CanConvertType(Type t) => 45 ConvertableType.IsAssignableFrom(t);43 typeof(DoubleArray).IsAssignableFrom(t); 46 44 47 45 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { … … 68 66 public class PercentArrayConverter : BaseConverter { 69 67 public override int Priority => 2; 70 public override Type ConvertableType => typeof(PercentArray);71 68 72 69 public override bool CanConvertType(Type t) => 73 ConvertableType.IsAssignableFrom(t);70 typeof(PercentArray).IsAssignableFrom(t); 74 71 75 72 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { … … 96 93 public class BoolArrayConverter : BaseConverter { 97 94 public override int Priority => 1; 98 public override Type ConvertableType => typeof(BoolArray);99 95 100 96 public override bool CanConvertType(Type t) => 101 ConvertableType.IsAssignableFrom(t);97 typeof(BoolArray).IsAssignableFrom(t); 102 98 103 99 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeMatrixConverter.cs
r17828 r17843 11 11 public class IntMatrixConverter : ValueTypeMatrixConverter<IntMatrix, int> { 12 12 public override int Priority => 1; 13 public override Type ConvertableType => typeof(IntMatrix);14 13 15 14 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { … … 31 30 public class DoubleMatrixConverter : ValueTypeMatrixConverter<DoubleMatrix, double> { 32 31 public override int Priority => 1; 33 public override Type ConvertableType => typeof(DoubleMatrix);34 32 35 33 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { … … 53 51 public class PercentMatrixConverter : ValueTypeMatrixConverter<PercentMatrix, double> { 54 52 public override int Priority => 2; 55 public override Type ConvertableType => typeof(PercentMatrix);56 53 57 54 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { … … 73 70 public class BoolMatrixConverter : ValueTypeMatrixConverter<BoolMatrix, bool> { 74 71 public override int Priority => 1; 75 public override Type ConvertableType => typeof(BoolMatrix);76 72 77 73 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) { … … 94 90 { 95 91 public override bool CanConvertType(Type t) => 96 ConvertableType.IsAssignableFrom(t);92 typeof(MatrixType).IsAssignableFrom(t); 97 93 98 94 #region Helper -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Converters/ValueTypeValueConverter.cs
r17828 r17843 1 1 using System; 2 using System.Collections.Generic;3 using System.Linq;4 using System.Text;5 using System.Threading.Tasks;6 2 using HeuristicLab.Core; 7 3 using HeuristicLab.Data; … … 11 7 public class IntValueConverter : BaseConverter { 12 8 public override int Priority => 1; 13 public override Type ConvertableType => typeof(IntValue);14 9 15 10 public override bool CanConvertType(Type t) => 16 ConvertableType.IsAssignableFrom(t);11 typeof(IntValue).IsAssignableFrom(t); 17 12 18 13 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) => … … 31 26 public class DoubleValueConverter : BaseConverter { 32 27 public override int Priority => 1; 33 public override Type ConvertableType => typeof(DoubleValue);34 28 35 29 public override bool CanConvertType(Type t) => 36 ConvertableType.IsAssignableFrom(t);30 typeof(DoubleValue).IsAssignableFrom(t); 37 31 38 32 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) => … … 51 45 public class PercentValueConverter : BaseConverter { 52 46 public override int Priority => 2; 53 public override Type ConvertableType => typeof(PercentValue);54 47 55 48 public override bool CanConvertType(Type t) => 56 ConvertableType.IsAssignableFrom(t);49 typeof(PercentValue).IsAssignableFrom(t); 57 50 58 51 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) => … … 71 64 public class BoolValueConverter : BaseConverter { 72 65 public override int Priority => 1; 73 public override Type ConvertableType => typeof(BoolValue);74 66 75 67 public override bool CanConvertType(Type t) => 76 ConvertableType.IsAssignableFrom(t);68 typeof(BoolValue).IsAssignableFrom(t); 77 69 78 70 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) => … … 89 81 public class DateTimeValueConverter : BaseConverter { 90 82 public override int Priority => 1; 91 public override Type ConvertableType => typeof(DateTimeValue);92 83 93 84 public override bool CanConvertType(Type t) => 94 ConvertableType.IsAssignableFrom(t);85 typeof(DateTimeValue).IsAssignableFrom(t); 95 86 96 87 public override void Inject(IItem item, IJsonItem data, IJsonItemConverter root) => -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/HeuristicLab.JsonInterface.csproj
r17834 r17843 68 68 <Compile Include="Converters\ResultConverter.cs" /> 69 69 <Compile Include="Converters\ResultParameterConverter.cs" /> 70 <Compile Include="Converters\SymbolicRegressionSolutionConverter.cs" />71 70 <Compile Include="Converters\ValueLookupParameterConverter.cs" /> 72 71 <Compile Include="Converters\ValueRangeConverter.cs" /> … … 106 105 <Compile Include="ResultFormatter\ResultFormatter.cs" /> 107 106 <Compile Include="ResultFormatter\StringResultFormatter.cs" /> 107 <Compile Include="ResultFormatter\SymbolicRegressionSolutionFormatterBase.cs" /> 108 108 <Compile Include="SingleLineArrayJsonWriter.cs" /> 109 109 <Compile Include="JsonTemplateGenerator.cs" /> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItem.cs
r17519 r17843 58 58 59 59 /// <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>72 60 /// Method to generate a Newtonsoft JObject, which describes the JsonItem. 73 61 /// </summary> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/Interfaces/IJsonItemConverter.cs
r17828 r17843 21 21 22 22 /// <summary> 23 /// The targeted type for the converter.24 /// </summary>25 Type ConvertableType { get; }26 27 /// <summary>28 23 /// A given priority, higher numbers are prior. 29 24 /// </summary> -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItemConverter.cs
r17828 r17843 8 8 /// </summary> 9 9 public class JsonItemConverter : IJsonItemConverter { 10 10 11 11 #region Properties 12 private I Dictionary<Type, IJsonItemConverter> Converters { get; set; }13 = new Dictionary<Type,IJsonItemConverter>();12 private IEnumerable<IJsonItemConverter> Converters { get; set; } 13 = Enumerable.Empty<IJsonItemConverter>(); 14 14 15 15 private IDictionary<int, IJsonItem> InjectCache { get; set; } … … 35 35 36 36 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); 39 39 } 40 41 40 42 41 if(possibleConverters.Count > 0) { … … 86 85 /// Static constructor for default converter configuration. 87 86 /// </summary> 88 internal JsonItemConverter(I Dictionary<Type,IJsonItemConverter> converters) {87 internal JsonItemConverter(IEnumerable<IJsonItemConverter> converters) { 89 88 Converters = converters; 90 89 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItemConverterFactory.cs
r17519 r17843 5 5 namespace HeuristicLab.JsonInterface { 6 6 public static class JsonItemConverterFactory { 7 private static I Dictionary<Type,IJsonItemConverter> ConverterCache { get; set; }7 private static IEnumerable<IJsonItemConverter> ConverterCache { get; set; } 8 8 9 9 public static JsonItemConverter Create() { … … 14 14 15 15 private static void InitCache() { 16 ConverterCache = new Dictionary<Type,IJsonItemConverter>();16 IList<IJsonItemConverter> cache = new List<IJsonItemConverter>(); 17 17 foreach (var converter in ApplicationManager.Manager.GetInstances<IJsonItemConverter>()) { 18 ConverterCache.Add(converter.ConvertableType,converter);18 cache.Add(converter); 19 19 } 20 ConverterCache = cache; 20 21 } 21 22 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItems/JsonItem.cs
r17834 r17843 64 64 public virtual string Description { get; set; } 65 65 66 private string fixedPath = "";67 66 public virtual string Path { 68 67 get { 69 if (!string.IsNullOrWhiteSpace(fixedPath))70 return fixedPath;71 72 68 IJsonItem tmp = Parent; 73 69 StringBuilder builder = new StringBuilder(this.Name); … … 115 111 public IJsonItemValidator GetValidator() => new JsonItemValidator(this); 116 112 117 public void FixatePath() => fixedPath = Path;118 public void LoosenPath() => fixedPath = "";119 120 113 public virtual JObject GenerateJObject() => 121 114 JObject.FromObject(this, new JsonSerializer() { -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonItems/ResultJsonItem.cs
r17834 r17843 1 1 using System; 2 using System.Collections.Generic;3 using System.Linq;4 2 using Newtonsoft.Json.Linq; 5 3 -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/JsonTemplateGenerator.cs
r17828 r17843 73 73 private static void PopulateJsonItems(IJsonItem item, IList<IJsonItem> jsonItems) { 74 74 foreach(var x in item) { 75 if (x.Active && !(x is EmptyJsonItem) ) {75 if (x.Active && !(x is EmptyJsonItem) && !(x is UnsupportedJsonItem)) { 76 76 jsonItems.Add(x); 77 77 } -
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; 1 using HeuristicLab.Encodings.SymbolicExpressionTreeEncoding; 7 2 using HeuristicLab.Problems.DataAnalysis.Symbolic; 8 using HeuristicLab.Problems.DataAnalysis.Symbolic.Regression;9 3 10 4 namespace 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(); 22 8 } 23 9 } -
branches/3026_IntegrationIntoSymSpace/HeuristicLab.JsonInterface/ResultFormatter/ResultFormatter.cs
r17834 r17843 12 12 public abstract class ResultFormatter : IResultFormatter { 13 13 public abstract int Priority { get; } 14 15 14 public abstract bool CanFormatType(Type t); 16 15 public abstract string Format(object o);
Note: See TracChangeset
for help on using the changeset viewer.