Free cookie consent management tool by TermsFeed Policy Generator

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

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

Location:
trunk/sources/HeuristicLab.SequentialEngine/3.3
Files:
2 deleted
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.SequentialEngine/3.3/HeuristicLab.SequentialEngine-3.3.csproj

    r2546 r2656  
    7878    </Reference>
    7979    <Reference Include="System.Data" />
    80     <Reference Include="System.Drawing" />
    81     <Reference Include="System.Windows.Forms" />
    8280    <Reference Include="System.Xml" />
    8381  </ItemGroup>
     
    8684    <Compile Include="Properties\AssemblyInfo.cs" />
    8785    <Compile Include="SequentialEngine.cs" />
    88     <Compile Include="SequentialEngineView.cs">
    89       <SubType>UserControl</SubType>
    90     </Compile>
    91     <Compile Include="SequentialEngineView.Designer.cs">
    92       <DependentUpon>SequentialEngineView.cs</DependentUpon>
    93     </Compile>
    9486  </ItemGroup>
    9587  <ItemGroup>
     
    9890  </ItemGroup>
    9991  <ItemGroup>
    100     <ProjectReference Include="..\..\HeuristicLab.Core.Views\3.3\HeuristicLab.Core.Views-3.3.csproj">
    101       <Project>{E226881D-315F-423D-B419-A766FE0D8685}</Project>
    102       <Name>HeuristicLab.Core.Views-3.3</Name>
    103     </ProjectReference>
    10492    <ProjectReference Include="..\..\HeuristicLab.Core\3.3\HeuristicLab.Core-3.3.csproj">
    10593      <Project>{C36BD924-A541-4A00-AFA8-41701378DDC5}</Project>
    10694      <Name>HeuristicLab.Core-3.3</Name>
    107     </ProjectReference>
    108     <ProjectReference Include="..\..\HeuristicLab.MainForm.WindowsForms\3.2\HeuristicLab.MainForm.WindowsForms-3.2.csproj">
    109       <Project>{AB687BBE-1BFE-476B-906D-44237135431D}</Project>
    110       <Name>HeuristicLab.MainForm.WindowsForms-3.2</Name>
    111     </ProjectReference>
    112     <ProjectReference Include="..\..\HeuristicLab.MainForm\3.2\HeuristicLab.MainForm-3.2.csproj">
    113       <Project>{3BD61258-31DA-4B09-89C0-4F71FEF5F05A}</Project>
    114       <Name>HeuristicLab.MainForm-3.2</Name>
    11595    </ProjectReference>
    11696    <ProjectReference Include="..\..\HeuristicLab.Persistence\3.3\HeuristicLab.Persistence-3.3.csproj">
  • trunk/sources/HeuristicLab.SequentialEngine/3.3/HeuristicLabSequentialEnginePlugin.cs

    r2520 r2656  
    2929  /// Plugin class for HeuristicLab.SequentialEngine plugin.
    3030  /// </summary>
    31   [ClassInfo(Name = "HeuristicLab.SequentialEngine-3.3")]
    32   [PluginFile(Filename = "HeuristicLab.SequentialEngine-3.3.dll", Filetype = PluginFileType.Assembly)]
    33   [Dependency(Dependency = "HeuristicLab.Core-3.3")]
    34   [Dependency(Dependency = "HeuristicLab.Core.Views-3.3")]
    35   [Dependency(Dependency = "HeuristicLab.MainForm-3.2")]
    36   [Dependency(Dependency = "HeuristicLab.MainForm.WindowsForms-3.2")]
     31  [Plugin("HeuristicLab.SequentialEngine-3.3")]
     32  [PluginFile("HeuristicLab.SequentialEngine-3.3.dll", PluginFileType.Assembly)]
     33  [PluginDependency("HeuristicLab.Persistence-3.3")]
     34  [PluginDependency("HeuristicLab.Core-3.3")]
    3735  public class HeuristicLabSequentialEnginePlugin : PluginBase {
    3836  }
  • trunk/sources/HeuristicLab.SequentialEngine/3.3/SequentialEngine.cs

    r2546 r2656  
    2424using System.Text;
    2525using HeuristicLab.Core;
    26 using System.Threading;
    2726using HeuristicLab.Persistence.Default.CompositeSerializers.Storable;
    2827
     
    4342    /// <remarks>Calls <see cref="EngineBase.Abort"/> of base class <see cref="EngineBase"/> and
    4443    /// <see cref="IOperator.Abort"/> of the current <see cref="IOperator"/>.</remarks>
    45     public override void Abort() {
    46       base.Abort();
     44    public override void Stop() {
     45      base.Stop();
    4746      if (currentOperator != null)
    4847        currentOperator.Abort();
     
    5655    /// is pushed on the stack again.<br/>
    5756    /// If the execution was successful <see cref="EngineBase.OnOperationExecuted"/> is called.</remarks>
    58     protected override void ProcessNextOperation() {
    59       IOperation operation = myExecutionStack.Pop();
    60       if (operation is AtomicOperation) {
    61         AtomicOperation atomicOperation = (AtomicOperation)operation;
    62         IOperation next = null;
    63         try {
    64           currentOperator = atomicOperation.Operator;
    65           next = atomicOperation.Operator.Execute(atomicOperation.Scope);
    66         }
    67         catch (Exception ex) {
    68           // push operation on stack again
    69           myExecutionStack.Push(atomicOperation);
    70           Abort();
    71           ThreadPool.QueueUserWorkItem(delegate(object state) { OnExceptionOccurred(ex);});
    72         }
    73         if (next != null)
    74           myExecutionStack.Push(next);
    75         OnOperationExecuted(atomicOperation);
    76         if (atomicOperation.Operator.Breakpoint) Abort();
    77       } else if (operation is CompositeOperation) {
    78         CompositeOperation compositeOperation = (CompositeOperation)operation;
    79         for (int i = compositeOperation.Operations.Count - 1; i >= 0; i--)
    80           myExecutionStack.Push(compositeOperation.Operations[i]);
     57    protected override void ProcessNextOperator() {
     58      currentOperator = null;
     59      ExecutionContext context = ExecutionStack.Pop();
     60      ExecutionContextCollection next = null;
     61      try {
     62        currentOperator = context.Operator;
     63        next = context.Operator.Execute(context);
     64        currentOperator = null;
    8165      }
     66      catch (Exception ex) {
     67        ExecutionStack.Push(context);
     68        Stop();
     69        OnExceptionOccurred(ex);
     70      }
     71      if (next != null) {
     72        for (int i = next.Count - 1; i >= 0; i--)
     73          ExecutionStack.Push(next[i]);
     74      }
     75      if (context.Operator.Breakpoint)
     76        Stop();
    8277    }
    8378  }
Note: See TracChangeset for help on using the changeset viewer.