Skip to content

Instantly share code, notes, and snippets.

@cvigoe
Created December 17, 2019 22:08
Show Gist options
  • Save cvigoe/94c0803be827b2a1191b29a84e8d5344 to your computer and use it in GitHub Desktop.
Save cvigoe/94c0803be827b2a1191b29a84e8d5344 to your computer and use it in GitHub Desktop.
example of the simulator code structure
def simulator(initial_state, parameter):
state = initial_state
for t in range(timesteps):
state = next_state(state,parameter)
print(state)
#############################################
# but I need to be able to do something like
parameter = 0
state = 0
for t in range(timesteps):
state = initialise_simulator(state, initial_parameter)
parameter = update_parameter(state, parameter)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment