Reproduction code for "A Bayesian quality scheduling index for planning recurrent service robot tasks: from the shop floor to the household"
Description
Python code that reproduces every quantitative result, table and figure of the associated manuscript, submitted to the International Journal of Production Research. The manuscript extends the Quality Scheduling Index, a managerial tool for comparing production schedules on quality, time and cost, into a Bayesian Quality Scheduling Index (BQSI) for planning the recurrent tasks of service robots under uncertainty, with a fleet level prior estimated from operator logs, a forgetting factor for changing environments, a valuation of trial periods, and a rate form of the index for large task sets. The code has nine parts. Part 1: acquisition viability Monte Carlo for 200,000 simulated households (Section 4.1, Figure 1). Part 2: value of Bayesian learning against a static allocator (Section 4.2). Part 3: sensitivity analysis with rank correlations, prior perturbation scenarios and a tornado analysis (Table 4, Figure 3). Part 4: hierarchical fleet prior, forgetting under regime change and the trial period valued as expected value of sample information (Table 3). Part 5: comparison of the index maximiser with epsilon greedy, UCB1, Thompson sampling and sliding window Thompson sampling on stationary and drifting instances (Table 2, Figure 2). Part 6: a seven task schedule with precedence constraints, travel times, a battery budget and uncertain durations, all 3,591 feasible ordered schedules ranked under a stochastic battery cut off (Table 5). Part 7: scale test of the rate ordering (Proposition 3) on replenishment rounds of 20 to 200 stations against a fractional upper bound, learning on a 100 station round, and a Monte Carlo check of the closed form condition of Proposition 4 (Table 6, Appendix A.4). Part 8: a routine that reads a fleet log with the fields unit, task, start and end timestamps, status and intervention, applies censoring and minimum instance rules, and returns the fleet prior, tested on a synthetic log (Section 3.5). Part 9: calibration of the hospital case on the published operating figures of Li et al. (2026, Scientific Reports 16:18927), including Gamma and Beta priors, the first month adaptation as a drift, and a reconstruction of the reported payback (Section 5.1.3). Two identical implementations are provided: bqsi_sim.py (plain Python script) and bqsi_sim.ipynb (Jupyter and Google Colab notebook). All random draws use fixed seeds, so outputs are deterministic. No proprietary or personal data are used or included. Part 9 uses only aggregate figures quoted from the cited open access article. Requirements: Python 3 with NumPy; SciPy is optional and speeds up Part 6; matplotlib is needed only for the figure blocks. Version history: V1 parts 1 to 3; V2 added part 4; V3 added part 5 and updated headers to the manuscript title; V4 adds parts 6 to 9 and renumbers table and figure references to the current manuscript.
Files
Steps to reproduce
Google Colab: File → Upload notebook → bqsi_sim.ipynb → Runtime → Run all. Locally: python bqsi_sim.py with Python 3 and NumPy installed. Parts 1 to 5 and 7 to 9 complete in about two minutes in total. Part 6 evaluates 3,591 schedules for every replication and day and takes about 20 to 25 minutes at the 120 replications used in the manuscript; the constant REPS in that block can be lowered for a quick check, but the reported numbers require REPS = 120. Console headers name the manuscript table, figure or section each block reproduces, and the figure blocks write PNG files to the working directory.
Institutions
- Titu Maiorescu UniversityBucurești, Bucharest