Free cookie consent management tool by TermsFeed Policy Generator

source: branches/HeuristicLab.Hive_Milestone2/sources/HeuristicLab.Core/3.2/Interfaces/IEngine.cs @ 1835

Last change on this file since 1835 was 1815, checked in by swagner, 15 years ago

Added a property for the thread priority of an engine's worker thread to EngineBase (#623)

File size: 3.5 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 System.Threading;
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    /// <summary>
48    /// Gets or sets the thread priority of the worker thread.
49    /// </summary>
50    ThreadPriority Priority { get; set; }
51
52    /// <summary>
53    /// Gets information whether the engine is currently running.
54    /// </summary>
55    bool Running { get; }
56    /// <summary>
57    /// Gets information whether the engine is canceled.
58    /// </summary>
59    bool Canceled { get; }
60    /// <summary>
61    /// Gets information whether the engine has already terminated.
62    /// </summary>
63    bool Terminated { get; }
64
65    /// <summary>
66    /// Executes the whole run.
67    /// </summary>
68    void Execute();
69    /// <summary>
70    /// Executes one step (one operation).
71    /// </summary>
72    void ExecuteStep();
73    /// <summary>
74    /// Executes the given number of steps.
75    /// </summary>
76    /// <param name="steps">The number of steps to execute.</param>
77    void ExecuteSteps(int steps);
78    /// <summary>
79    /// Aborts the engine run.
80    /// </summary>
81    void Abort();
82    /// <summary>
83    /// Resets the current instance.
84    /// </summary>
85    void Reset();
86
87    /// <summary>
88    /// Occurs when the current instance is initialized.
89    /// </summary>
90    event EventHandler Initialized;
91    /// <summary>
92    /// Occurs when an operation is executed.
93    /// </summary>
94    event EventHandler<OperationEventArgs> OperationExecuted;
95    /// <summary>
96    /// Occurs when an exception was thrown.
97    /// </summary>
98    event EventHandler<ExceptionEventArgs> ExceptionOccurred;
99    /// <summary>
100    /// Occurs when the execution time was changed.
101    /// </summary>
102    event EventHandler ExecutionTimeChanged;
103    /// <summary>
104    /// Occurs when the engine is finished.
105    /// </summary>
106    event EventHandler Finished;
107  }
108}
Note: See TracBrowser for help on using the repository browser.