public class DefaultVisitsLoggingSimJob<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue> extends DefaultSelfListeningSimJob<J,Q>
DefaultSimJob that logs its SimQueue visits with JobQueueVisitLogs.
Visit-logging jobs play a crucial role in the testing sub-system of SimQueues.
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.PreNotificationHookSimEntity.Action, SimEntity.UnknownNotificationTypePolicy, SimEntity.UnknownOperationPolicyDEFAULT_FALLBACK_REQUESTED_SERIVE_TIMEUSE_ARRAY_OPTIMIZATION| Constructor and Description |
|---|
DefaultVisitsLoggingSimJob(org.javades.jsimulation.r5.SimEventList eventList,
String name,
double requestedServiceTime)
Creates a new
DefaultVisitsLoggingSimJob. |
DefaultVisitsLoggingSimJob(org.javades.jsimulation.r5.SimEventList eventList,
String name,
Map<Q,Double> requestedServiceTimeMap)
Creates a new
DefaultVisitsLoggingSimJob. |
| Modifier and Type | Method and Description |
|---|---|
TreeMap<Double,TreeMap<Integer,JobQueueVisitLog>> |
getVisitLogs()
Returns the
JobQueueVisitLogs; indexed by arrival time. |
void |
notifyArrival(double time,
J job,
Q queue)
Performs sanity checks and administers the event in the visit logs.
|
void |
notifyAutoRevocation(double time,
J job,
Q queue)
Invokes
notifyRevocation(double, J, Q). |
void |
notifyDeparture(double time,
J job,
Q queue)
Performs sanity checks and administers the event in the visit logs.
|
void |
notifyDrop(double time,
J job,
Q queue)
Performs sanity checks and administers the event in the visit logs.
|
void |
notifyResetEntity(SimEntity entity)
Does nothing.
|
void |
notifyRevocation(double time,
J job,
Q queue)
Performs sanity checks and administers the event in the visit logs.
|
void |
notifyStart(double time,
J job,
Q queue)
Performs sanity checks and administers the event in the visit logs.
|
void |
notifyStateChanged(double time,
SimEntity entity,
List<Map<SimEntitySimpleEventType.Member,SimEntityEvent>> notifications)
Does nothing.
|
void |
notifyUpdate(double time,
SimEntity entity)
Does nothing.
|
void |
reset()
Clears the visit logs gathered thus far.
|
getFallbackRequestedServiceTime, getServiceTime, setFallbackRequestedServiceTime, setRequestedServiceTimeMappingForQueuegetQueue, resetEntitySubClass, setQueueaddPendingNotification, 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, toStringDefault, unregisterSimEntityListener, unregisterStdOutSimEntityListener, updateclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdoAfterNotifications, doOperation, getEventList, getLastUpdateTime, getRegisteredNotificationTypes, getRegisteredOperations, getSimEntityListeners, getUnknownNotificationTypePolicy, getUnknownOperationPolicy, isIgnoreEventListReset, registerSimEntityListener, resetEntity, setIgnoreEventListReset, setName, setUnknownNotificationTypePolicy, setUnknownOperationPolicy, toStringDefault, unregisterSimEntityListener, updatenotifyEventListResetgetQoS, getQoSClasspublic DefaultVisitsLoggingSimJob(org.javades.jsimulation.r5.SimEventList eventList,
String name,
Map<Q,Double> requestedServiceTimeMap)
DefaultVisitsLoggingSimJob.eventList - The event list.name - The name.requestedServiceTimeMap - The requested service-time map.For detailed explanation on the parameters.public DefaultVisitsLoggingSimJob(org.javades.jsimulation.r5.SimEventList eventList,
String name,
double requestedServiceTime)
DefaultVisitsLoggingSimJob.eventList - The event list.name - The name.requestedServiceTime - The requested service-time.For detailed explanation on the parameters.public final TreeMap<Double,TreeMap<Integer,JobQueueVisitLog>> getVisitLogs()
JobQueueVisitLogs; indexed by arrival time.
For each arrival time, the consecutive visits are logged as JobQueueVisitLog,
bearing in mind that a job can visit multiple queues in sequence at the same instant.
Visit counts start with zero.
A new map is created for the outer-level, but no deep-cloning is performed. Hence changes to the visit logs (for instance) will "write though" to the visit logs of this job.
JobQueueVisitLogs; indexed by arrival time.public final void reset()
public final void notifyResetEntity(SimEntity entity)
notifyResetEntity in interface SimEntityListenernotifyResetEntity in class DefaultSelfListeningSimJob<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>entity - The entity that has been reset.public final void notifyUpdate(double time,
SimEntity entity)
notifyUpdate in interface SimEntityListenernotifyUpdate in class DefaultSelfListeningSimJob<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>time - The time of the update.entity - The entity that is about to be updated.SimEntityListener.notifyStateChanged(double, org.javades.jqueues.r5.entity.SimEntity, java.util.List<java.util.Map<org.javades.jqueues.r5.entity.SimEntitySimpleEventType.Member, org.javades.jqueues.r5.entity.SimEntityEvent>>),
AbstractSimQueueStatpublic final void notifyStateChanged(double time,
SimEntity entity,
List<Map<SimEntitySimpleEventType.Member,SimEntityEvent>> notifications)
notifyStateChanged in interface SimEntityListenernotifyStateChanged in class DefaultSelfListeningSimJob<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>time - The current time (the time of the state change).entity - The entity at which the state changed.notifications - The sequence of notifications of state-changes the combination of which led to the new state.SimEntityListener.notifyUpdate(double, org.javades.jqueues.r5.entity.SimEntity)public final void notifyArrival(double time,
J job,
Q queue)
notifyArrival in interface SimJQListener<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>notifyArrival in class DefaultSelfListeningSimJob<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.SimQueue.arrive(double, J)public final void notifyStart(double time,
J job,
Q queue)
notifyStart in interface SimJQListener<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>notifyStart in class DefaultSelfListeningSimJob<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.public final void notifyDrop(double time,
J job,
Q queue)
notifyDrop in interface SimJQListener<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>notifyDrop in class DefaultSelfListeningSimJob<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.public final void notifyRevocation(double time,
J job,
Q queue)
notifyRevocation in interface SimJQListener<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>notifyRevocation in class DefaultSelfListeningSimJob<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.SimQueue.revoke(double, J, boolean)public final void notifyAutoRevocation(double time,
J job,
Q queue)
notifyRevocation(double, J, Q).notifyAutoRevocation in interface SimJQListener<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>notifyAutoRevocation in class DefaultSelfListeningSimJob<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.SimQueue.getAutoRevocationPolicy()public final void notifyDeparture(double time,
J job,
Q queue)
notifyDeparture in interface SimJQListener<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>notifyDeparture in class DefaultSelfListeningSimJob<J extends DefaultVisitsLoggingSimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.Copyright © 2018. All rights reserved.