public class P_LCFS<J extends SimJob,Q extends P_LCFS> extends AbstractPreemptiveSimQueue<J,Q>
Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
AbstractSimEntity.Notifier, AbstractSimEntity.PreNotificationHookSimQueue.AutoRevocationPolicySimEntity.Action, SimEntity.UnknownNotificationTypePolicy, SimEntity.UnknownOperationPolicyDEFAULT_PREEMPTION_STRATEGY, jobsBeingServed, remainingServiceTime, TOLERANCE_RSTeventsScheduled, SANITYUSE_ARRAY_OPTIMIZATION| Constructor and Description |
|---|
P_LCFS(org.javades.jsimulation.r5.SimEventList eventList,
PreemptionStrategy preemptionStrategy)
Creates a single-server preemptive LCFS queue with infinite buffer size given an event list and preemption strategy.
|
| Modifier and Type | Method and Description |
|---|---|
P_LCFS<J,Q> |
getCopySimQueue()
Returns a new (preemptive)
P_LCFS object on the same SimEventList and the same preemption strategy. |
Object |
getQoS()
Calls super method (in order to make implementation final).
|
Class |
getQoSClass()
Calls super method (in order to make implementation final).
|
protected double |
getServiceTimeForJob(J job)
Calls super method (in order to make implementation final).
|
protected void |
insertJobInQueueUponArrival(J job,
double time)
Inserts the job at the head of an internal LIFO job queue (for selecting which job to resume)
and at the head of an internal LIFO wait queue (for selecting which job to start).
|
protected void |
insertJobInQueueUponStart(J job,
double time)
Performs sanity checks, removes the job from the internal LIFO wait queue, and administers its remaining service time.
|
boolean |
isStartArmed()
Returns
true. |
protected void |
removeJobFromQueueUponExit(J exitingJob,
double time)
Removes the job from internal administration (a.o., LIFO job and LIFO wait queues)
and cancels any pending departure event for it.
|
protected void |
rescheduleAfterArrival(J job,
double time)
Starts the arrived job if server-access credits are available.
|
protected void |
rescheduleAfterExit(double time)
If there are jobs in the service area but none in execution,
starts a service-chunk for the job in the service area
that arrived last at the queue.
|
protected void |
rescheduleAfterStart(J job,
double time)
Schedules the started job for immediate execution if it is the only job in the service area
or if its arrival time is strictly smaller than the arrival time of a job in execution,
the latter of which is then preempted.
|
protected void |
rescheduleForNewServerAccessCredits(double time)
Starts jobs as long as there are server-access credits and jobs waiting.
|
protected void |
resetEntitySubClass()
Calls super method and clears the internal LIFO queues.
|
protected void |
setServerAccessCreditsSubClass()
Calls super method (in order to make implementation final).
|
String |
toStringDefault()
Returns "P_LCFS[preemption strategy]".
|
getJobsBeingServed, getPreemptionStrategy, preemptJob, queueAccessVacationDropSubClass, removeJobFromQueueUponDeparture, removeJobFromQueueUponDrop, removeJobFromQueueUponRevokation, rescheduleAfterDeparture, rescheduleAfterDrop, rescheduleAfterRevokation, startServiceChunk, updateRemainingServiceTimegetBufferSize, getNumberOfServersarrive, autoRevoke, cancelDepartureEvent, cancelDepartureEvent, depart, departureFromEventList, drop, getAutoRevocationPolicy, getDepartureEvents, getDepartureEvents, getFirstJob, getFirstJobInServiceArea, getFirstJobInWaitingArea, getJobs, getJobsInServiceArea, getJobsInWaitingArea, getNumberOfJobs, getNumberOfJobsInServiceArea, getNumberOfJobsInWaitingArea, getServerAccessCredits, hasJobs, hasJobsInServiceArea, hasJobsInWaitingArea, hasServerAcccessCredits, isJob, isJobInServiceArea, isJobInWaitingArea, isQueueAccessVacation, registerStdOutSimQueueListener, revoke, revoke, scheduleDepartureEvent, scheduleJobArrival, setAutoRevocationPolicy, setQueueAccessVacation, setServerAccessCredits, start, takeServerAccessCredit, triggerPotentialNewStartArmed, unregisterStdOutSimQueueListeneraddPendingNotification, 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, unregisterSimEntityListener, unregisterStdOutSimEntityListener, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitarrive, getAutoRevocationPolicy, getJobs, getJobsInServiceArea, getJobsInWaitingArea, getNumberOfJobs, getNumberOfJobsInServiceArea, getNumberOfJobsInWaitingArea, getServerAccessCredits, isJob, isJobInServiceArea, isJobInWaitingArea, isQueueAccessVacation, revoke, revoke, setAutoRevocationPolicy, setQueueAccessVacation, setServerAccessCreditsdoAfterNotifications, doOperation, getEventList, getLastUpdateTime, getRegisteredNotificationTypes, getRegisteredOperations, getSimEntityListeners, getUnknownNotificationTypePolicy, getUnknownOperationPolicy, isIgnoreEventListReset, registerSimEntityListener, resetEntity, setIgnoreEventListReset, setName, setUnknownNotificationTypePolicy, setUnknownOperationPolicy, unregisterSimEntityListener, updatepublic P_LCFS(org.javades.jsimulation.r5.SimEventList eventList,
PreemptionStrategy preemptionStrategy)
eventList - The event list to use.preemptionStrategy - The preemption strategy, if null, the default is used (preemptive-resume).IllegalArgumentException - If the event list is null.public P_LCFS<J,Q> getCopySimQueue()
P_LCFS object on the same SimEventList and the same preemption strategy.P_LCFS object on the same SimEventList and the same preemption strategy.AbstractSimEntity.getEventList(),
AbstractPreemptiveSimQueue.getPreemptionStrategy()public String toStringDefault()
toStringDefault in interface SimEntitytoStringDefault in class AbstractSimQueue<J extends SimJob,Q extends P_LCFS>SimEntity.setName(java.lang.String),
Object.toString()public final Class getQoSClass()
null.public final Object getQoS()
null.protected final void resetEntitySubClass()
resetEntitySubClass in class AbstractPreemptiveSimQueue<J extends SimJob,Q extends P_LCFS>AbstractPreemptiveSimQueue.remainingServiceTime,
AbstractPreemptiveSimQueue.jobsBeingServedprotected final void insertJobInQueueUponArrival(J job, double time)
insertJobInQueueUponArrival in class AbstractSimQueue<J extends SimJob,Q extends P_LCFS>job - The job that arrived.time - The current time (i.e., arrival time of the job).AbstractSimQueue.arrive(double, J),
AbstractSimQueue.rescheduleAfterArrival(J, double)protected final void rescheduleAfterArrival(J job, double time)
rescheduleAfterArrival in class AbstractSimQueue<J extends SimJob,Q extends P_LCFS>job - The job that arrived (and is already present in AbstractSimQueue.getJobs()).time - The current time (i.e., the arrival time of the job).AbstractSimQueue.hasServerAcccessCredits(),
AbstractSimQueue.start(double, J)protected final void setServerAccessCreditsSubClass()
setServerAccessCreditsSubClass in class AbstractSimQueue<J extends SimJob,Q extends P_LCFS>AbstractSimQueue.getServerAccessCredits(),
AbstractSimQueue.setServerAccessCredits(double, int),
AbstractSimQueue.rescheduleForNewServerAccessCredits(double)protected final void rescheduleForNewServerAccessCredits(double time)
Jobs are started in reverse order of arrival through the use of an internal LIFO wait queue.
rescheduleForNewServerAccessCredits in class AbstractSimQueue<J extends SimJob,Q extends P_LCFS>time - The current time (i.e., the time at which new server-access credits became available).AbstractSimQueue.hasServerAcccessCredits(),
AbstractSimQueue.hasJobsInWaitingArea(),
AbstractSimQueue.start(double, J)public final boolean isStartArmed()
true.true.SimQueueListener.notifyNewStartArmed(double, Q, boolean)protected final void insertJobInQueueUponStart(J job, double time)
insertJobInQueueUponStart in class AbstractSimQueue<J extends SimJob,Q extends P_LCFS>job - The job that starts.time - The current time (i.e., start time of the job).getServiceTimeForJob(J),
AbstractPreemptiveSimQueue.remainingServiceTimeprotected final void rescheduleAfterStart(J job, double time)
The reverse order of arrival time is achieved with the internal LIFO job queue.
rescheduleAfterStart in class AbstractSimQueue<J extends SimJob,Q extends P_LCFS>job - The job that started (and is already present in AbstractSimQueue.getJobsInServiceArea().time - The current time (i.e., the start time of the job).AbstractPreemptiveSimQueue.preemptJob(double, J),
AbstractPreemptiveSimQueue.startServiceChunk(double, J)protected final double getServiceTimeForJob(J job)
getServiceTimeForJob in class AbstractSimQueue<J extends SimJob,Q extends P_LCFS>job - The job, non-null.protected final void removeJobFromQueueUponExit(J exitingJob, double time)
removeJobFromQueueUponExit in class AbstractPreemptiveSimQueue<J extends SimJob,Q extends P_LCFS>exitingJob - The job leaving.time - The (current) time.AbstractPreemptiveSimQueue.remainingServiceTime,
AbstractPreemptiveSimQueue.jobsBeingServed,
AbstractSimQueue.getDepartureEvents(),
AbstractSimQueue.cancelDepartureEvent(org.javades.jqueues.r5.entity.jq.SimJQEvent.Departure<J, Q>)protected final void rescheduleAfterExit(double time)
The reverse order of arrival time is achieved with the internal LIFO job queue.
rescheduleAfterExit in class AbstractPreemptiveSimQueue<J extends SimJob,Q extends P_LCFS>time - The (current) time.AbstractPreemptiveSimQueue.startServiceChunk(double, J)Copyright © 2018. All rights reserved.