Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/17/10 05:24:03 (14 years ago)
Author:
swagner
Message:

Operator architecture refactoring (#95)

  • corrected several bugs in order to get SGA working
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.SequentialEngine/3.3/SequentialEngine.cs

    r2790 r2818  
    6262        for (int i = coll.Count - 1; i >= 0; i--)
    6363          ExecutionStack.Push(coll[i]);
    64         next = ExecutionStack.Pop();
     64        next = ExecutionStack.Count > 0 ? ExecutionStack.Pop() : null;
    6565        coll = next as ExecutionContextCollection;
    6666      }
    6767      ExecutionContext context = next as ExecutionContext;
    68       try {
    69         currentOperator = context.Operator;
    70         ExecutionStack.Push(context.Operator.Execute(context));
    71         currentOperator = null;
     68      if (context != null) {
     69        try {
     70          currentOperator = context.Operator;
     71          ExecutionStack.Push(context.Operator.Execute(context));
     72          currentOperator = null;
     73        }
     74        catch (Exception ex) {
     75          ExecutionStack.Push(context);
     76          Stop();
     77          OnExceptionOccurred(ex);
     78        }
     79        if (context.Operator.Breakpoint)
     80          Stop();
    7281      }
    73       catch (Exception ex) {
    74         ExecutionStack.Push(context);
    75         Stop();
    76         OnExceptionOccurred(ex);
    77       }
    78       if (context.Operator.Breakpoint)
    79         Stop();
    8082    }
    8183  }
Note: See TracChangeset for help on using the changeset viewer.