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

jadex.bdi.examples.marsworld_classic.producer.ProduceOrePlan 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.marsworld_classic.producer;

import jadex.bdi.examples.marsworld_classic.Target;
import jadex.bdi.runtime.IGoal;
import jadex.bdi.runtime.Plan;

/**
 *  Production of Ore is done by increasing the amount.
 */
public class ProduceOrePlan extends Plan
{
	//-------- constructors --------

	/**
	 *  Create a new plan.
	 */
	public ProduceOrePlan()
	{
		getLogger().info("Created: "+this);
	}

	//-------- methods --------

	/**
	 *  The Amount of Ore at the current location is increased.
	 */
	public void body()
	{
		// Get the target first.
		Target target = (Target)getParameter("target").getValue();

		IGoal go_dest = createGoal("move.move_dest");
		go_dest.getParameter("destination").setValue(target.getLocation());
		dispatchSubgoalAndWait(go_dest);

		int max = target.getOreCapacity();
		for(int i = 0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy