Free cookie consent management tool by TermsFeed Policy Generator

source: branches/Operator Architecture Refactoring/HeuristicLab.Core/3.3/Interfaces/IOperator.cs @ 2046

Last change on this file since 2046 was 2046, checked in by swagner, 15 years ago

Refactoring of the operator architecture (#95)

File size: 3.7 KB
Line 
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
22using System;
23using System.Collections.Generic;
24using System.Text;
25
26namespace HeuristicLab.Core {
27  /// <summary>
28  /// Interface to represent an operator (e.g. GreaterThanComparator,...),
29  /// a basic instruction of an algorithm.
30  /// </summary>
31  public interface IOperator : IItem {
32    /// <summary>
33    /// Gets or sets the name of the current instance.
34    /// </summary>
35    string Name { get; set; }
36    /// <summary>
37    /// Gets or sets the description of the current instance.
38    /// </summary>
39    string Description { get; }
40
41    /// <summary>
42    /// Gets information whether the current operator has been canceled.
43    /// </summary>
44    bool Canceled { get; }
45    /// <summary>
46    /// Gets or sets a boolean value whether the engine should stop here during the run.
47    /// </summary>
48    bool Breakpoint { get; set; }
49
50    /// <summary>
51    /// Gets a collection of all variable (parameter) infos.
52    /// </summary>
53    ICollection<IParameter> Parameters { get; }
54
55    /// <summary>
56    /// Gets the variable info with the given <paramref name="formalName"/>.
57    /// </summary>
58    /// <param name="formalName">The formal name of the variable info.</param>
59    /// <returns>The variable info with the specified formal name.</returns>
60    IParameter GetParameter(string name);
61    /// <summary>
62    /// Adds the specified variable info to the current instance.
63    /// </summary>
64    /// <param name="variableInfo">The variable info to add.</param>
65    void AddParameter(IParameter parameter);
66    /// <summary>
67    /// Removes the variable info with the given formal name.
68    /// </summary>
69    /// <param name="formalName">The formal name of the variable info to remove.</param>
70    void RemoveParameter(string name);
71
72    /// <summary>
73    /// Executes the current instance on the specified <paramref name="scope"/>.
74    /// </summary>
75    /// <param name="scope">The scope where to execute the current instance.</param>
76    /// <returns>The next operation.</returns>
77    IOperation Execute(IScope scope);
78    /// <summary>
79    /// Aborts the current operator.
80    /// </summary>
81    void Abort();
82
83    /// <summary>
84    /// Occurs when the name of the operator was changed.
85    /// </summary>
86    event EventHandler NameChanged;
87    /// <summary>
88    /// Occurs when the breakpoint flag of the current instance was changed.
89    /// </summary>
90    event EventHandler BreakpointChanged;
91    /// <summary>
92    /// Occurs when a variable info has been added.
93    /// </summary>
94    event EventHandler<EventArgs<IParameter>> ParameterAdded;
95    /// <summary>
96    /// Occurs when a variable info has been deleted.
97    /// </summary>
98    event EventHandler<EventArgs<IParameter>> ParameterRemoved;
99    /// <summary>
100    /// Occurs when the current instance is executed.
101    /// </summary>
102    event EventHandler Executed;
103  }
104}
Note: See TracBrowser for help on using the repository browser.