Free cookie consent management tool by TermsFeed Policy Generator

source: trunk/sources/HeuristicLab.Core/3.3/Interfaces/IEngine.cs @ 2883

Last change on this file since 2883 was 2834, checked in by swagner, 15 years ago

Operator architecture refactoring (#95)

  • worked on operators, engines, and optimization
File size: 3.2 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
4 *
5 * This file is part of HeuristicLab.
6 *
7 * HeuristicLab is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * HeuristicLab is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
19 */
20#endregion
21
22using System;
23using HeuristicLab.Common;
24
25namespace HeuristicLab.Core {
26  /// <summary>
27  /// Interface to represent one run. (An engine is an interpreter, holding the code,
28  /// the data and the actual state, which is the runtime stack and a pointer onto the next operation.).
29  /// It is responsible for operator execution and able to deal with parallelism.
30  /// </summary>
31  public interface IEngine : IItem {
32    /// <summary>
33    /// Gets the operator graph of the current instance.
34    /// </summary>
35    OperatorGraph OperatorGraph { get; set; }
36    /// <summary>
37    /// Gets the global scope of the current instance.
38    /// </summary>
39    IScope GlobalScope { get; }
40
41    /// <summary>
42    /// Gets the execution time of the current instance.
43    /// </summary>
44    TimeSpan ExecutionTime { get; }
45
46    /// <summary>
47    /// Gets information whether the engine is currently running.
48    /// </summary>
49    bool Running { get; }
50    /// <summary>
51    /// Gets information whether the engine has already terminated.
52    /// </summary>
53    bool Finished { get; }
54
55    /// <summary>
56    /// Prepares the engine for a new run.
57    /// </summary>
58    void Prepare();
59    /// <summary>
60    /// Prepares the engine with a given initial operation.
61    /// </summary>
62    void Prepare(IOperation initialOperation);
63    /// <summary>
64    /// Executes the whole run.
65    /// </summary>
66    void Start();
67    /// <summary>
68    /// Executes one step (one operation).
69    /// </summary>
70    void Step();
71    /// <summary>
72    /// Aborts the engine run.
73    /// </summary>
74    void Stop();
75
76    /// <summary>
77    /// Occurs when the operator graph was changed.
78    /// </summary>
79    event EventHandler OperatorGraphChanged;
80    /// <summary>
81    /// Occurs when the execution time was changed.
82    /// </summary>
83    event EventHandler ExecutionTimeChanged;
84    /// <summary>
85    /// Occurs when the engine is prepared for a new run.
86    /// </summary>
87    event EventHandler Prepared;
88    /// <summary>
89    /// Occurs when the engine is executed.
90    /// </summary>
91    event EventHandler Started;
92    /// <summary>
93    /// Occurs when the engine is finished.
94    /// </summary>
95    event EventHandler Stopped;
96    /// <summary>
97    /// Occurs when an exception was thrown.
98    /// </summary>
99    event EventHandler<EventArgs<Exception>> ExceptionOccurred;
100  }
101}
Note: See TracBrowser for help on using the repository browser.