Free cookie consent management tool by TermsFeed Policy Generator

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

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

Implemented generic EventArgs (#796)

File size: 3.3 KB
Line 
1#region License Information
2/* HeuristicLab
3 * Copyright (C) 2002-2008 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 System.Collections.Generic;
24using System.Text;
25using HeuristicLab.Common;
26
27namespace HeuristicLab.Core {
28  /// <summary>
29  /// Interface to represent one run. (An engine is an interpreter, holding the code,
30  /// the data and the actual state, which is the runtime stack and a pointer onto the next operation.).
31  /// It is responsible for operator execution and able to deal with parallelism.
32  /// </summary>
33  public interface IEngine : IItem {
34    /// <summary>
35    /// Gets the operator graph of the current instance.
36    /// </summary>
37    IOperatorGraph OperatorGraph { get; }
38    /// <summary>
39    /// Gets the global scope of the current instance.
40    /// </summary>
41    IScope GlobalScope { get; }
42
43    /// <summary>
44    /// Gets the execution time of the current instance.
45    /// </summary>
46    TimeSpan ExecutionTime { get; }
47
48    /// <summary>
49    /// Gets information whether the engine is currently running.
50    /// </summary>
51    bool Running { get; }
52    /// <summary>
53    /// Gets information whether the engine is canceled.
54    /// </summary>
55    bool Canceled { get; }
56    /// <summary>
57    /// Gets information whether the engine has already terminated.
58    /// </summary>
59    bool Terminated { get; }
60
61    /// <summary>
62    /// Executes the whole run.
63    /// </summary>
64    void Execute();
65    /// <summary>
66    /// Executes one step (one operation).
67    /// </summary>
68    void ExecuteStep();
69    /// <summary>
70    /// Executes the given number of steps.
71    /// </summary>
72    /// <param name="steps">The number of steps to execute.</param>
73    void ExecuteSteps(int steps);
74    /// <summary>
75    /// Aborts the engine run.
76    /// </summary>
77    void Abort();
78    /// <summary>
79    /// Resets the current instance.
80    /// </summary>
81    void Reset();
82
83    /// <summary>
84    /// Occurs when the current instance is initialized.
85    /// </summary>
86    event EventHandler Initialized;
87    /// <summary>
88    /// Occurs when an operation is executed.
89    /// </summary>
90    event EventHandler<EventArgs<IOperation>> OperationExecuted;
91    /// <summary>
92    /// Occurs when an exception was thrown.
93    /// </summary>
94    event EventHandler<EventArgs<Exception>> ExceptionOccurred;
95    /// <summary>
96    /// Occurs when the execution time was changed.
97    /// </summary>
98    event EventHandler ExecutionTimeChanged;
99    /// <summary>
100    /// Occurs when the engine is finished.
101    /// </summary>
102    event EventHandler Finished;
103  }
104}
Note: See TracBrowser for help on using the repository browser.