[2] | 1 | #region License Information
|
---|
| 2 | /* HeuristicLab
|
---|
[2790] | 3 | * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
|
---|
[2] | 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 |
|
---|
| 22 | using System;
|
---|
[2474] | 23 | using HeuristicLab.Common;
|
---|
[2] | 24 |
|
---|
| 25 | namespace HeuristicLab.Core {
|
---|
[776] | 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>
|
---|
[2] | 31 | public interface IEngine : IItem {
|
---|
[776] | 32 | /// <summary>
|
---|
| 33 | /// Gets the execution time of the current instance.
|
---|
| 34 | /// </summary>
|
---|
[2] | 35 | TimeSpan ExecutionTime { get; }
|
---|
| 36 |
|
---|
[776] | 37 | /// <summary>
|
---|
| 38 | /// Gets information whether the engine is currently running.
|
---|
| 39 | /// </summary>
|
---|
[2] | 40 | bool Running { get; }
|
---|
[776] | 41 | /// <summary>
|
---|
| 42 | /// Gets information whether the engine has already terminated.
|
---|
| 43 | /// </summary>
|
---|
[2653] | 44 | bool Finished { get; }
|
---|
[2] | 45 |
|
---|
[776] | 46 | /// <summary>
|
---|
[2834] | 47 | /// Prepares the engine with a given initial operation.
|
---|
| 48 | /// </summary>
|
---|
| 49 | void Prepare(IOperation initialOperation);
|
---|
| 50 | /// <summary>
|
---|
[776] | 51 | /// Executes the whole run.
|
---|
| 52 | /// </summary>
|
---|
[2653] | 53 | void Start();
|
---|
[776] | 54 | /// <summary>
|
---|
| 55 | /// Executes one step (one operation).
|
---|
| 56 | /// </summary>
|
---|
[2653] | 57 | void Step();
|
---|
[776] | 58 | /// <summary>
|
---|
| 59 | /// Aborts the engine run.
|
---|
| 60 | /// </summary>
|
---|
[2653] | 61 | void Stop();
|
---|
| 62 |
|
---|
[2796] | 63 | /// <summary>
|
---|
[2653] | 64 | /// Occurs when the execution time was changed.
|
---|
[776] | 65 | /// </summary>
|
---|
[2653] | 66 | event EventHandler ExecutionTimeChanged;
|
---|
[776] | 67 | /// <summary>
|
---|
[3226] | 68 | /// Occurs when the running flag was changed.
|
---|
| 69 | /// </summary>
|
---|
| 70 | event EventHandler RunningChanged;
|
---|
| 71 | /// <summary>
|
---|
[2790] | 72 | /// Occurs when the engine is prepared for a new run.
|
---|
[776] | 73 | /// </summary>
|
---|
[2790] | 74 | event EventHandler Prepared;
|
---|
[776] | 75 | /// <summary>
|
---|
[2653] | 76 | /// Occurs when the engine is executed.
|
---|
[776] | 77 | /// </summary>
|
---|
[2653] | 78 | event EventHandler Started;
|
---|
[776] | 79 | /// <summary>
|
---|
[2653] | 80 | /// Occurs when the engine is finished.
|
---|
| 81 | /// </summary>
|
---|
| 82 | event EventHandler Stopped;
|
---|
| 83 | /// <summary>
|
---|
[776] | 84 | /// Occurs when an exception was thrown.
|
---|
| 85 | /// </summary>
|
---|
[2474] | 86 | event EventHandler<EventArgs<Exception>> ExceptionOccurred;
|
---|
[2] | 87 | }
|
---|
| 88 | }
|
---|