Jadex 0.941

jadex.runtime
Class JavaMobilePlanExecutor

java.lang.Object
  extended byjadex.runtime.JavaMobilePlanExecutor
All Implemented Interfaces:
IPlanExecutor, Serializable

public class JavaMobilePlanExecutor
extends Object
implements IPlanExecutor, Serializable

A plan executor for JADE-behaviour style plans (with action method called for each step). Plan bodies have to inherit from @link{MobilePlan}.

See Also:
Serialized Form

Constructor Summary
JavaMobilePlanExecutor()
          Create a new threadbased plan executor.
 
Method Summary
 Object createPlanBody(jadex.runtime.impl.RPlan plan)
          Create the body of a plan.
 boolean executePlanStep(jadex.runtime.impl.RPlan plan)
          Execute a step of a plan.
 Thread getExecutionThread(jadex.runtime.impl.RPlan rplan)
          Get the executing thread of a plan.
 void interruptPlanStep(jadex.runtime.impl.RPlan plan)
          Interrupt a plan step during execution.
 void terminatePlan(jadex.runtime.impl.RPlan rplan)
          Called on termination of a plan.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaMobilePlanExecutor

public JavaMobilePlanExecutor()
Create a new threadbased plan executor.

Method Detail

createPlanBody

public Object createPlanBody(jadex.runtime.impl.RPlan plan)
                      throws Exception
Create the body of a plan.

Specified by:
createPlanBody in interface IPlanExecutor
Parameters:
plan - The plan.
Returns:
The created body. May throw any kind of exception, when the body creation fails
Throws:
Exception

executePlanStep

public boolean executePlanStep(jadex.runtime.impl.RPlan plan)
                        throws Exception
Execute a step of a plan. Executing a step should cause the latest event to be handled. Will be called by the scheduler for every event to be handled. May throw any kind of exception, when the plan execution fails

Specified by:
executePlanStep in interface IPlanExecutor
Returns:
True, if plan was interrupted (micro plan step).
Throws:
Exception

interruptPlanStep

public void interruptPlanStep(jadex.runtime.impl.RPlan plan)
Interrupt a plan step during execution. The plan is requested to stop the execution to allow consequences of performed plan actions (like belief changes) taking place. If the method is not implemented the plan step will be NOT be interrupted.

Specified by:
interruptPlanStep in interface IPlanExecutor

terminatePlan

public void terminatePlan(jadex.runtime.impl.RPlan rplan)
Called on termination of a plan. Free all associated ressources, stop threads, etc.

Specified by:
terminatePlan in interface IPlanExecutor

getExecutionThread

public Thread getExecutionThread(jadex.runtime.impl.RPlan rplan)
Get the executing thread of a plan.

Specified by:
getExecutionThread in interface IPlanExecutor
Parameters:
rplan - The plan.
Returns:
The executing thread (if any).

Jadex 0.941

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2005 Lars Braubach, Alexander Pokahr, Andrzej Walczak - University of Hamburg. Use is subject to license terms.