logist.task
Class DefaultTaskDistribution

java.lang.Object
  extended by logist.task.DefaultTaskDistribution
All Implemented Interfaces:
TaskDistribution

public class DefaultTaskDistribution
extends java.lang.Object
implements TaskDistribution

A task distribution and a task generator that are based on task frequencies.

Author:
Robin Steiger

Constructor Summary
DefaultTaskDistribution(Topology topology, java.util.Random random, double[][] f, double[][] r, double[][] w, double[] n)
           
 
Method Summary
 Task createTask()
           
 Task createTask(Topology.City from)
           
 TaskSet createTaskSet(int size)
           
 TaskSet createTaskSet(Task[] tasks)
           
 java.util.Random getRandom()
           
 double probability(Topology.City from, Topology.City to)
          Returns the probability that a task to to is available in city from.
 int reward(Topology.City from, Topology.City to)
          Returns the (expected) reward for a task between two cities.
 int weight(Topology.City from, Topology.City to)
          Returns the (expected) weight for a task between two cities.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTaskDistribution

public DefaultTaskDistribution(Topology topology,
                               java.util.Random random,
                               double[][] f,
                               double[][] r,
                               double[][] w,
                               double[] n)
Method Detail

probability

public double probability(Topology.City from,
                          Topology.City to)
Description copied from interface: TaskDistribution
Returns the probability that a task to to is available in city from. If to is null then the probability that there is no task available in city from is returned.

Specified by:
probability in interface TaskDistribution
Parameters:
from - the source of the task
to - the destination of the task, or null

reward

public int reward(Topology.City from,
                  Topology.City to)
Description copied from interface: TaskDistribution
Returns the (expected) reward for a task between two cities.

Specified by:
reward in interface TaskDistribution
Parameters:
from - the source of the task
to - the destination of the task

weight

public int weight(Topology.City from,
                  Topology.City to)
Description copied from interface: TaskDistribution
Returns the (expected) weight for a task between two cities.

Specified by:
weight in interface TaskDistribution
Parameters:
from - the source of the task
to - the destination of the task

createTask

public Task createTask(Topology.City from)

createTaskSet

public TaskSet createTaskSet(int size)

createTaskSet

public TaskSet createTaskSet(Task[] tasks)

createTask

public Task createTask()

getRandom

public java.util.Random getRandom()