Package jadex.examples.shop
Class ShopAgent
- java.lang.Object
-
- jadex.examples.shop.ShopAgent
-
public class ShopAgent extends java.lang.ObjectMicro agent implementation of the shop.
-
-
Field Summary
Fields Modifier and Type Field Description protected IInternalAccessagentThe agent.protected doublemoneyThe money account.
-
Constructor Summary
Constructors Constructor Description ShopAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IFuture<java.lang.Void>agentCreated()Called once after agent creation.ItemInfobuyItem(java.lang.String name, double price)Buy an item.ItemInfo[]getCatalog()Get the item catalog.
-
-
-
Field Detail
-
agent
protected IInternalAccess agent
The agent.
-
money
protected double money
The money account.
-
-
Method Detail
-
agentCreated
public IFuture<java.lang.Void> agentCreated()
Called once after agent creation.
-
buyItem
public ItemInfo buyItem(java.lang.String name, double price)
Buy an item.- Parameters:
item- The item.
-
getCatalog
public ItemInfo[] getCatalog()
Get the item catalog.- Returns:
- The catalog.
-
-