|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AuctionBehavior
The behavior of a decentralized agent that buys tasks through auction.
| Method Summary | |
|---|---|
java.lang.Long |
askPrice(Task task)
Asks an agent to offer a price for a task. |
void |
auctionResult(Task lastTask,
int lastWinner,
java.lang.Long[] lastOffers)
lastTask and lastWinner contain the results of the previous auction. |
java.util.List<Plan> |
plan(java.util.List<Vehicle> vehicles,
TaskSet tasks)
Computes the joint plan for several vehicles. |
void |
setup(Topology topology,
TaskDistribution distribution,
Agent agent)
The setup method is called exactly once, before the simulation starts and before any other method is called. |
| Method Detail |
|---|
void setup(Topology topology,
TaskDistribution distribution,
Agent agent)
The agent argument allows you to access important information about your agent, most notably:
Agent.vehicles() the list of vehicles controlled
by the agentAgent.getTasks() the set of tasks that the agent
has accepted but not yet delivered
topology - The topology of the simulationdistribution - The task distribution of the simulationagent - The properties of the agentjava.lang.Long askPrice(Task task)
This method is called for each task that is auctioned. The agent should return the amount of money it would like to receive for that task. If the agent wins the auction the reward of the task will be set to the agent's price and the agent receives the task.
task - the task being auctioned
Agent.id()
void auctionResult(Task lastTask,
int lastWinner,
java.lang.Long[] lastOffers)
lastTask - the task that was auctionedlastWinner - the id of the agent who has won the previous auctionlastOffers - the price offers of all agents from the previous auction,
indexed by agent id. May contain null bids for agents
that did not participate.Agent.id()
java.util.List<Plan> plan(java.util.List<Vehicle> vehicles,
TaskSet tasks)
vehicles - The list of vehiclestasks - The list of tasks to be handled
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||