Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/17/11 14:37:34 (13 years ago)
Author:
mkommend
Message:

#1592: Enabled creation of empty ensemble solutions and problem data changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r6439 r6666  
    3434  [Item("RegressionProblemData", "Represents an item containing all data defining a regression problem.")]
    3535  public class RegressionProblemData : DataAnalysisProblemData, IRegressionProblemData {
    36     private const string TargetVariableParameterName = "TargetVariable";
     36    protected const string TargetVariableParameterName = "TargetVariable";
    3737
    3838    #region default data
     
    6868    private static string defaultTargetVariable;
    6969
     70    private static RegressionProblemData emptyProblemData;
     71    public static RegressionProblemData EmptyProblemData {
     72      get { return emptyProblemData; }
     73    }
     74
    7075    static RegressionProblemData() {
    7176      defaultDataset = new Dataset(new string[] { "y", "x" }, kozaF1);
     
    7479      defaultAllowedInputVariables = new List<string>() { "x" };
    7580      defaultTargetVariable = "y";
     81
     82      var problemData = new RegressionProblemData();
     83      problemData.Parameters.Clear();
     84      problemData.Name = "Empty Regression ProblemData";
     85      problemData.Description = "This ProblemData acts as place holder before the correct problem data is loaded.";
     86      problemData.isEmpty = true;
     87
     88      problemData.Parameters.Add(new FixedValueParameter<Dataset>(DatasetParameterName, "", new Dataset()));
     89      problemData.Parameters.Add(new FixedValueParameter<ReadOnlyCheckedItemList<StringValue>>(InputVariablesParameterName, ""));
     90      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TrainingPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
     91      problemData.Parameters.Add(new FixedValueParameter<IntRange>(TestPartitionParameterName, "", (IntRange)new IntRange(0, 0).AsReadOnly()));
     92      problemData.Parameters.Add(new ConstrainedValueParameter<StringValue>(TargetVariableParameterName, new ItemSet<StringValue>()));
     93      emptyProblemData = problemData;
    7694    }
    7795    #endregion
     
    91109    }
    92110
    93 
    94111    protected RegressionProblemData(RegressionProblemData original, Cloner cloner)
    95112      : base(original, cloner) {
    96113      RegisterParameterEvents();
    97114    }
    98     public override IDeepCloneable Clone(Cloner cloner) { return new RegressionProblemData(this, cloner); }
     115    public override IDeepCloneable Clone(Cloner cloner) {
     116      if (this == emptyProblemData) return emptyProblemData;
     117      return new RegressionProblemData(this, cloner);
     118    }
    99119
    100120    public RegressionProblemData()
Note: See TracChangeset for help on using the changeset viewer.