-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
48 changed files
with
136 additions
and
14,725 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
Copyright (c) 2017 Jinyu Xie | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
from simglucose.simulation.user_interface import simulate | ||
from simglucose.controller.base import Controller, Action | ||
|
||
|
||
class MyController(Controller): | ||
def __init__(self, init_state): | ||
self.state = init_state | ||
|
||
def policy(self, observation, reward, done, **info): | ||
''' | ||
Every controller must have this implementation! | ||
---- | ||
Inputs: | ||
observation - a namedtuple defined in simglucose.simulation.env. It has | ||
CHO and CGM two entries. | ||
reward - current reward returned by environment | ||
done - True, game over. False, game continues | ||
info - additional information as key word arguments, | ||
simglucose.simulation.env.T1DSimEnv returns patient_name | ||
and sample_time | ||
---- | ||
Output: | ||
action - a namedtuple defined at the beginning of this file. The | ||
controller action contains two entries: basal, bolus | ||
''' | ||
self.state = observation | ||
action = Action(basal=0, bolus=0) | ||
return action | ||
|
||
|
||
ctrller = MyController(0) | ||
simulate(controller=ctrller) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
from simglucose.simulation.user_interface import simulate | ||
simulate() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
|
||
setup(name='simglucose', | ||
version='0.1', | ||
description='A Type-1 Diabetes simulator as an OpenAI gym environment', | ||
description='A Type-1 Diabetes Simulator as a Reinforcement Learning Environment', | ||
url='', | ||
author='Jinyu Xie', | ||
author_email='[email protected]', | ||
|
@@ -14,6 +14,7 @@ | |
'numpy', | ||
'scipy', | ||
'matplotlib', | ||
'pathos' | ||
], | ||
include_package_data=True, | ||
zip_safe=False) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
simglucose/simulation/results/2017-12-30_13-22-35/CVGA_stats.csv
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.