Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2326 for trunk


Ignore:
Timestamp:
09/02/09 16:48:56 (15 years ago)
Author:
mkommend
Message:

added name in IModel
added update methods for IModel and ModelData
(ticket #712)

Location:
trunk/sources
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DataObjects/Model.cs

    r2293 r2326  
    3232    public Model() {
    3333      targetVariable = default(EntityRef<Variable>);
    34       algorithm = default(EntityRef<Algorithm>);
     34      algorithm = default(EntityRef<Algorithm>);     
    3535    }
    3636
     
    9494    }
    9595
     96    private string name;
     97    [Column(Storage = "name", CanBeNull = true)]
     98    public string Name {
     99      get { return this.name; }
     100      set { this.name = value; }
     101    }
     102
    96103    private int trainingSamplesStart;
    97104    [Column(Storage = "trainingSamplesStart", CanBeNull = false)]
  • trunk/sources/HeuristicLab.Modeling.Database.SQLServerCompact/3.2/DatabaseService.cs

    r2314 r2326  
    264264    }
    265265
     266    public void UpdateModel(IModel model) {
     267      Model m = (Model)model;
     268      Model orginal = ctx.Models.GetOriginalEntityState(m);
     269      if (orginal == null)
     270        ctx.Models.Attach(m);
     271      ctx.SubmitChanges();
     272    }
     273
    266274    public byte[] GetModelData(IModel model) {
    267275      var data = (from md in ctx.ModelData
     
    273281    }
    274282
     283    public void UpdateModelData(IModel model, byte[] modelData) {
     284      Model m = (Model)model;
     285      ctx.ModelData.DeleteAllOnSubmit(ctx.ModelData.Where(x => x.Model == m));
     286      ctx.ModelData.InsertOnSubmit(new ModelData(m, modelData));
     287      ctx.SubmitChanges();
     288    }
     289
    275290    public IPredictor GetModelPredictor(IModel model) {
    276291      byte[] data = GetModelData(model);
  • trunk/sources/HeuristicLab.Modeling.Database/3.2/IModel.cs

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

    r2314 r2326  
    3232    IProblem PersistProblem(Dataset dataset);
    3333
     34    void UpdateModel(IModel model);
     35    void UpdateModelData(IModel model, byte[] modelData);
     36
    3437    IEnumerable<IModel> GetAllModels();
    3538    IEnumerable<IResult> GetAllResults();
Note: See TracChangeset for help on using the changeset viewer.