fipaos.tutorial.emarkets.agent.seller.manufacturer
Class ManufacturerSellerAgent

fipaos.agent.FIPAOSAgent
  |
  +--fipaos.tutorial.emarkets.agent.SubscribingAgent
        |
        +--fipaos.tutorial.emarkets.agent.seller.SellerAgent
              |
              +--fipaos.tutorial.emarkets.agent.seller.manufacturer.ManufacturerSellerAgent

public class ManufacturerSellerAgent
extends SellerAgent
implements SellerAbility

This class represents a manufacturer that wishes to sell goods to a retail buyer


Inner classes inherited from class fipaos.agent.FIPAOSAgent
FIPAOSAgent.TopLevelHandlerTask

Fields inherited from class fipaos.agent.FIPAOSAgent
_registered_with, _state

Constructor Summary
ManufacturerSellerAgent(String platform_profile, String name, String owner)
          Constructs a ManufacturerSellerAgent

Method Summary
 NegotiationMessagecreateCounterProposal(String buyer_id, NegotiationMessage proposal)
          If the negotiation has not finished and this seller wishes to send a new round of cfp's then this method is called to create new cfp messages in reply to proposals from the buyers.
 NegotiationMessagecreateInitialCFP()
          Generates the initial call for proposals to the Retail Buyer agents
 voidevaluateBids()
          Algorithm to evaluate any received bids and decide whether a further iteration is needed
 voidinitialiseOfferEngine()
          initialises the offers engine
 static voidmain(String[] args)
          A main method to enable the agent to be run from the command line.
 synchronized voidshutdown()
          Attempts to unsubscribe from the market manager before shutting down the agent

Methods inherited from class fipaos.tutorial.emarkets.agent.seller.SellerAgent
dealWithEscrowProtocolFailure, dealWithEscrowProtocolInform, dealWithFIPASubscribeInform, dealWithFIPASubscribeRefuse, dealWithNegotiationProtocolPropose, doneEmarketsTimerTask, doneEscrowProtocolInitiatorHandlerTask, doneNegotiationProtocolInitiatorHandlerTask, getCredits, getItems, getTargetCredits, GUIClosed

Methods inherited from class fipaos.tutorial.emarkets.agent.SubscribingAgent
addAgent, doneFIPASubscribeInitiatorHandlerTask, doneFIPASubscribeInitiatorHandlerTask, getSubscribedWith, searchForAgents, subscribe, subscriberGUIClosed, unsubscribe

Methods inherited from class fipaos.agent.FIPAOSAgent
activate, forward, forward, getAID, getCurrentConversation, getHAP, getLocalAMS, getLocalAMSAID, getLocalDF, getLocalDFAID, getNewConversation, getOwnership, getPlatformProfile, getProfile, getState, isShutdown, notify, notify, notifyDone, notifyError, notifyMessageInEndedConversation, notifyMessageUndeliverable, notifyTimeout, sendNotUnderstood, sendNotUnderstood, setMessageSender, waitForPushLock

Constructor Detail

ManufacturerSellerAgent

public ManufacturerSellerAgent(String platform_profile, String name, String owner)
Constructs a ManufacturerSellerAgent
Parameters:
platform_profile - The location of the platform profile
name - The agent name
owner - The owner of this agent
Method Detail

createCounterProposal

public NegotiationMessage createCounterProposal(String buyer_id, NegotiationMessage proposal)
If the negotiation has not finished and this seller wishes to send a new round of cfp's then this method is called to create new cfp messages in reply to proposals from the buyers.
Parameters:
buyer_id - The buyer that sent this proposal
proposal - The proposal from the buyer containing the number of items that the buyer wishes to purchase, and the price per item they wish to pay
Returns: A new CFP containing a new price per item and number of items on offer to the buyer

createInitialCFP

public NegotiationMessage createInitialCFP()
Generates the initial call for proposals to the Retail Buyer agents
Returns: A NegotiationMessage that contains the number of items on offer to each buyer and the price per item

evaluateBids

public void evaluateBids()
Algorithm to evaluate any received bids and decide whether a further iteration is needed

initialiseOfferEngine

public void initialiseOfferEngine()
initialises the offers engine

main

public static void main(String[] args)
A main method to enable the agent to be run from the command line. The agent takes two command line parameters - the platform profile location, which is set up by the SetupFIPAOS.bat file to be in the system variable %PLATFORM%, and the agent name.
Parameters:
args. args[0] - = location of platform.profile args[1] = name to assign to this agent

shutdown

public synchronized void shutdown()
Attempts to unsubscribe from the market manager before shutting down the agent

Association Links

to Class fipaos.tutorial.emarkets.agent.seller.offer.OfferEngine

Reference to an OfferEngine that can be instantiated with any object that implements the OfferEngine interface