- Timestamp:
- 10/22/15 19:00:13 (9 years ago)
- Location:
- stable
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
stable
- Property svn:mergeinfo changed
/trunk/sources merged: 13001
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis
- Property svn:mergeinfo changed
/trunk/sources/HeuristicLab.Problems.DataAnalysis merged: 13001
- Property svn:mergeinfo changed
-
stable/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/ConstantRegressionModel.cs
r12702 r13048 20 20 #endregion 21 21 22 using System; 22 23 using System.Collections.Generic; 23 24 using System.Linq; 24 25 using HeuristicLab.Common; 25 26 using HeuristicLab.Core; 27 using HeuristicLab.Data; 26 28 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; 27 29 … … 29 31 [StorableClass] 30 32 [Item("Constant Regression Model", "A model that always returns the same constant value regardless of the presented input data.")] 31 public class ConstantRegressionModel : NamedItem, IRegressionModel {33 public class ConstantRegressionModel : NamedItem, IRegressionModel, IStringConvertibleValue { 32 34 [Storable] 33 pr otecteddouble constant;35 private double constant; 34 36 public double Constant { 35 37 get { return constant; } 38 // setter not implemented because manipulation of the constant is not allowed 36 39 } 37 40 … … 49 52 this.description = ItemDescription; 50 53 this.constant = constant; 54 this.ReadOnly = true; // changing a constant regression model is not supported 51 55 } 52 56 … … 58 62 return new ConstantRegressionSolution(this, new RegressionProblemData(problemData)); 59 63 } 64 65 public override string ToString() { 66 return string.Format("Constant: {0}", GetValue()); 67 } 68 69 #region IStringConvertibleValue 70 public bool ReadOnly { get; private set; } 71 public bool Validate(string value, out string errorMessage) { 72 throw new NotSupportedException(); // changing a constant regression model is not supported 73 } 74 75 public string GetValue() { 76 return string.Format("{0:E4}", constant); 77 } 78 79 public bool SetValue(string value) { 80 throw new NotSupportedException(); // changing a constant regression model is not supported 81 } 82 83 public event EventHandler ValueChanged; 84 #endregion 60 85 } 61 86 }
Note: See TracChangeset
for help on using the changeset viewer.