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

jadex.bdi.examples.blocksworld.ConfigureBlocksPlan 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.blocksworld;

import jadex.bdi.runtime.IGoal;
import jadex.bdi.runtime.Plan;

import java.awt.Color;
import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

/**
 *  Stack blocks according to the target configuration.
 */
public class ConfigureBlocksPlan	extends Plan
{
	//-------- methods --------

	/**
	 *  The plan body.
	 */
	public void body()
	{
		Table configuration	= (Table)getParameter("configuration").getValue();
//		getParameterSet("blocks").addValues(configuration.getAllBlocks());
		
		// Create set of blocks currently on the table.
		Table	table	= (Table)getBeliefbase().getBelief("table").getFact();
		Block[]	blocks	= table.getAllBlocks();
		Set	oldblocks	= new HashSet();
		for(int i=0; i




© 2015 - 2025 Weber Informatics LLC | Privacy Policy