openpathsampling.PathSimulator
- class openpathsampling.PathSimulator(storage)[source]
Abstract class for the “main” function of a simulation.
- Parameters:
storage (
Storage) – Storage file for results
- save_frequency
Results should be sync’d (saved to disk) after every
save_frequencysteps. Note: subclasses must directly implement this, the attribute is just a placeholder.- Type:
int
- output_stream
Subclasses should write output to this, allowing a standard way to redirect any output.
- Type:
file
- allow_refresh
Whether to allow the output to refresh an ipynb cell; default True. This is likely to be overridden when a pathsimulator is wrapped in another simulation.
- Type:
bool
Methods
__init__(storage)args()Return a list of args of the __init__ function of a class
attach_default_hooks()attach_hook(hook[, hook_for])Attach a hook class or method to this simulation.
base()Return the most parent class actually derived from StorableObject
count_weaks()Return number of objects subclassed from StorableObject still in memory
descendants()Return a list of all subclassed objects
empty_hooks()Return a hook dictionary with no hooks.
fix_name()Set the objects name to be immutable.
from_dict(dct)Reconstruct an object from a dictionary representaiton
get_uuid()idx(store)Return the index which is used for the object in the given store.
named(name)Name an unnamed object.
objects()Returns a dictionary of all storable objects
reverse_uuid()run(n_steps)Run the simulator for a number of steps
run_hooks(hook_name, **kwargs)Run the hooks for the given
hook_nameruuid(uid)save_initial_step()Save the initial state as an MCStep to the storage
set_observer(active)(De-)Activate observing creation of storable objects
sync_storage()Will sync all collective variables and the storage to disk
to_dict()Convert object into a dictionary representation
Attributes
ACTIVE_LONGCREATION_COUNTINSTANCE_UUIDbase_clsReturn the base class
base_cls_nameReturn the name of the base class
calc_nameclsReturn the class name as a string
default_nameReturn the default name.
hook_namesis_namedTrue if this object has a custom name.
nameReturn the current name of the object.
observe_objects