Model Components¶
Basic building components (generators/processes) for parallel models. In general, the framework allows one to build a model by defining an arrival, routing, and job/servicing process such that work is introduced in the order of Arrivals->Router->Job/Servicing.
- class parallelqueue.network.Network(**kwargs)¶
The Network constructor allows a user to create a queueing network by overriding each member. Upon generation, jobs flow through a network in the order of: Arrivals → Router → Job. By default, the Network class can be used to handle JSQd, Redundancy-d, and Threshold-(d,r) models with general arrival and service distributions.
- Arrivals(system, env, number, queues, **kwargs)¶
This generator/process defines how jobs enter the network
- static Job(system, env, name, arrive, queues, choice, **kwargs)¶
This generator/process defines the behaviour of a job (replica or original) after routing.
- Router(system, env, name, queues, **kwargs)¶
This generator/process specifies the scheduling system used.
- parallelqueue.arrivals.DefaultArrivals(router, system, env, number, queues, **kwargs)¶
General arrival process; interarrival times are defined by the given distribution
- Parameters
router – Router process.
system (base_models.ParallelQueueSystem) – System providing environment.
env (simpy.Environment) – Environment for the simulation
number (int) – Max numberJobs of jobs if infiniteJobs is false.
queues (List[simpy.Resource]) – A list of all queues making up the parallel system.
- parallelqueue.routers.DefaultRouter(job, system, env, name, queues, **kwargs)¶
Specifies the scheduling system used. If replication is enabled, this router tracks each set of replicas using a
base_models.ParallelQueueSystem.ReplicaDict
which can be accessed bynetwork.Network.Job
processes.- Parameters
job – Job process.
system (base_models.ParallelQueueSystem) – System providing environment.
env (simpy.Environment) – Environment for the simulation.
name (str) – Identifier for the job.
queues (List[simpy.Resource]) – A list of queues to consider.
- parallelqueue.routers.NoInSystem(R)¶
Total number of Jobs in the resource R.
- parallelqueue.routers.QueueSelector(d, parallelism, counters)¶
The actual queue selection logic.
- parallelqueue.jobs.DefaultJob(system, env, name, arrive, queues, choice, **kwargs)¶
For a redundancy model, this generator/process defines the behaviour of a job (replica or original) after routing.
- Parameters
system (base_models.ParallelQueueSystem) – System providing environment.
env (simpy.Environment) – Environment for the simulation
name (str) – Identifier for the job.
queues (List[simpy.Resource]) – A list of queuesOverTime.
arrive (float) – Time of job arrival (before replication).
choice (int) – The queue which this replica is currently in