|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectlogist.plan.Plan
public class Plan
A sequence of actions for one vehicle.
| Field Summary | |
|---|---|
static Plan |
EMPTY
The empty plan |
| Constructor Summary | |
|---|---|
Plan(Topology.City initialCity,
Action... actions)
Creates a simple plan from an initial city and a fixed number of actions. |
|
Plan(Topology.City initialCity,
java.util.List<Action> actions)
Creates a simple plan from an initial city and a list of actions. |
|
| Method Summary | |
|---|---|
void |
append(Action action)
Appends an action to the plan |
void |
appendDelivery(Task task)
Appends a delivery action to the plan |
void |
appendMove(Topology.City city)
Appends a move action to the plan |
void |
appendPickup(Task task)
Appends a pickup action to the plan |
boolean |
isSealed()
Whether this plan has been sealed |
java.util.Iterator<Action> |
iterator()
|
Plan |
seal()
Prevent any future modification to this plan |
java.lang.String |
toString()
|
double |
totalDistance()
Computes the total distance (in km) of this plan |
long |
totalDistanceUnits()
Computes the total distance (in units) of this plan |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final Plan EMPTY
| Constructor Detail |
|---|
public Plan(Topology.City initialCity,
Action... actions)
new Plan(initialCity)
initialCity - The initial cityactions - (optional) A fixed number of actions
public Plan(Topology.City initialCity,
java.util.List<Action> actions)
new Plan(initialCity)
initialCity - The initial cityactions - The list of actions| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic void append(Action action)
action - The action to appendpublic void appendMove(Topology.City city)
city - The target of the movepublic void appendPickup(Task task)
task - The task to pick uppublic void appendDelivery(Task task)
task - The task to deliverpublic Plan seal()
public boolean isSealed()
public java.util.Iterator<Action> iterator()
iterator in interface java.lang.Iterable<Action>public double totalDistance()
public long totalDistanceUnits()
Measures
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||