Changeset 2377
- Timestamp:
- 09/22/09 11:45:04 (15 years ago)
- Location:
- trunk/sources
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.CEDMA.Server/3.3/DispatcherView.cs
r2376 r2377 101 101 testSamplesStartTextBox.Text = selectedSpec.TestSamplesStart.ToString(); 102 102 testSamplesEndTextBox.Text = selectedSpec.TestSamplesEnd.ToString(); 103 minTimeOffsetTextBox.Text = selectedSpec.MinTimeOffset.ToString(); 104 maxTimeOffsetTextBox.Text = selectedSpec.MaxTimeOffset.ToString(); 105 autoregressiveCheckBox.Checked = selectedSpec.AutoRegressive; 103 106 } 104 107 … … 134 137 135 138 private void radioButton_CheckedChanged(object sender, EventArgs e) { 136 string selectedTarget = (string)targetVariableList.SelectedItem;137 139 minTimeOffsetLabel.Enabled = timeSeriesRadioButton.Checked; 138 140 minTimeOffsetTextBox.Enabled = timeSeriesRadioButton.Checked; … … 144 146 else if (classificationRadioButton.Checked) selectedSpec.LearningTask = LearningTask.Classification; 145 147 else if (regressionRadioButton.Checked) selectedSpec.LearningTask = LearningTask.Regression; 148 var allowedAlgorithms = dispatcher.GetAllowedAlgorithms(selectedSpec.TargetVariable); 149 foreach (var algo in allowedAlgorithms) { 150 dispatcher.DisableAlgorithm(selectedSpec.TargetVariable, algo); 151 } 146 152 UpdateAlgorithms(); 147 153 } -
trunk/sources/HeuristicLab.CEDMA.Server/3.3/SimpleDispatcher.cs
r2375 r2377 145 145 if (possibleAlgos.Count() > 0) selectedAlgorithm = possibleAlgos.ElementAt(random.Next(possibleAlgos.Count())); 146 146 if (selectedAlgorithm != null) { 147 // create a clone of the algorithm template before setting the parameters 148 selectedAlgorithm = (HeuristicLab.Modeling.IAlgorithm)selectedAlgorithm.Clone(); 147 149 SetProblemParameters(selectedAlgorithm, problemSpecifications[targetVariable]); 148 150 if (!(selectedAlgorithm is IStochasticAlgorithm)) -
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 } -
trunk/sources/HeuristicLab.LinearRegression/3.2/LinearRegression.cs
r2375 r2377 42 42 public virtual string Description { get { return "TODO"; } } 43 43 44 private SequentialEngine.SequentialEngine engine;44 private IEngine engine; 45 45 public virtual IEngine Engine { 46 46 get { return engine; } … … 135 135 136 136 HL3TreeEvaluatorInjector treeEvaluatorInjector = new HL3TreeEvaluatorInjector(); 137 138 137 139 138 LinearRegressionOperator lrOperator = new LinearRegressionOperator(); … … 250 249 251 250 public virtual IEditor CreateEditor() { 252 return engine.CreateEditor(); 253 } 254 251 return ((SequentialEngine.SequentialEngine)engine).CreateEditor(); 252 } 253 254 #endregion 255 256 #region persistence 257 public override object Clone(IDictionary<Guid, object> clonedObjects) { 258 LinearRegression clone = (LinearRegression) base.Clone(clonedObjects); 259 clone.engine = (IEngine)Auxiliary.Clone(Engine, clonedObjects); 260 return clone; 261 } 262 263 public override XmlNode GetXmlNode(string name, XmlDocument document, IDictionary<Guid, IStorable> persistedObjects) { 264 XmlNode node = base.GetXmlNode(name, document, persistedObjects); 265 node.AppendChild(PersistenceManager.Persist("Engine", engine, document, persistedObjects)); 266 return node; 267 } 268 269 public override void Populate(XmlNode node, IDictionary<Guid, IStorable> restoredObjects) { 270 base.Populate(node, restoredObjects); 271 engine = (IEngine)PersistenceManager.Restore(node.SelectSingleNode("Engine"), restoredObjects); 272 } 255 273 #endregion 256 274 } -
trunk/sources/HeuristicLab.Modeling/3.2/IAlgorithm.cs
r2375 r2377 27 27 28 28 namespace HeuristicLab.Modeling { 29 public interface IAlgorithm {29 public interface IAlgorithm : ICloneable { 30 30 string Name { get; } 31 31 string Description { get; } -
trunk/sources/HeuristicLab.SupportVectorMachines/3.2/SupportVectorRegression.cs
r2375 r2377 42 42 public virtual string Description { get { return "TODO"; } } 43 43 44 private SequentialEngine.SequentialEngine engine;44 private IEngine engine; 45 45 public IEngine Engine { 46 46 get { return engine; } … … 490 490 491 491 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 } 495 514 #endregion 496 515 }
Note: See TracChangeset
for help on using the changeset viewer.