
jadex.bdi.examples.blackjack.player.PlayerDeclineGamePlan 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.
The newest version!
package jadex.bdi.examples.blackjack.player;
import jadex.bdi.runtime.IMessageEvent;
import jadex.bdi.runtime.Plan;
import jadex.bridge.fipa.SFipa;
/**
* This plan is executed when the agent wants to decline a game.
*/
public class PlayerDeclineGamePlan extends Plan
{
//-------- constructors --------
/**
* Create a new plan.
*/
public PlayerDeclineGamePlan()
{
getLogger().info("created: " + this);
}
//-------- attributes --------
/**
* Execute a plan.
*/
public void body()
{
IMessageEvent querybet = (IMessageEvent)getReason();
// Reply to dealer.
IMessageEvent msg = getEventbase().createReply(querybet, "refuse_bet");
msg.getParameter(SFipa.CONTENT).setValue(querybet.getParameter(SFipa.CONTENT).getValue());
getLogger().info("sending decline to the dealer...");
sendMessage(msg);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy