You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking to add a basic function to terminate a simulation through using a method that requests a simulation to end with the Simulation object. Right now if you want to cleanly end a simulation early you need to exit the iterator within the simulation for loop like this:
So if we have a callback set for before_step that could have some basic functionality to end a simulation (like if you are deviating too far out some ideal depth or something).
withSimulation("model") assim:
nodeXYZ=Nodes(sim)["nodeZYX"]
defbefore_step_callback():
ifnodeXYZ.depth>8:
sim.terminate_simulation()
# Setting Callbackssim.add_before_step(before_step_callback)
forind, stepinenumerate(sim):
# Now simulation will end early if the depth is > 8pass
Benefits - if you are running optimization it could save you computational time.
Cons - if you like wasting money, you don't get to waste money anymore...
The text was updated successfully, but these errors were encountered:
Looking to add a basic function to terminate a simulation through using a method that requests a simulation to end with the Simulation object. Right now if you want to cleanly end a simulation early you need to exit the iterator within the simulation for loop like this:
So if we have a callback set for
before_step
that could have some basic functionality to end a simulation (like if you are deviating too far out some ideal depth or something).Benefits - if you are running optimization it could save you computational time.
Cons - if you like wasting money, you don't get to waste money anymore...
The text was updated successfully, but these errors were encountered: