#region License Information /* HeuristicLab * Copyright (C) 2002-2010 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 HeuristicLab.Common; 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. /// OperatorGraph OperatorGraph { get; set; } /// /// Gets the global scope of the current instance. /// IScope GlobalScope { get; } /// /// Gets the problem of the current instance. /// IProblem Problem { get; set; } /// /// 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 has already terminated. /// bool Finished { get; } /// /// Prepares the engine for a new run. /// void Prepare(); /// /// Executes the whole run. /// void Start(); /// /// Executes one step (one operation). /// void Step(); /// /// Aborts the engine run. /// void Stop(); /// /// Occurs when the operator graph was changed. /// event EventHandler OperatorGraphChanged; /// /// Occurs when the problem was changed. /// event EventHandler ProblemChanged; /// /// Occurs when the execution time was changed. /// event EventHandler ExecutionTimeChanged; /// /// Occurs when the engine is prepared for a new run. /// event EventHandler Prepared; /// /// Occurs when the engine is executed. /// event EventHandler Started; /// /// Occurs when the engine is finished. /// event EventHandler Stopped; /// /// Occurs when an exception was thrown. /// event EventHandler> ExceptionOccurred; } }