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