Free cookie consent management tool by TermsFeed Policy Generator

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

Last change on this file since 2796 was 2796, checked in by swagner, 14 years ago

Operator architecture refactoring (#95)

  • worked on operators, parameters and problems
File size: 3.3 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    /// <summary>
41    /// Gets the problem of the current instance.
42    /// </summary>
43    IProblem Problem { get; set; }
44
45    /// <summary>
46    /// Gets the execution time of the current instance.
47    /// </summary>
48    TimeSpan ExecutionTime { get; }
49
50    /// <summary>
51    /// Gets information whether the engine is currently running.
52    /// </summary>
53    bool Running { get; }
54    /// <summary>
55    /// Gets information whether the engine has already terminated.
56    /// </summary>
57    bool Finished { get; }
58
59    /// <summary>
60    /// Prepares the engine for a new run.
61    /// </summary>
62    void Prepare();
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 problem was changed.
82    /// </summary>
83    event EventHandler ProblemChanged;
84    /// <summary>
85    /// Occurs when the execution time was changed.
86    /// </summary>
87    event EventHandler ExecutionTimeChanged;
88    /// <summary>
89    /// Occurs when the engine is prepared for a new run.
90    /// </summary>
91    event EventHandler Prepared;
92    /// <summary>
93    /// Occurs when the engine is executed.
94    /// </summary>
95    event EventHandler Started;
96    /// <summary>
97    /// Occurs when the engine is finished.
98    /// </summary>
99    event EventHandler Stopped;
100    /// <summary>
101    /// Occurs when an exception was thrown.
102    /// </summary>
103    event EventHandler<EventArgs<Exception>> ExceptionOccurred;
104  }
105}
Note: See TracBrowser for help on using the repository browser.