Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/20/10 05:00:28 (15 years ago)
Author:
swagner
Message:

Committing first results of the refactoring of HeuristicLab.Core and related plugins (#95)

Location:
trunk/sources/HeuristicLab.Core/3.3/Interfaces
Files:
4 added
9 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Core/3.3/Interfaces/IEngine.cs

    r2474 r2653  
    3535    /// Gets the operator graph of the current instance.
    3636    /// </summary>
    37     IOperatorGraph OperatorGraph { get; }
     37    OperatorGraph OperatorGraph { get; set; }
    3838    /// <summary>
    3939    /// Gets the global scope of the current instance.
    4040    /// </summary>
    41     IScope GlobalScope { get; }
     41    Scope GlobalScope { get; }
    4242
    4343    /// <summary>
     
    5151    bool Running { get; }
    5252    /// <summary>
    53     /// Gets information whether the engine is canceled.
    54     /// </summary>
    55     bool Canceled { get; }
    56     /// <summary>
    5753    /// Gets information whether the engine has already terminated.
    5854    /// </summary>
    59     bool Terminated { get; }
     55    bool Finished { get; }
    6056
     57    /// <summary>
     58    /// Resets the current instance.
     59    /// </summary>
     60    void Initialize();
    6161    /// <summary>
    6262    /// Executes the whole run.
    6363    /// </summary>
    64     void Execute();
     64    void Start();
    6565    /// <summary>
    6666    /// Executes one step (one operation).
    6767    /// </summary>
    68     void ExecuteStep();
    69     /// <summary>
    70     /// Executes the given number of steps.
    71     /// </summary>
    72     /// <param name="steps">The number of steps to execute.</param>
    73     void ExecuteSteps(int steps);
     68    void Step();
    7469    /// <summary>
    7570    /// Aborts the engine run.
    7671    /// </summary>
    77     void Abort();
    78     /// <summary>
    79     /// Resets the current instance.
    80     /// </summary>
    81     void Reset();
     72    void Stop();
    8273
    83     /// <summary>
    84     /// Occurs when the current instance is initialized.
    85     /// </summary>
    86     event EventHandler Initialized;
    87     /// <summary>
    88     /// Occurs when an operation is executed.
    89     /// </summary>
    90     event EventHandler<EventArgs<IOperation>> OperationExecuted;
    91     /// <summary>
    92     /// Occurs when an exception was thrown.
    93     /// </summary>
    94     event EventHandler<EventArgs<Exception>> ExceptionOccurred;
     74    event EventHandler OperatorGraphChanged;
    9575    /// <summary>
    9676    /// Occurs when the execution time was changed.
     
    9878    event EventHandler ExecutionTimeChanged;
    9979    /// <summary>
     80    /// Occurs when the engine is initialized.
     81    /// </summary>
     82    event EventHandler Initialized;
     83    /// <summary>
     84    /// Occurs when the engine is executed.
     85    /// </summary>
     86    event EventHandler Started;
     87    /// <summary>
    10088    /// Occurs when the engine is finished.
    10189    /// </summary>
    102     event EventHandler Finished;
     90    event EventHandler Stopped;
     91    /// <summary>
     92    /// Occurs when an exception was thrown.
     93    /// </summary>
     94    event EventHandler<EventArgs<Exception>> ExceptionOccurred;
    10395  }
    10496}
  • trunk/sources/HeuristicLab.Core/3.3/Interfaces/IItem.cs

    r2546 r2653  
    2222using System;
    2323using System.Collections.Generic;
     24using System.ComponentModel;
    2425using System.Text;
    2526using System.Drawing;
     
    2930  /// Interface to represent (almost) every HeuristicLab object (an object, an operator,...).
    3031  /// </summary>
    31   public interface IItem : ICloneable {
    32     string Name { get; }
    33     string Description { get; }
    34     Image Image { get; }
     32  public interface IItem : IDeepCloneable {
     33    string ItemName { get; }
     34    string ItemDescription { get; }
     35    Image ItemImage { get; }
    3536
    36     /// <summary>
    37     /// Creates a deep clone of this item.
    38     /// </summary>
    39     /// <param name="cloner">The cloner which is responsible for keeping track of all already
    40     /// cloned objects.</param>
    41     /// <returns>A clone of this instance.</returns>
    42     IItem Clone(ICloner cloner);
    43 
    44     /// <summary>
    45     /// Fires a new <c>Changed</c> event.
    46     /// </summary>
    47     void FireChanged();
    48 
    49     /// <summary>
    50     /// Occurs when the current instance has changed.
    51     /// </summary>
    52     event EventHandler Changed;
     37    event ChangedEventHandler Changed;
    5338  }
    5439}
  • trunk/sources/HeuristicLab.Core/3.3/Interfaces/IOperator.cs

    r2524 r2653  
    2424using System.Text;
    2525using HeuristicLab.Common;
     26using HeuristicLab.Collections;
    2627
    2728namespace HeuristicLab.Core {
     
    3031  /// a basic instruction of an algorithm.
    3132  /// </summary>
    32   public interface IOperator : IItem {
    33     /// <summary>
    34     /// Gets or sets the name of the current instance.
    35     /// </summary>
    36     string Name { get; set; }
    37     /// <summary>
    38     /// Gets or sets the description of the current instance.
    39     /// </summary>
    40     string Description { get; }
     33  public interface IOperator : INamedItem {
     34    IObservableKeyedCollection<string, IParameter> Parameters { get; }
    4135
    42     /// <summary>
    43     /// Gets information whether the current operator has been canceled.
    44     /// </summary>
    45     bool Canceled { get; }
    4636    /// <summary>
    4737    /// Gets or sets a boolean value whether the engine should stop here during the run.
     
    5040
    5141    /// <summary>
    52     /// Gets a list of all sub operators.
    53     /// </summary>
    54     IList<IOperator> SubOperators { get; }
    55     /// <summary>
    56     /// Gets a collection of all variable (parameter) infos.
    57     /// </summary>
    58     ICollection<IVariableInfo> VariableInfos { get; }
    59     /// <summary>
    60     /// Gets a collection of all variables of the current operator.
    61     /// </summary>
    62     ICollection<IVariable> Variables { get; }
    63 
    64     /// <summary>
    65     /// Adds the given sub operator to the current instance.
    66     /// </summary>
    67     /// <param name="op">The operator to add.</param>
    68     void AddSubOperator(IOperator op);
    69     /// <summary>
    70     /// Adds the given sub operator at a the specified <paramref name="index"/>.
    71     /// </summary>
    72     /// <param name="op">The operator to add.</param>
    73     /// <param name="index">The position where to add the operator.</param>
    74     void AddSubOperator(IOperator op, int index);
    75     /// <summary>
    76     /// Removes a sub operator at the specified <paramref name="index"/>.
    77     /// </summary>
    78     /// <param name="index">The position where to delete the operator.</param>
    79     void RemoveSubOperator(int index);
    80 
    81     /// <summary>
    82     /// Gets the variable info with the given <paramref name="formalName"/>.
    83     /// </summary>
    84     /// <param name="formalName">The formal name of the variable info.</param>
    85     /// <returns>The variable info with the specified formal name.</returns>
    86     IVariableInfo GetVariableInfo(string formalName);
    87     /// <summary>
    88     /// Adds the specified variable info to the current instance.
    89     /// </summary>
    90     /// <param name="variableInfo">The variable info to add.</param>
    91     void AddVariableInfo(IVariableInfo variableInfo);
    92     /// <summary>
    93     /// Removes the variable info with the given formal name.
    94     /// </summary>
    95     /// <param name="formalName">The formal name of the variable info to remove.</param>
    96     void RemoveVariableInfo(string formalName);
    97 
    98     /// <summary>
    99     /// Gets a variable with the given <paramref name="name"/>.
    100     /// </summary>
    101     /// <param name="name">The name of the variable.</param>
    102     /// <returns>The variable with the specified name.</returns>
    103     IVariable GetVariable(string name);
    104     /// <summary>
    105     /// Adds the specified <paramref name="variable"/> to the current instance.
    106     /// </summary>
    107     /// <param name="variable">The variable to add.</param>
    108     void AddVariable(IVariable variable);
    109     /// <summary>
    110     /// Deletes the variable with the specified <paramref name="name"/>.
    111     /// </summary>
    112     /// <param name="name">The name of the variable to delete.</param>
    113     void RemoveVariable(string name);
    114 
    115     /// <inheritdoc cref="GetVariableValue(string, HeuristicLab.Core.IScope, bool)"/>
    116     /// <typeparam name="T">The type of the value that is searched.</typeparam>       
    117     T GetVariableValue<T>(string formalName, IScope scope, bool recursiveLookup) where T : class, IItem;
    118     /// <inheritdoc cref="GetVariableValue(string, HeuristicLab.Core.IScope, bool, bool)"/>
    119     /// <typeparam name="T">The type of the value that is searched.</typeparam>
    120     T GetVariableValue<T>(string formalName, IScope scope, bool recursiveLookup, bool throwOnError) where T : class, IItem;
    121     /// <inheritdoc cref="GetVariableValue(System.String, IScope, bool, bool)"
    122     /// select="summary"/>
    123     /// <param name="formalName">The formal name of the variable info whose variable value is searched.</param>
    124     /// <param name="scope">The scope where to look for the variable.</param>
    125     /// <param name="recursiveLookup">Boolean value, whether also the parent scopes shall be searched if
    126     /// the variable is not found in the specified <paramref name="scope"/>.</param>
    127     /// <returns>The value of the searched variable or null if it is not found.</returns>
    128     IItem GetVariableValue(string formalName, IScope scope, bool recursiveLookup);
    129     /// <summary>
    130     /// Gets the value of the variable in the specified <paramref name="scope"/>
    131     /// whose variable(parameter) info has the specified <paramref name="formalName"/>.
    132     /// </summary>
    133     /// <param name="formalName">The formal name of the variable info whose variable value is searched.</param>
    134     /// <param name="scope">The scope where to look for the variable.</param>
    135     /// <param name="recursiveLookup">Boolean value, whether also the parent scopes shall be searched if
    136     /// the variable is not found in the specified <paramref name="scope"/>.</param>
    137     /// <param name="throwOnError">Boolean value, whether an exception shall be thrown, if the variable
    138     /// cannot be found or just <c>null</c> shall be returned.</param>
    139     /// <returns>The value of the searched variable (or null if the variable is not
    140     /// found and <paramref name="throwOnError"/> is set to false).</returns>
    141     IItem GetVariableValue(string formalName, IScope scope, bool recursiveLookup, bool throwOnError);
    142 
    143     /// <summary>
    14442    /// Executes the current instance on the specified <paramref name="scope"/>.
    14543    /// </summary>
    14644    /// <param name="scope">The scope where to execute the current instance.</param>
    14745    /// <returns>The next operation.</returns>
    148     IOperation Execute(IScope scope);
     46    ExecutionContextCollection Execute(ExecutionContext context);
    14947    /// <summary>
    15048    /// Aborts the current operator.
     
    15351
    15452    /// <summary>
    155     /// Occurs when the name of the operator was changed.
    156     /// </summary>
    157     event EventHandler NameChanged;
    158     /// <summary>
    15953    /// Occurs when the breakpoint flag of the current instance was changed.
    16054    /// </summary>
    16155    event EventHandler BreakpointChanged;
    162     /// <summary>
    163     /// Occurs when a sub operator has been added.
    164     /// </summary>
    165     event EventHandler<EventArgs<IOperator, int>> SubOperatorAdded;
    166     /// <summary>
    167     /// Occurs when a sub operator has been deleted.
    168     /// </summary>
    169     event EventHandler<EventArgs<IOperator, int>> SubOperatorRemoved;
    170     /// <summary>
    171     /// Occurs when a variable info has been added.
    172     /// </summary>
    173     event EventHandler<EventArgs<IVariableInfo>> VariableInfoAdded;
    174     /// <summary>
    175     /// Occurs when a variable info has been deleted.
    176     /// </summary>
    177     event EventHandler<EventArgs<IVariableInfo>> VariableInfoRemoved;
    178     /// <summary>
    179     /// Occurs when a variable has been added.
    180     /// </summary>
    181     event EventHandler<EventArgs<IVariable>> VariableAdded;
    182     /// <summary>
    183     /// Occurs when a variable has been deleted.
    184     /// </summary>
    185     event EventHandler<EventArgs<IVariable>> VariableRemoved;
    18656    /// <summary>
    18757    /// Occurs when the current instance is executed.
Note: See TracChangeset for help on using the changeset viewer.