nagasim 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (429) hide show
  1. nagasim-0.6.0/LICENSE +202 -0
  2. nagasim-0.6.0/NOTICE +10 -0
  3. nagasim-0.6.0/PKG-INFO +247 -0
  4. nagasim-0.6.0/README.md +199 -0
  5. nagasim-0.6.0/nagasim/__init__.py +1 -0
  6. nagasim-0.6.0/nagasim/__main__.py +3 -0
  7. nagasim-0.6.0/nagasim/_cli.py +26 -0
  8. nagasim-0.6.0/nagasim/agent_tools/__init__.py +75 -0
  9. nagasim-0.6.0/nagasim/agent_tools/core.py +729 -0
  10. nagasim-0.6.0/nagasim/agent_tools/data.py +456 -0
  11. nagasim-0.6.0/nagasim/agent_tools/debug.py +281 -0
  12. nagasim-0.6.0/nagasim/agent_tools/model.py +363 -0
  13. nagasim-0.6.0/nagasim/agent_tools/records.py +520 -0
  14. nagasim-0.6.0/nagasim/agent_tools/reference.py +167 -0
  15. nagasim-0.6.0/nagasim/agent_tools/runs.py +620 -0
  16. nagasim-0.6.0/nagasim/api.py +651 -0
  17. nagasim-0.6.0/nagasim/assistant.py +401 -0
  18. nagasim-0.6.0/nagasim/calibrate.py +495 -0
  19. nagasim-0.6.0/nagasim/cli.py +151 -0
  20. nagasim-0.6.0/nagasim/core/__init__.py +0 -0
  21. nagasim-0.6.0/nagasim/core/agents/__init__.py +241 -0
  22. nagasim-0.6.0/nagasim/core/agents/authoring.py +320 -0
  23. nagasim-0.6.0/nagasim/core/agents/common.py +211 -0
  24. nagasim-0.6.0/nagasim/core/agents/compile.py +617 -0
  25. nagasim-0.6.0/nagasim/core/agents/python.py +315 -0
  26. nagasim-0.6.0/nagasim/core/agents/runtime.py +1325 -0
  27. nagasim-0.6.0/nagasim/core/agents/space.py +918 -0
  28. nagasim-0.6.0/nagasim/core/agents/validation.py +1523 -0
  29. nagasim-0.6.0/nagasim/core/base_process.py +377 -0
  30. nagasim-0.6.0/nagasim/core/battery.py +66 -0
  31. nagasim-0.6.0/nagasim/core/block_registry.py +96 -0
  32. nagasim-0.6.0/nagasim/core/block_spec.py +178 -0
  33. nagasim-0.6.0/nagasim/core/blocking.py +538 -0
  34. nagasim-0.6.0/nagasim/core/blocks/__init__.py +53 -0
  35. nagasim-0.6.0/nagasim/core/blocks/_common.py +107 -0
  36. nagasim-0.6.0/nagasim/core/blocks/assign.py +111 -0
  37. nagasim-0.6.0/nagasim/core/blocks/batch.py +134 -0
  38. nagasim-0.6.0/nagasim/core/blocks/buffer.py +102 -0
  39. nagasim-0.6.0/nagasim/core/blocks/conveyor.py +324 -0
  40. nagasim-0.6.0/nagasim/core/blocks/create.py +268 -0
  41. nagasim-0.6.0/nagasim/core/blocks/decide.py +243 -0
  42. nagasim-0.6.0/nagasim/core/blocks/delay.py +67 -0
  43. nagasim-0.6.0/nagasim/core/blocks/dispose.py +132 -0
  44. nagasim-0.6.0/nagasim/core/blocks/duplicate.py +78 -0
  45. nagasim-0.6.0/nagasim/core/blocks/hold.py +171 -0
  46. nagasim-0.6.0/nagasim/core/blocks/logic.py +61 -0
  47. nagasim-0.6.0/nagasim/core/blocks/match.py +175 -0
  48. nagasim-0.6.0/nagasim/core/blocks/motion.py +177 -0
  49. nagasim-0.6.0/nagasim/core/blocks/process.py +477 -0
  50. nagasim-0.6.0/nagasim/core/blocks/record.py +134 -0
  51. nagasim-0.6.0/nagasim/core/blocks/release.py +105 -0
  52. nagasim-0.6.0/nagasim/core/blocks/route.py +173 -0
  53. nagasim-0.6.0/nagasim/core/blocks/seize.py +184 -0
  54. nagasim-0.6.0/nagasim/core/blocks/send.py +63 -0
  55. nagasim-0.6.0/nagasim/core/blocks/separate.py +164 -0
  56. nagasim-0.6.0/nagasim/core/blocks/signal.py +81 -0
  57. nagasim-0.6.0/nagasim/core/blocks/station.py +101 -0
  58. nagasim-0.6.0/nagasim/core/blocks/submodel.py +90 -0
  59. nagasim-0.6.0/nagasim/core/blocks/transfer.py +100 -0
  60. nagasim-0.6.0/nagasim/core/blocks/transport.py +278 -0
  61. nagasim-0.6.0/nagasim/core/bottleneck.py +163 -0
  62. nagasim-0.6.0/nagasim/core/calendar.py +508 -0
  63. nagasim-0.6.0/nagasim/core/chargers.py +307 -0
  64. nagasim-0.6.0/nagasim/core/clipboard.py +142 -0
  65. nagasim-0.6.0/nagasim/core/context.py +330 -0
  66. nagasim-0.6.0/nagasim/core/control.py +136 -0
  67. nagasim-0.6.0/nagasim/core/conversions.py +471 -0
  68. nagasim-0.6.0/nagasim/core/costs.py +164 -0
  69. nagasim-0.6.0/nagasim/core/custom_logic.py +11 -0
  70. nagasim-0.6.0/nagasim/core/debugger.py +208 -0
  71. nagasim-0.6.0/nagasim/core/distribution_spec.py +74 -0
  72. nagasim-0.6.0/nagasim/core/distributions.py +880 -0
  73. nagasim-0.6.0/nagasim/core/document.py +1844 -0
  74. nagasim-0.6.0/nagasim/core/entity_manager.py +65 -0
  75. nagasim-0.6.0/nagasim/core/events.py +27 -0
  76. nagasim-0.6.0/nagasim/core/export.py +339 -0
  77. nagasim-0.6.0/nagasim/core/expressions.py +1422 -0
  78. nagasim-0.6.0/nagasim/core/graph_model.py +321 -0
  79. nagasim-0.6.0/nagasim/core/initial_state.py +710 -0
  80. nagasim-0.6.0/nagasim/core/layout_tools.py +309 -0
  81. nagasim-0.6.0/nagasim/core/levels.py +1847 -0
  82. nagasim-0.6.0/nagasim/core/levels_validation.py +378 -0
  83. nagasim-0.6.0/nagasim/core/link_tools.py +80 -0
  84. nagasim-0.6.0/nagasim/core/logic_authoring.py +94 -0
  85. nagasim-0.6.0/nagasim/core/motion.py +310 -0
  86. nagasim-0.6.0/nagasim/core/movers.py +1514 -0
  87. nagasim-0.6.0/nagasim/core/network.py +550 -0
  88. nagasim-0.6.0/nagasim/core/orders.py +405 -0
  89. nagasim-0.6.0/nagasim/core/outline.py +278 -0
  90. nagasim-0.6.0/nagasim/core/outputs.py +1670 -0
  91. nagasim-0.6.0/nagasim/core/playback.py +1005 -0
  92. nagasim-0.6.0/nagasim/core/problems.py +748 -0
  93. nagasim-0.6.0/nagasim/core/quantities.py +417 -0
  94. nagasim-0.6.0/nagasim/core/resource_manager.py +1246 -0
  95. nagasim-0.6.0/nagasim/core/schedules.py +240 -0
  96. nagasim-0.6.0/nagasim/core/schema/__init__.py +45 -0
  97. nagasim-0.6.0/nagasim/core/schema/common.py +145 -0
  98. nagasim-0.6.0/nagasim/core/schema/graph.py +226 -0
  99. nagasim-0.6.0/nagasim/core/schema/layout.py +1013 -0
  100. nagasim-0.6.0/nagasim/core/schema/migrate.py +189 -0
  101. nagasim-0.6.0/nagasim/core/schema/prepare.py +149 -0
  102. nagasim-0.6.0/nagasim/core/schema/sections_validation.py +902 -0
  103. nagasim-0.6.0/nagasim/core/schema/submodels.py +267 -0
  104. nagasim-0.6.0/nagasim/core/sd.py +1284 -0
  105. nagasim-0.6.0/nagasim/core/sd_loops.py +387 -0
  106. nagasim-0.6.0/nagasim/core/search.py +131 -0
  107. nagasim-0.6.0/nagasim/core/sections.py +259 -0
  108. nagasim-0.6.0/nagasim/core/seizing.py +515 -0
  109. nagasim-0.6.0/nagasim/core/sequences.py +210 -0
  110. nagasim-0.6.0/nagasim/core/session.py +381 -0
  111. nagasim-0.6.0/nagasim/core/sim_classes.py +114 -0
  112. nagasim-0.6.0/nagasim/core/sim_runner.py +279 -0
  113. nagasim-0.6.0/nagasim/core/stats.py +460 -0
  114. nagasim-0.6.0/nagasim/core/store_manager.py +156 -0
  115. nagasim-0.6.0/nagasim/core/submodels.py +1279 -0
  116. nagasim-0.6.0/nagasim/core/svgsafe.py +210 -0
  117. nagasim-0.6.0/nagasim/core/tables.py +385 -0
  118. nagasim-0.6.0/nagasim/core/tape.py +343 -0
  119. nagasim-0.6.0/nagasim/core/tending.py +464 -0
  120. nagasim-0.6.0/nagasim/core/timeseries.py +184 -0
  121. nagasim-0.6.0/nagasim/core/timeseries_inputs.py +462 -0
  122. nagasim-0.6.0/nagasim/core/timeunits.py +180 -0
  123. nagasim-0.6.0/nagasim/core/trace.py +191 -0
  124. nagasim-0.6.0/nagasim/core/units.py +501 -0
  125. nagasim-0.6.0/nagasim/core/utils.py +56 -0
  126. nagasim-0.6.0/nagasim/cpsat.py +412 -0
  127. nagasim-0.6.0/nagasim/dashboard.py +317 -0
  128. nagasim-0.6.0/nagasim/databind.py +922 -0
  129. nagasim-0.6.0/nagasim/examples.py +58 -0
  130. nagasim-0.6.0/nagasim/experiments.py +983 -0
  131. nagasim-0.6.0/nagasim/exporters.py +93 -0
  132. nagasim-0.6.0/nagasim/forecast.py +363 -0
  133. nagasim-0.6.0/nagasim/inputfit.py +530 -0
  134. nagasim-0.6.0/nagasim/investment.py +252 -0
  135. nagasim-0.6.0/nagasim/live.py +566 -0
  136. nagasim-0.6.0/nagasim/llm.py +425 -0
  137. nagasim-0.6.0/nagasim/loopdominance.py +556 -0
  138. nagasim-0.6.0/nagasim/mcp_server.py +328 -0
  139. nagasim-0.6.0/nagasim/mdlimport.py +799 -0
  140. nagasim-0.6.0/nagasim/modelcheck.py +509 -0
  141. nagasim-0.6.0/nagasim/modeldiff.py +735 -0
  142. nagasim-0.6.0/nagasim/models/abm_boids_flock.json +274 -0
  143. nagasim-0.6.0/nagasim/models/abm_nagel_schreckenberg.json +476 -0
  144. nagasim-0.6.0/nagasim/models/abm_schelling_segregation.json +1485 -0
  145. nagasim-0.6.0/nagasim/models/abm_sir_small_world.json +268 -0
  146. nagasim-0.6.0/nagasim/models/abm_sugarscape_lite.json +205 -0
  147. nagasim-0.6.0/nagasim/models/abm_wolf_sheep.json +378 -0
  148. nagasim-0.6.0/nagasim/models/agents_bass_diffusion_agents.json +234 -0
  149. nagasim-0.6.0/nagasim/models/agents_machine_repair.json +175 -0
  150. nagasim-0.6.0/nagasim/models/agents_network_courier.json +191 -0
  151. nagasim-0.6.0/nagasim/models/agents_random_walker.json +180 -0
  152. nagasim-0.6.0/nagasim/models/agents_server_utilization.json +183 -0
  153. nagasim-0.6.0/nagasim/models/agents_sir_agents.json +271 -0
  154. nagasim-0.6.0/nagasim/models/automation_cell.json +307 -0
  155. nagasim-0.6.0/nagasim/models/automation_floor.json +4419 -0
  156. nagasim-0.6.0/nagasim/models/biogas_digester_demo.json +358 -0
  157. nagasim-0.6.0/nagasim/models/biogas_plant_library.json +4738 -0
  158. nagasim-0.6.0/nagasim/models/call_centre_day.json +912 -0
  159. nagasim-0.6.0/nagasim/models/clinic_library.json +1031 -0
  160. nagasim-0.6.0/nagasim/models/clinic_twin.json +285 -0
  161. nagasim-0.6.0/nagasim/models/data/clinic_visits.csv +74 -0
  162. nagasim-0.6.0/nagasim/models/data/mes_twin_shop/calendar.csv +4 -0
  163. nagasim-0.6.0/nagasim/models/data/mes_twin_shop/equipment.csv +4 -0
  164. nagasim-0.6.0/nagasim/models/data/mes_twin_shop/events.csv +297 -0
  165. nagasim-0.6.0/nagasim/models/data/mes_twin_shop/routings.csv +6 -0
  166. nagasim-0.6.0/nagasim/models/data/mes_twin_shop/snapshot.csv +2 -0
  167. nagasim-0.6.0/nagasim/models/data/mes_twin_shop/wip.csv +3 -0
  168. nagasim-0.6.0/nagasim/models/data/mes_twin_shop/work_orders.csv +87 -0
  169. nagasim-0.6.0/nagasim/models/data/mes_twin_shop.mesmap.json +54 -0
  170. nagasim-0.6.0/nagasim/models/decide_routing.json +175 -0
  171. nagasim-0.6.0/nagasim/models/ed_game.json +631 -0
  172. nagasim-0.6.0/nagasim/models/ed_patient_agents.json +339 -0
  173. nagasim-0.6.0/nagasim/models/energy_heat_and_ev.json +1515 -0
  174. nagasim-0.6.0/nagasim/models/energy_pv_battery.json +271 -0
  175. nagasim-0.6.0/nagasim/models/energy_site_library.json +1290 -0
  176. nagasim-0.6.0/nagasim/models/hold_on_store.json +199 -0
  177. nagasim-0.6.0/nagasim/models/hold_signal_flow.json +402 -0
  178. nagasim-0.6.0/nagasim/models/impatient_customers.json +224 -0
  179. nagasim-0.6.0/nagasim/models/inventory_sS.json +327 -0
  180. nagasim-0.6.0/nagasim/models/job_shop_jackson.json +401 -0
  181. nagasim-0.6.0/nagasim/models/job_shop_routed.json +568 -0
  182. nagasim-0.6.0/nagasim/models/line_with_buffers.json +864 -0
  183. nagasim-0.6.0/nagasim/models/machine_with_breakdowns.json +161 -0
  184. nagasim-0.6.0/nagasim/models/mes_twin_shop.json +1375 -0
  185. nagasim-0.6.0/nagasim/models/mfg_line_library.json +1147 -0
  186. nagasim-0.6.0/nagasim/models/order_due_dates.json +314 -0
  187. nagasim-0.6.0/nagasim/models/parallel_routing_policy.json +199 -0
  188. nagasim-0.6.0/nagasim/models/priority_rework.json +312 -0
  189. nagasim-0.6.0/nagasim/models/sd_bass_diffusion.json +216 -0
  190. nagasim-0.6.0/nagasim/models/sd_inventory_delay3.json +230 -0
  191. nagasim-0.6.0/nagasim/models/sd_population.json +205 -0
  192. nagasim-0.6.0/nagasim/models/sd_sir.json +270 -0
  193. nagasim-0.6.0/nagasim/models/sd_supply_game.json +340 -0
  194. nagasim-0.6.0/nagasim/models/sd_training_pipeline.json +202 -0
  195. nagasim-0.6.0/nagasim/models/sd_workforce_delay1.json +241 -0
  196. nagasim-0.6.0/nagasim/models/single_server.json +134 -0
  197. nagasim-0.6.0/nagasim/models/supply_chain_library.json +1612 -0
  198. nagasim-0.6.0/nagasim/models/table_process_times.json +226 -0
  199. nagasim-0.6.0/nagasim/models/two_cell_line.json +281 -0
  200. nagasim-0.6.0/nagasim/models/two_teller_set.json +149 -0
  201. nagasim-0.6.0/nagasim/models/warehouse_forklifts.json +677 -0
  202. nagasim-0.6.0/nagasim/models/warehouse_library.json +3365 -0
  203. nagasim-0.6.0/nagasim/modelschema.py +2488 -0
  204. nagasim-0.6.0/nagasim/monitor.py +560 -0
  205. nagasim-0.6.0/nagasim/netguard.py +673 -0
  206. nagasim-0.6.0/nagasim/optimize/__init__.py +49 -0
  207. nagasim-0.6.0/nagasim/optimize/_constants.py +15 -0
  208. nagasim-0.6.0/nagasim/optimize/cli.py +220 -0
  209. nagasim-0.6.0/nagasim/optimize/designs.py +56 -0
  210. nagasim-0.6.0/nagasim/optimize/doe.py +187 -0
  211. nagasim-0.6.0/nagasim/optimize/evaluation.py +336 -0
  212. nagasim-0.6.0/nagasim/optimize/factors.py +108 -0
  213. nagasim-0.6.0/nagasim/optimize/optimization.py +465 -0
  214. nagasim-0.6.0/nagasim/optimize/selection.py +220 -0
  215. nagasim-0.6.0/nagasim/optimize/sensitivity.py +52 -0
  216. nagasim-0.6.0/nagasim/optimize/sobol.py +119 -0
  217. nagasim-0.6.0/nagasim/optimize/tornado.py +58 -0
  218. nagasim-0.6.0/nagasim/outbox.py +263 -0
  219. nagasim-0.6.0/nagasim/planning.py +208 -0
  220. nagasim-0.6.0/nagasim/plant.py +1301 -0
  221. nagasim-0.6.0/nagasim/player.py +646 -0
  222. nagasim-0.6.0/nagasim/plugins.py +186 -0
  223. nagasim-0.6.0/nagasim/readers/__init__.py +72 -0
  224. nagasim-0.6.0/nagasim/readers/mqtt.py +343 -0
  225. nagasim-0.6.0/nagasim/readers/opcua.py +273 -0
  226. nagasim-0.6.0/nagasim/readers/rest.py +272 -0
  227. nagasim-0.6.0/nagasim/readers/sparkplug.py +140 -0
  228. nagasim-0.6.0/nagasim/recommend.py +1011 -0
  229. nagasim-0.6.0/nagasim/report.py +1000 -0
  230. nagasim-0.6.0/nagasim/results.py +103 -0
  231. nagasim-0.6.0/nagasim/rl.py +369 -0
  232. nagasim-0.6.0/nagasim/score.py +371 -0
  233. nagasim-0.6.0/nagasim/sdimport.py +1214 -0
  234. nagasim-0.6.0/nagasim/settings/__init__.py +0 -0
  235. nagasim-0.6.0/nagasim/settings/color_palette.py +50 -0
  236. nagasim-0.6.0/nagasim/settings/config.py +7 -0
  237. nagasim-0.6.0/nagasim/settings/userpaths.py +56 -0
  238. nagasim-0.6.0/nagasim/sources.py +94 -0
  239. nagasim-0.6.0/nagasim/state.py +733 -0
  240. nagasim-0.6.0/nagasim/surrogate.py +386 -0
  241. nagasim-0.6.0/nagasim/svgcharts.py +561 -0
  242. nagasim-0.6.0/nagasim/tablegen.py +545 -0
  243. nagasim-0.6.0/nagasim/templates/naga-models.yml +37 -0
  244. nagasim-0.6.0/nagasim/templates/viewer_notices.txt +6629 -0
  245. nagasim-0.6.0/nagasim/twin.py +1178 -0
  246. nagasim-0.6.0/nagasim/viewer.py +1055 -0
  247. nagasim-0.6.0/nagasim/viewer_runtime.py +198 -0
  248. nagasim-0.6.0/nagasim.egg-info/PKG-INFO +247 -0
  249. nagasim-0.6.0/nagasim.egg-info/SOURCES.txt +427 -0
  250. nagasim-0.6.0/nagasim.egg-info/dependency_links.txt +1 -0
  251. nagasim-0.6.0/nagasim.egg-info/entry_points.txt +2 -0
  252. nagasim-0.6.0/nagasim.egg-info/requires.txt +31 -0
  253. nagasim-0.6.0/nagasim.egg-info/top_level.txt +1 -0
  254. nagasim-0.6.0/pyproject.toml +78 -0
  255. nagasim-0.6.0/setup.cfg +4 -0
  256. nagasim-0.6.0/tests/test_agent_actions_oracle.py +388 -0
  257. nagasim-0.6.0/tests/test_agent_attribute_stats.py +108 -0
  258. nagasim-0.6.0/tests/test_agent_births_deaths_oracle.py +330 -0
  259. nagasim-0.6.0/tests/test_agent_composite_states.py +245 -0
  260. nagasim-0.6.0/tests/test_agent_composite_states_oracle.py +531 -0
  261. nagasim-0.6.0/tests/test_agent_deterioration_oracle.py +229 -0
  262. nagasim-0.6.0/tests/test_agent_gaps.py +259 -0
  263. nagasim-0.6.0/tests/test_agent_movement_oracle.py +381 -0
  264. nagasim-0.6.0/tests/test_agent_population_oracle.py +193 -0
  265. nagasim-0.6.0/tests/test_agent_tool_catalogue.py +23 -0
  266. nagasim-0.6.0/tests/test_agent_tools.py +1254 -0
  267. nagasim-0.6.0/tests/test_agent_vectorised.py +219 -0
  268. nagasim-0.6.0/tests/test_agents.py +736 -0
  269. nagasim-0.6.0/tests/test_agents_categorical.py +280 -0
  270. nagasim-0.6.0/tests/test_agents_grid.py +237 -0
  271. nagasim-0.6.0/tests/test_agents_heading.py +201 -0
  272. nagasim-0.6.0/tests/test_agents_links.py +325 -0
  273. nagasim-0.6.0/tests/test_agents_machine_repair.py +55 -0
  274. nagasim-0.6.0/tests/test_agents_neighbours.py +254 -0
  275. nagasim-0.6.0/tests/test_agents_oracles.py +324 -0
  276. nagasim-0.6.0/tests/test_agents_python.py +284 -0
  277. nagasim-0.6.0/tests/test_agents_tick.py +221 -0
  278. nagasim-0.6.0/tests/test_api.py +353 -0
  279. nagasim-0.6.0/tests/test_assistant.py +532 -0
  280. nagasim-0.6.0/tests/test_battery.py +415 -0
  281. nagasim-0.6.0/tests/test_battery_oracle.py +345 -0
  282. nagasim-0.6.0/tests/test_bench_tool.py +21 -0
  283. nagasim-0.6.0/tests/test_block_registry.py +321 -0
  284. nagasim-0.6.0/tests/test_bundled_names.py +44 -0
  285. nagasim-0.6.0/tests/test_calibrate_series.py +124 -0
  286. nagasim-0.6.0/tests/test_case_study.py +216 -0
  287. nagasim-0.6.0/tests/test_conversions.py +364 -0
  288. nagasim-0.6.0/tests/test_conveyor.py +196 -0
  289. nagasim-0.6.0/tests/test_conveyor_oracle.py +335 -0
  290. nagasim-0.6.0/tests/test_conveyor_systems.py +129 -0
  291. nagasim-0.6.0/tests/test_conveyor_systems_oracle.py +326 -0
  292. nagasim-0.6.0/tests/test_costing.py +327 -0
  293. nagasim-0.6.0/tests/test_cpsat.py +146 -0
  294. nagasim-0.6.0/tests/test_cpsat_oracle.py +343 -0
  295. nagasim-0.6.0/tests/test_dashboard.py +117 -0
  296. nagasim-0.6.0/tests/test_dashboard_oracle.py +265 -0
  297. nagasim-0.6.0/tests/test_dashboard_rules.py +365 -0
  298. nagasim-0.6.0/tests/test_debugger.py +518 -0
  299. nagasim-0.6.0/tests/test_decide_policy.py +133 -0
  300. nagasim-0.6.0/tests/test_deterministic.py +227 -0
  301. nagasim-0.6.0/tests/test_deterministic_oracle.py +245 -0
  302. nagasim-0.6.0/tests/test_distribution_scale_params.py +90 -0
  303. nagasim-0.6.0/tests/test_document.py +693 -0
  304. nagasim-0.6.0/tests/test_ed_template.py +65 -0
  305. nagasim-0.6.0/tests/test_energy.py +136 -0
  306. nagasim-0.6.0/tests/test_energy_oracle.py +293 -0
  307. nagasim-0.6.0/tests/test_engine_docs.py +197 -0
  308. nagasim-0.6.0/tests/test_entity_agent_oracle.py +195 -0
  309. nagasim-0.6.0/tests/test_experiments.py +773 -0
  310. nagasim-0.6.0/tests/test_exporters.py +86 -0
  311. nagasim-0.6.0/tests/test_expressions.py +298 -0
  312. nagasim-0.6.0/tests/test_function_traits.py +51 -0
  313. nagasim-0.6.0/tests/test_game_oracle.py +467 -0
  314. nagasim-0.6.0/tests/test_game_templates.py +101 -0
  315. nagasim-0.6.0/tests/test_gantry.py +134 -0
  316. nagasim-0.6.0/tests/test_gantry_oracle.py +233 -0
  317. nagasim-0.6.0/tests/test_hold_match.py +101 -0
  318. nagasim-0.6.0/tests/test_hold_on_store.py +47 -0
  319. nagasim-0.6.0/tests/test_inputfit.py +302 -0
  320. nagasim-0.6.0/tests/test_investment.py +317 -0
  321. nagasim-0.6.0/tests/test_investment_oracle.py +206 -0
  322. nagasim-0.6.0/tests/test_levels.py +763 -0
  323. nagasim-0.6.0/tests/test_live.py +452 -0
  324. nagasim-0.6.0/tests/test_llm.py +483 -0
  325. nagasim-0.6.0/tests/test_loopdominance.py +78 -0
  326. nagasim-0.6.0/tests/test_loopdominance_oracles.py +416 -0
  327. nagasim-0.6.0/tests/test_mcp_server.py +317 -0
  328. nagasim-0.6.0/tests/test_model_units.py +57 -0
  329. nagasim-0.6.0/tests/test_modelcheck.py +450 -0
  330. nagasim-0.6.0/tests/test_modelcheck_oracle.py +235 -0
  331. nagasim-0.6.0/tests/test_modeldiff.py +125 -0
  332. nagasim-0.6.0/tests/test_modeldiff_oracle.py +233 -0
  333. nagasim-0.6.0/tests/test_modelmerge.py +125 -0
  334. nagasim-0.6.0/tests/test_modelmerge_oracle.py +307 -0
  335. nagasim-0.6.0/tests/test_monitor.py +534 -0
  336. nagasim-0.6.0/tests/test_motion.py +306 -0
  337. nagasim-0.6.0/tests/test_motion_oracle.py +292 -0
  338. nagasim-0.6.0/tests/test_netguard.py +573 -0
  339. nagasim-0.6.0/tests/test_network.py +743 -0
  340. nagasim-0.6.0/tests/test_notebook.py +116 -0
  341. nagasim-0.6.0/tests/test_opcua_probe.py +76 -0
  342. nagasim-0.6.0/tests/test_optimize.py +701 -0
  343. nagasim-0.6.0/tests/test_optimize_sensitivity.py +67 -0
  344. nagasim-0.6.0/tests/test_optimize_sobol.py +141 -0
  345. nagasim-0.6.0/tests/test_oracles.py +428 -0
  346. nagasim-0.6.0/tests/test_orders.py +303 -0
  347. nagasim-0.6.0/tests/test_param_metadata.py +121 -0
  348. nagasim-0.6.0/tests/test_perf_bind_constants.py +81 -0
  349. nagasim-0.6.0/tests/test_perf_bound_values.py +61 -0
  350. nagasim-0.6.0/tests/test_perf_compile_once.py +108 -0
  351. nagasim-0.6.0/tests/test_perf_create_thinning.py +87 -0
  352. nagasim-0.6.0/tests/test_perf_debug_logging.py +86 -0
  353. nagasim-0.6.0/tests/test_perf_dispose_immediate.py +51 -0
  354. nagasim-0.6.0/tests/test_perf_flat_logs.py +23 -0
  355. nagasim-0.6.0/tests/test_perf_match_index.py +209 -0
  356. nagasim-0.6.0/tests/test_perf_sampler.py +61 -0
  357. nagasim-0.6.0/tests/test_perf_schedule_index.py +38 -0
  358. nagasim-0.6.0/tests/test_perf_small_items.py +84 -0
  359. nagasim-0.6.0/tests/test_perf_study_logs.py +186 -0
  360. nagasim-0.6.0/tests/test_plan_cli.py +123 -0
  361. nagasim-0.6.0/tests/test_plan_risk.py +55 -0
  362. nagasim-0.6.0/tests/test_plan_risk_oracle.py +196 -0
  363. nagasim-0.6.0/tests/test_plant.py +992 -0
  364. nagasim-0.6.0/tests/test_playback.py +656 -0
  365. nagasim-0.6.0/tests/test_player.py +426 -0
  366. nagasim-0.6.0/tests/test_player_script.py +253 -0
  367. nagasim-0.6.0/tests/test_problem_codes.py +39 -0
  368. nagasim-0.6.0/tests/test_properties.py +264 -0
  369. nagasim-0.6.0/tests/test_published_text.py +125 -0
  370. nagasim-0.6.0/tests/test_queue_behaviour.py +799 -0
  371. nagasim-0.6.0/tests/test_readers.py +1879 -0
  372. nagasim-0.6.0/tests/test_recommend.py +1008 -0
  373. nagasim-0.6.0/tests/test_report.py +322 -0
  374. nagasim-0.6.0/tests/test_resource_queue.py +105 -0
  375. nagasim-0.6.0/tests/test_resource_rerank.py +110 -0
  376. nagasim-0.6.0/tests/test_resource_rerank_oracle.py +270 -0
  377. nagasim-0.6.0/tests/test_resources.py +365 -0
  378. nagasim-0.6.0/tests/test_rl.py +223 -0
  379. nagasim-0.6.0/tests/test_sankey_bottleneck.py +79 -0
  380. nagasim-0.6.0/tests/test_sankey_bottleneck_oracle.py +272 -0
  381. nagasim-0.6.0/tests/test_schedule_log.py +136 -0
  382. nagasim-0.6.0/tests/test_schedule_log_oracle.py +210 -0
  383. nagasim-0.6.0/tests/test_schedules.py +748 -0
  384. nagasim-0.6.0/tests/test_schema.py +855 -0
  385. nagasim-0.6.0/tests/test_score.py +750 -0
  386. nagasim-0.6.0/tests/test_sd.py +483 -0
  387. nagasim-0.6.0/tests/test_sd_constructs_oracle.py +388 -0
  388. nagasim-0.6.0/tests/test_sd_functions.py +232 -0
  389. nagasim-0.6.0/tests/test_sd_loops.py +89 -0
  390. nagasim-0.6.0/tests/test_sd_oracles.py +370 -0
  391. nagasim-0.6.0/tests/test_sd_subscripts2_oracle.py +248 -0
  392. nagasim-0.6.0/tests/test_sd_subscripts_oracle.py +328 -0
  393. nagasim-0.6.0/tests/test_sd_trees.py +54 -0
  394. nagasim-0.6.0/tests/test_sdimport.py +289 -0
  395. nagasim-0.6.0/tests/test_sdimport_conveyor.py +155 -0
  396. nagasim-0.6.0/tests/test_sdimport_mdl.py +187 -0
  397. nagasim-0.6.0/tests/test_sdx_conformance.py +135 -0
  398. nagasim-0.6.0/tests/test_sections.py +148 -0
  399. nagasim-0.6.0/tests/test_segment_traffic.py +154 -0
  400. nagasim-0.6.0/tests/test_segment_traffic_oracle.py +277 -0
  401. nagasim-0.6.0/tests/test_sequences.py +523 -0
  402. nagasim-0.6.0/tests/test_session.py +161 -0
  403. nagasim-0.6.0/tests/test_session_control_oracle.py +305 -0
  404. nagasim-0.6.0/tests/test_session_oracle.py +338 -0
  405. nagasim-0.6.0/tests/test_smoke_engine.py +769 -0
  406. nagasim-0.6.0/tests/test_state.py +975 -0
  407. nagasim-0.6.0/tests/test_submodels.py +1246 -0
  408. nagasim-0.6.0/tests/test_surrogate.py +134 -0
  409. nagasim-0.6.0/tests/test_tablegen.py +273 -0
  410. nagasim-0.6.0/tests/test_tablegen_oracle.py +270 -0
  411. nagasim-0.6.0/tests/test_tables.py +159 -0
  412. nagasim-0.6.0/tests/test_tape.py +250 -0
  413. nagasim-0.6.0/tests/test_tending.py +396 -0
  414. nagasim-0.6.0/tests/test_tending_oracle.py +361 -0
  415. nagasim-0.6.0/tests/test_tours.py +130 -0
  416. nagasim-0.6.0/tests/test_tours_oracle.py +272 -0
  417. nagasim-0.6.0/tests/test_twin.py +658 -0
  418. nagasim-0.6.0/tests/test_twin_cycle.py +921 -0
  419. nagasim-0.6.0/tests/test_unit_conversion_blocks.py +46 -0
  420. nagasim-0.6.0/tests/test_unit_conversion_sections.py +64 -0
  421. nagasim-0.6.0/tests/test_unit_migration.py +102 -0
  422. nagasim-0.6.0/tests/test_unit_tables.py +82 -0
  423. nagasim-0.6.0/tests/test_units.py +232 -0
  424. nagasim-0.6.0/tests/test_units_strict.py +170 -0
  425. nagasim-0.6.0/tests/test_userpaths.py +40 -0
  426. nagasim-0.6.0/tests/test_view_state.py +136 -0
  427. nagasim-0.6.0/tests/test_viewer.py +840 -0
  428. nagasim-0.6.0/tests/test_workers.py +261 -0
  429. nagasim-0.6.0/tests/test_workers_oracle.py +218 -0
