Giter VIP home page Giter VIP logo

carbmetsim's Introduction

CarbMetSim

A discrete event simulator for tracking blood glucose level based on carbodydrate metabolism in human body.

Authors:

Mukul Goyal ([email protected])

Buket Aydas ([email protected])

Husam Ghazaleh ([email protected])

Usage:

The simulator is implemented in C++. A simple makefile has been provided.

Run the simulator in the following manner:

carbmetsim foodsfile exercisefile paramsfile eventsfile seed outputfile

"foodsfile":

The "foodsfile" contains the description of different food items. Each line in this file describes a different food using the following format:

id food-description serving-size-in-grams RAG-per-serving SAG-per-serving Protein-per-serving Fat-per-serving

The "id" is an integer id. The food item is referred to in "eventsfile" using this "id". The "food-description" is a text string (containing no space) that describes the food item. The "serving-size-in-grams" specifies the size in grams of one serving of this food item. The "RAG-per-serving" specifies the amount in grams of "Rapidly Available Glucose" (carbs that will appear in the bloodstream as glucose within 20 minutes of being eaten) in one serving of the food item. The "SAG-per-serving" specifies the amount in grams of "Slowly Available Glucose" (carbs that will appear in the bloodstream as glucose within 120 minutes of being eaten) in one serving of the food item. The "Protein-per-serving" specifies the amount in grams of protein in one serving of the food item. The "Fat-per-serving" specifies the amount in grams of fat in one serving of the food item.

For example, the following line describes a "Breakfast" with serving size 100 grams, which consists of 25 grams of RAG, 30 grams of SAG, 25 grams of protein and 20 grams of fat:

1 Breakfast 100 25 30 25 20

"exercisefile":

The "exercisefile" contains the description of different exercise types. Each line in this file describes a different exercise type using the following format:

id exercise-description intensity-in-METs

The "id" is an integer id. The exercise type is referred to in "eventsfile" using this "id". The "exercise-description" is a text string (containing no space) that describes the exercise type. The "intensity-in-METs" specifies the intensity of the exercise type in units of METs.

For example, the following line describes a "SlowWalk" activity with intensity 3 METs:

1 SlowWalk 3

"paramsfile":

The "paramsfile" describes the values of various parameters affecting the operation of different organs. The "paramsfile" can be used to modify the values of those parameters for which the default values are not appropriate. For example, the following lines in the "paramsfile" are setting the values of a few simulation parameters in "HumanBody" class:

ALL HUMAN_BODY bodyWeight_ 57

ALL HUMAN_BODY age_ 23

ALL HUMAN_BODY gender_ 0

ALL HUMAN_BODY fitnessLevel_ 50

"eventsfile":

The "eventsfile" specifies the events that the simulator will simulate. Each line in this file specifies a different event in the following format:

time-stamp event-type event-subtype howmuch

Here, "time-stamp" indicates the time when the event will be fired and is specified in the following format "day:hour:minute".

The simulator currently supports the following "event-type"s:

0: Food Event

1: Exercise Event

2: Halt Event

If the "event-type" is 2 (indicating the Halt Event), the simulation terminates at the event firing time.

The "event-subtype" is same as the "id" of a food/exercise type in "foodsfile" or "exercisefile".

For a food event, "howmuch" indicates the amount in grams of the food eaten. For an exercise event, "howmuch" indicates the duration in minutes of the exercise activity.

Here is a sample "eventsfile":

0:8:0 0 1 100

0:13:0 0 2 135

0:16:0 0 3 60

0:18:0 1 1 30

0:20:0 0 4 135

1:6:0 2 0 0

"seed":

The "seed" is a string that acts as the seed for the random number generation.

"outputfile":

The "outputfile" is the file where the simulation output will be stored. The simulation output is appended to any existing contents of this file.

Folder "conf_files_and_scripts":

A few examples of different configuration files described above as well as a few python scripts to run the simulations using different seeds can be seen in the folder "conf_files_and_scripts".

carbmetsim's People

Contributors

mukulgoyalmke avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.