Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
09/22/09 11:45:04 (15 years ago)
Author:
gkronber
Message:
  • Implemented cloning and persistence in data-modeling algorithms.
  • Fixed bugs in CEDMA controller.

#754

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs

    r2375 r2377  
    4242    public virtual string Description { get { return "TODO"; } }
    4343
    44     private SequentialEngine.SequentialEngine engine;
     44    private IEngine engine;
    4545    public IEngine Engine {
    4646      get { return engine; }
     
    490490
    491491    public IEditor CreateEditor() {
    492       return engine.CreateEditor();
    493     }
    494 
     492      return ((SequentialEngine.SequentialEngine)engine).CreateEditor();
     493    }
     494
     495    #endregion
     496
     497    #region persistence
     498    public override object Clone(IDictionary<Guid, object> clonedObjects) {
     499      SupportVectorRegression clone = (SupportVectorRegression) base.Clone(clonedObjects);
     500      clone.engine = (IEngine)Auxiliary.Clone(Engine, clonedObjects);
     501      return clone;
     502    }
     503
     504    public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) {
     505      XmlNode node = base.GetXmlNode(name, document, persistedObjects);
     506      node.AppendChild(PersistenceManager.Persist("Engine", engine, document, persistedObjects));
     507      return node;
     508    }
     509
     510    public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) {
     511      base.Populate(node, restoredObjects);
     512      engine = (IEngine)PersistenceManager.Restore(node.SelectSingleNode("Engine"), restoredObjects);
     513    }
    495514    #endregion
    496515  }
Note: See TracChangeset for help on using the changeset viewer.