public class GATE<J extends SimJob,Q extends GATE> extends AbstractServerlessSimQueue<J,Q> implements SimQueueWithGate<J,Q>
GATE queue lets jobs depart without service conditionally ("gate is open") or lets them wait ("gate is closed").
The gate status is a SimQueue state variable, i.e., it can be changed from an event list being run.
The state of the gate is represented by a single non-negative number, the gate passage credits.
If the credits are zero, the gate is closed, and if infinite (Integer.MAX_VALUE), the gate is open without limits.
If the number of credits is in between, the gate is also open, but only for that number of job passages.
This SimQueue is server-less.
AbstractSimEntity.Notifier, AbstractSimEntity.PreNotificationHookSimQueue.AutoRevocationPolicySimEntity.Action, SimEntity.UnknownNotificationTypePolicy, SimEntity.UnknownOperationPolicyeventsScheduled, SANITYUSE_ARRAY_OPTIMIZATION| Constructor and Description |
|---|
GATE(org.javades.jsimulation.r5.SimEventList eventList)
Creates a
GATE queue with infinite buffer size given an event list. |
| Modifier and Type | Method and Description |
|---|---|
GATE<J,Q> |
getCopySimQueue()
Returns a new
GATE object on the same SimEventList. |
int |
getGatePassageCredits()
Returns the number of (remaining) gate-passage credits.
|
Object |
getQoS()
Calls super method (in order to make implementation final).
|
Class |
getQoSClass()
Calls super method (in order to make implementation final).
|
protected void |
insertJobInQueueUponArrival(J job,
double time)
Does nothing.
|
protected void |
removeJobFromQueueUponDeparture(J departingJob,
double time)
Does nothing.
|
protected void |
removeJobFromQueueUponDrop(J job,
double time)
Throws
IllegalStateException. |
protected void |
removeJobFromQueueUponRevokation(J job,
double time,
boolean auto)
Does nothing.
|
protected void |
rescheduleAfterArrival(J job,
double time)
Makes the job depart from the job queue if the gate is currently open
|
protected void |
rescheduleAfterDeparture(J departedJob,
double time)
Does nothing.
|
protected void |
rescheduleAfterDrop(J job,
double time)
Throws
IllegalStateException. |
protected void |
rescheduleAfterRevokation(J job,
double time,
boolean auto)
Does nothing.
|
protected void |
resetEntitySubClass()
Calls super method and opens the gate (limitless).
|
void |
setGatePassageCredits(double time,
int gatePassageCredits)
Updates the internal administration and releases (makes depart) waiting jobs if applicable.
|
String |
toStringDefault()
Returns "GATE".
|
getServiceTimeForJob, insertJobInQueueUponStart, isStartArmed, queueAccessVacationDropSubClass, 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, isStartArmed, revoke, revoke, setAutoRevocationPolicy, setQueueAccessVacation, setServerAccessCreditsdoAfterNotifications, doOperation, getEventList, getLastUpdateTime, getRegisteredNotificationTypes, getRegisteredOperations, getSimEntityListeners, getUnknownNotificationTypePolicy, getUnknownOperationPolicy, isIgnoreEventListReset, registerSimEntityListener, resetEntity, setIgnoreEventListReset, setName, setUnknownNotificationTypePolicy, setUnknownOperationPolicy, unregisterSimEntityListener, updatepublic GATE(org.javades.jsimulation.r5.SimEventList eventList)
GATE queue with infinite buffer size given an event list.eventList - The event list to use.public GATE<J,Q> getCopySimQueue()
GATE object on the same SimEventList.getCopySimQueue in interface SimQueue<J extends SimJob,Q extends GATE>GATE object on the same SimEventList.AbstractSimEntity.getEventList()public String toStringDefault()
toStringDefault in interface SimEntitytoStringDefault in class AbstractSimQueue<J extends SimJob,Q extends GATE>SimEntity.setName(java.lang.String),
Object.toString()public int getGatePassageCredits()
SimQueueWithGategetGatePassageCredits in interface SimQueueWithGate<J extends SimJob,Q extends GATE>public final void setGatePassageCredits(double time,
int gatePassageCredits)
This must be a top-level event, at the expense of a IllegalStateException.
setGatePassageCredits in interface SimQueueWithGate<J extends SimJob,Q extends GATE>time - The current time.gatePassageCredits - The remaining number of passages to allow (will override, not add to, any previous value),
with Integer.MAX_VALUE treated as infinity.getGatePassageCredits(),
AbstractSimEntity.update(double),
AbstractSimQueue.hasJobsInWaitingArea(),
AbstractSimQueue.depart(double, J),
AbstractSimEntity.clearAndUnlockPendingNotificationsIfLocked(),
AbstractSimEntity.fireAndLockPendingNotifications()public final Class getQoSClass()
public final Object getQoS()
protected final void resetEntitySubClass()
resetEntitySubClass in class AbstractSimQueue<J extends SimJob,Q extends GATE>SimEntity.resetEntity()protected final void insertJobInQueueUponArrival(J job, double time)
insertJobInQueueUponArrival in class AbstractSimQueue<J extends SimJob,Q extends GATE>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 GATE>job - The job that arrived (and is already present in AbstractSimQueue.getJobs()).time - The current time (i.e., the arrival time of the job).getGatePassageCredits(),
AbstractSimQueue.depart(double, J)protected final void removeJobFromQueueUponDrop(J job, double time)
IllegalStateException.removeJobFromQueueUponDrop in class AbstractSimQueue<J extends SimJob,Q extends GATE>job - The job that is to be dropped.time - The current time (i.e., drop time of the job).IllegalStateException - Always, as a call to this method is unexpected.AbstractSimQueue.drop(J, double),
AbstractSimQueue.rescheduleAfterDrop(J, double)protected final void rescheduleAfterDrop(J job, double time)
IllegalStateException.rescheduleAfterDrop in class AbstractSimQueue<J extends SimJob,Q extends GATE>job - The jobs that was dropped.time - The current time (i.e., drop time of the job).IllegalStateException - Always, as a call to this method is unexpected.AbstractSimQueue.drop(J, double),
AbstractSimQueue.removeJobFromQueueUponDrop(J, double)protected final void removeJobFromQueueUponRevokation(J job, double time, boolean auto)
removeJobFromQueueUponRevokation in class AbstractSimQueue<J extends SimJob,Q extends GATE>job - The job that is to be revoked.time - The current time (i.e., revocation time of the job).auto - Whether or not this applies to an auto-revocation.AbstractSimQueue.revoke(double, J, boolean),
AbstractSimQueue.autoRevoke(double, J),
AbstractSimQueue.rescheduleAfterRevokation(J, double, boolean),
SimQueue.AutoRevocationPolicyprotected final void rescheduleAfterRevokation(J job, double time, boolean auto)
rescheduleAfterRevokation in class AbstractSimQueue<J extends SimJob,Q extends GATE>job - The jobs that was successfully revoked.time - The current time (i.e., revocation time of the job).auto - Whether or not this applies to an auto-revocation.AbstractSimQueue.revoke(double, J, boolean),
AbstractSimQueue.autoRevoke(double, J),
AbstractSimQueue.removeJobFromQueueUponRevokation(J, double, boolean),
SimQueue.AutoRevocationPolicyprotected final void removeJobFromQueueUponDeparture(J departingJob, double time)
removeJobFromQueueUponDeparture in class AbstractSimQueue<J extends SimJob,Q extends GATE>departingJob - The job that departs.time - The departure (current) time.AbstractSimQueue.depart(double, J),
AbstractSimQueue.rescheduleAfterDeparture(J, double)protected final void rescheduleAfterDeparture(J departedJob, double time)
rescheduleAfterDeparture in class AbstractSimQueue<J extends SimJob,Q extends GATE>departedJob - The departed job.time - The departure (current) time.AbstractSimQueue.depart(double, J),
AbstractSimQueue.removeJobFromQueueUponDeparture(J, double)Copyright © 2018. All rights reserved.