public abstract class AbstractSimJob<J extends SimJob,Q extends SimQueue> extends AbstractSimJQ<J,Q> implements SimJob<J,Q>
SimJob.
This class maintains an internal reference to the SimQueue being visited.
The method getServiceTime(Q) is kept abstract on purpose, as forgetting to override a default implementation is
considered too risky.
Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
DefaultSimJobAbstractSimEntity.Notifier, AbstractSimEntity.PreNotificationHookSimEntity.Action, SimEntity.UnknownNotificationTypePolicy, SimEntity.UnknownOperationPolicyUSE_ARRAY_OPTIMIZATION| Constructor and Description |
|---|
AbstractSimJob(org.javades.jsimulation.r5.SimEventList eventList,
String name)
Creates a new
SimJob with given event list and name. |
| Modifier and Type | Method and Description |
|---|---|
Q |
getQueue()
Returns the internally stored
SimQueue visiting. |
abstract double |
getServiceTime(Q queue)
The requested service time at given queue.
|
protected void |
resetEntitySubClass()
Calls super method and sets the queue to
null. |
void |
setQueue(Q queue)
Sets the internally stored
SimQueue visiting. |
addPendingNotification, addPendingNotification, clearAndUnlockPendingNotificationsIfLocked, delegateOperation, doAfterNotifications, doOperation, fireAndLockPendingNotifications, getEventList, getLastUpdateTime, getRegisteredDelegatedOperations, getRegisteredNotificationTypes, getRegisteredOperations, getSimEntityListeners, getUnknownNotificationTypePolicy, getUnknownOperationPolicy, isIgnoreEventListReset, notifyEventListReset, registerDelegatedOperation, registerNotificationType, registerOperation, registerPreEventHook, registerPreNotificationHook, registerPreUpdateHook, registerSimEntityListener, registerStdOutSimEntityListener, removeDelegationForOperation, resetEntity, setIgnoreEventListReset, setName, setUnknownNotificationTypePolicy, setUnknownOperationPolicy, toString, toStringDefault, unregisterSimEntityListener, unregisterStdOutSimEntityListener, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdoAfterNotifications, doOperation, getEventList, getLastUpdateTime, getRegisteredNotificationTypes, getRegisteredOperations, getSimEntityListeners, getUnknownNotificationTypePolicy, getUnknownOperationPolicy, isIgnoreEventListReset, registerSimEntityListener, resetEntity, setIgnoreEventListReset, setName, setUnknownNotificationTypePolicy, setUnknownOperationPolicy, toStringDefault, unregisterSimEntityListener, updatenotifyEventListResetgetQoS, getQoSClasspublic AbstractSimJob(org.javades.jsimulation.r5.SimEventList eventList,
String name)
SimJob with given event list and name.eventList - The event list to use, may be null.name - The name of the job, may be null.AbstractSimEntity.getEventList(),
AbstractSimEntity.setName(java.lang.String)public final void setQueue(Q queue) throws IllegalStateException
SimQueue visiting.setQueue in interface SimJob<J extends SimJob,Q extends SimQueue>queue - The new SimQueue visiting, may be null.IllegalStateException - If the job is already visiting another SimQueue,
and the supplied argument is not null.SimQueue.arrive(double, J)protected void resetEntitySubClass()
null.resetEntitySubClass in class AbstractSimJQ<J extends SimJob,Q extends SimQueue>SimEntity.resetEntity()public abstract double getServiceTime(Q queue) throws IllegalArgumentException
SimJob
This method is used by a SimQueue to query the requested service time,
and appropriately schedule a departure event for the job,
but can be called anytime.
The returned value should not change during a visit to a SimQueue,
and it is not manipulated by the queue being visited, in other words,
it cannot be used to query the remaining service time of a job at a queue.
It is safe to change this in-between queue visits. However, the convention is that the method then returns the required service time at the next visit to the queue. For instance, many test and job-factory classes depend on this, as they often directly probe a non-visiting job for its required service time at a queue. Obviously, implementations must be prepared for invocations of this method while not visiting a queue.
getServiceTime in interface SimJob<J extends SimJob,Q extends SimQueue>queue - The SimQueue for which the service time is requested,
if null, the service time at the current queue is used,
or zero if the job is not currently visiting a queue.IllegalArgumentException - If the queue supplied cannot serve the job.SimJob.getQueue()Copyright © 2018. All rights reserved.