Class ShopAgent


  • public class ShopAgent
    extends java.lang.Object
    Micro agent implementation of the shop.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected IInternalAccess agent
      The agent.
      protected double money
      The 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.
      ItemInfo buyItem​(java.lang.String name, double price)
      Buy an item.
      ItemInfo[] getCatalog()
      Get the item catalog.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • money

        protected double money
        The money account.
    • Constructor Detail

      • ShopAgent

        public ShopAgent()
    • 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.