DJ - The delegate-job type.DQ - The queue-type for delegate jobs.J - The job type.Q - The queue type for jobs.public class JSQ<DJ extends AbstractSimJob,DQ extends SimQueue,J extends SimJob,Q extends JSQ> extends AbstractParallelSimQueues<DJ,DQ,J,Q>
The selection of the "shortest queue" is either based on all jobs present in the candidate queues or on all waiting jobs present.
Ties are broken at random with equal probabilities.
This queue uses the LocalStart model as explained with AbstractSimQueueComposite_LocalStart.
Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
SimQueue.getNumberOfJobs(),
SimQueue.getNumberOfJobsInServiceArea()AbstractSimQueueComposite.RealDelegateJobMapper<J extends SimJob,DJ extends SimJob>AbstractSimEntity.Notifier, AbstractSimEntity.PreNotificationHookSimQueue.AutoRevocationPolicySimEntity.Action, SimEntity.UnknownNotificationTypePolicy, SimEntity.UnknownOperationPolicyrealDelegateJobMappereventsScheduled, SANITYUSE_ARRAY_OPTIMIZATION| Constructor and Description |
|---|
JSQ(org.javades.jsimulation.r5.SimEventList eventList,
Set<DQ> queues,
DelegateSimJobFactory delegateSimJobFactory,
boolean onlyWaitingJobs,
Random rng)
Creates a parallel queue with Join-Shortest Queue selection policy given an event list and a list of queues.
|
| Modifier and Type | Method and Description |
|---|---|
JSQ<DJ,DQ,J,Q> |
getCopySimQueue()
Returns a new
JSQ object on the same SimEventList with copies of the sub-queues,
the same onlyWaitingJobs argument, a new RNG, and the same delegate-job factory. |
static SimQueue |
getRandomSimQueueFromSet(Set<SimQueue> queues,
Random rng)
Selects a queue at random (with equal probabilities) from a set of queues.
|
boolean |
isOnlyWaitingJobs()
Returns whether only waiting jobs are considered in queue selection.
|
protected void |
resetEntitySubClass()
Calls super method (in order to make implementation final).
|
String |
toStringDefault()
Returns "JSQ[queue list]".
|
processSubQueueNotificationsgetQoS, getQoSClass, getServiceTimeForJob, insertJobInQueueUponArrival, insertJobInQueueUponStart, isStartArmed, queueAccessVacationDropSubClass, removeJobFromQueueUponDeparture, removeJobFromQueueUponDrop, removeJobFromQueueUponRevokation, rescheduleAfterArrival, rescheduleAfterDeparture, rescheduleAfterDrop, rescheduleAfterRevokation, rescheduleAfterStart, rescheduleForNewServerAccessCredits, setServerAccessCreditsSubClassaddRealJobLocal, getCopySimQueues, getCopySubSimQueues, getDelegateJob, getDelegateJobMild, getDelegateSimJobFactory, getIndex, getIndex, getQueue, getQueue, getQueues, getRealJob, getRealJob, getSimQueueSelector, isDelegateJob, isRealJob, notifyResetEntity, notifyStateChanged, notifyUpdate, removeJobsFromQueueLocal, resetSimQueueSelector, selectFirstQueue, selectNextQueue, setDelegateSimJobFactoryarrive, 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 JSQ(org.javades.jsimulation.r5.SimEventList eventList,
Set<DQ> queues,
DelegateSimJobFactory delegateSimJobFactory,
boolean onlyWaitingJobs,
Random rng)
eventList - The event list to use.queues - The queues in no particular order.delegateSimJobFactory - An optional factory for the delegate SimJobs.onlyWaitingJobs - Whether queue-length is the number of waiting jobs (true),
or the total number of jobs present (true).rng - An optional user-supplied random-number generator
(if absent, a new one is created for local use).IllegalArgumentException - If the event list is null,
the queues argument is null,
or if it contains a null entry.DelegateSimJobFactory,
DefaultDelegateSimJobFactory,
SimQueueSelector,
SimQueue.getNumberOfJobs(),
SimQueue.getNumberOfJobsInServiceArea(),
Randompublic JSQ<DJ,DQ,J,Q> getCopySimQueue()
JSQ object on the same SimEventList with copies of the sub-queues,
the same onlyWaitingJobs argument, a new RNG, and the same delegate-job factory.JSQ object on the same SimEventList with copies of the sub-queues,
the same onlyWaitingJobs argument, a new RNG, and the same delegate-job factory.UnsupportedOperationException - If the encapsulated queues could not be copied through SimQueue.getCopySimQueue().AbstractSimEntity.getEventList(),
AbstractSimQueueComposite.getCopySubSimQueues(),
AbstractSimQueueComposite.getDelegateSimJobFactory(),
isOnlyWaitingJobs()public String toStringDefault()
toStringDefault in interface SimEntitytoStringDefault in class AbstractSimQueue<J extends SimJob,Q extends JSQ>SimEntity.setName(java.lang.String),
Object.toString()public final boolean isOnlyWaitingJobs()
True if only waiting jobs are considered in queue selection,
false if all jobs present are considered.public static SimQueue getRandomSimQueueFromSet(Set<SimQueue> queues, Random rng)
queues - The queues, non-null.rng - The random-number generator to use, non-null.null if the set was empty.IllegalArgumentException - If the queues argument is null, contains null,
or the rng argument is null.protected final void resetEntitySubClass()
resetEntitySubClass in class AbstractSimQueueComposite_LocalStart<DJ extends AbstractSimJob,DQ extends SimQueue,J extends SimJob,Q extends JSQ>AbstractSimQueueComposite_LocalStart.removeJobFromQueueUponRevokation(J, double, boolean),
AbstractSimQueueComposite_LocalStart.rescheduleAfterRevokation(J, double, boolean),
SimEntity.resetEntity()Copyright © 2018. All rights reserved.