#region License Information /* HeuristicLab * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL) * * This file is part of HeuristicLab. * * HeuristicLab is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * HeuristicLab is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with HeuristicLab. If not, see . */ #endregion using System; using System.Collections.Generic; using System.Text; namespace HeuristicLab.Core { /// /// Interface to represent one run. (An engine is an interpreter, holding the code, /// the data and the actual state, which is the runtime stack and a pointer onto the next operation.). /// It is responsible for operator execution and able to deal with parallelism. /// public interface IEngine : IItem { /// /// Gets the operator graph of the current instance. /// IOperatorGraph OperatorGraph { get; } /// /// Gets the global scope of the current instance. /// IScope GlobalScope { get; } /// /// Gets the execution time of the current instance. /// TimeSpan ExecutionTime { get; } /// /// Gets information whether the engine is currently running. /// bool Running { get; } /// /// Gets information whether the engine is canceled. /// bool Canceled { get; } /// /// Gets information whether the engine has already terminated. /// bool Terminated { get; } /// /// Executes the whole run. /// void Execute(); /// /// Executes one step (one operation). /// void ExecuteStep(); /// /// Executes the given number of steps. /// /// The number of steps to execute. void ExecuteSteps(int steps); /// /// Aborts the engine run. /// void Abort(); /// /// Resets the current instance. /// void Reset(); /// /// Occurs when the current instance is initialized. /// event EventHandler Initialized; /// /// Occurs when an operation is executed. /// event EventHandler OperationExecuted; /// /// Occurs when an exception was thrown. /// event EventHandler ExceptionOccurred; /// /// Occurs when the execution time was changed. /// event EventHandler ExecutionTimeChanged; /// /// Occurs when the engine is finished. /// event EventHandler Finished; } }