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 classBuyerAgent.PurchaseBook
-
Field Summary
Fields Modifier and Type Field Description protected IInternalAccessagentprotected Future<Gui>guiprotected java.util.List<NegotiationReport>reports
-
Constructor Summary
Constructors Constructor Description BuyerAgent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbody()The agent body.voidcreateGoal(Order order)Create a purchase or sell oder.protected voidgenerateNegotiationReport(Order order, Tuple2<IBuyBookService,java.lang.Integer>[] proposals, double acceptable_price)Generate and add a negotiation report.IInternalAccessgetAgent()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 longgetTime()Get the current time.protected voidpurchaseBook(BuyerAgent.PurchaseBook goal)voidshutdown()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:INegotiationAgentGet all orders.- Specified by:
getOrdersin 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:
getAgentin interfaceINegotiationAgent- Returns:
- The agent.
-
createGoal
public void createGoal(Order order)
Create a purchase or sell oder.- Specified by:
createGoalin interfaceINegotiationAgent
-
getGoals
public java.util.Collection<INegotiationGoal> getGoals()
Get all purchase or sell goals.- Specified by:
getGoalsin interfaceINegotiationAgent
-
getReports
public java.util.List<NegotiationReport> getReports(Order order)
Get all reports.- Specified by:
getReportsin interfaceINegotiationAgent
-
-