AntibioSim
Gymnasium environments for reinforcement learning in antimicrobial stewardship and antibiotic treatment optimization.
AntibioSim provides four Gymnasium-compatible environments that model key clinical decision points in antibiotic therapy: drug selection, dose optimization, therapy switching, and ward-level resistance control. Each environment is grounded in established pharmacokinetic/pharmacodynamic (PK/PD) models and bacterial dynamics from the antimicrobial stewardship literature.
Environments
| Environment | Task | Action Space | Difficulty |
|---|---|---|---|
AntibioticSelection-v0 |
Choose optimal antibiotic from formulary | Discrete(5) | Easy |
DoseOptimization-v0 |
Optimize dosing for PK/PD target attainment | Box(1) | Medium |
TherapySwitch-v0 |
IV-to-oral switch and escalation decisions | Discrete(4) | Medium |
ResistanceControl-v0 |
Ward-level antibiotic policy for resistance control | MultiDiscrete(3^5) | Hard |
Installation
pip install antibiosim
For training:
pip install antibiosim[train]
Quick Start
import gymnasium as gym
import antibiosim
env = gym.make("antibiosim/AntibioticSelection-v0")
obs, info = env.reset()
for _ in range(14):
action = env.action_space.sample()
obs, reward, terminated, truncated, info = env.step(action)
if terminated or truncated:
break
Domain Models
- Pharmacokinetics: One-compartment and two-compartment PK models (Drusano, 2004)
- Pharmacodynamics: Emax and sigmoidal Emax models (Regoes et al., 2004)
- Bacterial dynamics: Logistic growth with antibiotic kill (Austin et al., 1999)
- Resistance: Two-population susceptible/resistant dynamics (Levin & Bonten, 2004)
Baseline Agents
- Random: Uniform random action selection
- Heuristic: Clinical guideline-based rules (Barlam et al., 2016)
- PPO: Proximal Policy Optimization via Stable-Baselines3
Training
# Train PPO on all environments
python -m antibiosim.training.train_all
# Train a single environment
antibiosim-train --env antibiosim/DoseOptimization-v0
Citation
@software{dhia2026antibiosim,
author = {Dhia, Hass},
title = {AntibioSim: Gymnasium Environments for Reinforcement Learning in Antimicrobial Stewardship},
year = {2026},
url = {https://github.com/HassDhia/antibiosim},
version = {0.1.0}
}
License
MIT License. Copyright (c) 2026 Hass Dhia, Smart Technology Investments Research Institute.
Metadata
Release files for antibiosim 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| antibiosim-0.1.0.tar.gz | 35.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| antibiosim-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 69.1 kB
Release files / antibiosim-0.1.0.tar.gz
| Download URL | antibiosim-0.1.0.tar.gz |
|---|---|
| Size | 35.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
84b9a18ba04422d787fc67f676e9ba86a4318bf636827f7066b55a0c602f6642
|
|
BLAKE2b-256 checksum How to use checksums |
e7a6b68066bf59ca086a790a778f76fa08ab78e04d829359c8343296dbd2f4ae
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Release files / antibiosim-0.1.0-py3-none-any.whl
| Download URL | antibiosim-0.1.0-py3-none-any.whl |
|---|---|
| Size | 33.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fb1cd5c456bfd728860bc4286bf61fcb46592fbb8e9ff69c36206ae70aee31de
|
|
BLAKE2b-256 checksum How to use checksums |
4c54b3958ce9e4c8727e43b39b43baf668415bef34b9bd420544476e5ef6a058
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.6
|
Security for antibiosim 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.