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

jadex.bdi.examples.cleanerworld_classic.cleaner.RemoteDropWasteActionPlan Maven / Gradle / Ivy

Go to download

The Jadex BDI applications package contain several example applications, benchmarks and testcases using BDI agents.

There is a newer version: 2.4
Show newest version
package jadex.bdi.examples.cleanerworld_classic.cleaner;

import jadex.bdi.examples.cleanerworld_classic.RequestDropWaste;
import jadex.bdi.examples.cleanerworld_classic.Waste;
import jadex.bdi.examples.cleanerworld_classic.Wastebin;
import jadex.bdi.runtime.PlanFailureException;

/**
 *  Pick up a piece of waste in the environment.
 */
public class RemoteDropWasteActionPlan extends RemoteActionPlan
{
	//-------- methods --------

	/**
	 *  The plan body.
	 */
	public void body()
	{
		Waste waste = (Waste)getParameter("waste").getValue();
		Wastebin wastebin = (Wastebin)getParameter("wastebin").getValue();

		// Search and store the environment agent.
		if(getBeliefbase().getBelief("environmentagent").getFact()==null)
			searchEnvironmentAgent();
		if(getBeliefbase().getBelief("environmentagent").getFact()==null)
			throw new PlanFailureException();

		RequestDropWaste rd = new RequestDropWaste();
		rd.setWaste(waste);
		rd.setWastebinname(wastebin.getName());
		requestAction(rd);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy