All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jadex.bdi.examples.disastermanagement.commander.ClearChemicalsPlan Maven / Gradle / Ivy

Go to download

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.IClearChemicalsService;
import jadex.bdi.runtime.Plan;
import jadex.commons.future.ITerminableFuture;
import jadex.extension.envsupport.environment.ISpaceObject;

/**
 * 
 */
public class ClearChemicalsPlan extends Plan
{
	protected ITerminableFuture	cc;
	
	/**
	 *  The body method is called on the
	 *  instantiated plan instance from the scheduler.
	 */
	public void	body()
	{
		ISpaceObject disaster = (ISpaceObject)getParameter("disaster").getValue();
		IClearChemicalsService force = (IClearChemicalsService)getParameter("rescueforce").getValue();
		cc	= force.clearChemicals(disaster);
		cc.get(this);
	}
	
	/**
	 *  Called when the plan is aborted.
	 */
	public void aborted()
	{
		if(cc!=null)
		{
			cc.terminate();
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy