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[]
breakpointcommands
The breakpoint commands.protected java.util.Set
breakpoints
The breakpoints (i.e. rules that set the interpreter to step mode, when activated).protected boolean
dostep
Flag indicating that a single step should be performed.protected Executor
executor
The executor.protected RuleSystem
rulesystem
The agenda.protected boolean
stepmode
The 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 void
addBreakpoint(java.lang.Object rule)
Add a breakpoint to the interpreter.void
addBreakpointCommand(ICommand command)
Add a command to be executed, when a breakpoint is reached.void
doStep()
Execute a step.RuleSystem
getRulesystem()
Get the rule system.boolean
isBreakpoint(java.lang.Object rule)
Check if a rule is a breakpoint for the interpreter.boolean
isStepmode()
Test if in stepmode.void
removeBreakpoint(java.lang.Object rule)
Remove a breakpoint from the interpreter.void
setStepmode(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:
doStep
in interfaceISteppable
-
setStepmode
public void setStepmode(boolean stepmode)
Set the stepmode.- Specified by:
setStepmode
in interfaceISteppable
- Parameters:
stepmode
- True for stepmode.
-
isStepmode
public boolean isStepmode()
Test if in stepmode.- Specified by:
isStepmode
in interfaceISteppable
- Returns:
- True, if in stepmode.
-
addBreakpoint
public void addBreakpoint(java.lang.Object rule)
Add a breakpoint to the interpreter.- Specified by:
addBreakpoint
in interfaceISteppable
-
removeBreakpoint
public void removeBreakpoint(java.lang.Object rule)
Remove a breakpoint from the interpreter.- Specified by:
removeBreakpoint
in interfaceISteppable
-
isBreakpoint
public boolean isBreakpoint(java.lang.Object rule)
Check if a rule is a breakpoint for the interpreter.- Specified by:
isBreakpoint
in interfaceISteppable
-
addBreakpointCommand
public void addBreakpointCommand(ICommand command)
Add a command to be executed, when a breakpoint is reached.- Specified by:
addBreakpointCommand
in interfaceISteppable
-
getRulesystem
public RuleSystem getRulesystem()
Get the rule system.- Returns:
- The rule system.
-
-