Package jadex.rules.rulesystem
Class RuleSystemExecutor
- java.lang.Object
-
- jadex.rules.rulesystem.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 Summary
Fields Modifier and Type Field Description protected ICommand[]breakpointcommandsThe breakpoint commands.protected java.util.SetbreakpointsThe breakpoints (i.e. rules that set the interpreter to step mode, when activated).protected booleandostepFlag indicating that a single step should be performed.protected ExecutorexecutorThe executor.protected RuleSystemrulesystemThe agenda.protected booleanstepmodeThe stepmode flag.
-
Constructor Summary
Constructors Constructor Description RuleSystemExecutor(RuleSystem rulesystem, boolean stepmode)Executor for rule systems.RuleSystemExecutor(RuleSystem rulesystem, boolean stepmode, IThreadPool threadpool)Executor for rule systems.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddBreakpoint(java.lang.Object rule)Add a breakpoint to the interpreter.voidaddBreakpointCommand(ICommand command)Add a command to be executed, when a breakpoint is reached.voiddoStep()Execute a step.RuleSystemgetRulesystem()Get the rule system.booleanisBreakpoint(java.lang.Object rule)Check if a rule is a breakpoint for the interpreter.booleanisStepmode()Test if in stepmode.voidremoveBreakpoint(java.lang.Object rule)Remove a breakpoint from the interpreter.voidsetStepmode(boolean stepmode)Set the stepmode.
-
-
-
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:
doStepin interfaceISteppable
-
setStepmode
public void setStepmode(boolean stepmode)
Set the stepmode.- Specified by:
setStepmodein interfaceISteppable- Parameters:
stepmode- True for stepmode.
-
isStepmode
public boolean isStepmode()
Test if in stepmode.- Specified by:
isStepmodein interfaceISteppable- Returns:
- True, if in stepmode.
-
addBreakpoint
public void addBreakpoint(java.lang.Object rule)
Add a breakpoint to the interpreter.- Specified by:
addBreakpointin interfaceISteppable
-
removeBreakpoint
public void removeBreakpoint(java.lang.Object rule)
Remove a breakpoint from the interpreter.- Specified by:
removeBreakpointin interfaceISteppable
-
isBreakpoint
public boolean isBreakpoint(java.lang.Object rule)
Check if a rule is a breakpoint for the interpreter.- Specified by:
isBreakpointin interfaceISteppable
-
addBreakpointCommand
public void addBreakpointCommand(ICommand command)
Add a command to be executed, when a breakpoint is reached.- Specified by:
addBreakpointCommandin interfaceISteppable
-
getRulesystem
public RuleSystem getRulesystem()
Get the rule system.- Returns:
- The rule system.
-
-