jadex.bdi.examples.blackjack.manager.ManagerDealerRegisterPlan 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.examples.blackjack.manager;
import jadex.bdi.runtime.Plan;
import jadex.bridge.IComponentIdentifier;
/**
* Register at dealer, when dealer belief has changed.
*/
public class ManagerDealerRegisterPlan extends Plan
{
/**
* Execute a plan.
*/
public void body()
{
final IComponentIdentifier dealerAID = (IComponentIdentifier)getBeliefbase().getBelief("localDealerAID").getFact();
// final ManagerFrame gui = (ManagerFrame)getBeliefbase().getBelief("gui").getFact();
getLogger().info("Dealer-AID has changed " + dealerAID);
// new dealer found
/*if (dealerAID != null)
{
// // Send register message to the dealer.
// IMessageEvent register = createMessageEvent("dealer_register");
// register.getParameterSet(SFipa.RECEIVERS).addValue(dealerAID);
// getLogger().info("send registerAsTracker-Query to Dealer");
// sendMessage(register);
// AWTThread.
EventQueue.invokeLater(new Runnable()
{
public void run()
{
gui.setDealerLabels(dealerAID.getName(), null);
}
});
}
else // no dealer found
{
getLogger().info("No dealer in beliefbase, reset GUILabel");
// AWTThread.
EventQueue.invokeLater(new Runnable()
{
public void run()
{
gui.resetDealerLabels();
gui.setLocalDealerButtonMode(true);
}
});
}*/
}
}