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

jadex.bdi.testcases.planlib.DAMakeProposalPlan 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.testcases.planlib;

import jadex.bdi.runtime.Plan;


/**
 * Decides if the actual price of the auction is acceptable.
 */
public class DAMakeProposalPlan extends Plan
{
	/**
	 *  The plan body.
	 */
	public void body()
	{
		Double maxprice = (Double)getBeliefbase().getBelief("max_price").getFact();
		Double price = (Double)getParameter("cfp").getValue();
		Boolean accept = Boolean.valueOf(price.doubleValue() <= maxprice.doubleValue());
		//System.out.println(getAgentName()+" accept="+accept+" price="+price+" max="+maxprice);
		getParameter("accept").setValue(accept);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy