gen_constants.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2021 by
  4. * The Salk Institute for Biological Studies
  5. *
  6. * Use of this source code is governed by an MIT-style
  7. * license that can be found in the LICENSE file or at
  8. * https://opensource.org/licenses/MIT.
  9. *
  10. ******************************************************************************/
  11. #ifndef API_GEN_CONSTANTS
  12. #define API_GEN_CONSTANTS
  13. #include <string>
  14. #include <climits>
  15. #include <cfloat>
  16. #include "api/globals.h"
  17. namespace MCell {
  18. namespace API {
  19. const std::string STATE_UNSET = "STATE_UNSET";
  20. const int STATE_UNSET_INT = -1;
  21. const int BOND_UNBOUND = -1;
  22. const int BOND_BOUND = -2;
  23. const int BOND_ANY = -3;
  24. const double PARTITION_EDGE_EXTRA_MARGIN_UM = 0.01;
  25. const int DEFAULT_COUNT_BUFFER_SIZE = 100;
  26. const std::string ALL_MOLECULES = "ALL_MOLECULES";
  27. const std::string ALL_VOLUME_MOLECULES = "ALL_VOLUME_MOLECULES";
  28. const std::string ALL_SURFACE_MOLECULES = "ALL_SURFACE_MOLECULES";
  29. const std::string DEFAULT_CHECKPOINTS_DIR = "checkpoints";
  30. const std::string DEFAULT_SEED_DIR_PREFIX = "seed_";
  31. const int DEFAULT_SEED_DIR_DIGITS = 5;
  32. const std::string DEFAULT_ITERATION_DIR_PREFIX = "it_";
  33. const int ID_INVALID = -1;
  34. const int NUMBER_OF_TRAINS_UNLIMITED = -1;
  35. const double TIME_INFINITY = 1e140;
  36. const int INT_UNSET = INT32_MAX;
  37. const double FLT_UNSET = FLT_MAX;
  38. const int RNG_SIZE = 256;
  39. enum class Orientation {
  40. DOWN = -1,
  41. NONE = 0,
  42. UP = 1,
  43. NOT_SET = 2,
  44. ANY = 3,
  45. DEFAULT = 4
  46. };
  47. static inline std::ostream& operator << (std::ostream& out, const Orientation v) {
  48. switch (v) {
  49. case Orientation::DOWN: out << "m.Orientation.DOWN"; break;
  50. case Orientation::NONE: out << "m.Orientation.NONE"; break;
  51. case Orientation::UP: out << "m.Orientation.UP"; break;
  52. case Orientation::NOT_SET: out << "m.Orientation.NOT_SET"; break;
  53. case Orientation::ANY: out << "m.Orientation.ANY"; break;
  54. case Orientation::DEFAULT: out << "m.Orientation.DEFAULT"; break;
  55. }
  56. return out;
  57. };
  58. enum class Notification {
  59. NONE = 0,
  60. BRIEF = 1,
  61. FULL = 2
  62. };
  63. static inline std::ostream& operator << (std::ostream& out, const Notification v) {
  64. switch (v) {
  65. case Notification::NONE: out << "m.Notification.NONE"; break;
  66. case Notification::BRIEF: out << "m.Notification.BRIEF"; break;
  67. case Notification::FULL: out << "m.Notification.FULL"; break;
  68. }
  69. return out;
  70. };
  71. enum class WarningLevel {
  72. IGNORE = 0,
  73. WARNING = 1,
  74. ERROR = 2
  75. };
  76. static inline std::ostream& operator << (std::ostream& out, const WarningLevel v) {
  77. switch (v) {
  78. case WarningLevel::IGNORE: out << "m.WarningLevel.IGNORE"; break;
  79. case WarningLevel::WARNING: out << "m.WarningLevel.WARNING"; break;
  80. case WarningLevel::ERROR: out << "m.WarningLevel.ERROR"; break;
  81. }
  82. return out;
  83. };
  84. enum class VizMode {
  85. ASCII = 0,
  86. CELLBLENDER_V1 = 1,
  87. CELLBLENDER = 2
  88. };
  89. static inline std::ostream& operator << (std::ostream& out, const VizMode v) {
  90. switch (v) {
  91. case VizMode::ASCII: out << "m.VizMode.ASCII"; break;
  92. case VizMode::CELLBLENDER_V1: out << "m.VizMode.CELLBLENDER_V1"; break;
  93. case VizMode::CELLBLENDER: out << "m.VizMode.CELLBLENDER"; break;
  94. }
  95. return out;
  96. };
  97. enum class Shape {
  98. UNSET = 0,
  99. SPHERICAL = 1,
  100. REGION_EXPR = 2,
  101. LIST = 3,
  102. COMPARTMENT = 4
  103. };
  104. static inline std::ostream& operator << (std::ostream& out, const Shape v) {
  105. switch (v) {
  106. case Shape::UNSET: out << "m.Shape.UNSET"; break;
  107. case Shape::SPHERICAL: out << "m.Shape.SPHERICAL"; break;
  108. case Shape::REGION_EXPR: out << "m.Shape.REGION_EXPR"; break;
  109. case Shape::LIST: out << "m.Shape.LIST"; break;
  110. case Shape::COMPARTMENT: out << "m.Shape.COMPARTMENT"; break;
  111. }
  112. return out;
  113. };
  114. enum class SurfacePropertyType {
  115. UNSET = 0,
  116. REACTIVE = 1,
  117. REFLECTIVE = 2,
  118. TRANSPARENT = 3,
  119. ABSORPTIVE = 4,
  120. CONCENTRATION_CLAMP = 5,
  121. FLUX_CLAMP = 6
  122. };
  123. static inline std::ostream& operator << (std::ostream& out, const SurfacePropertyType v) {
  124. switch (v) {
  125. case SurfacePropertyType::UNSET: out << "m.SurfacePropertyType.UNSET"; break;
  126. case SurfacePropertyType::REACTIVE: out << "m.SurfacePropertyType.REACTIVE"; break;
  127. case SurfacePropertyType::REFLECTIVE: out << "m.SurfacePropertyType.REFLECTIVE"; break;
  128. case SurfacePropertyType::TRANSPARENT: out << "m.SurfacePropertyType.TRANSPARENT"; break;
  129. case SurfacePropertyType::ABSORPTIVE: out << "m.SurfacePropertyType.ABSORPTIVE"; break;
  130. case SurfacePropertyType::CONCENTRATION_CLAMP: out << "m.SurfacePropertyType.CONCENTRATION_CLAMP"; break;
  131. case SurfacePropertyType::FLUX_CLAMP: out << "m.SurfacePropertyType.FLUX_CLAMP"; break;
  132. }
  133. return out;
  134. };
  135. enum class ExprNodeType {
  136. UNSET = 0,
  137. LEAF = 1,
  138. ADD = 2,
  139. SUB = 3
  140. };
  141. static inline std::ostream& operator << (std::ostream& out, const ExprNodeType v) {
  142. switch (v) {
  143. case ExprNodeType::UNSET: out << "m.ExprNodeType.UNSET"; break;
  144. case ExprNodeType::LEAF: out << "m.ExprNodeType.LEAF"; break;
  145. case ExprNodeType::ADD: out << "m.ExprNodeType.ADD"; break;
  146. case ExprNodeType::SUB: out << "m.ExprNodeType.SUB"; break;
  147. }
  148. return out;
  149. };
  150. enum class RegionNodeType {
  151. UNSET = 0,
  152. LEAF_GEOMETRY_OBJECT = 1,
  153. LEAF_SURFACE_REGION = 2,
  154. UNION = 3,
  155. DIFFERENCE = 4,
  156. INTERSECT = 5
  157. };
  158. static inline std::ostream& operator << (std::ostream& out, const RegionNodeType v) {
  159. switch (v) {
  160. case RegionNodeType::UNSET: out << "m.RegionNodeType.UNSET"; break;
  161. case RegionNodeType::LEAF_GEOMETRY_OBJECT: out << "m.RegionNodeType.LEAF_GEOMETRY_OBJECT"; break;
  162. case RegionNodeType::LEAF_SURFACE_REGION: out << "m.RegionNodeType.LEAF_SURFACE_REGION"; break;
  163. case RegionNodeType::UNION: out << "m.RegionNodeType.UNION"; break;
  164. case RegionNodeType::DIFFERENCE: out << "m.RegionNodeType.DIFFERENCE"; break;
  165. case RegionNodeType::INTERSECT: out << "m.RegionNodeType.INTERSECT"; break;
  166. }
  167. return out;
  168. };
  169. enum class ReactionType {
  170. UNSET = 0,
  171. UNIMOL_VOLUME = 1,
  172. UNIMOL_SURFACE = 2,
  173. VOLUME_VOLUME = 3,
  174. VOLUME_SURFACE = 4,
  175. SURFACE_SURFACE = 5
  176. };
  177. static inline std::ostream& operator << (std::ostream& out, const ReactionType v) {
  178. switch (v) {
  179. case ReactionType::UNSET: out << "m.ReactionType.UNSET"; break;
  180. case ReactionType::UNIMOL_VOLUME: out << "m.ReactionType.UNIMOL_VOLUME"; break;
  181. case ReactionType::UNIMOL_SURFACE: out << "m.ReactionType.UNIMOL_SURFACE"; break;
  182. case ReactionType::VOLUME_VOLUME: out << "m.ReactionType.VOLUME_VOLUME"; break;
  183. case ReactionType::VOLUME_SURFACE: out << "m.ReactionType.VOLUME_SURFACE"; break;
  184. case ReactionType::SURFACE_SURFACE: out << "m.ReactionType.SURFACE_SURFACE"; break;
  185. }
  186. return out;
  187. };
  188. enum class MoleculeType {
  189. UNSET = 0,
  190. VOLUME = 1,
  191. SURFACE = 2
  192. };
  193. static inline std::ostream& operator << (std::ostream& out, const MoleculeType v) {
  194. switch (v) {
  195. case MoleculeType::UNSET: out << "m.MoleculeType.UNSET"; break;
  196. case MoleculeType::VOLUME: out << "m.MoleculeType.VOLUME"; break;
  197. case MoleculeType::SURFACE: out << "m.MoleculeType.SURFACE"; break;
  198. }
  199. return out;
  200. };
  201. enum class BNGSimulationMethod {
  202. NONE = 0,
  203. ODE = 1,
  204. SSA = 2,
  205. PLA = 3,
  206. NF = 4
  207. };
  208. static inline std::ostream& operator << (std::ostream& out, const BNGSimulationMethod v) {
  209. switch (v) {
  210. case BNGSimulationMethod::NONE: out << "m.BNGSimulationMethod.NONE"; break;
  211. case BNGSimulationMethod::ODE: out << "m.BNGSimulationMethod.ODE"; break;
  212. case BNGSimulationMethod::SSA: out << "m.BNGSimulationMethod.SSA"; break;
  213. case BNGSimulationMethod::PLA: out << "m.BNGSimulationMethod.PLA"; break;
  214. case BNGSimulationMethod::NF: out << "m.BNGSimulationMethod.NF"; break;
  215. }
  216. return out;
  217. };
  218. enum class CountOutputFormat {
  219. UNSET = 0,
  220. AUTOMATIC_FROM_EXTENSION = 1,
  221. DAT = 2,
  222. GDAT = 3
  223. };
  224. static inline std::ostream& operator << (std::ostream& out, const CountOutputFormat v) {
  225. switch (v) {
  226. case CountOutputFormat::UNSET: out << "m.CountOutputFormat.UNSET"; break;
  227. case CountOutputFormat::AUTOMATIC_FROM_EXTENSION: out << "m.CountOutputFormat.AUTOMATIC_FROM_EXTENSION"; break;
  228. case CountOutputFormat::DAT: out << "m.CountOutputFormat.DAT"; break;
  229. case CountOutputFormat::GDAT: out << "m.CountOutputFormat.GDAT"; break;
  230. }
  231. return out;
  232. };
  233. void define_pybinding_constants(py::module& m);
  234. void define_pybinding_enums(py::module& m);
  235. } // namespace API
  236. } // namespace MCell
  237. #endif // API_GEN_CONSTANTS