README.md 3.81 KB
Newer Older
pkda001's avatar
pkda001 committed
1
# CLAsim
pkda001's avatar
pkda001 committed
2
The closed-loop assistant (CLA) simulation framework (CLAsim) enables simulation of the interaction between closed-loop medical systems consisting of patient monitors, closed-loop physiology management algorithms, and infusion pumps, and patient physiology. It is written in C++ and relies on the <a href="https://physiology.kitware.com/">Pulse Physiology Engine</a> for simulating patient physiology.
pkda001's avatar
pkda001 committed
3
4

## Getting Started
pkda001's avatar
pkda001 committed
5

pkda001's avatar
pkda001 committed
6
7
### Installing Pulse and CLAsim
CLAsim is has only been tested on Ubuntu 16.04. This is the recommended platform. We hope to support other platforms soon.
pkda001's avatar
pkda001 committed
8

pkda001's avatar
pkda001 committed
9
#### Pulse
pkda001's avatar
pkda001 committed
10
11
12
13
14
To install, go to the <a href="https://gitlab.kitware.com/physiology/engine">Pulse repository</a> and follow the instructions there. Be sure to follow the instructions for Ubuntu.

If you need to install or update cmake, be sure to use the install from source option.

 *For Java, be sure to use the openjdk version.*
pkda001's avatar
pkda001 committed
15
16

#### CLASim
pkda001's avatar
pkda001 committed
17
18
1. Check out the CLAsim repository into a folder of your choice.
2. Install libconfig++  
pkda001's avatar
pkda001 committed
19
20
   ~~~bash
   # update packages
pkda001's avatar
pkda001 committed
21
   $ sudo apt-get update
pkda001's avatar
pkda001 committed
22
   # install libconfig++
pkda001's avatar
pkda001 committed
23
24
   $ sudo apt-get install libconfig++-dev
   ~~~
pkda001's avatar
pkda001 committed
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
3. Find the paths for the libconfig.h++ and libconfig++.a and input them in clasim.cmake

  a. For libconfig.h++
    ~~~bash
    # find the path for libconfig.h++
    $ dpkg -L libconfig++-dev | grep libconfig.h++
    # output should be
    $ <somepath>/libconfig.h++
    # for example
    $ /usr/include/libconfig.h++
    ~~~

  b. For libconfig++.a
    ~~~bash
    # find the path for libconfig++.a
    $ dpkg -L libconfig++-dev | grep libconfig++.a
    ~~~

  c. Go to clasim.cmake file which should be in <PathToCLAsim>

  d. On line 6, which should looks like
    ~~~bash
    find_path(CONFIG++_INCLUDE_DIR libconfig.h++ <libconfig.h++ location>)
    ~~~
    replace `<libconfig.h++ location>` with the path (`<somepath>`) you found in step 3a.
pkda001's avatar
pkda001 committed
50

pkda001's avatar
pkda001 committed
51
52
53
54
55
56
57
  e. On line 7, which should look like
    ~~~bash
    find_library(CONFIG++_LIBRARY NAMES libconfig++.a PATH <libconfig++.a location>)
    ~~~
    replace `<libconfig++.a location>` with the path (`<somepath>`) you found in step 3b.

4. Install CLASim with CMake
pkda001's avatar
pkda001 committed
58
59
60
61
62
63
64
65
   ~~~bash
   # make sure you are in the CLAsim folder
   $ cd <PathToCLAsim>
   # create a builds directory
   $ mkdir builds
   # enter builds folder
   $ cd builds
   # connect Pulse and CLASim for CMake Install
66
   $ cmake .. -DCMAKE_PREFIX_PATH=<PathToPulse>/builds/install/
pkda001's avatar
pkda001 committed
67
68
69
70
71
   # create CLASim add_executable
   $ make
   $ make Install
   ~~~

pkda001's avatar
pkda001 committed
72
5. Test that the CLASim executable installed properly.
pkda001's avatar
pkda001 committed
73
74
75
76
77
   ~~~bash
   # go to Pulse bin directory
   # (CLAsim executable installs there)
   $ cd <PathToPulse>/builds/install/bin
   # run CLAsim
78
   # this will generate an error, but confirms installation
pkda001's avatar
pkda001 committed
79
   $ ./clasim
pkda001's avatar
pkda001 committed
80
   ~~~
pkda001's avatar
pkda001 committed
81
82

### Running Demo Examples
pkda001's avatar
pkda001 committed
83
84
85
86
87
88
89
90
91
92
93
94
95
The repository comes with demo examples in `/simsrc/mcps2018`. The clasim.cmake file is already configured for `algo1` in this example. In the `resources` folder, you will find a `scenario.cfg` file. Here, you can adjust some of the simulation parameters.

Running step 5 above should run the simulation. The results will be generated in a `results` folder. The patient data will be in a `PulseSimEngine_<patient name>.txt` file.

## Coming Soon
We are working on the following:
- *Data visualization/interaction tools:* making the python scripts for plotting the data more flexible so others can use them to visualize/interact with data generated from the simulation.

- *Flexible output:* making it easier to specify where the results should go.

- *Flexible input:* making it easier to specify where the specific scenario file to use as well as making it easier to control more of the simulation from configuration files without the need to recompile.

- *Modulalar base code:* making the base code more modular so others can create and use their own models of devices and algorithms.