adapter
Class BehaviorAdapter

java.lang.Object
  extended by adapter.BehaviorAdapter
All Implemented Interfaces:
AuctionBehavior

public class BehaviorAdapter
extends java.lang.Object
implements AuctionBehavior


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

BehaviorAdapter

public BehaviorAdapter(epfl.lia.logist.agent.behavior.Behavior behavior)
Method Detail

askPrice

public java.lang.Long askPrice(Task task)
Description copied from interface: AuctionBehavior
Asks an agent to offer a price for a 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.

Specified by:
askPrice in interface AuctionBehavior
Parameters:
task - the task being auctioned
Returns:
A bid for the task, or null
See Also:
AgentInfo.id()

auctionResult

public void auctionResult(Task lastTask,
                          int lastWinner,
                          java.lang.Long[] lastOffers)
Description copied from interface: AuctionBehavior
lastWinner and lastWinner contain the results of the previous auction, except during the first auction when lastWinner == false and lastWinner == null

Specified by:
auctionResult in interface AuctionBehavior
Parameters:
lastTask - the task that was auctioned
lastWinner - the id of the agent who has won the previous auction
lastOffers - the price offers of all agents from the previous auction, indexed by agent id. May contain null bids for agents that did not participate.
See Also:
AgentInfo.id()

plan

public java.util.List<Plan> plan(java.util.List<VehicleInfo> vehicles,
                                 TaskSet tasks)
Specified by:
plan in interface AuctionBehavior

setup

public void setup(Topology topology,
                  TaskDistribution distribution,
                  AgentInfo agent)
Description copied from interface: AuctionBehavior
The setup method is called exactly once, before the simulation starts and before any other method is called.

The agent argument allows you to access important information about your agent, most notably:

Specified by:
setup in interface AuctionBehavior
Parameters:
topology - the topology of the simulation
distribution - the task distribution of the simulation
agent - the properties of the agent