question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Environment creates the same scenario between resets

See original GitHub issue

Consider this minimal example:

import gym
from gym.envs.registration import register

register(
	id='simglucose-adult001-v0',
		entry_point='simglucose.envs:T1DSimEnv',
		kwargs={'patient_name': 'adult#001'}
	)
env = gym.make('simglucose-adult001-v0')
env.seed(0)

env.reset()
>>> Observation(CGM=126.63092222821054)

env.reset()
>>> Observation(CGM=126.63092222821054)

The environment produces the same scenario Observation(CGM=126.63092222821054) on reset(), even on changing the seed unless I make the environment again. This shouldn’t be the case as it keeps on generating the same episode.

Is this a potential bug, or am I missing something here? @jxx123

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
jxx123commented, Dec 28, 2020

@sumanabasu Thank you so much for your comments!

  • Re: moving this line to __init__, actually this line in __init__ will call _seed() function.
  • Re: my plan for generating the new episode, my plan is of course as you said changing those 2 seeds deterministically. Then this start_time will be regenerated. My next plan is to make the initial BG settable (see this issue). And set the initial BG randomly based on the seed.
  • Re the patient parameters: the patient parameters are saved in this file. If you want to change the parameters, this is the place to change it.
  • Thanks a lot if you want to contribute to a better documentation! Feel free to shoot me PRs.
0reactions
jxx123commented, Dec 28, 2020

The fix is in. Will make the initial BG settable in another PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Environments overview - Power Platform | Microsoft Learn
Environment history gives admins a timeline of the full environment lifecycle from the moment it's created until it's completely deleted with ...
Read more >
Climate change widespread, rapid, and intensifying – IPCC
GENEVA, Aug 9 – Scientists are observing changes in the Earth's climate in every region and across the whole climate system, according to ......
Read more >
Ecosystem Change - GreenFacts
World climate has already changed and continues to change, affecting temperature, rainfall, and sea levels. Commercially exploited fish stocks ...
Read more >
Adaptation | National Geographic Society
In evolutionary theory, adaptation is the biological mechanism by which organisms adjust to new environments or to changes in their current ...
Read more >
Global environmental change and health - NCBI - NIH
This causes inequalities in both health endangering exposures and health outcomes. ... Relations between human induced global environmental changes affect ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found