simulation_setup.yaml 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. Config:
  2. superclass: BaseDataClass
  3. doc: Class holds simulation configuration.
  4. items:
  5. - name: seed
  6. type: int
  7. default: 1
  8. min: 0 # TODO: min/max value check is not generated yet
  9. max: 65535
  10. doc: Random generator seed value.
  11. - name: time_step
  12. type: float
  13. default: 1e-6
  14. min: 1e12
  15. doc: |
  16. Set the simulation time step to time_step seconds. 1e-6 (1us) is a common value.
  17. One can set the time steps taken by individual molecules, but this
  18. time step is still used as a default.
  19. - name: use_bng_units
  20. type: bool
  21. default: false
  22. doc: |
  23. When False (default), MCell uses traditional MCell units for bimolecular reaction rates are:
  24. * [M^-1*s^-1] for bimolecular reactions between either two volume molecules, a volume molecule
  25. and a surface (molecule),
  26. * [um^2*N^-1*s^-1] bimolecular reactions between two surface molecules on the same surface.
  27. When True, BioNetGen units for bimolecular reaction rates are:
  28. * [um^3*N^-1*s^-1] for any bimolecular reactions. Surface-surface reaction rate conversion assumes 10nm membrane thickness
  29. BioNetGen units are compatible with BioNetGen's ODE, SSA, and PLA solvers given that seed species
  30. is copy number (N), these units are not compatible with NFSim.
  31. No other units are affected by this setting.
  32. - name: surface_grid_density
  33. type: float
  34. default: 10000
  35. min: 1
  36. doc:
  37. Tile all surfaces so that they can hold molecules at N different
  38. positions per square micron.
  39. - name: interaction_radius
  40. type: float
  41. default: unset
  42. min: 0
  43. doc: |
  44. Diffusing volume molecules will interact with each other when
  45. they get within N microns of each other. The default is
  46. 1/sqrt(PI * Sigma_s) where Sigma_s is the surface grid density
  47. (default or user-specified).
  48. - name: intermembrane_interaction_radius
  49. type: float
  50. default: unset
  51. min: 0
  52. doc: |
  53. Diffusing surface molecules will interact with surface molecules on other
  54. walls when they get within N microns of each other. The default is
  55. 1/sqrt(PI * Sigma_s) where Sigma_s is the surface grid density
  56. (default or user-specified).
  57. When unset, the default value is computed as:
  58. 1.0 / sqrt_f(MY_PI * surface_grid_density).
  59. examples: tests/pymcell4/3000_intermembrane_rxns/customization.py
  60. - name: vacancy_search_distance
  61. type: float
  62. default: 10
  63. min: 0
  64. doc: |
  65. Rather internal, there is usually no need to change this value.
  66. Used in dynamic geometry (see Model.apply_vertex_moves()).
  67. When a wall moves or its dimensions change, this is the maximum search distance
  68. use when looking onto which tiles place the molecules on this wall.
  69. If no empty tile is found within this distance, simulation fails.
  70. old_doc: |
  71. Normally, a reaction will not proceed on a surface unless there
  72. is room to place all products on the single grid element where
  73. the reaction is initiated. By increasing r from its default value
  74. of 0, one can specify how far from the reaction’s location, in microns, the
  75. reaction can place its products. To be useful, r must
  76. be larger than the longest axis of the grid element on the triangle
  77. in question. The reaction will then proceed if there is room to
  78. place its products within a radius r, and will place those products as
  79. close as possible to the place where the reaction occurs
  80. (deterministically, so small-scale directional bias is possible).
  81. examples: tests/pymcell4/1200_dyn_vert_tetrahedron_vol_mol_multiple_changes/model.py
  82. - name: center_molecules_on_grid
  83. type: bool
  84. default: False
  85. doc: |
  86. If set to True, then all molecules on a surface will be
  87. located exactly at the center of their grid element. If False, the
  88. molecules will be randomly located when placed, and reactions
  89. will take place at the location of the target (or the site of impact
  90. in the case of 3D molecule/surface reactions).
  91. examples: tests/pymcell4/1210_dyn_vert_tetrahedron_surf_mol_multiple_changes/model.py
  92. - name: partition_dimension
  93. type: float
  94. default: 10 #um
  95. min: 1e-5
  96. doc: |
  97. All the simulated 3d space is placed in a partition. The partition is a cube and
  98. this partition_dimension specifies the length of its edge in um.
  99. examples: tests/pymcell4/1100_point_release/model.py
  100. - name: initial_partition_origin
  101. type: List[float]
  102. default: unset
  103. doc: |
  104. Optional placement of the initial partition in um, specifies the left, lower front
  105. point. If not set, value -partition_dimension/2 is used for each of the dimensions
  106. placing the center of the partition to (0, 0, 0).
  107. - name: subpartition_dimension
  108. type: float
  109. default: 0.5 #um
  110. min: 1e-6
  111. doc: |
  112. Subpartition are spatial division of 3D space used to accelerate collision checking.
  113. In general, partitions should be chosen to avoid having too many surfaces and molecules
  114. in one subpartition.
  115. If there are few surfaces and/or molecules in a subvolume, it is advantageous to have the
  116. subvolume as large as possible. Crossing partition boundaries takes a small amount of time,
  117. so it is rarely useful to have partitions more finely spaced than the average diffusion distance
  118. of the faster-moving molecules in the simulation.
  119. examples: tests/pymcell4/2000_bngl_a_plus_b_to_c_partitioning/model.py
  120. - name: total_iterations
  121. type: float
  122. default: 1000000
  123. min: 9
  124. doc: |
  125. Required for checkpointing so that the checkpointed model has information on
  126. the intended total number of iterations.
  127. Also used when generating visualization data files and also for other reporting uses.
  128. Value is truncated to an integer.
  129. - name: check_overlapped_walls
  130. type: bool
  131. default: True
  132. doc: |
  133. Enables check for overlapped walls. Overlapping walls can cause issues during
  134. simulation such as a molecule escaping closed geometry when it hits two walls
  135. that overlap.
  136. - name: reaction_class_cleanup_periodicity
  137. type: int
  138. default: 500
  139. doc: |
  140. Reaction class cleanup removes computed reaction classes for inactive species from memory.
  141. This provides faster reaction lookup faster but when the same reaction class is
  142. needed again, it must be recomputed.
  143. examples: tests/pymcell4/2701_concentration_based_rxn_rate_cleanup_check/model.py
  144. - name: species_cleanup_periodicity
  145. type: int
  146. default: 10000
  147. doc: |
  148. Species cleanup removes inactive species from memory. It removes also all reaction classes
  149. that reference it.
  150. This provides faster addition of new species lookup faster but when the species is
  151. needed again, it must be recomputed.
  152. examples: tests/pymcell4/2701_concentration_based_rxn_rate_cleanup_check/model.py
  153. - name: molecules_order_random_shuffle_periodicity
  154. type: int
  155. default: 10000
  156. doc: |
  157. Randomly shuffle the order in which molecules are simulated.
  158. This helps to overcome potential biases that may occur when
  159. molecules are ordered e.g. by their species when simulation starts.
  160. The first shuffling occurs at this iteration, i.e. no shuffle is done at iteration 0.
  161. Setting this parameter to 0 disables the shuffling.
  162. - name: sort_molecules
  163. type: bool
  164. default: False
  165. doc: |
  166. Enables sorting of molecules for diffusion, this may improve cache locality and provide
  167. slightly better performance.
  168. Produces different results for the same seed when enabled because molecules are simulated
  169. in a different order.
  170. - name: memory_limit_gb
  171. type: int
  172. default: -1
  173. doc: |
  174. Sets memory limit in GB for simulation run.
  175. When this limit is hit, all buffers are flushed and simulation is terminated with an error.
  176. examples: tests/nutmeg4_pymcell4/0200_memory_limit/model.py
  177. - name: initial_iteration
  178. type: uint64
  179. default: 0
  180. min: 0
  181. doc: Initial iteration, used when resuming a checkpoint.
  182. - name: initial_time
  183. type: float
  184. default: 0
  185. min: 0
  186. doc: |
  187. Initial time in us, used when resuming a checkpoint.
  188. Will be truncated to be a multiple of time step.
  189. - name: initial_rng_state
  190. type: RngState*
  191. default: unset
  192. doc: |
  193. Used for checkpointing, may contain state of the random number generator to be set
  194. after initialization right before the first event is started.
  195. When not set, the set 'seed' value is used to initialize the random number generator.
  196. - name: append_to_count_output_data
  197. type: bool
  198. default: false
  199. doc: |
  200. Used for checkpointing, instead of creating new files for Count observables data,
  201. new values are appended to the existing files. If such files do not exist, new files are
  202. created.
  203. - name: continue_after_sigalrm
  204. type: bool
  205. default: false
  206. doc: |
  207. MCell registers a SIGALRM signal handler. When SIGALRM signal is received and
  208. continue_after_sigalrm is False, checkpoint is stored and simulation is terminated.
  209. When continue_after_sigalrm is True, checkpoint is stored and simulation continues.
  210. SIGALRM is not supported on Windows.
  211. examples: tests/nutmeg4_pymcell4/2785_schedule_checkpoint_async_w_sigalrm_continue/model.py
  212. Notifications:
  213. superclass: BaseDataClass
  214. items:
  215. - name: bng_verbosity_level
  216. type: int
  217. default: 0
  218. min: 0
  219. max: 3
  220. doc: |
  221. Sets verbosity level that enables printouts of extra information on BioNetGen
  222. species and rules created and used during simulation.
  223. - name: rxn_and_species_report
  224. type: bool
  225. default: False
  226. doc: |
  227. When set to True, simulation generates files rxn_report_SEED.txt, and
  228. species_report_SEED.txt that contain details on reaction classes and species
  229. that were created based on reaction rules.
  230. - name: simulation_stats_every_n_iterations
  231. type: int
  232. default: 0
  233. doc: |
  234. When set to a value other than 0, internal simulation stats will be printed.
  235. - name: rxn_probability_changed
  236. type: bool
  237. default: True
  238. doc: |
  239. When True, information that a reaction's probability has changed is printed during simulation.
  240. - name: iteration_report
  241. type: bool
  242. default: True
  243. doc: |
  244. When True, a running report of how many iterations have completed, chosen based
  245. on the total number of iterations, will be printed during simulation.
  246. todo: add to cellblender and data model import/export
  247. - name: wall_overlap_report
  248. type: bool
  249. default: False
  250. doc: |
  251. When True, information on wall overlaps will be printed.
  252. # none of these notifications below are currrently interpreted by mcell
  253. # - name: probability_report
  254. # type: bool
  255. # default: True
  256. #
  257. # - name: diffusion_constant_report
  258. # type: Notification
  259. # default: Notification.BRIEF
  260. #
  261. # FILE_OUTPUT_REPORT - to be removed, controls only how many lines are to be printed to reac_output
  262. #
  263. # - name: final_summary
  264. # type: bool
  265. # default: True
  266. #
  267. #
  268. # PARTITION_LOCATION_REPORT - maybe rename to something modere useful, used here: vol_util.cpp:1835
  269. #
  270. # - name: varying_probability_report
  271. # type: bool
  272. # default: True
  273. # doc: Related to changing rxn probabilities at runtime
  274. #
  275. # - name: progress_report
  276. # type: bool
  277. # default: True
  278. #
  279. # - name: release_event_report
  280. # type: bool
  281. # default: True
  282. #
  283. # - name: molecule_collision_report
  284. # type: bool
  285. # default: True
  286. Warnings:
  287. superclass: BaseDataClass
  288. doc: |
  289. This class contains warnings settings. For now it contains only one configurable
  290. warning.
  291. items:
  292. - name: high_reaction_probability
  293. type: WarningLevel
  294. default: WarningLevel.IGNORE
  295. doc: |
  296. Print a warning when a bimolecular reaction probability is over 0.5 but less or equal than 1.
  297. Warning when probability is greater than 1 is always printed.
  298. Cannot be set to WarningLevel.ERROR.
  299. examples: tests/nutmeg4_pymcell4/0615_bimol_rxn_prob_over_05_less_1_warning_disabled/model.py
  300. - name: molecule_placement_failure
  301. type: WarningLevel
  302. default: WarningLevel.ERROR
  303. doc: |
  304. Print a warning or end with an error when a release of a molecule fails.
  305. # - name: molecule_collision_report
  306. # type: WarningLevel
  307. # default: WarningLevel.WARNING
  308. #
  309. # - name: degenerate_polygons
  310. # type: WarningLevel
  311. # default: WarningLevel.WARNING
  312. #
  313. # - name: negative_diffusion_constant
  314. # type: WarningLevel
  315. # default: WarningLevel.WARNING
  316. #
  317. # - name: missing_surface_orientation
  318. # type: WarningLevel
  319. # default: WarningLevel.ERROR
  320. #
  321. # - name: negative_reaction_rate
  322. # type: WarningLevel
  323. # default: WarningLevel.WARNING
  324. #
  325. # - name: useless_volume_orientation
  326. # type: WarningLevel
  327. # default: WarningLevel.WARNING
  328. #
  329. # - name: lifetime_too_short
  330. # type: WarningLevel
  331. # default: WarningLevel.WARNING
  332. #
  333. # - name: lifetime_threshold
  334. # type: float
  335. # default: 50 # units?
  336. #
  337. # - name: missed_reactions
  338. # type: WarningLevel
  339. # default: WarningLevel.WARNING
  340. #
  341. # - name: missed_reactions_threshold
  342. # type: float
  343. # default: 0.00100000004749745 # TODO: where is this constant coming from?
  344. #