UC-Davis-molecular-computing / ppsim

Python package for simulating population protocols
MIT License
10 stars 5 forks source link

detect if user specifies parameters in Simulation constructor and do not override if so #37

Open dave-doty opened 2 years ago

dave-doty commented 2 years ago

First, allow CRNs to be simulated in discrete time. The Simulation constructor forces continuous time to be used if the transition rules are specified by a list of CRN reactions, ignoring the value of the parameter continuous_time.

Instead, we should check whether the user specified continuous time explicitly, and if so, then use the value they gave, independently of whether CRN reactions or another method is used to specify transitions. One way is to declare its type is Optional[bool] with default value None. That way if it is a Boolean value then the user specified it. If it is None we can convert it to False after recording that it was the default value.

A similar issue appears with the steps_per_time_unit, which is automatically configured in some cases, but should not be automatically configured if the user specified a value, so it should be made type Optional[float] with default value None.

I'm not sure if this applies to any other parameters.