Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/10/10 03:39:02 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • worked on parameters and operators
Location:
trunk/sources/HeuristicLab.Core/3.3
Files:
5 edited
1 moved

Legend:

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

    r2757 r2773  
    9393    /// </summary>
    9494    [Storable]
    95     private Stack<IExecutionContext> executionStack;
     95    private Stack<IExecutionSequence> executionStack;
    9696    /// <summary>
    9797    /// Gets the current execution stack.
    9898    /// </summary>
    99     protected Stack<IExecutionContext> ExecutionStack {
     99    protected Stack<IExecutionSequence> ExecutionStack {
    100100      get { return executionStack; }
    101101    }
     
    135135    protected Engine() {
    136136      globalScope = new Scope("Global");
    137       executionStack = new Stack<IExecutionContext>();
     137      executionStack = new Stack<IExecutionSequence>();
    138138      OperatorGraph = new OperatorGraph();
    139139    }
     
    151151      clone.globalScope = (Scope)cloner.Clone(globalScope);
    152152      clone.executionTime = executionTime;
    153       IExecutionContext[] contexts = executionStack.ToArray();
     153      IExecutionSequence[] contexts = executionStack.ToArray();
    154154      for (int i = contexts.Length - 1; i >= 0; i--)
    155         clone.executionStack.Push((IExecutionContext)cloner.Clone(contexts[i]));
     155        clone.executionStack.Push((IExecutionSequence)cloner.Clone(contexts[i]));
    156156      clone.running = running;
    157157      clone.canceled = canceled;
  • trunk/sources/HeuristicLab.Core/3.3/ExecutionContext.cs

    r2757 r2773  
    2626
    2727namespace HeuristicLab.Core {
    28   public class ExecutionContext : DeepCloneable, IExecutionContext {
     28  public class ExecutionContext : DeepCloneable, IExecutionSequence {
    2929    [Storable]
    3030    private ExecutionContext parent;
  • trunk/sources/HeuristicLab.Core/3.3/ExecutionContextCollection.cs

    r2757 r2773  
    2828
    2929namespace HeuristicLab.Core {
    30   public class ExecutionContextCollection : DeepCloneable, IList<IExecutionContext>, IExecutionContext {
     30  public class ExecutionContextCollection : DeepCloneable, IList<IExecutionSequence>, IExecutionSequence {
    3131    [Storable]
    32     private IList<IExecutionContext> contexts;
     32    private IList<IExecutionSequence> contexts;
    3333
    3434    [Storable]
     
    4040
    4141    public ExecutionContextCollection() {
    42       contexts = new List<IExecutionContext>();
     42      contexts = new List<IExecutionSequence>();
    4343      parallel = false;
    4444    }
    45     public ExecutionContextCollection(IEnumerable<IExecutionContext> collection) {
    46       contexts = new List<IExecutionContext>(collection.Where(e => e != null));
     45    public ExecutionContextCollection(IEnumerable<IExecutionSequence> collection) {
     46      contexts = new List<IExecutionSequence>(collection.Where(e => e != null));
    4747      parallel = false;
    4848    }
    49     public ExecutionContextCollection(params IExecutionContext[] list) {
    50       contexts = new List<IExecutionContext>(list.Where(e => e != null));
     49    public ExecutionContextCollection(params IExecutionSequence[] list) {
     50      contexts = new List<IExecutionSequence>(list.Where(e => e != null));
    5151      parallel = false;
    5252    }
     
    5757      clone.parallel = parallel;
    5858      for (int i = 0; i < contexts.Count; i++)
    59         clone.contexts.Add((IExecutionContext)cloner.Clone(contexts[i]));
     59        clone.contexts.Add((IExecutionSequence)cloner.Clone(contexts[i]));
    6060      return clone;
    6161    }
    6262
    6363    #region IList<IExecutionContext> Members
    64     public int IndexOf(IExecutionContext item) {
     64    public int IndexOf(IExecutionSequence item) {
    6565      return contexts.IndexOf(item);
    6666    }
    67     public void Insert(int index, IExecutionContext item) {
     67    public void Insert(int index, IExecutionSequence item) {
    6868      if (item != null) contexts.Insert(index, item);
    6969    }
     
    7171      contexts.RemoveAt(index);
    7272    }
    73     public IExecutionContext this[int index] {
     73    public IExecutionSequence this[int index] {
    7474      get { return contexts[index]; }
    7575      set { if (value != null) contexts[index] = value; }
     
    7878
    7979    #region ICollection<IExecutionContext> Members
    80     public void Add(IExecutionContext item) {
     80    public void Add(IExecutionSequence item) {
    8181      if (item != null) contexts.Add(item);
    8282    }
     
    8484      contexts.Clear();
    8585    }
    86     public bool Contains(IExecutionContext item) {
     86    public bool Contains(IExecutionSequence item) {
    8787      return contexts.Contains(item);
    8888    }
    89     public void CopyTo(IExecutionContext[] array, int arrayIndex) {
     89    public void CopyTo(IExecutionSequence[] array, int arrayIndex) {
    9090      contexts.CopyTo(array, arrayIndex);
    9191    }
     
    9696      get { return contexts.IsReadOnly; }
    9797    }
    98     public bool Remove(IExecutionContext item) {
     98    public bool Remove(IExecutionSequence item) {
    9999      return contexts.Remove(item);
    100100    }
     
    102102
    103103    #region IEnumerable<IExecutionContext> Members
    104     public IEnumerator<IExecutionContext> GetEnumerator() {
     104    public IEnumerator<IExecutionSequence> GetEnumerator() {
    105105      return contexts.GetEnumerator();
    106106    }
  • trunk/sources/HeuristicLab.Core/3.3/HeuristicLab.Core-3.3.csproj

    r2757 r2773  
    104104    <Compile Include="ChangedEventArgs.cs" />
    105105    <None Include="HeuristicLabCorePlugin.cs.frame" />
    106     <Compile Include="Interfaces\IExecutionContext.cs" />
     106    <Compile Include="Interfaces\IExecutionSequence.cs" />
    107107    <Compile Include="Interfaces\IValueLookupParameter.cs" />
    108108    <Compile Include="Interfaces\IValueParameter.cs" />
  • trunk/sources/HeuristicLab.Core/3.3/Interfaces/IExecutionSequence.cs

    r2772 r2773  
    3030  /// Interface which represents an execution context.
    3131  /// </summary>
    32   public interface IExecutionContext : IDeepCloneable { }
     32  public interface IExecutionSequence : IDeepCloneable { }
    3333}
  • trunk/sources/HeuristicLab.Core/3.3/Interfaces/IOperator.cs

    r2757 r2773  
    4444    /// <param name="scope">The scope where to execute the current instance.</param>
    4545    /// <returns>The next operation.</returns>
    46     IExecutionContext Execute(ExecutionContext context);
     46    IExecutionSequence Execute(ExecutionContext context);
    4747    /// <summary>
    4848    /// Aborts the current operator.
Note: See TracChangeset for help on using the changeset viewer.