J - The job type.DQ - The queue-type for delegate jobs.public class JacksonSimQueueSelector<J extends SimJob,DQ extends SimQueue> extends Object implements SimQueueSelector<J,DQ>
SimQueueSelector for Jackson networks.
A Jackson queueing network, for the purposes of this software framework, is a queueing system consisting of a fixed set of
(other) queueing systems between which the routing of SimJobs is determined by fixed probabilities,
both at arrival of a job at the aggregate queue, as well as upon departure of the job at one of the
constituent (sub)queues.
Copyright (C) 2005-2017 Jan de Jongh, TNO
This file is covered by the LICENSE file in the root of this project.
| Constructor and Description |
|---|
JacksonSimQueueSelector(Set<DQ> queues,
double[] pdfArrival,
double[][] pdfTransition,
Random userRNG)
Creates a
SimQueueSelector for a Jackson network. |
| Modifier and Type | Method and Description |
|---|---|
protected static void |
checkPdfArray(double[] pdfArray,
int requiredSize)
Checks a probability-distribution array for dimension and values.
|
protected static void |
checkPdfMatrix(double[][] pdfMatrix,
int requiredSize)
Checks a probability-distribution matrix for dimension and values.
|
double[] |
getPdfArrival()
Gets the arrival probabilities (as probability distribution function).
|
double[][] |
getPdfTransition()
Gets the transition probabilities for each (source) queue in turn (as probability distribution function).
|
Random |
getRNG()
Returns the Random Number Generator used for arrivals and transitions.
|
void |
resetSimQueueSelector()
Resets this selector.
|
DQ |
selectFirstQueue(double time,
J job)
Returns the queue selected (or
null implying an immediate departure)
from a probabilistic experiment governed by the pdfArrival
array passed in the constructor. |
DQ |
selectNextQueue(double time,
J job,
DQ previousQueue)
Returns the queue selected (or
null implying a departure)
from a probabilistic experiment governed by the pdfTransition
matrix passed in the constructor. |
public JacksonSimQueueSelector(Set<DQ> queues, double[] pdfArrival, double[][] pdfTransition, Random userRNG)
SimQueueSelector for a Jackson network.queues - The queues, must be non-null.pdfArrival - The arrival probabilities for each queue (pdf);
must be array of size |Q|.
Entries must be between zero and unity and their sum should not exceed unity.
The "remainder" denotes the probability that a job departs immediately upon arrival.
This argument is copied.pdfTransition - The transition probabilities from/to each queue (pdf for each (source) queue);
must be square matrix of size |Q|x|Q|.
Entries must be between zero and unity and each row sum should not exceed unity.
The "remainder" in a row denotes the probability that a job departs after a visit to the
corresponding queue.
This argument is (deep-)copied.userRNG - An optional user-supplied random-number generator
(if absent, a new one is created for local use).IllegalArgumentException - If the queues argument is null,
or if it contains a null entry,
or if one or both of the probability arguments is improperly dimensioned or contains
illegal values.protected static void checkPdfArray(double[] pdfArray,
int requiredSize)
pdfArray - The pdf array.requiredSize - The required size of the array.IllegalArgumentException - If the array is null or not of the required size,
or any of its members is strictly negative or exceeds unity,
or the sum of its members exceeds unity.protected static void checkPdfMatrix(double[][] pdfMatrix,
int requiredSize)
pdfMatrix - The pdf matrix.requiredSize - The required (one-dimensional) size of the array.IllegalArgumentException - If the matrix is null or not square with the required size,
or any of its members is strictly negative or exceeds unity,
or one or more of its row sums exceeds unity.public final double[] getPdfArrival()
public final double[][] getPdfTransition()
public final Random getRNG()
null).public void resetSimQueueSelector()
SimQueueSelectorresetSimQueueSelector in interface SimQueueSelector<J extends SimJob,DQ extends SimQueue>public DQ selectFirstQueue(double time, J job)
null implying an immediate departure)
from a probabilistic experiment governed by the pdfArrival
array passed in the constructor.selectFirstQueue in interface SimQueueSelector<J extends SimJob,DQ extends SimQueue>time - The time of arrival of the job.job - The job, non-null.null, the job is to depart immediately.draw(double[])public DQ selectNextQueue(double time, J job, DQ previousQueue)
null implying a departure)
from a probabilistic experiment governed by the pdfTransition
matrix passed in the constructor.selectNextQueue in interface SimQueueSelector<J extends SimJob,DQ extends SimQueue>time - The current time, i.e., the departure time of the job at its previous queue.job - The job, non-null.previousQueue - The previous queue the job visited, and just departed from.null, the job is to depart immediately.IllegalStateException - If the previous queue argument is null or not a member of the set of queues.draw(double[])Copyright © 2018. All rights reserved.