Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2371


Ignore:
Timestamp:
09/21/09 14:15:37 (15 years ago)
Author:
mkommend
Message:

added code for persisting of ModelType into the database (ticket #756)

Location:
trunk/sources
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Common/3.2/HeuristicLab.Common-3.2.csproj

    r2367 r2371  
    8484    </Compile>
    8585    <Compile Include="EnumerableEventArgs.cs" />
     86    <Compile Include="EventArgs.cs" />
    8687    <Compile Include="HeuristicLabCommonPlugin.cs" />
    8788    <Compile Include="NotificationDictionary.cs" />
  • trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DataObjects/Model.cs

    r2326 r2371  
    3232    public Model() {
    3333      targetVariable = default(EntityRef<Variable>);
    34       algorithm = default(EntityRef<Algorithm>);     
     34      algorithm = default(EntityRef<Algorithm>);
    3535    }
    3636
    37     public Model(Variable targetVariable, Algorithm algorithm)
     37    public Model(Variable targetVariable, Algorithm algorithm, ModelType modelType)
    3838      : this() {
    3939      this.targetVariableId = targetVariable.Id;
    4040      this.algorithmId = algorithm.Id;
     41      ModelType = modelType.ToString();
    4142    }
    4243
     
    9495    }
    9596
     97    private string modelType;
     98    [Column(Storage = "modelType", CanBeNull = false)]
     99    public string ModelType {
     100      get { return this.modelType; }
     101      private set { this.modelType = value; }
     102    }
     103
     104    ModelType IModel.ModelType {
     105      get {
     106        if (!Enum.IsDefined(typeof(ModelType), this.modelType))
     107          throw new ArgumentException("ModelType " + modelType + " not declared.");
     108        return (ModelType)Enum.Parse(typeof(ModelType), this.modelType);
     109      }
     110    }
     111
    96112    private string name;
    97113    [Column(Storage = "name", CanBeNull = true)]
  • trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DatabaseService.cs

    r2370 r2371  
    8484
    8585      using (ModelingDataContext ctx = new ModelingDataContext(connection)) {
    86         m = new Model(target, algo);
     86        m = new Model(target, algo,model.Type);
    8787        m.TrainingSamplesStart = model.TrainingSamplesStart;
    8888        m.TrainingSamplesEnd = model.TrainingSamplesEnd;
  • trunk/sources/HeuristicLab.Modeling.Database/3.2/IModel.cs

    r2326 r2371  
    2929    IVariable TargetVariable { get; }
    3030    IAlgorithm Algorithm { get; }
     31    ModelType ModelType { get; }
    3132    string Name { get; set; }
    3233    int TrainingSamplesStart { get; }
  • trunk/sources/HeuristicLab.Modeling/3.2/AnalyzerModel.cs

    r2370 r2371  
    3131    public AnalyzerModel() { } // for persistence
    3232
    33     #region IModel Members
     33    #region IAnalyzerModel Members
    3434
    3535    private Dataset dataset;
Note: See TracChangeset for help on using the changeset viewer.