open2c / polychrom

Chromosome polymer simulations and in silico capture experiments
MIT License
46 stars 16 forks source link

Model vs Simulation class #2

Closed nvictus closed 4 years ago

nvictus commented 5 years ago

Is there a clean distinction between model and simulation? If so, it might be worthwhile to "model" them as distinct objects. Model = forces, system size, initial conformation, etc., Simulation takes sim parameters (integrator, etc.) , registers reporters and eats a specified model object and keeps track of time and state. Then you can elaborate on the simulation methodology decoupled from the model itself, if that makes sense.

mimakaev commented 5 years ago

We've been thinking about it. One distinction is: things that affect the outcome of the simulation, and things that don't. For example, integrator, PBC, timestep, etc. affect the simulation. Platform, reporters do not.

The problem is that most things affect the simulation. It's only reporter and platform that do not.

As of the model vs simulation - not sure there is a clear boundary. There are forces, integrator, PBC, starting conformation, and dynamic things such as loop extrusion.

nvictus commented 5 years ago

Yeah, looking at it, I think "models" aren't more than the force dict and maybe initial configuration. Or maybe it is precisely a openmm.System.

Other things, as you said (integrator, time step, boundary conditions, even temperature and implicit solvent) are kind of somewhere in between model and simulation. More like openmm.Context.

I guess Simulation can be seen as an encapsulation of a System and a Context. So if I were to split it any further I would avoid breaking up those underlying concepts (e.g. have a PolymerSystem wrapper or a PolymerSimContext but not something that mixes up partial concepts from both).