Free cookie consent management tool by TermsFeed Policy Generator

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

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

Implemented first version of algorithm batch processing (#947).

File size: 2.8 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 execution time of the current instance.
34    /// </summary>
35    TimeSpan ExecutionTime { get; }
36
37    /// <summary>
38    /// Gets information whether the engine is currently running.
39    /// </summary>
40    bool Running { get; }
41    /// <summary>
42    /// Gets information whether the engine has already terminated.
43    /// </summary>
44    bool Finished { get; }
45
46    /// <summary>
47    /// Prepares the engine with a given initial operation.
48    /// </summary>
49    void Prepare(IOperation initialOperation);
50    /// <summary>
51    /// Executes the whole run.
52    /// </summary>
53    void Start();
54    /// <summary>
55    /// Executes one step (one operation).
56    /// </summary>
57    void Step();
58    /// <summary>
59    /// Aborts the engine run.
60    /// </summary>
61    void Stop();
62
63    /// <summary>
64    /// Occurs when the execution time was changed.
65    /// </summary>
66    event EventHandler ExecutionTimeChanged;
67    /// <summary>
68    /// Occurs when the running flag was changed.
69    /// </summary>
70    event EventHandler RunningChanged;
71    /// <summary>
72    /// Occurs when the engine is prepared for a new run.
73    /// </summary>
74    event EventHandler Prepared;
75    /// <summary>
76    /// Occurs when the engine is executed.
77    /// </summary>
78    event EventHandler Started;
79    /// <summary>
80    /// Occurs when the engine is finished.
81    /// </summary>
82    event EventHandler Stopped;
83    /// <summary>
84    /// Occurs when an exception was thrown.
85    /// </summary>
86    event EventHandler<EventArgs<Exception>> ExceptionOccurred;
87  }
88}
Note: See TracBrowser for help on using the repository browser.