public interface SimJob<J extends SimJob,Q extends SimQueue> extends SimEntity, SimQoS<J,Q>
SimJob represents an amount of work or a task to be carried out by one
or more SimQueues.
At any point in time, a SimJob can be visiting at most one
SimQueue.
Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
SimEntity.Action, SimEntity.UnknownNotificationTypePolicy, SimEntity.UnknownOperationPolicy| Modifier and Type | Method and Description |
|---|---|
Q |
getQueue()
The queue this job is currently visiting.
|
double |
getServiceTime(Q queue)
The requested service time at given queue.
|
void |
setQueue(Q queue)
Set the queue being visited.
|
doAfterNotifications, doOperation, getEventList, getLastUpdateTime, getRegisteredNotificationTypes, getRegisteredOperations, getSimEntityListeners, getUnknownNotificationTypePolicy, getUnknownOperationPolicy, isIgnoreEventListReset, registerSimEntityListener, resetEntity, setIgnoreEventListReset, setName, setUnknownNotificationTypePolicy, setUnknownOperationPolicy, toStringDefault, unregisterSimEntityListener, updatenotifyEventListResetgetQoS, getQoSClassQ getQueue()
void setQueue(Q queue) throws IllegalStateException
This method is for private use by SimQueues and subclasses,
and should not be used elsewhere.
It is set by the SimQueue upon arrival of the SimJob.
queue - The queue being visited, may be null as a result of a departure event.IllegalStateException - If the job is already visiting another SimQueue,
and the supplied argument is not null.SimQueue.arrive(double, J)double getServiceTime(Q queue) throws IllegalArgumentException
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.
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.getQueue()Copyright © 2018. All rights reserved.