Package jadex.bdi.booktrading
Class SellerAgent
java.lang.Object
jadex.bdi.booktrading.SellerAgent
- All Implemented Interfaces:
IBuyBookService
,INegotiationAgent
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclass
class
class
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjadex.future.IFuture
<Void> acceptProposal
(String title, int price) Buy a bookvoid
body()
The agent body.jadex.future.IFuture
<Integer> callForProposal
(String title) Ask the seller for a a quote on a book.void
createGoal
(Order order) Create a purchase or sell oder.protected void
jadex.core.IComponent
getAgent()
Get the agent.getGoals()
Get all purchase or sell goals.Get all orders.getReports
(Order order) Get all reports.protected long
getTime()
Get the current time.protected void
void
shutdown()
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:INegotiationAgent
Get all orders.- Specified by:
getOrders
in 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:
callForProposal
in interfaceIBuyBookService
- Parameters:
title
- The book title.- Returns:
- The price.
-
acceptProposal
Buy a book- Specified by:
acceptProposal
in 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:
getAgent
in interfaceINegotiationAgent
- Returns:
- The agent.
-
createGoal
Create a purchase or sell oder.- Specified by:
createGoal
in interfaceINegotiationAgent
-
getGoals
Get all purchase or sell goals.- Specified by:
getGoals
in interfaceINegotiationAgent
-
getReports
Get all reports.- Specified by:
getReports
in interfaceINegotiationAgent
-