public class SimQueueStartArmedLogger extends DefaultSimQueueListener
SimQueueListener that logs StartArmed in between resets.Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
SimEntity.resetEntity(),
SimEntityListener.notifyResetEntity(org.javades.jqueues.r5.entity.SimEntity),
SimQueueListener.notifyNewStartArmed(double, Q, boolean)| Constructor and Description |
|---|
SimQueueStartArmedLogger() |
| Modifier and Type | Method and Description |
|---|---|
List<Map<Double,Boolean>> |
getStartArmedLog()
Returns the
StartArmed log (unmodifiable). |
static boolean |
matchStartArmedLogs(List<Map<Double,Boolean>> predictedStaLogs,
List<Map<Double,Boolean>> actualStaLogs,
double accuracy,
String testString)
Compares two
StartArmed logs (predicted and actual), and reports inequalities to System.err. |
void |
notifyNewStartArmed(double time,
SimQueue queue,
boolean startArmed)
Does nothing.
|
void |
notifyResetEntity(SimEntity entity)
Does nothing.
|
notifyOutOfServerAccessCredits, notifyRegainedServerAccessCredits, notifyStartQueueAccessVacation, notifyStopQueueAccessVacationnotifyArrival, notifyAutoRevocation, notifyDeparture, notifyDrop, notifyRevocation, notifyStartnotifyStateChanged, notifyUpdateclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitnotifyArrival, notifyAutoRevocation, notifyDeparture, notifyDrop, notifyRevocation, notifyStartnotifyStateChanged, notifyUpdatepublic final List<Map<Double,Boolean>> getStartArmedLog()
StartArmed log (unmodifiable).
The log is constructed as a list of non-null and unique single-entry maps,
corresponding to a reported state change in StartArmed.
The entry holds the time as its key and the new StartArmed as its value.
The StartArmed log is automatically cleared upon a (reported) queue reset.
StartArmed log (unmodifiable).SimEntityListener.notifyResetEntity(org.javades.jqueues.r5.entity.SimEntity)public void notifyResetEntity(SimEntity entity)
DefaultSimEntityListenernotifyResetEntity in interface SimEntityListenernotifyResetEntity in class DefaultSimEntityListenerentity - The entity that has been reset.public void notifyNewStartArmed(double time,
SimQueue queue,
boolean startArmed)
DefaultSimQueueListenernotifyNewStartArmed in interface SimQueueListenernotifyNewStartArmed in class DefaultSimQueueListenertime - The (current) time.queue - The queue.startArmed - The new startArmed state.SimQueue.isStartArmed()public static boolean matchStartArmedLogs(List<Map<Double,Boolean>> predictedStaLogs, List<Map<Double,Boolean>> actualStaLogs, double accuracy, String testString)
StartArmed logs (predicted and actual), and reports inequalities to System.err.
In case of a mismatch,
the method re-attempts with a compacted version (dealing with simultaneous notifications)
of the predicted logs,
because some SimQueuePredictor implementations
cannot always provide atomic StartArmed notifications.
A warning on System.err is given in case
erroneous notifications are found in the predicted logs.
predictedStaLogs - The predicted StartArmed logs.actualStaLogs - The actual StartArmed logs.accuracy - The allowed deviation in key values (times-of-change).testString - An optional String identifying the test in place.true if the two logs match.IllegalArgumentException - If an argument is null or improperly structured.Copyright © 2018. All rights reserved.