jadex.bdi.testcases.planlib.EAMakeProposalPlan Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jadex-applications-bdi Show documentation
Show all versions of jadex-applications-bdi Show documentation
The Jadex BDI applications package contain
several example applications, benchmarks and
testcases using BDI agents.
package jadex.bdi.testcases.planlib;
import jadex.bdi.runtime.Plan;
/**
* Decides if the actual price of the auction is acceptable.
*/
public class EAMakeProposalPlan extends Plan
{
/**
* The plan body.
*/
public void body()
{
Double maxprice = (Double)getBeliefbase().getBelief("max_price").getFact();
Double price = (Double)getParameter("cfp").getValue();
getParameter("accept").setValue(new Boolean(price.doubleValue() <= maxprice.doubleValue()));
}
}