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

jadex.bdi.examples.moneypainter.PrintRichPlan 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.moneypainter;

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

/**
 * 
 */
public class PrintRichPlan extends Plan
{
	/**
	 * 
	 */
	public void body()
	{
		int mon = ((Integer)getBeliefbase().getBelief("money").getFact()).intValue();
		int target = ((Integer)getBeliefbase().getBelief("target").getFact()).intValue();
		
		if(((IGoal)getReason()).isSucceeded())
		{
			System.out.println("Now I am rich as I have made "+mon+" euros.");
		}
		else
		{
			System.out.println("I have made only "+mon+" euros, planned were "+target);
		}
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy