public class LCFS_B<J extends SimJob,Q extends LCFS_B> extends AbstractNonPreemptiveWorkConservingSimQueue<J,Q> implements SimQoS<J,Q>
LCFS queue with given (possibly infinite) buffer size.
Last Come First Served with buffer size B and a single server.
When a job arrives when the buffer is full and non-empty, the job in the waiting queue that arrived least recently is dropped.
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.UnknownOperationPolicyeventsScheduled, SANITYUSE_ARRAY_OPTIMIZATION| Constructor and Description |
|---|
LCFS_B(org.javades.jsimulation.r5.SimEventList eventList,
int bufferSize)
Creates a single-server LCFS queue given an event list and given (possibly infinite) buffer size.
|
| Modifier and Type | Method and Description |
|---|---|
LCFS_B<J,Q> |
getCopySimQueue()
Returns a new
LCFS_B object on the same SimEventList with the same buffer size. |
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 queue.
|
protected void |
removeJobFromQueueUponExit(J exitingJob,
double time)
Calls super method and removes the job (if present) from the internal LIFO queue.
|
protected void |
resetEntitySubClass()
Calls super method and clears the internal LIFO queue.
|
protected J |
selectJobToDropAtFullQueue(J arrivingJob,
double time)
Returns the job at the tail of the internal LIFO (wait) queue, i.e., the "oldest" waiter.
|
protected J |
selectJobToStart()
Returns the first job in (and removes it from) the internal LIFO queue.
|
String |
toStringDefault()
Returns "LCFS_B[buffer size]".
|
hasServerAvailable, insertJobInQueueUponStart, isStartArmed, queueAccessVacationDropSubClass, removeJobFromQueueUponDeparture, removeJobFromQueueUponDrop, removeJobFromQueueUponRevokation, reschedule, rescheduleAfterArrival, rescheduleAfterDeparture, rescheduleAfterDrop, rescheduleAfterRevokation, rescheduleAfterStart, rescheduleForNewServerAccessCredits, setServerAccessCreditsSubClassgetBufferSize, 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 LCFS_B(org.javades.jsimulation.r5.SimEventList eventList,
int bufferSize)
eventList - The event list to use.bufferSize - The buffer size (non-negative), Integer.MAX_VALUE is interpreted as infinity.IllegalArgumentException - If the buffer size is negative.public LCFS_B<J,Q> getCopySimQueue()
LCFS_B object on the same SimEventList with the same buffer size.getCopySimQueue in interface SimQueue<J extends SimJob,Q extends LCFS_B>LCFS_B object on the same SimEventList with the same buffer size.AbstractSimEntity.getEventList(),
AbstractClassicSimQueue.getBufferSize()public String toStringDefault()
toStringDefault in interface SimEntitytoStringDefault in class AbstractSimQueue<J extends SimJob,Q extends LCFS_B>SimEntity.setName(java.lang.String),
Object.toString()public final Class getQoSClass()
public final Object getQoS()
protected final void resetEntitySubClass()
resetEntitySubClass in class AbstractNonPreemptiveWorkConservingSimQueue<J extends SimJob,Q extends LCFS_B>AbstractNonPreemptiveWorkConservingSimQueue.insertJobInQueueUponArrival(J, double)protected final void insertJobInQueueUponArrival(J job, double time)
insertJobInQueueUponArrival in class AbstractNonPreemptiveWorkConservingSimQueue<J extends SimJob,Q extends LCFS_B>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 J selectJobToDropAtFullQueue(J arrivingJob, double time)
selectJobToDropAtFullQueue in class AbstractNonPreemptiveWorkConservingSimQueue<J extends SimJob,Q extends LCFS_B>arrivingJob - The job that arrived at the queue.time - THe job's arrival time.IllegalStateException - If the waiting area or internal LIFO queue is emptyAbstractNonPreemptiveWorkConservingSimQueue.insertJobInQueueUponArrival(J, double)protected final J selectJobToStart()
selectJobToStart in class AbstractNonPreemptiveWorkConservingSimQueue<J extends SimJob,Q extends LCFS_B>AbstractNonPreemptiveWorkConservingSimQueue.insertJobInQueueUponArrival(J, double),
AbstractNonPreemptiveWorkConservingSimQueue.reschedule(double)protected final double getServiceTimeForJob(J job)
getServiceTimeForJob in class AbstractSimQueue<J extends SimJob,Q extends LCFS_B>job - The job, non-null.protected final void removeJobFromQueueUponExit(J exitingJob, double time)
removeJobFromQueueUponExit in class AbstractNonPreemptiveWorkConservingSimQueue<J extends SimJob,Q extends LCFS_B>exitingJob - The jobs that ends its visit, non-null.time - The current time, i.e., the time the job ends its visit.AbstractNonPreemptiveWorkConservingSimQueue.removeJobFromQueueUponDrop(J, double),
AbstractNonPreemptiveWorkConservingSimQueue.removeJobFromQueueUponRevokation(J, double, boolean),
AbstractNonPreemptiveWorkConservingSimQueue.removeJobFromQueueUponDeparture(J, double)Copyright © 2018. All rights reserved.