# NephroSim

Gymnasium environments for reinforcement learning in hemodialysis optimization.

## Installation

```bash
pip install nephrosim
```

## Quick Start

```python
import gymnasium as gym
import nephrosim

env = gym.make("nephrosim/UreaClearing-v0")
obs, info = env.reset()

for _ in range(240):
    action = env.action_space.sample()
    obs, reward, terminated, truncated, info = env.step(action)
    if terminated or truncated:
        break
```

## Environments

| Environment | Observation | Action | Objective |
|---|---|---|---|
| `UreaClearing-v0` | 7-dim | 2-dim (Qb, Qd) | Maximize Kt/V |
| `UltrafiltrationControl-v0` | 8-dim | 1-dim (UF rate) | Remove fluid safely |
| `PhosphateMgmt-v0` | 6-dim | 1-dim (binder dose) | Weekly phosphate control |
| `FullDialysisSession-v0` | 11-dim | 3-dim (Qb, Qd, UF) | Multi-objective |

## Citation

```bibtex
@article{dhia2026nephrosim,
  title={NephroSim: Gymnasium Environments for Reinforcement Learning in Hemodialysis Optimization},
  author={Dhia, Hass},
  year={2026},
  institution={Smart Technology Investments Research Institute}
}
```

## License

MIT
