Monitors¶
As simulations run, the Monitor class interacts with the main environment, gathering data at certain intervals
This module contains methods for monitoring and visualization. As simulations run, the Monitor class interacts with the main environment, gathering data at certain intervals. Moreover, the Monitor class was designed to be general enough so that one can build their own by overriding its Name and its data-gathering Add function.
- class parallelqueue.monitors.JobTime¶
Tracks time of job entry and exit.
- class parallelqueue.monitors.JobTotal¶
Tracks total time each job/set spends in system. To get the mean time each job/set spends:
Example
from monitors import JobTotal import pandas as pd sim = base_models.RedundancyQueueSystem(maxTime=100.0, parallelism=10, seed=1234, d=2, Arrival=random.expovariate, AArgs=0.5, Service=random.expovariate, SArgs=0.2, doPrint=True, Monitors = [JobTotal]) sim.RunSim() totals = sim.MonitorOutput["JobTotal"] mean = pd.Series(totals, index = totals.keys()).mean()
- class parallelqueue.monitors.Monitor¶
Base class defining the behaviour of monitors over ParallelQueue models. Unless overridden, the return of this class will be a dict of values.
Note
In general, if you need data not provided by any one of the default implementations, you would fare better by overriding elements of Monitor as needed. This is as opposed to calling a collection of monitors which will then need to update frequently.
- class parallelqueue.monitors.ReplicaSets¶
Tracks replica sets generated over time, along with their times of creation and disposal.
- class parallelqueue.monitors.TimeQueueSize¶
Tracks queue sizes over time.