|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectadapter.BehaviorAdapter
public class BehaviorAdapter
| Constructor Summary | |
|---|---|
BehaviorAdapter(epfl.lia.logist.agent.behavior.Behavior behavior)
|
|
| 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)
lastWinner and lastWinner contain the results of the previous auction, except during the first auction when lastWinner == false and lastWinner == null |
java.util.List<Plan> |
plan(java.util.List<VehicleInfo> vehicles,
TaskSet tasks)
|
void |
setup(Topology topology,
TaskDistribution distribution,
AgentInfo agent)
The setup method is called exactly once, before the simulation starts and before any other method is called. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public BehaviorAdapter(epfl.lia.logist.agent.behavior.Behavior behavior)
| Method Detail |
|---|
public java.lang.Long askPrice(Task task)
AuctionBehaviorThis 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.
askPrice in interface AuctionBehaviortask - the task being auctioned
AgentInfo.id()
public void auctionResult(Task lastTask,
int lastWinner,
java.lang.Long[] lastOffers)
AuctionBehavior
auctionResult in interface AuctionBehaviorlastTask - 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.AgentInfo.id()
public java.util.List<Plan> plan(java.util.List<VehicleInfo> vehicles,
TaskSet tasks)
plan in interface AuctionBehavior
public void setup(Topology topology,
TaskDistribution distribution,
AgentInfo agent)
AuctionBehaviorThe agent argument allows you to access important information about your agent, most notably:
AgentInfo.vehicles() the list of vehicles
controlled by the agentAgentInfo.getTasks() the set of tasks that the
agent has won so far
setup in interface AuctionBehaviortopology - the topology of the simulationdistribution - the task distribution of the simulationagent - the properties of the agent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||