nagasim-0.6.0/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
nagasim-0.6.0/NOTICE ADDED
@@ -0,0 +1,10 @@
1
+ Naga engine
2
+ Copyright (c) 2026 Matteo Brunetti
3
+
4
+ This product includes software developed by Matteo Brunetti and contributors.
5
+ Licensed under the Apache License, Version 2.0 (the "License"); you may not use
6
+ these files except in compliance with the License. A copy of the License is in
7
+ the LICENSE file next to this notice and at http://www.apache.org/licenses/LICENSE-2.0
8
+
9
+ Redistributions must retain this NOTICE file (Apache-2.0 section 4(d)). If you
10
+ use the engine in published work, please cite it (see CITATION.cff).
nagasim-0.6.0/PKG-INFO ADDED
@@ -0,0 +1,247 @@
1
+ Metadata-Version: 2.4
2
+ Name: nagasim
3
+ Version: 0.6.0
4
+ Summary: A simulation engine on SimPy for discrete-event, system-dynamics and agent-based models, with model files, experiments, a twin and agent tools
5
+ Author: Matteo Brunetti
6
+ License: Apache-2.0
7
+ Project-URL: Homepage, https://github.com/TheMattHub/naga
8
+ Project-URL: Documentation, https://thematthub.github.io/naga/
9
+ Project-URL: Source, https://github.com/TheMattHub/naga
10
+ Keywords: simulation,discrete-event,system dynamics,agent-based,simpy,digital twin,mcp
11
+ Classifier: Development Status :: 4 - Beta
12
+ Classifier: Intended Audience :: Science/Research
13
+ Classifier: Intended Audience :: Manufacturing
14
+ Classifier: License :: OSI Approved :: Apache Software License
15
+ Classifier: Topic :: Scientific/Engineering
16
+ Classifier: Programming Language :: Python :: 3
17
+ Classifier: Programming Language :: Python :: 3.11
18
+ Classifier: Programming Language :: Python :: 3.12
19
+ Classifier: Programming Language :: Python :: 3.13
20
+ Classifier: Programming Language :: Python :: 3.14
21
+ Requires-Python: >=3.11
22
+ Description-Content-Type: text/markdown
23
+ License-File: LICENSE
24
+ License-File: NOTICE
25
+ Requires-Dist: simpy<5,>=4.1
26
+ Requires-Dist: numpy>=2.0
27
+ Requires-Dist: pandas>=2.2
28
+ Requires-Dist: scipy>=1.14
29
+ Requires-Dist: openpyxl>=3.1
30
+ Requires-Dist: tzdata>=2024.1; sys_platform == "win32"
31
+ Provides-Extra: plan
32
+ Requires-Dist: ortools>=9.10; extra == "plan"
33
+ Provides-Extra: ml
34
+ Requires-Dist: optuna; extra == "ml"
35
+ Requires-Dist: scikit-learn; extra == "ml"
36
+ Requires-Dist: gymnasium; extra == "ml"
37
+ Provides-Extra: sql
38
+ Requires-Dist: sqlalchemy; extra == "sql"
39
+ Provides-Extra: opcua
40
+ Requires-Dist: asyncua<3,>=2.1; extra == "opcua"
41
+ Provides-Extra: plot
42
+ Requires-Dist: matplotlib; extra == "plot"
43
+ Provides-Extra: mcp
44
+ Requires-Dist: mcp>=1.2; extra == "mcp"
45
+ Provides-Extra: assistant
46
+ Requires-Dist: anthropic>=0.40; extra == "assistant"
47
+ Dynamic: license-file
48
+
49
+ <p align="center"><img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/banner.svg" alt="Naga: a simulation engine on SimPy" width="820"></p>
50
+
51
+ <p align="center">
52
+ <a href="https://github.com/TheMattHub/naga/actions/workflows/tests.yml"><img src="https://github.com/TheMattHub/naga/actions/workflows/tests.yml/badge.svg" alt="tests"></a>
53
+ <a href="https://pypi.org/project/nagasim/"><img src="https://img.shields.io/pypi/v/nagasim" alt="PyPI"></a>
54
+ <a href="https://pypi.org/project/nagasim/"><img src="https://img.shields.io/pypi/pyversions/nagasim" alt="Python versions"></a>
55
+ <a href="LICENSE"><img src="https://img.shields.io/badge/licence-Apache--2.0-blue" alt="Apache-2.0"></a>
56
+ </p>
57
+
58
+ # Naga
59
+
60
+ Naga is a simulation engine for Python, built on [SimPy](https://simpy.readthedocs.io/), for
61
+ people who have a question about how a system behaves and want an answer they can show their
62
+ work for. You describe the system once, as a data file of blocks, resources and expressions,
63
+ and Naga runs it as a discrete-event, system-dynamics or agent-based model, or as all three on
64
+ one clock. Around each run it puts what turns a single run into evidence: independent
65
+ replications with confidence intervals, scenarios compared on the same random numbers, designed
66
+ experiments, optimisation and calibration. The same model can also be connected to a plant, so
67
+ that it starts from what is happening now, forecasts what comes next, checks those forecasts
68
+ against what then happened, and proposes what to change. Because the model stays a file that
69
+ can be read, compared and shared, whichever way you drive it, the answer it gives is one a team
70
+ can inspect and repeat rather than take on trust.
71
+
72
+ ```console
73
+ pip install nagasim
74
+ naga run single_server --replications 5 --report report.html
75
+ ```
76
+
77
+ Documentation: <https://thematthub.github.io/naga/>
78
+
79
+ ## How it fits together
80
+
81
+ <p align="center"><img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/overview.svg" alt="What goes into the engine, what it does, and what comes out" width="900"></p>
82
+
83
+ The picture reads from left to right. On the left is what you bring: a model file, the data
84
+ it draws on and, if you have one, a plant to follow. In the middle the engine runs the model on
85
+ a single clock, whichever of the three ways of modelling it uses, and wraps the run in
86
+ statistics, experiments or a twin. On the right is what comes back: results and a report,
87
+ pages you can send to someone else, and a twin's forecasts and proposals. Along the top are the
88
+ three ways in, the command line, Python and an agent, and because a model is a data file and
89
+ not a program, the same file gives the same answer through each of them.
90
+
91
+ ## What it does
92
+
93
+ - **Discrete-event models** from blocks (create, process, seize/release, batch, match, decide,
94
+ route, transport, ...) with resources, sets, schedules, failures, costs, expressions and
95
+ submodels.
96
+ - **Material handling**: path networks, vehicle fleets with batteries and chargers, conveyors,
97
+ motion cycles, machine tending.
98
+ - **System dynamics** (stocks, flows, auxiliaries, delays, subscripts, units, XMILE and Vensim
99
+ import) and **agent-based** models (statecharts, messages, space, networks), in the same model
100
+ and on the same clock as the discrete-event part.
101
+ - **Statistics you can defend**: independent replications, Student-t intervals, warm-up handling,
102
+ reproducible random streams, validated against queueing theory.
103
+ - **Experiments**: named scenarios with paired comparisons, design of experiments,
104
+ ranking-and-selection, optimisation, calibration, forecasting, an investment case.
105
+ - **A twin of a plant** (`naga twin`): live readers for files, SQL, REST, MQTT and OPC UA, a run
106
+ that starts from the observed state, forecasts scored against what happened, and candidate
107
+ actions compared on the forecast. It reads a plant and never writes to one.
108
+ - **Model files as data**: a versioned JSON schema, validation with stable problem codes,
109
+ semantic diff and three-way merge, assertions (`naga check`) with a CI template.
110
+ - **Outputs**: pandas frames, Excel, CSV, JSON, a self-contained HTML report, a recorded run to
111
+ replay, and a viewer in which the engine itself runs in a browser.
112
+ - **Agent tools**: 68 tools over MCP to build, validate, run, debug and analyse a model.
113
+
114
+ ## Quick start
115
+
116
+ From the command line, with the bundled example models (`naga examples` lists them; a command
117
+ that takes a model file also takes one of their names):
118
+
119
+ ```console
120
+ naga examples
121
+ naga run single_server --replications 5 --report report.html
122
+ naga scenarios automation_cell
123
+ naga validate single_server
124
+ naga --help
125
+ ```
126
+
127
+ From Python:
128
+
129
+ ```python
130
+ from nagasim import api, examples
131
+
132
+ results = api.run_model(examples.path("single_server"), replications=5, seed=0)
133
+ print(results["system"])
134
+ ```
135
+
136
+ `results` is a dictionary of pandas frames (system, resources, queues, entities, costs and more).
137
+
138
+ ## What you can see
139
+
140
+ A run is easier to trust when you can look at it, so the engine writes what it finds as pages
141
+ as well as tables. Each of the four below is a single file, made by one command, that opens in
142
+ a browser with no server behind it: a report to read, a recorded run to replay, a monitor that
143
+ follows a plant, and a viewer in which someone else can change the inputs and run the model
144
+ again. They are what you hand to the people who asked the question.
145
+
146
+ | | |
147
+ |---|---|
148
+ | <img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/shots/charts.png" alt="Charts from the HTML report" width="420"> | <img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/shots/player.png" alt="A recorded run in the HTML player" width="420"> |
149
+ | **A report.** `naga run MODEL --report report.html`: KPIs with intervals, resources, costs and charts. | **A recorded run.** `naga run MODEL --player run.html`: the run replayed on the model's layout, with its KPIs. |
150
+ | <img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/shots/monitor.png" alt="The twin's monitor page" width="420"> | <img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/shots/viewer.png" alt="The viewer: the engine in a browser" width="420"> |
151
+ | **A twin's monitor.** `naga twin run ... --monitor`: the plant now, the forecast against what happened, problems with their hints. The page reloads itself. | **A viewer.** `naga viewer MODEL -o viewer.html`: the engine runs in the reader's browser; they change the inputs you exposed and run it again. |
152
+
153
+ ## Example models
154
+
155
+ The package holds about fifty models: queues with a known analytical answer, job shops,
156
+ warehouses with forklifts, an energy site, a biogas plant, a supply chain, system-dynamics
157
+ classics, agent-based classics. Each runs as it is, and the documentation has a gallery of them
158
+ with numbers from a run:
159
+
160
+ ```console
161
+ naga run warehouse_forklifts --replications 2
162
+ ```
163
+
164
+ Some of them use submodels that came from asset libraries of a separate product; the engine
165
+ runs the submodels, the product's artwork is not included here.
166
+
167
+ ## Use with an agent
168
+
169
+ The engine ships 68 tools an agent can call to build, validate, run, debug and analyse a model, and two
170
+ ways to offer them:
171
+
172
+ <!-- no-run: a server that waits for its client, and a request to a language model -->
173
+ ```console
174
+ pip install "nagasim[mcp]"
175
+ naga mcp --root path/to/models # an MCP server over stdio (Claude Code, Claude Desktop)
176
+
177
+ pip install "nagasim[assistant]" # only for Claude
178
+ naga assist model.json "add a second server" # one assistant turn on a model file
179
+ ```
180
+
181
+ A local model needs no extra.
182
+
183
+ `naga assist` talks to a local model by default (an OpenAI-compatible server such as Ollama at
184
+ `http://localhost:11434/v1`; pass its model name with `--model-id`) or to Claude when
185
+ `ANTHROPIC_API_KEY` is set. Where a request goes is the caller's choice and nothing else's:
186
+ command-line flags, then the environment (`NAGASIM_LLM_PROVIDER`, `NAGASIM_LLM_BASE_URL`,
187
+ `NAGASIM_LLM_MODEL`; also `NAGASIM_LLM_API_KEY` and `NAGASIM_LLM_REASONING`), then the defaults.
188
+ `naga mcp` keeps every file inside `--root` and has the network off unless you allow it;
189
+ `naga assist` works on the one model file you give it and reaches only the endpoint you
190
+ configured. A model's own Python behaviour never runs through either.
191
+
192
+ ## Limits to know
193
+
194
+ - No test has run against a real broker, OPC UA server, MES or plant counter: the readers and
195
+ the twin are tested on in-process stand-ins and recorded logs.
196
+ - A twin cannot yet start from the state of a model with vehicles or blocking buffers; such a
197
+ model is monitored and its forecast is refused by name.
198
+ - Recommendations build one action, a resource's capacity, and one sink, a file.
199
+ - The viewer needs Chrome, Edge or Firefox on a desktop.
200
+ - There is no editor and no animation here beyond the recorded player: Naga is an engine.
201
+
202
+ ## Building a product on top
203
+
204
+ Naga is the engine only. It is written so that a product package (an editor, asset libraries,
205
+ an assistant, connectors) sits beside it and imports it, never the other way round: nothing in
206
+ `nagasim` imports such a package, and a test keeps it that way. Where the code or a comment says
207
+ `product` or "the product", that is the place such a package takes; none is part of this
208
+ repository.
209
+
210
+ What a product builds on:
211
+
212
+ - `nagasim.api` (`run_model` and friends) and `nagasim.core.document.ModelDocument`, the model
213
+ as an editable, undoable document;
214
+ - the model schema (`naga schema`) and structured validation problems with stable codes;
215
+ - the event bus and `nagasim.core.trace.TraceRecorder`, with `nagasim.core.playback.Timeline`
216
+ to turn a recorded or live run into the state at any instant (what an animation draws);
217
+ - plugin entry points for blocks, distributions and exporters (`nagasim.plugins`);
218
+ - `nagasim.netguard`, the one place file and network access is decided.
219
+
220
+ ## Development
221
+
222
+ <!-- no-run: installs the package and runs its test suite -->
223
+ ```console
224
+ git clone https://github.com/TheMattHub/naga
225
+ cd naga
226
+ pip install -e ".[plan,ml,sql,plot]" -r requirements-dev.txt
227
+ python -m pytest -q -n auto
228
+ ```
229
+
230
+ Python 3.11 or later. The engine depends on SimPy, NumPy, pandas, SciPy and openpyxl; everything
231
+ else is optional and imported only where it is used. The documentation's sources are in `docs/`
232
+ (`pip install -r requirements-docs.txt`, then `python -m mkdocs serve`).
233
+
234
+ ## Versions
235
+
236
+ Before 1.0:
237
+
238
+ - Model files always migrate forward: a file saved by an older version opens in a newer one.
239
+ - Agent tool names and problem codes are permanent.
240
+ - The Python API may change between minor versions; every such change has a changelog line.
241
+
242
+ See the [changelog](CHANGELOG.md).
243
+
244
+ ## Licence and citation
245
+
246
+ Apache License 2.0, see [LICENSE](LICENSE) and [NOTICE](NOTICE). If you use Naga in published
247
+ work, please cite it: see [CITATION.cff](CITATION.cff).
@@ -0,0 +1,199 @@
1
+ <p align="center"><img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/banner.svg" alt="Naga: a simulation engine on SimPy" width="820"></p>
2
+
3
+ <p align="center">
4
+ <a href="https://github.com/TheMattHub/naga/actions/workflows/tests.yml"><img src="https://github.com/TheMattHub/naga/actions/workflows/tests.yml/badge.svg" alt="tests"></a>
5
+ <a href="https://pypi.org/project/nagasim/"><img src="https://img.shields.io/pypi/v/nagasim" alt="PyPI"></a>
6
+ <a href="https://pypi.org/project/nagasim/"><img src="https://img.shields.io/pypi/pyversions/nagasim" alt="Python versions"></a>
7
+ <a href="LICENSE"><img src="https://img.shields.io/badge/licence-Apache--2.0-blue" alt="Apache-2.0"></a>
8
+ </p>
9
+
10
+ # Naga
11
+
12
+ Naga is a simulation engine for Python, built on [SimPy](https://simpy.readthedocs.io/), for
13
+ people who have a question about how a system behaves and want an answer they can show their
14
+ work for. You describe the system once, as a data file of blocks, resources and expressions,
15
+ and Naga runs it as a discrete-event, system-dynamics or agent-based model, or as all three on
16
+ one clock. Around each run it puts what turns a single run into evidence: independent
17
+ replications with confidence intervals, scenarios compared on the same random numbers, designed
18
+ experiments, optimisation and calibration. The same model can also be connected to a plant, so
19
+ that it starts from what is happening now, forecasts what comes next, checks those forecasts
20
+ against what then happened, and proposes what to change. Because the model stays a file that
21
+ can be read, compared and shared, whichever way you drive it, the answer it gives is one a team
22
+ can inspect and repeat rather than take on trust.
23
+
24
+ ```console
25
+ pip install nagasim
26
+ naga run single_server --replications 5 --report report.html
27
+ ```
28
+
29
+ Documentation: <https://thematthub.github.io/naga/>
30
+
31
+ ## How it fits together
32
+
33
+ <p align="center"><img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/overview.svg" alt="What goes into the engine, what it does, and what comes out" width="900"></p>
34
+
35
+ The picture reads from left to right. On the left is what you bring: a model file, the data
36
+ it draws on and, if you have one, a plant to follow. In the middle the engine runs the model on
37
+ a single clock, whichever of the three ways of modelling it uses, and wraps the run in
38
+ statistics, experiments or a twin. On the right is what comes back: results and a report,
39
+ pages you can send to someone else, and a twin's forecasts and proposals. Along the top are the
40
+ three ways in, the command line, Python and an agent, and because a model is a data file and
41
+ not a program, the same file gives the same answer through each of them.
42
+
43
+ ## What it does
44
+
45
+ - **Discrete-event models** from blocks (create, process, seize/release, batch, match, decide,
46
+ route, transport, ...) with resources, sets, schedules, failures, costs, expressions and
47
+ submodels.
48
+ - **Material handling**: path networks, vehicle fleets with batteries and chargers, conveyors,
49
+ motion cycles, machine tending.
50
+ - **System dynamics** (stocks, flows, auxiliaries, delays, subscripts, units, XMILE and Vensim
51
+ import) and **agent-based** models (statecharts, messages, space, networks), in the same model
52
+ and on the same clock as the discrete-event part.
53
+ - **Statistics you can defend**: independent replications, Student-t intervals, warm-up handling,
54
+ reproducible random streams, validated against queueing theory.
55
+ - **Experiments**: named scenarios with paired comparisons, design of experiments,
56
+ ranking-and-selection, optimisation, calibration, forecasting, an investment case.
57
+ - **A twin of a plant** (`naga twin`): live readers for files, SQL, REST, MQTT and OPC UA, a run
58
+ that starts from the observed state, forecasts scored against what happened, and candidate
59
+ actions compared on the forecast. It reads a plant and never writes to one.
60
+ - **Model files as data**: a versioned JSON schema, validation with stable problem codes,
61
+ semantic diff and three-way merge, assertions (`naga check`) with a CI template.
62
+ - **Outputs**: pandas frames, Excel, CSV, JSON, a self-contained HTML report, a recorded run to
63
+ replay, and a viewer in which the engine itself runs in a browser.
64
+ - **Agent tools**: 68 tools over MCP to build, validate, run, debug and analyse a model.
65
+
66
+ ## Quick start
67
+
68
+ From the command line, with the bundled example models (`naga examples` lists them; a command
69
+ that takes a model file also takes one of their names):
70
+
71
+ ```console
72
+ naga examples
73
+ naga run single_server --replications 5 --report report.html
74
+ naga scenarios automation_cell
75
+ naga validate single_server
76
+ naga --help
77
+ ```
78
+
79
+ From Python:
80
+
81
+ ```python
82
+ from nagasim import api, examples
83
+
84
+ results = api.run_model(examples.path("single_server"), replications=5, seed=0)
85
+ print(results["system"])
86
+ ```
87
+
88
+ `results` is a dictionary of pandas frames (system, resources, queues, entities, costs and more).
89
+
90
+ ## What you can see
91
+
92
+ A run is easier to trust when you can look at it, so the engine writes what it finds as pages
93
+ as well as tables. Each of the four below is a single file, made by one command, that opens in
94
+ a browser with no server behind it: a report to read, a recorded run to replay, a monitor that
95
+ follows a plant, and a viewer in which someone else can change the inputs and run the model
96
+ again. They are what you hand to the people who asked the question.
97
+
98
+ | | |
99
+ |---|---|
100
+ | <img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/shots/charts.png" alt="Charts from the HTML report" width="420"> | <img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/shots/player.png" alt="A recorded run in the HTML player" width="420"> |
101
+ | **A report.** `naga run MODEL --report report.html`: KPIs with intervals, resources, costs and charts. | **A recorded run.** `naga run MODEL --player run.html`: the run replayed on the model's layout, with its KPIs. |
102
+ | <img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/shots/monitor.png" alt="The twin's monitor page" width="420"> | <img src="https://raw.githubusercontent.com/TheMattHub/naga/main/docs/img/shots/viewer.png" alt="The viewer: the engine in a browser" width="420"> |
103
+ | **A twin's monitor.** `naga twin run ... --monitor`: the plant now, the forecast against what happened, problems with their hints. The page reloads itself. | **A viewer.** `naga viewer MODEL -o viewer.html`: the engine runs in the reader's browser; they change the inputs you exposed and run it again. |
104
+
105
+ ## Example models
106
+
107
+ The package holds about fifty models: queues with a known analytical answer, job shops,
108
+ warehouses with forklifts, an energy site, a biogas plant, a supply chain, system-dynamics
109
+ classics, agent-based classics. Each runs as it is, and the documentation has a gallery of them
110
+ with numbers from a run:
111
+
112
+ ```console
113
+ naga run warehouse_forklifts --replications 2
114
+ ```
115
+
116
+ Some of them use submodels that came from asset libraries of a separate product; the engine
117
+ runs the submodels, the product's artwork is not included here.
118
+
119
+ ## Use with an agent
120
+
121
+ The engine ships 68 tools an agent can call to build, validate, run, debug and analyse a model, and two
122
+ ways to offer them:
123
+
124
+ <!-- no-run: a server that waits for its client, and a request to a language model -->
125
+ ```console
126
+ pip install "nagasim[mcp]"
127
+ naga mcp --root path/to/models # an MCP server over stdio (Claude Code, Claude Desktop)
128
+
129
+ pip install "nagasim[assistant]" # only for Claude
130
+ naga assist model.json "add a second server" # one assistant turn on a model file
131
+ ```
132
+
133
+ A local model needs no extra.
134
+
135
+ `naga assist` talks to a local model by default (an OpenAI-compatible server such as Ollama at
136
+ `http://localhost:11434/v1`; pass its model name with `--model-id`) or to Claude when
137
+ `ANTHROPIC_API_KEY` is set. Where a request goes is the caller's choice and nothing else's:
138
+ command-line flags, then the environment (`NAGASIM_LLM_PROVIDER`, `NAGASIM_LLM_BASE_URL`,
139
+ `NAGASIM_LLM_MODEL`; also `NAGASIM_LLM_API_KEY` and `NAGASIM_LLM_REASONING`), then the defaults.
140
+ `naga mcp` keeps every file inside `--root` and has the network off unless you allow it;
141
+ `naga assist` works on the one model file you give it and reaches only the endpoint you
142
+ configured. A model's own Python behaviour never runs through either.
143
+
144
+ ## Limits to know
145
+
146
+ - No test has run against a real broker, OPC UA server, MES or plant counter: the readers and
147
+ the twin are tested on in-process stand-ins and recorded logs.
148
+ - A twin cannot yet start from the state of a model with vehicles or blocking buffers; such a
149
+ model is monitored and its forecast is refused by name.
150
+ - Recommendations build one action, a resource's capacity, and one sink, a file.
151
+ - The viewer needs Chrome, Edge or Firefox on a desktop.
152
+ - There is no editor and no animation here beyond the recorded player: Naga is an engine.
153
+
154
+ ## Building a product on top
155
+
156
+ Naga is the engine only. It is written so that a product package (an editor, asset libraries,
157
+ an assistant, connectors) sits beside it and imports it, never the other way round: nothing in
158
+ `nagasim` imports such a package, and a test keeps it that way. Where the code or a comment says
159
+ `product` or "the product", that is the place such a package takes; none is part of this
160
+ repository.
161
+
162
+ What a product builds on:
163
+
164
+ - `nagasim.api` (`run_model` and friends) and `nagasim.core.document.ModelDocument`, the model
165
+ as an editable, undoable document;
166
+ - the model schema (`naga schema`) and structured validation problems with stable codes;
167
+ - the event bus and `nagasim.core.trace.TraceRecorder`, with `nagasim.core.playback.Timeline`
168
+ to turn a recorded or live run into the state at any instant (what an animation draws);
169
+ - plugin entry points for blocks, distributions and exporters (`nagasim.plugins`);
170
+ - `nagasim.netguard`, the one place file and network access is decided.
171
+
172
+ ## Development
173
+
174
+ <!-- no-run: installs the package and runs its test suite -->
175
+ ```console
176
+ git clone https://github.com/TheMattHub/naga
177
+ cd naga
178
+ pip install -e ".[plan,ml,sql,plot]" -r requirements-dev.txt
179
+ python -m pytest -q -n auto
180
+ ```
181
+
182
+ Python 3.11 or later. The engine depends on SimPy, NumPy, pandas, SciPy and openpyxl; everything
183
+ else is optional and imported only where it is used. The documentation's sources are in `docs/`
184
+ (`pip install -r requirements-docs.txt`, then `python -m mkdocs serve`).
185
+
186
+ ## Versions
187
+
188
+ Before 1.0:
189
+
190
+ - Model files always migrate forward: a file saved by an older version opens in a newer one.
191
+ - Agent tool names and problem codes are permanent.
192
+ - The Python API may change between minor versions; every such change has a changelog line.
193
+
194
+ See the [changelog](CHANGELOG.md).
195
+
196
+ ## Licence and citation
197
+
198
+ Apache License 2.0, see [LICENSE](LICENSE) and [NOTICE](NOTICE). If you use Naga in published
199
+ work, please cite it: see [CITATION.cff](CITATION.cff).
@@ -0,0 +1 @@
1
+ __version__ = "0.6.0"
@@ -0,0 +1,3 @@
1
+ from nagasim.cli import main
2
+
3
+ raise SystemExit(main())