Handle the basics of running parallel simulations
Classes:
- Simulation
- Framework for a basic simulation
Bases: simulations.base.Base
Base class for an individual simulation
Parameters:
- data
- The data dictionary for the simulation. Usually created by the SimulationRunner
- iteration
- The iteration number of the simulation. Usually handled by the SimulationRunner
- outfile
- The name of a file to which to dump output (or None, indicating stdout)
Public Methods:
- run()
- Runs the simulation
- set_output_file()
- Sets the output file name
Methods to Implement:
- _add_listeners()
- Set up listeners for various simulation events
- _run()
- Actual simulation functionality
Events:
- done(this)
- emitted when run() is complete and results have been stored
- outfile changed(this)
- emitted when the outfile name has been changed by set_output_file()
- outfile error(this)
- emitted when there was an error opening the output file
- run(this)
- emitted just before _run() is called
Sets up listeners for various events
Closes the Simulation.out object that simulations should print to
Parameters:
- this
- A reference to a Simulation instance
Opens the Simulation.out object that simulations should print to
Parameters:
- this
- A reference to a Simulation instance