Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/31/11 11:52:11 (13 years ago)
Author:
abeham
Message:

#1628

  • Updated branch from trunk
  • Changed ReferenceEqualityComparer<T> to become a non-generic class (generic implementation probably was only made because of lacking support for co- and contravariance in C# 3.5)
  • Added finished experiment from sample algorithms to the tests
  • Wrote a unit test to instantiate every IDeepCloneable type, clone it and compare the objects in the object graph for equal references
  • Wrote a unit test to load the experiment, clone it and compare again the objects in the object graph
  • Preliminary fix for a potential bug in ThreadSafeLog
  • Preliminary fix for a potential bug in OperatorGraphVisualizationInfo
  • Preliminary fix for a potential bug in Calculator (and added license headers)
  • Preliminary fix for a potential bug in ScrambleMove
Location:
branches/GeneralizedQAP
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/GeneralizedQAP

  • branches/GeneralizedQAP/HeuristicLab.Problems.DataAnalysis

  • branches/GeneralizedQAP/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/Regression/RegressionProblemData.cs

    r6439 r6685  
    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
     
    6464          {0.83763905,  0.468046718}
    6565    };
    66     private static Dataset defaultDataset;
    67     private static IEnumerable<string> defaultAllowedInputVariables;
    68     private static string defaultTargetVariable;
     66    private static readonly Dataset defaultDataset;
     67    private static readonly IEnumerable<string> defaultAllowedInputVariables;
     68    private static readonly string defaultTargetVariable;
     69
     70    private static readonly RegressionProblemData emptyProblemData;
     71    public static RegressionProblemData EmptyProblemData {
     72      get { return emptyProblemData; }
     73    }
    6974
    7075    static RegressionProblemData() {
     
    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.