Q - The type of SimQueues supported.public interface SimQueuePredictor<Q extends SimQueue> extends SimQueueEventPredictor<Q>, SimQueueStatePredictor<Q>
SimQueues under user-supplied workload and conditions.
A SimQueuePredictor is a stateless object that is capable of predicting the behavior of a specific SimQueue
class or (if applicable) of (some of) its subclasses;
the (base) class of queues supported is present as generic type argument Q.
Objects like this are extensively used in the test sub-system of jqueues.
The most important feature of a SimQueuePredictor is the prediction of job visits to a given (stateless!)
SimQueue under a given external workload (e.g., arrivals, revocations, setting server-access credits,
or queue-specific external operations). The workload consists of a collection of SimJQEvents, and this collection
may contain events scheduled at the same time. Depending on the method invoked on the predictor,
such simultaneous events are to be interpreted as occurring in "random order"
(as if processed by a ROEL SimEventList like DefaultSimEventList_ROEL)
or as occurring in the strict and deterministic order (somehow) imposed by the collection
(as if processed by a IOEL SimEventList like DefaultSimEventList_IOEL).
In the first case,
see predict_SQ_SV_ROEL_U(Q, java.util.Set<org.javades.jqueues.r5.entity.jq.SimJQEvent>),
the workload schedule itself can easily lead to ambiguities that prevent the delivery of a prediction,
for instance in the case of simultaneous arrivals (of jobs with non-zero required service time) at a FCFS queue.
On the other hand, queues like ZERO appear to be robust against simultaneous arrivals under ROEL,
and for queues like IC, simultaneous arrivals under ROEL are unambiguous only if sufficient
server-access credits are available, hence, the ambiguity of simultaneous arrivals for this queue is state-dependent.
However, for all SimQueues, the simultaneous start of a queue-access vacation (again, state-dependent) and
an arrival always leads to ambiguities.
In the seconds case,
see predict_SQ_SV_IOEL_U(Q, java.util.NavigableMap<java.lang.Double, java.util.Set<org.javades.jqueues.r5.entity.jq.SimJQEvent>>, java.util.NavigableMap<java.lang.Double, java.util.Set<org.javades.jqueues.r5.entity.jq.SimJQEvent>>),
workload events do not cause ambiguities among themselves, but they may still interfere with queue-internal
events like departures, for instance the simultaneous occurrence of an arrival and a scheduled departure in a P_LCFS
queue that is otherwise empty. Even worse, queues may exhibit internal ambiguities, for instance, the simultaneous
occurrence of a "catch-up" and a departure (both "internal events") in a CUPS queue.
Note that even with a ROEL SimEventList, certain SimQueue implementations
may process "simultaneous events" in a specific sequence, and heavily rely on their sequential execution.
For instance, the Tandem lets (delegate) jobs arrive at their first sub-queue if
server-access credits become available, yet it processes these arrivals in a specific order (the arrival order of the
corresponding "real" jobs) and it effectuates these arrivals immediately, without using the underlying event list.
In any case, implementations must provide a collection of visit logs, see JobQueueVisitLog,
or throw an exception upon determining an ambiguity, see SimQueuePredictionAmbiguityException.
Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
| Modifier and Type | Method and Description |
|---|---|
static <Q extends SimQueue> |
matchVisitLogs_SQ_SV(Q queue,
Map<SimJob,JobQueueVisitLog<SimJob,Q>> predicted,
Map<SimJob,TreeMap<Double,TreeMap<Integer,JobQueueVisitLog<SimJob,Q>>>> actual,
double accuracy,
PrintStream stream,
String testString)
Compares two maps of predicted and actual
JobQueueVisitLogs for equality, within given accuracy. |
SimQueuePrediction_SQ_SV<Q> |
predict_SQ_SV_IOEL_U(Q queue,
NavigableMap<Double,Set<SimJQEvent>> workloadEventsMap,
NavigableMap<Double,Set<SimJQEvent>> processedEventsMap)
Creates the unique prediction, if possible,
resulting from subjecting a given queue to a given workload
under an Insertion-Order Event List.
|
SimQueuePrediction_SQ_SV<Q> |
predict_SQ_SV_ROEL_U(Q queue,
Set<SimJQEvent> workloadEvents)
Creates the unique prediction, if possible,
resulting from subjecting a given queue to a given workload
under a Random-Order Event List.
|
createQueueState, createWorkloadSchedule_SQ_SV_ROEL_U, createWorkloadSchedule_SQ_SV, doQueueEvents_SQ_SV_ROEL_U, doWorkloadEvents_SQ_SV_ROEL_U, doWorkloadEvents_SQ_SV, getNextQueueEventTimeBeyond, updateToTimehasServerAccessCredits, isQueueAccessVacation, isStartArmedSimQueuePrediction_SQ_SV<Q> predict_SQ_SV_ROEL_U(Q queue, Set<SimJQEvent> workloadEvents) throws SimQueuePredictionException
queue - The queue, non-null.workloadEvents - The workload events; events related to other queues are allowed and are to be ignored.IllegalArgumentException - If queue == null or the workload parameters are somehow illegal.UnsupportedOperationException - If the queue type or the workload is (partially) unsupported.SimQueuePredictionException - If a prediction is (e.g.) too complex to generate
(SimQueuePredictionComplexityException),
if invalid input has been supplied to the predictor
(SimQueuePredictionInvalidInputException),
or if a unique prediction cannot be generated
(SimQueuePredictionAmbiguityException).SimQueuePrediction_SQ_SV<Q> predict_SQ_SV_IOEL_U(Q queue, NavigableMap<Double,Set<SimJQEvent>> workloadEventsMap, NavigableMap<Double,Set<SimJQEvent>> processedEventsMap) throws SimQueuePredictionException
Note that processed-events map parameter may be equal to the workload events map, in which case processed (internal) events are inserted in situ. If a different map is provided, it is cleared upon entry.
queue - The queue, non-null.workloadEventsMap - The workload events as a map from event time onto the
(ordered!) set of events occurring at that time;
events related to other queues are allowed and are to be ignored.processedEventsMap - An optional map in which all events processed at the queue (including workload events)
are stored unambiguously; the events in a value set are in processing ordered
(you can use this to resolve ambiguities in the visit logs like equal departure times).IllegalArgumentException - If queue == null or the workload parameters are somehow illegal.UnsupportedOperationException - If the queue type or the workload is (partially) unsupported.SimQueuePredictionException - If a prediction is (e.g.) too complex to generate
(SimQueuePredictionComplexityException),
if invalid input has been supplied to the predictor
(SimQueuePredictionInvalidInputException),
or if a unique prediction cannot be generated
(SimQueuePredictionAmbiguityException).static <Q extends SimQueue> boolean matchVisitLogs_SQ_SV(Q queue, Map<SimJob,JobQueueVisitLog<SimJob,Q>> predicted, Map<SimJob,TreeMap<Double,TreeMap<Integer,JobQueueVisitLog<SimJob,Q>>>> actual, double accuracy, PrintStream stream, String testString)
JobQueueVisitLogs for equality, within given accuracy.
The actual argument holds all (allowing multiple) job visits, and may contain visits to other SimQueues;
the latter of which are (to be) ignored.
The map has the jobs as keys, and each value holds another map from arrival times (of the
particular job) to numbered JobQueueVisitLog of that job at that particular arrival time
(this allows multiple arrivals of the same job at the same time).
Q - The (generic) type of the queue.queue - The queue, non-null.predicted - The predicted JobQueueVisitLogs, indexed by job-arrival time; arrival at other queues
are (to be) ignored.actual - The actual JobQueueVisitLogs, see above.accuracy - The accuracy (maximum deviation of times in a JobQueueVisitLog), non-negative.stream - An optional stream for mismatch reporting.testString - An optional String identifying the test in place.IllegalArgumentException - If any of the arguments except the stream has null value,
is illegally structured, or if the
accuracy argument is negative.Copyright © 2018. All rights reserved.