|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectde.upb.swtpra05.group03.shuttle.TaskPlan
List of tasks the shuttle has to execute.
| Field Summary | |
(package private) static java.util.logging.Logger |
log
Logger for debugging |
private ShuttleDataInterface |
shuttleData
The shuttle data |
private java.util.LinkedList |
tasks
The tasks |
| Constructor Summary | |
TaskPlan()
Constructor |
|
| Method Summary | |
void |
activateOrder(de.upb.swtpra.kernel.id.OrderID orderId)
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. |
private void |
addRepairAtPos(int pos,
int stretchAtPos)
This method will insert a Repair at the given position and if there is always a task, this task and all behind it will be shifted to the end |
void |
addTask(int index,
java.lang.Object o)
Adds a task or taskplan to this taskplan. |
void |
addTaskBeforeLastMove(Task taskToAdd)
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 orderId)
Returns if taskplan contains order. |
boolean |
containsStationId(int stationId)
Returns if taskplan contains station. |
private void |
deleteAllRepairs()
Deletes all repair tasks in the taskplan. |
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 currentTime,
int timeUseabilityHasToStart)
Returns a useable taskplan which contains all tasks after useTime. |
int |
indexOf(Task task)
Returns the index of the task |
void |
init(ModuleContainerInterface manager)
Initializes this module. |
boolean |
isSuccessorOf(int startId,
int successorId)
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 orderId)
Removes all tasks which belong to the order id |
int |
size()
Returns the count of tasks in the taskplan. |
protected int |
substractRepair(int currentStretch)
Will return the correct stretch if a repair takes place with the stretch given as a parameter |
java.lang.String |
toString()
Returns a string representation. |
protected void |
updateRepairPlan()
Updates the repair tasks so we do them at the right time. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private java.util.LinkedList tasks
private ShuttleDataInterface shuttleData
static final java.util.logging.Logger log
| Constructor Detail |
public TaskPlan()
| Method Detail |
public void init(ModuleContainerInterface manager)
Module
init in interface Modulemanager - The module manager which contain all modules
public void addTask(int index,
java.lang.Object o)
TaskPlanInterface
addTask in interface TaskPlanInterfaceindex - index to add ato - task or taskplanpublic void remove(int index)
TaskPlanInterface
remove in interface TaskPlanInterfaceindex - index of task to removepublic int getHighestCapacity(int baseLoaded)
TaskPlanInterface
getHighestCapacity in interface TaskPlanInterfacebaseLoaded - The current load
public java.util.LinkedList getAllConnectionOkTasks()
TaskPlanInterface
getAllConnectionOkTasks in interface TaskPlanInterfacepublic void addTaskBeforeLastMove(Task taskToAdd)
TaskPlanInterface
addTaskBeforeLastMove in interface TaskPlanInterfacetaskToAdd - The new Task to add to the taskplanpublic int getLastTaskIndexOf(int stationId)
TaskPlanInterface
getLastTaskIndexOf in interface TaskPlanInterfacestationId - the id of the station whose last task will be returned
public boolean isSuccessorOf(int startId,
int successorId)
TaskPlanInterface
isSuccessorOf in interface TaskPlanInterfacestartId - Description of the ParametersuccessorId - Description of the Parameter
public int getLastStationOnRoute()
getLastStationOnRoute in interface TaskPlanInterfaceprotected int substractRepair(int currentStretch)
currentStretch - the stretch before the repair
private void addRepairAtPos(int pos,
int stretchAtPos)
pos - The position where the Repair will be insertedstretchAtPos - the stretch at this position, needed to calculate the costs
correctlyprotected void updateRepairPlan()
private void deleteAllRepairs()
public java.lang.String toString()
TaskPlanInterface
toString in interface TaskPlanInterfacepublic void addAsFirstTask(java.lang.Object o)
TaskPlanInterface
addAsFirstTask in interface TaskPlanInterfaceo - The feature to be added to the First attributepublic void activateOrder(de.upb.swtpra.kernel.id.OrderID orderId)
TaskPlanInterface
activateOrder in interface TaskPlanInterfaceorderId - The order id to activate tasks forpublic java.util.LinkedList removeOrder(de.upb.swtpra.kernel.id.OrderID orderId)
TaskPlanInterface
removeOrder in interface TaskPlanInterfaceorderId - The order if to remove task for
public TaskPlanInterface getUseableTaskPlan(int currentTime,
int timeUseabilityHasToStart)
TaskPlanInterface
getUseableTaskPlan in interface TaskPlanInterfacecurrentTime - current timetimeUseabilityHasToStart - useable time, time from which get all tasks
public void addAsLastTask(java.lang.Object o)
TaskPlanInterface
addAsLastTask in interface TaskPlanInterfaceo - The feature to be added to the Last attributepublic int size()
TaskPlanInterface
size in interface TaskPlanInterfacepublic Task getFirstTask()
TaskPlanInterface
getFirstTask in interface TaskPlanInterfacepublic java.lang.Object removeFirstTask()
TaskPlanInterface
removeFirstTask in interface TaskPlanInterfacepublic java.util.SortedMap getOrderHandlingInfos()
TaskPlanInterface
getOrderHandlingInfos in interface TaskPlanInterfaceOrderIDs with their
OrderHandlingInfopublic Task getTask(int i)
TaskPlanInterface
getTask in interface TaskPlanInterfacei - index of the task to return
public int indexOf(Task task)
TaskPlanInterface
indexOf in interface TaskPlanInterfacetask - task which index to return
public java.util.ListIterator listIterator()
TaskPlanInterface
listIterator in interface TaskPlanInterfacepublic java.util.Vector getStringVector()
getStringVector in interface TaskPlanInterfacepublic boolean containsStationId(int stationId)
TaskPlanInterface
containsStationId in interface TaskPlanInterfacestationId - station id
public boolean containsOrderId(de.upb.swtpra.kernel.id.OrderID orderId)
TaskPlanInterface
containsOrderId in interface TaskPlanInterfaceorderId - order id
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||