Skip to content

UVA-DSA/OpenAPS-Glucosym-3.9

Repository files navigation

OpenAPS-Glucosym

Table of Contents
  1. About The Project
  2. Getting Started
  3. Simulation Workflow
  4. Acknowledgements

About The Project

Getting Started

Prerequisites

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

Installation

  1. Clone the repo
$ git clone https://github.com/UVA-DSA/OpenAPS-Glucosym-3.9.git
  1. 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.
  1. 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.

Simulation Workflow

Setting up Glucosym

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.

Initializing and running OpenAPS closed loop

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.

Collecting output data

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.

Acknowledgements

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published