Class BuyerAgent
- java.lang.Object
-
- jadex.bdiv3.examples.booktrading.buyer.BuyerAgent
-
- All Implemented Interfaces:
INegotiationAgent
public class BuyerAgent extends java.lang.Object implements INegotiationAgent
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
BuyerAgent.PurchaseBook
-
Field Summary
Fields Modifier and Type Field Description protected IInternalAccess
agent
protected Future<Gui>
gui
protected java.util.List<NegotiationReport>
reports
-
Constructor Summary
Constructors Constructor Description BuyerAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
body()
The agent body.void
createGoal(Order order)
Create a purchase or sell oder.protected void
generateNegotiationReport(Order order, Tuple2<IBuyBookService,java.lang.Integer>[] proposals, double acceptable_price)
Generate and add a negotiation report.IInternalAccess
getAgent()
Get the agent.java.util.Collection<INegotiationGoal>
getGoals()
Get all purchase or sell goals.java.util.List<Order>
getOrders()
Get all orders.java.util.List<NegotiationReport>
getReports(Order order)
Get all reports.protected long
getTime()
Get the current time.protected void
purchaseBook(BuyerAgent.PurchaseBook goal)
void
shutdown()
Called when agent terminates.
-
-
-
Field Detail
-
agent
protected IInternalAccess agent
-
reports
protected java.util.List<NegotiationReport> reports
-
-
Method Detail
-
body
public void body()
The agent body.
-
shutdown
public void shutdown()
Called when agent terminates.
-
getOrders
public java.util.List<Order> getOrders()
Description copied from interface:INegotiationAgent
Get all orders.- Specified by:
getOrders
in interfaceINegotiationAgent
-
getTime
protected long getTime()
Get the current time.
-
purchaseBook
protected void purchaseBook(BuyerAgent.PurchaseBook goal)
-
generateNegotiationReport
protected void generateNegotiationReport(Order order, Tuple2<IBuyBookService,java.lang.Integer>[] proposals, double acceptable_price)
Generate and add a negotiation report.
-
getAgent
public IInternalAccess getAgent()
Get the agent.- Specified by:
getAgent
in interfaceINegotiationAgent
- Returns:
- The agent.
-
createGoal
public void createGoal(Order order)
Create a purchase or sell oder.- Specified by:
createGoal
in interfaceINegotiationAgent
-
getGoals
public java.util.Collection<INegotiationGoal> getGoals()
Get all purchase or sell goals.- Specified by:
getGoals
in interfaceINegotiationAgent
-
getReports
public java.util.List<NegotiationReport> getReports(Order order)
Get all reports.- Specified by:
getReports
in interfaceINegotiationAgent
-
-