wolfgpu.SimulationRunner
Module Contents
- class wolfgpu.SimulationRunner.GlWindowManagerInterface[source]
Bases:
enum.Enum
Generic enumeration.
Derive from this class to define new enumerations.
- class wolfgpu.SimulationRunner.SimulationRunner(glsim, record_path: pathlib.Path | str = Path('.'), early_out_delta_max=1e-06, record=True, page_flip_func=pygame.display.flip, enable_alpha_recording=False)[source]
-
- classmethod quick_run(sim: wolfgpu.simple_simulation.SimpleSimulation, record_path: pathlib.Path | str, refresh_view: float = 0.1, early_out_threshold=None, gl_wmi: GlWindowManagerInterface = GlWindowManagerInterface.PYGAME) wolfgpu.results_store.ResultsStore [source]
Run a full simulation quickly. By quickly we mean a lot of the setup of the simulator (such as OpenGL context) is done automatically. In particular a progress window is displayed.
sim: the simulation you want to run
- record_patha directory where to record the results of the simulation. We
accept str as well as Path.
refresh_view : how often the progress window is displyaed (every N seconds)
- restart_from_record(start_rec=None)[source]
Restart a simulation from a previous record. This is useful when you want to continue a simulation that has been interrupted.
When restarting from a record, it means that the record in question will be deleted and simulation will go on from there.
- Parameters:
start_rec – the index of the record you want to start from. If None, the simulation will restart from the last record.
- results_store() wolfgpu.results_store.ResultsStore [source]
Gives a result store back. The result store will be opened in read mode.
- texture_written_by_last_step() int [source]
After running run_one_step this gives the number of the texture that was written to (zero or one; rememeber the GPU code often uses flip-flop textures, that’s what you query here).