Package jadex.bdi.booktrading
Class SellerAgent
java.lang.Object
jadex.bdi.booktrading.SellerAgent
- All Implemented Interfaces:
IBuyBookService,INegotiationAgent
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassclassclass -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjadex.future.IFuture<Void>acceptProposal(String title, int price) Buy a bookvoidbody()The agent body.jadex.future.IFuture<Integer>callForProposal(String title) Ask the seller for a a quote on a book.voidcreateGoal(Order order) Create a purchase or sell oder.protected voidjadex.core.IComponentgetAgent()Get the agent.getGoals()Get all purchase or sell goals.Get all orders.getReports(Order order) Get all reports.protected longgetTime()Get the current time.protected voidvoidshutdown()Called when agent terminates.
-
Field Details
-
agent
protected jadex.core.IComponent agent -
reports
-
gui
-
-
Constructor Details
-
SellerAgent
public SellerAgent()
-
-
Method Details
-
body
public void body()The agent body. -
shutdown
public void shutdown()Called when agent terminates. -
getOrders
Description copied from interface:INegotiationAgentGet all orders.- Specified by:
getOrdersin interfaceINegotiationAgent
-
getOrders
-
makeProposal
-
executeTask
-
getTime
protected long getTime()Get the current time. -
callForProposal
Ask the seller for a a quote on a book.- Specified by:
callForProposalin interfaceIBuyBookService- Parameters:
title- The book title.- Returns:
- The price.
-
acceptProposal
Buy a book- Specified by:
acceptProposalin interfaceIBuyBookService- Parameters:
title- The book title.price- The price to pay.- Returns:
- A future indicating if the transaction was successful.
-
getAgent
public jadex.core.IComponent getAgent()Get the agent.- Specified by:
getAgentin interfaceINegotiationAgent- Returns:
- The agent.
-
createGoal
Create a purchase or sell oder.- Specified by:
createGoalin interfaceINegotiationAgent
-
getGoals
Get all purchase or sell goals.- Specified by:
getGoalsin interfaceINegotiationAgent
-
getReports
Get all reports.- Specified by:
getReportsin interfaceINegotiationAgent
-