
jadex.bdi.examples.disastermanagement.commander.ExtinguishFirePlan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-bdi Show documentation
Show all versions of jadex-applications-bdi Show documentation
The Jadex BDI applications package contain
several example applications, benchmarks and
testcases using BDI agents.
The newest version!
package jadex.bdi.examples.disastermanagement.commander;
import jadex.bdi.examples.disastermanagement.IExtinguishFireService;
import jadex.bdi.runtime.Plan;
import jadex.commons.future.ITerminableFuture;
import jadex.extension.envsupport.environment.ISpaceObject;
/**
*
*/
public class ExtinguishFirePlan extends Plan
{
protected ITerminableFuture ef;
/**
* The body method is called on the
* instantiated plan instance from the scheduler.
*/
public void body()
{
ISpaceObject disaster = (ISpaceObject)getParameter("disaster").getValue();
IExtinguishFireService force = (IExtinguishFireService)getParameter("rescueforce").getValue();
ef = force.extinguishFire(disaster);
ef.get(this);
}
/**
* Called when the plan is aborted.
*/
public void aborted()
{
if(ef!=null)
{
ef.terminate();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy