Class RuleSystemExecutor

  • All Implemented Interfaces:
    ISteppable

    public class RuleSystemExecutor
    extends java.lang.Object
    implements ISteppable
    A rule system executor can execute rule systems on a separate thread.
    • Field Detail

      • stepmode

        protected boolean stepmode
        The stepmode flag.
      • dostep

        protected boolean dostep
        Flag indicating that a single step should be performed.
      • rulesystem

        protected RuleSystem rulesystem
        The agenda.
      • executor

        protected Executor executor
        The executor.
      • breakpoints

        protected java.util.Set breakpoints
        The breakpoints (i.e. rules that set the interpreter to step mode, when activated).
      • breakpointcommands

        protected ICommand[] breakpointcommands
        The breakpoint commands.
    • Constructor Detail

      • RuleSystemExecutor

        public RuleSystemExecutor​(RuleSystem rulesystem,
                                  boolean stepmode)
        Executor for rule systems.
      • RuleSystemExecutor

        public RuleSystemExecutor​(RuleSystem rulesystem,
                                  boolean stepmode,
                                  IThreadPool threadpool)
        Executor for rule systems.
    • Method Detail

      • doStep

        public void doStep()
        Execute a step.
        Specified by:
        doStep in interface ISteppable
      • setStepmode

        public void setStepmode​(boolean stepmode)
        Set the stepmode.
        Specified by:
        setStepmode in interface ISteppable
        Parameters:
        stepmode - True for stepmode.
      • isStepmode

        public boolean isStepmode()
        Test if in stepmode.
        Specified by:
        isStepmode in interface ISteppable
        Returns:
        True, if in stepmode.
      • addBreakpoint

        public void addBreakpoint​(java.lang.Object rule)
        Add a breakpoint to the interpreter.
        Specified by:
        addBreakpoint in interface ISteppable
      • removeBreakpoint

        public void removeBreakpoint​(java.lang.Object rule)
        Remove a breakpoint from the interpreter.
        Specified by:
        removeBreakpoint in interface ISteppable
      • isBreakpoint

        public boolean isBreakpoint​(java.lang.Object rule)
        Check if a rule is a breakpoint for the interpreter.
        Specified by:
        isBreakpoint in interface ISteppable
      • addBreakpointCommand

        public void addBreakpointCommand​(ICommand command)
        Add a command to be executed, when a breakpoint is reached.
        Specified by:
        addBreakpointCommand in interface ISteppable
      • getRulesystem

        public RuleSystem getRulesystem()
        Get the rule system.
        Returns:
        The rule system.