logist.behavior
Interface AuctionBehavior


public interface AuctionBehavior

The behavior of a decentralized agent that buys tasks through auction.

Author:
Robin Steiger

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

setup

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.

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

Parameters:
topology - The topology of the simulation
distribution - The task distribution of the simulation
agent - The properties of the agent

askPrice

java.lang.Long askPrice(Task task)
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.

Parameters:
task - the task being auctioned
Returns:
A bid for the task, or null
See Also:
Agent.id()

auctionResult

void auctionResult(Task lastTask,
                   int lastWinner,
                   java.lang.Long[] lastOffers)
lastTask and lastWinner contain the results of the previous auction.

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:
Agent.id()

plan

java.util.List<Plan> plan(java.util.List<Vehicle> vehicles,
                          TaskSet tasks)
Computes the joint plan for several vehicles.
The plans for each vehicle are returned as a list, in the same order than the vehicles. The agent can assume that no vehicle is carrying a task.

Parameters:
vehicles - The list of vehicles
tasks - The list of tasks to be handled
Returns:
The plans for each vehicle