Table of Contents
Before the installation process, the following things need to be installed:
- python3.9
- pip (
$ wget https://bootstrap.pypa.io/get-pip.py
) - [email protected] (
$ pip install virtualenv==20.7.2
) - git
- Clone the repo
$ git clone https://github.com/UVA-DSA/OpenAPS-Glucosym-3.9.git
- Virtual environment
- A virtual environment need to be set up inside ./OpenAPS-Glucosym-3.9/:
$ cd ./OpenAPS-Glucosym-3.9
$ virtualenv --python=/usr/bin/python3.9 ./venv/ #set up a virtual environment that uses python3.9
- To enter the virtual environment, use the following command:
$ source ./venv/bin/activate
- To quit the virtual environment, use the following command:
(venv)$ deactivate
- Note: The virtual environment needs to be activated while doing the following steps.
- Run the auto-install script
(venv)$ chmod u+x ./closedloop3.9-setup.sh
(venv)$ ./closedloop3.9-setup.sh
- After finishing the above steps, please close the current terminal window.
First, open a terminal window and run the following commands:
(venv)$ cd ./OpenAPS-Glucosym-3.9
(venv)$ source ./venv/bin/activate
(venv)$ cd ./glucosym
(venv)$ npm start
Then, open a browser and navigate to http://localhost:3000.
Open another terminal window and initialize OpenAPS:
(venv)$ cd ./OpenAPS-Glucosym-3.9
(venv)$ source ./venv/bin/activate
(venv)$ cd ./openaps3.9
(venv)$ python initialize.py [initial bg]
Next, change the initial bg of the selected patient on the glucosym server and run the closed loop simulation:
(venv)$ python updated_ct_script_iob_based.py [number of iterations]
- Note: Changing the patient insulin_sensitivities, bg_targets, or basal_profile files stored under ./openaps3.9/settings/ will affect the simulation result. You may want to change it if for simulation on real datasets.
Run the following command:
(venv)$ python updated_collected.py
The output data should be collected in a file called data.scv under the OpenAPS directory.