Changeset 2377 for trunk/sources/HeuristicLab.GP.Algorithms
- Timestamp:
- 09/22/09 11:45:04 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.GP.Algorithms/3.2/AlgorithmBase.cs
r2361 r2377 106 106 } 107 107 108 private IOperator algorithm; 109 110 private SequentialEngine.SequentialEngine engine; 108 private IEngine engine; 111 109 public IEngine Engine { 112 110 get { return engine; } 113 protected set { engine = (SequentialEngine.SequentialEngine)value; }111 protected set { engine = value; } 114 112 } 115 113 … … 158 156 algo.OperatorGraph.AddOperator(seq); 159 157 algo.OperatorGraph.InitialOperator = seq; 160 this.algorithm = seq;161 158 return algo; 162 159 } … … 466 463 } 467 464 468 469 public override object Clone(IDictionary<Guid, object> clonedObjects) {470 AlgorithmBase clone = (AlgorithmBase)base.Clone(clonedObjects);471 clonedObjects.Add(Guid, clone);472 clone.engine = (SequentialEngine.SequentialEngine)Auxiliary.Clone(Engine, clonedObjects);473 return clone;474 }475 476 465 protected virtual IOperator GetVariableInjector() { 477 466 CombinedOperator init = (CombinedOperator)GetInitializationOperator(); … … 485 474 486 475 protected virtual IOperator GetInitializationOperator() { 487 return algorithm.SubOperators[0]; 476 CombinedOperator algo = (CombinedOperator)Engine.OperatorGraph.InitialOperator; 477 return algo.OperatorGraph.InitialOperator.SubOperators[0]; 488 478 } 489 479 490 480 #region Persistence Methods 481 public override object Clone(IDictionary<Guid, object> clonedObjects) { 482 AlgorithmBase clone = (AlgorithmBase)base.Clone(clonedObjects); 483 clone.engine = (IEngine)Auxiliary.Clone(Engine, clonedObjects); 484 return clone; 485 } 486 491 487 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 492 488 XmlNode node = base.GetXmlNode(name, document, persistedObjects); … … 496 492 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 497 493 base.Populate(node, restoredObjects); 498 engine = ( SequentialEngine.SequentialEngine)PersistenceManager.Restore(node.SelectSingleNode("Engine"), restoredObjects);494 engine = (IEngine)PersistenceManager.Restore(node.SelectSingleNode("Engine"), restoredObjects); 499 495 } 500 496 #endregion 501 502 503 497 } 504 498 }
Note: See TracChangeset
for help on using the changeset viewer.