de.upb.swtpra05.group03.shuttle
Interface TaskPlanInterface

All Known Implementing Classes:
TaskPlan

public interface TaskPlanInterface

Interface of a taskplan.

Version:
$Revision: 1.3 $

Method Summary
 void activateOrder(de.upb.swtpra.kernel.id.OrderID id)
          Activates all tasks which belong to the order id
 void addAsFirstTask(java.lang.Object o)
          Adds a feature to the First attribute of the TaskPlan object
 void addAsLastTask(java.lang.Object o)
          Appends the given TaskPlan to the end of this list.
 void addTask(int index, java.lang.Object o)
          Adds a task or taskplan to this taskplan.
 void addTaskBeforeLastMove(Task task)
          This method will add the given task as the last task at the corresponding station if there is any.
 boolean containsOrderId(de.upb.swtpra.kernel.id.OrderID id)
          Returns if taskplan contains order.
 boolean containsStationId(int stationId)
          Returns if taskplan contains station.
 java.util.LinkedList getAllConnectionOkTasks()
          Gets the allConnectionOkTasks attribute of the TaskPlan object
 Task getFirstTask()
          Returns the first task.
 int getHighestCapacity(int baseLoaded)
          This method will loop through all of its tasks and calculate the maximum load at any time.
 int getLastStationOnRoute()
           
 int getLastTaskIndexOf(int stationId)
          This method will retrieve the position of the last Task in the TaskPlan which effects the stationId, e.g. at this point in the task, the shuttle will be at this station.
 java.util.SortedMap getOrderHandlingInfos()
          This method calculates the times until the shuttle will unload the orders and the number of connections between loading and unloading, if loading isn't in the taskplan (it's already executed) then the connections from beginning to unloading.
 java.util.Vector getStringVector()
           
 Task getTask(int i)
          Returns the task at index
 TaskPlanInterface getUseableTaskPlan(int curTime, int useTime)
          Returns a useable taskplan which contains all tasks after useTime.
 int indexOf(Task task)
          Returns the index of the task
 boolean isSuccessorOf(int start, int successor)
          Returns if station with successorId is a successor of station with startId.
 java.util.ListIterator listIterator()
          Returns a list iterator if the taskplan.
 void remove(int index)
          Removes the task at index.
 java.lang.Object removeFirstTask()
          Returns the first task and removes it.
 java.util.LinkedList removeOrder(de.upb.swtpra.kernel.id.OrderID id)
          Removes all tasks which belong to the order id
 int size()
          Returns the count of tasks in the taskplan.
 java.lang.String toString()
          Returns a string representation.
 

Method Detail

addTask

public void addTask(int index,
                    java.lang.Object o)
Adds a task or taskplan to this taskplan.

Parameters:
index - index to add at
o - task or taskplan

remove

public void remove(int index)
Removes the task at index.

Parameters:
index - index of task to remove

getHighestCapacity

public int getHighestCapacity(int baseLoaded)
This method will loop through all of its tasks and calculate the maximum load at any time. That means, if the current load is 4 and the next task is a LoadShuttleTask to load 3 passengers up the return value will be 7. If the 4 passengers got unloaded before loading the 3 people the answer will be 4.

Parameters:
baseLoaded - The current load
Returns:
the highest load over all tasks

getAllConnectionOkTasks

public java.util.LinkedList getAllConnectionOkTasks()
Gets the allConnectionOkTasks attribute of the TaskPlan object

Returns:
The allConnectionOkTasks value

addTaskBeforeLastMove

public void addTaskBeforeLastMove(Task task)
This method will add the given task as the last task at the corresponding station if there is any. If there is not already a task for this station, the task will be added at the end of the taskplan

Parameters:
task - The new Task to add to the taskplan

getLastTaskIndexOf

public int getLastTaskIndexOf(int stationId)
This method will retrieve the position of the last Task in the TaskPlan which effects the stationId, e.g. at this point in the task, the shuttle will be at this station.

Parameters:
stationId - the id of the station whose last task will be returned
Returns:
the position of the last found task in the taskplan

isSuccessorOf

public boolean isSuccessorOf(int start,
                             int successor)
Returns if station with successorId is a successor of station with startId.

Parameters:
start - Description of the Parameter
successor - Description of the Parameter
Returns:
if successor is realy a successor of start

getLastStationOnRoute

public int getLastStationOnRoute()
Returns:
The lastRouteMember value

toString

public java.lang.String toString()
Returns a string representation.

Returns:
a string representation.

addAsFirstTask

public void addAsFirstTask(java.lang.Object o)
Adds a feature to the First attribute of the TaskPlan object

Parameters:
o - The feature to be added to the First attribute

activateOrder

public void activateOrder(de.upb.swtpra.kernel.id.OrderID id)
Activates all tasks which belong to the order id

Parameters:
id - The order id to activate tasks for

removeOrder

public java.util.LinkedList removeOrder(de.upb.swtpra.kernel.id.OrderID id)
Removes all tasks which belong to the order id

Parameters:
id - The order if to remove task for
Returns:
Description of the Return Value

addAsLastTask

public void addAsLastTask(java.lang.Object o)
Appends the given TaskPlan to the end of this list.

Parameters:
o - The feature to be added to the Last attribute

size

public int size()
Returns the count of tasks in the taskplan.

Returns:
the count of tasks in the taskplan.

getFirstTask

public Task getFirstTask()
Returns the first task.

Returns:
the first task

removeFirstTask

public java.lang.Object removeFirstTask()
Returns the first task and removes it.

Returns:
the first task

getOrderHandlingInfos

public java.util.SortedMap getOrderHandlingInfos()
This method calculates the times until the shuttle will unload the orders and the number of connections between loading and unloading, if loading isn't in the taskplan (it's already executed) then the connections from beginning to unloading.

Returns:
a sorted map of OrderIDs with their OrderHandlingInfo

getTask

public Task getTask(int i)
Returns the task at index

Parameters:
i - index of the task to return
Returns:
task at index i

indexOf

public int indexOf(Task task)
Returns the index of the task

Parameters:
task - task which index to return
Returns:
index of the task

listIterator

public java.util.ListIterator listIterator()
Returns a list iterator if the taskplan.

Returns:
a list iterator if the taskplan

getStringVector

public java.util.Vector getStringVector()
Returns:
The stringVector value

containsStationId

public boolean containsStationId(int stationId)
Returns if taskplan contains station.

Parameters:
stationId - station id
Returns:
if taskplan contains station

containsOrderId

public boolean containsOrderId(de.upb.swtpra.kernel.id.OrderID id)
Returns if taskplan contains order.

Parameters:
id - order id
Returns:
if taskplan contains order

getUseableTaskPlan

public TaskPlanInterface getUseableTaskPlan(int curTime,
                                            int useTime)
Returns a useable taskplan which contains all tasks after useTime.

Parameters:
curTime - current time
useTime - useable time, time from which get all tasks
Returns:
useable taskplan