public abstract class AbstractSimQueueStat<J extends SimJob,Q extends SimQueue> extends Object implements SimQueueListener<J,Q>
SimQueue.Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
SimQueueListener| Constructor and Description |
|---|
AbstractSimQueueStat()
Constructor.
|
AbstractSimQueueStat(Q queue)
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
calculate() |
protected void |
calculate(double time)
Calculates all statistics (if invalid) and marks them valid.
|
protected abstract void |
calculateStatistics(double startTime,
double endTime)
Calculates all the statistics from the accumulated updates.
|
double |
getLastUpdateTime()
Returns the time of the last update.
|
Q |
getQueue()
Gets the
SimQueue we are gathering statistics on. |
double |
getStartTime()
Gets the start time for gathering statistics.
|
boolean |
getStatisticsValid()
Checks if the statistics are valid.
|
void |
notifyArrival(double time,
J job,
Q queue)
Does nothing.
|
void |
notifyAutoRevocation(double time,
J job,
Q queue)
Does nothing.
|
void |
notifyDeparture(double time,
J job,
Q queue)
Does nothing.
|
void |
notifyDrop(double time,
J job,
Q queue)
Does nothing.
|
void |
notifyNewStartArmed(double time,
Q queue,
boolean startArmed)
Does nothing.
|
void |
notifyOutOfServerAccessCredits(double time,
Q queue)
Does nothing.
|
void |
notifyRegainedServerAccessCredits(double time,
Q queue)
Does nothing.
|
void |
notifyResetEntity(SimEntity entity)
Invokes
reset(). |
void |
notifyRevocation(double time,
J job,
Q queue)
Does nothing.
|
void |
notifyStart(double time,
J job,
Q queue)
Does nothing.
|
void |
notifyStartQueueAccessVacation(double time,
Q queue)
Does nothing.
|
void |
notifyStateChanged(double time,
SimEntity entity,
List<Map<SimEntitySimpleEventType.Member,SimEntityEvent>> notifications)
Does nothing.
|
void |
notifyStopQueueAccessVacation(double time,
Q queue)
Does nothing.
|
void |
notifyUpdate(double time,
SimEntity entity)
Checks the queue argument and invokes
update(double). |
void |
reset()
Resets all statistics and start a new batch of statistics gathering.
|
protected abstract void |
resetStatistics()
Resets all the statistics.
|
void |
setQueue(Q queue)
Sets the
SimQueue we are gathering statistics on. |
protected void |
update(double time)
Updates all statistics at given time.
|
protected abstract void |
updateStatistics(double time,
double dt)
Updates all the statistics from the state of the queue.
|
public AbstractSimQueueStat(Q queue)
queue - The queue to gather statistics from.public AbstractSimQueueStat()
null.protected abstract void resetStatistics()
protected abstract void updateStatistics(double time,
double dt)
time - The actual (new) time.dt - The time since the last update.protected abstract void calculateStatistics(double startTime,
double endTime)
startTime - The start time of the statistics gathering.endTime - The last time the statistic was updated.public void reset()
The start time is set to the current time (the time on the event list of the queue, or minus infinity if no queue is present), all statistics are invalidated and prepared for the new batch.
Only override this method with a call to super if you have special actions to be performed upon a reset
other than resetting statistics. Otherwise, override resetStatistics().
getLastUpdateTime(),
resetStatistics(),
getStatisticsValid()protected void update(double time)
Only override this method with a call to super if you have special actions to be performed upon an update
other than updating statistics. Otherwise, override updateStatistics(double, double).
time - The (new) current time.IllegalArgumentException - If the time is in the past (i.e., strictly smaller than our last update time).protected void calculate(double time)
Only override this method with a call to super if you have special actions to be performed upon a calculation
other than calculating statistics. Otherwise, override calculateStatistics(double, double).
time - The current time, may be beyond the last update time.protected void calculate()
public final Q getQueue()
SimQueue we are gathering statistics on.SimQueue we are gathering statistics on.setQueue(Q)public void setQueue(Q queue)
SimQueue we are gathering statistics on.
This methods always invokes reset().
Override this method is discouraged, even with a call to super.
Also, an internal version of this method is used upon object construction.
queue - The new queue to monitor (may be null).getQueue(),
SimEntity.registerSimEntityListener(org.javades.jqueues.r5.entity.SimEntityListener),
SimEntity.unregisterSimEntityListener(org.javades.jqueues.r5.entity.SimEntityListener),
reset()public final double getStartTime()
public final double getLastUpdateTime()
update(double),
notifyUpdate(double, SimEntity)public final boolean getStatisticsValid()
calculate(double)public void notifyResetEntity(SimEntity entity)
reset().notifyResetEntity in interface SimEntityListenerentity - The entity that has been reset.public void notifyUpdate(double time,
SimEntity entity)
update(double).notifyUpdate in interface SimEntityListenertime - The time of the update.entity - The entity that is about to be updated.IllegalArgumentException - If the queue is null or not the queue we monitor.getQueue()public void notifyStateChanged(double time,
SimEntity entity,
List<Map<SimEntitySimpleEventType.Member,SimEntityEvent>> notifications)
notifyStateChanged in interface SimEntityListenertime - 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 void notifyArrival(double time,
J job,
Q queue)
notifyArrival in interface SimJQListener<J extends SimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.SimQueue.arrive(double, J)public void notifyStart(double time,
J job,
Q queue)
notifyStart in interface SimJQListener<J extends SimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.public void notifyDrop(double time,
J job,
Q queue)
notifyDrop in interface SimJQListener<J extends SimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.public void notifyRevocation(double time,
J job,
Q queue)
notifyRevocation in interface SimJQListener<J extends SimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.SimQueue.revoke(double, J, boolean)public void notifyAutoRevocation(double time,
J job,
Q queue)
notifyAutoRevocation in interface SimJQListener<J extends SimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.SimQueue.getAutoRevocationPolicy()public void notifyDeparture(double time,
J job,
Q queue)
notifyDeparture in interface SimJQListener<J extends SimJob,Q extends SimQueue>time - The (current) time.job - The job.queue - The queue.public void notifyNewStartArmed(double time,
Q queue,
boolean startArmed)
notifyNewStartArmed in interface SimQueueListener<J extends SimJob,Q extends SimQueue>time - The (current) time.queue - The queue.startArmed - The new startArmed state.SimQueue.isStartArmed()public void notifyStartQueueAccessVacation(double time,
Q queue)
notifyStartQueueAccessVacation in interface SimQueueListener<J extends SimJob,Q extends SimQueue>time - The (current) time.queue - The queue.SimQueue.setQueueAccessVacation(double, boolean)public void notifyStopQueueAccessVacation(double time,
Q queue)
notifyStopQueueAccessVacation in interface SimQueueListener<J extends SimJob,Q extends SimQueue>time - The (current) time.queue - The queue.SimQueue.setQueueAccessVacation(double, boolean)public void notifyOutOfServerAccessCredits(double time,
Q queue)
notifyOutOfServerAccessCredits in interface SimQueueListener<J extends SimJob,Q extends SimQueue>time - The (current) time.queue - The queue.SimQueue.setServerAccessCredits(double, int)public void notifyRegainedServerAccessCredits(double time,
Q queue)
notifyRegainedServerAccessCredits in interface SimQueueListener<J extends SimJob,Q extends SimQueue>time - The (current) time.queue - The queue.Copyright © 2018. All rights reserved.