Mesa 3.0.0b1__py3-none-any.whl → 3.0.0rc0__py3-none-any.whl

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.

Potentially problematic release.


This version of Mesa might be problematic. Click here for more details.

Files changed (111) hide show
  1. mesa/__init__.py +1 -3
  2. mesa/agent.py +23 -8
  3. mesa/batchrunner.py +26 -1
  4. {examples → mesa/examples}/README.md +11 -11
  5. mesa/examples/__init__.py +21 -0
  6. {examples → mesa/examples}/advanced/epstein_civil_violence/Readme.md +3 -2
  7. examples/advanced/epstein_civil_violence/epstein_civil_violence/agent.py → mesa/examples/advanced/epstein_civil_violence/agents.py +44 -38
  8. mesa/examples/advanced/epstein_civil_violence/app.py +73 -0
  9. mesa/examples/advanced/epstein_civil_violence/model.py +114 -0
  10. examples/advanced/pd_grid/readme.md → mesa/examples/advanced/pd_grid/Readme.md +4 -3
  11. mesa/examples/advanced/pd_grid/app.py +54 -0
  12. {examples/advanced/pd_grid → mesa/examples/advanced}/pd_grid/model.py +1 -2
  13. {examples → mesa/examples}/advanced/sugarscape_g1mt/Readme.md +6 -29
  14. examples/advanced/sugarscape_g1mt/sugarscape_g1mt/trader_agents.py → mesa/examples/advanced/sugarscape_g1mt/agents.py +26 -3
  15. {examples → mesa/examples}/advanced/sugarscape_g1mt/app.py +19 -18
  16. {examples/advanced/sugarscape_g1mt → mesa/examples/advanced}/sugarscape_g1mt/model.py +6 -6
  17. {examples → mesa/examples}/advanced/sugarscape_g1mt/tests.py +3 -6
  18. mesa/examples/advanced/wolf_sheep/app.py +84 -0
  19. {examples/advanced/wolf_sheep → mesa/examples/advanced}/wolf_sheep/model.py +9 -8
  20. mesa/examples/basic/boid_flockers/Readme.md +22 -0
  21. {examples → mesa/examples}/basic/boid_flockers/app.py +3 -4
  22. {examples → mesa/examples}/basic/boid_flockers/model.py +1 -2
  23. {examples → mesa/examples}/basic/boltzmann_wealth_model/Readme.md +1 -5
  24. mesa/examples/basic/boltzmann_wealth_model/__init__.py +0 -0
  25. {examples → mesa/examples}/basic/boltzmann_wealth_model/app.py +15 -12
  26. {examples → mesa/examples}/basic/boltzmann_wealth_model/model.py +3 -4
  27. {examples → mesa/examples}/basic/conways_game_of_life/Readme.md +11 -7
  28. mesa/examples/basic/conways_game_of_life/__init__.py +0 -0
  29. {examples → mesa/examples}/basic/conways_game_of_life/agents.py +8 -8
  30. mesa/examples/basic/conways_game_of_life/app.py +51 -0
  31. {examples → mesa/examples}/basic/conways_game_of_life/model.py +3 -4
  32. {examples → mesa/examples}/basic/conways_game_of_life/st_app.py +2 -1
  33. examples/basic/schelling/README.md → mesa/examples/basic/schelling/Readme.md +2 -9
  34. mesa/examples/basic/schelling/__init__.py +0 -0
  35. {examples → mesa/examples}/basic/schelling/app.py +6 -7
  36. {examples → mesa/examples}/basic/schelling/model.py +1 -2
  37. mesa/examples/basic/virus_on_network/__init__.py +0 -0
  38. mesa/examples/basic/virus_on_network/app.py +114 -0
  39. {examples → mesa/examples}/basic/virus_on_network/model.py +4 -7
  40. mesa/experimental/cell_space/discrete_space.py +6 -0
  41. mesa/experimental/devs/eventlist.py +6 -0
  42. mesa/model.py +13 -0
  43. mesa/space.py +70 -35
  44. mesa/visualization/__init__.py +16 -5
  45. mesa/visualization/components/__init__.py +83 -0
  46. mesa/visualization/components/altair_components.py +188 -0
  47. mesa/visualization/components/matplotlib_components.py +176 -0
  48. mesa/visualization/mpl_space_drawing.py +558 -0
  49. mesa/visualization/solara_viz.py +30 -20
  50. {mesa-3.0.0b1.dist-info → mesa-3.0.0rc0.dist-info}/METADATA +1 -3
  51. mesa-3.0.0rc0.dist-info/RECORD +95 -0
  52. examples/advanced/epstein_civil_violence/epstein_civil_violence/model.py +0 -146
  53. examples/advanced/epstein_civil_violence/epstein_civil_violence/portrayal.py +0 -33
  54. examples/advanced/epstein_civil_violence/epstein_civil_violence/server.py +0 -81
  55. examples/advanced/epstein_civil_violence/requirements.txt +0 -3
  56. examples/advanced/epstein_civil_violence/run.py +0 -3
  57. examples/advanced/pd_grid/pd_grid/portrayal.py +0 -19
  58. examples/advanced/pd_grid/pd_grid/server.py +0 -21
  59. examples/advanced/pd_grid/requirements.txt +0 -3
  60. examples/advanced/pd_grid/run.py +0 -3
  61. examples/advanced/sugarscape_g1mt/requirements.txt +0 -6
  62. examples/advanced/sugarscape_g1mt/run.py +0 -105
  63. examples/advanced/sugarscape_g1mt/sugarscape_g1mt/resource_agents.py +0 -26
  64. examples/advanced/sugarscape_g1mt/sugarscape_g1mt/server.py +0 -61
  65. examples/advanced/wolf_sheep/requirements.txt +0 -1
  66. examples/advanced/wolf_sheep/run.py +0 -3
  67. examples/advanced/wolf_sheep/wolf_sheep/resources/sheep.png +0 -0
  68. examples/advanced/wolf_sheep/wolf_sheep/resources/wolf.png +0 -0
  69. examples/advanced/wolf_sheep/wolf_sheep/server.py +0 -78
  70. examples/basic/__init__.py +0 -13
  71. examples/basic/boid_flockers/Readme.md +0 -43
  72. examples/basic/conways_game_of_life/portrayal.py +0 -18
  73. examples/basic/conways_game_of_life/requirements.txt +0 -1
  74. examples/basic/conways_game_of_life/server.py +0 -11
  75. examples/basic/virus_on_network/app.py +0 -133
  76. mesa/cookiecutter-mesa/cookiecutter.json +0 -8
  77. mesa/cookiecutter-mesa/hooks/post_gen_project.py +0 -13
  78. mesa/cookiecutter-mesa/{{cookiecutter.snake}}/README.md +0 -4
  79. mesa/cookiecutter-mesa/{{cookiecutter.snake}}/app.pytemplate +0 -27
  80. mesa/cookiecutter-mesa/{{cookiecutter.snake}}/setup.pytemplate +0 -11
  81. mesa/cookiecutter-mesa/{{cookiecutter.snake}}/{{cookiecutter.snake}}/__init__.py +0 -1
  82. mesa/cookiecutter-mesa/{{cookiecutter.snake}}/{{cookiecutter.snake}}/model.pytemplate +0 -60
  83. mesa/examples.py +0 -3
  84. mesa/main.py +0 -65
  85. mesa/visualization/components/altair.py +0 -88
  86. mesa/visualization/components/matplotlib.py +0 -342
  87. mesa-3.0.0b1.dist-info/RECORD +0 -114
  88. {examples → mesa/examples/advanced}/__init__.py +0 -0
  89. {examples → mesa/examples}/advanced/epstein_civil_violence/Epstein Civil Violence.ipynb +0 -0
  90. {examples/advanced → mesa/examples/advanced/epstein_civil_violence}/__init__.py +0 -0
  91. {examples/advanced/epstein_civil_violence/epstein_civil_violence → mesa/examples/advanced/pd_grid}/__init__.py +0 -0
  92. /examples/advanced/pd_grid/pd_grid/agent.py → /mesa/examples/advanced/pd_grid/agents.py +0 -0
  93. {examples → mesa/examples}/advanced/pd_grid/analysis.ipynb +0 -0
  94. {examples/advanced/pd_grid/pd_grid → mesa/examples/advanced/sugarscape_g1mt}/__init__.py +0 -0
  95. {examples/advanced/sugarscape_g1mt → mesa/examples/advanced}/sugarscape_g1mt/sugar-map.txt +0 -0
  96. {examples → mesa/examples}/advanced/wolf_sheep/Readme.md +0 -0
  97. {examples/advanced/sugarscape_g1mt/sugarscape_g1mt → mesa/examples/advanced/wolf_sheep}/__init__.py +0 -0
  98. {examples/advanced/wolf_sheep → mesa/examples/advanced}/wolf_sheep/agents.py +0 -0
  99. {examples/advanced/wolf_sheep → mesa/examples/basic}/__init__.py +0 -0
  100. {examples/advanced/wolf_sheep/wolf_sheep → mesa/examples/basic/boid_flockers}/__init__.py +0 -0
  101. {examples → mesa/examples}/basic/boid_flockers/agents.py +0 -0
  102. {examples → mesa/examples}/basic/boltzmann_wealth_model/agents.py +0 -0
  103. {examples → mesa/examples}/basic/boltzmann_wealth_model/st_app.py +0 -0
  104. {examples → mesa/examples}/basic/schelling/agents.py +0 -0
  105. {examples → mesa/examples}/basic/schelling/analysis.ipynb +0 -0
  106. /examples/basic/virus_on_network/README.md → /mesa/examples/basic/virus_on_network/Readme.md +0 -0
  107. {examples → mesa/examples}/basic/virus_on_network/agents.py +0 -0
  108. {mesa-3.0.0b1.dist-info → mesa-3.0.0rc0.dist-info}/WHEEL +0 -0
  109. {mesa-3.0.0b1.dist-info → mesa-3.0.0rc0.dist-info}/entry_points.txt +0 -0
  110. {mesa-3.0.0b1.dist-info → mesa-3.0.0rc0.dist-info}/licenses/LICENSE +0 -0
  111. {mesa-3.0.0b1.dist-info → mesa-3.0.0rc0.dist-info}/licenses/NOTICE +0 -0
@@ -0,0 +1,95 @@
1
+ mesa/__init__.py,sha256=JtANO2arGfbYdpYBvtWWDotVxxQInnzNtfru-pNt8Zo,660
2
+ mesa/agent.py,sha256=Ein1Ei7n1wZNKcv4L1NlP3iPu9q1pm-QGIL64dLC5Fw,24636
3
+ mesa/batchrunner.py,sha256=sMFLTxj5avP_-HGO0leLVuxXK2dH0xdPopvhAmawwRQ,7213
4
+ mesa/datacollection.py,sha256=xyb07aBpd-HSDh5bk-XcVqGiDu5bfaLlxj5eDlGIwqY,16138
5
+ mesa/model.py,sha256=fojtI87UxDLnRB71CGUKbZWh0BrstBHoCU9xWcw-MsA,10406
6
+ mesa/space.py,sha256=cfzlRfy9chegp8d89k2aqI29jo9cb18USlz2G2iOZU4,64082
7
+ mesa/time.py,sha256=5yWubqst13MfjXpsYjY-MNdIQH3KWi373KRmRZT5BBo,15044
8
+ mesa/examples/README.md,sha256=dNn8kv0BNQem3NNhO5mbOANQoK8UUYOo7rnkCFV9tnE,2882
9
+ mesa/examples/__init__.py,sha256=iJpTRiCJUwLVA253t5BIxoX3bFnPJ2_XPzET3ev5mxg,835
10
+ mesa/examples/advanced/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
11
+ mesa/examples/advanced/epstein_civil_violence/Epstein Civil Violence.ipynb,sha256=yh50ZAK2BVJyJIKsQTTxywnasqWn1IiQUVrwmZKue4w,29032
12
+ mesa/examples/advanced/epstein_civil_violence/Readme.md,sha256=IEU5IZTe5EbvAA2vkYxiIw8vK3O0MZcjbxzn8I2cQic,1874
13
+ mesa/examples/advanced/epstein_civil_violence/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
14
+ mesa/examples/advanced/epstein_civil_violence/agents.py,sha256=0X4JLj2K2cl1bACkFLI6-K6tKbr2SLZlAy_kjgUDjzA,5863
15
+ mesa/examples/advanced/epstein_civil_violence/app.py,sha256=puJmjkEevHyilfDpnkE65Y2ax6JEyOALg-IEtK8jBKk,1787
16
+ mesa/examples/advanced/epstein_civil_violence/model.py,sha256=fcTkjCRhEhDerDC1W_lrezdoWD1y5xIublkGIhCak8w,3918
17
+ mesa/examples/advanced/pd_grid/Readme.md,sha256=UVUQxZRFdfymCKDdQEn3ZEwgSqgp9cKJPsU8oZpLFnY,2367
18
+ mesa/examples/advanced/pd_grid/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
+ mesa/examples/advanced/pd_grid/agents.py,sha256=DzGj4LZUjV0xMQAwkRsv2Aoap1cUvLscJswfA1PdVDs,1716
20
+ mesa/examples/advanced/pd_grid/analysis.ipynb,sha256=ReYtRe2JVyCCXoMBONvynXDQ_eGtQSWhNcuJY3CYTTI,82323
21
+ mesa/examples/advanced/pd_grid/app.py,sha256=G4hKCQH4CXG_6OhoUyQeG4HFyx2I5gZuGkPkK1uh2lQ,1390
22
+ mesa/examples/advanced/pd_grid/model.py,sha256=iKy1Oa5lG_hlxwlw67NfFLP9dKk5uDreaaT0xO9-55A,2325
23
+ mesa/examples/advanced/sugarscape_g1mt/Readme.md,sha256=x3kKw1Rre2FPkNhGDLtdzeThmH089mxsGYUPZUeu26k,3595
24
+ mesa/examples/advanced/sugarscape_g1mt/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
25
+ mesa/examples/advanced/sugarscape_g1mt/agents.py,sha256=zE7zbO2_OaQiFDq_-t-0hv4ButBWv26dnS1zaPc3_ZE,10183
26
+ mesa/examples/advanced/sugarscape_g1mt/app.py,sha256=PYuHoAH4AfU8fbrkBpY-ZW8evwz5izLEP8srN1CHp_Y,1946
27
+ mesa/examples/advanced/sugarscape_g1mt/model.py,sha256=VVoUni3N2yk7vLEcWC1hiQemaa1vmzJU3gKxVRXxnqM,6069
28
+ mesa/examples/advanced/sugarscape_g1mt/sugar-map.txt,sha256=zZtGYciBPT4miZVnbVuoQ5TugTmGrbDWV9yb5KH6tnU,5000
29
+ mesa/examples/advanced/sugarscape_g1mt/tests.py,sha256=UNahmZTgLquSqmoi_9GcE3JP0qBHjkrHFZ15NMm0ce8,2517
30
+ mesa/examples/advanced/wolf_sheep/Readme.md,sha256=6zrtCg4Fb-hgQxqdLMpTkIYMwD6owCv8BMz_qn0N98Q,3165
31
+ mesa/examples/advanced/wolf_sheep/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
32
+ mesa/examples/advanced/wolf_sheep/agents.py,sha256=UocDCsKmXkWxt0-ToVIOhBjX-amYwMtZbHN8U2AolFI,3068
33
+ mesa/examples/advanced/wolf_sheep/app.py,sha256=n-WIPMHPYRvqrnsEF7y7mTLN5XKxKB3rJhQZzXZHwo8,2210
34
+ mesa/examples/advanced/wolf_sheep/model.py,sha256=qtCTA2fBP9lA7jJ8UUJ5SIy8gXW7K73YoY8F3YDKp6k,4522
35
+ mesa/examples/basic/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
+ mesa/examples/basic/boid_flockers/Readme.md,sha256=4KJinsLPtUciQSMzvaX3tU5r1HTUg3AFOFDKy73W5RE,894
37
+ mesa/examples/basic/boid_flockers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
38
+ mesa/examples/basic/boid_flockers/agents.py,sha256=QXT1zxOq_kdk_w60H2zPV3KpivzCHQ-ApyFIIDvxvok,2693
39
+ mesa/examples/basic/boid_flockers/app.py,sha256=5wKzyctjTq3iX1MJc69l3753a_iyYhFq3kv54h7dGSE,1289
40
+ mesa/examples/basic/boid_flockers/model.py,sha256=o335lgyGQ1E5TkAj4B-INhUL65mO0dEV3tf3gG40FvU,2201
41
+ mesa/examples/basic/boltzmann_wealth_model/Readme.md,sha256=wl1ylO9KWoTiuIJKOnk2FGdcmyVUqJ5wiSbVUa3WWAc,2725
42
+ mesa/examples/basic/boltzmann_wealth_model/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
43
+ mesa/examples/basic/boltzmann_wealth_model/agents.py,sha256=uVUo9jWQnv5I3uCaYE_N7X-cOdHhdy6RtLUL_znELgI,892
44
+ mesa/examples/basic/boltzmann_wealth_model/app.py,sha256=ltSC6BD5rEIecY0JIXK92BfWcZJpNaioRzfnxzzMsEk,2069
45
+ mesa/examples/basic/boltzmann_wealth_model/model.py,sha256=BYcfR5Nw0zXkKP72CoVnLkIvV-IVnNKKNQ7KsbJ07pc,1508
46
+ mesa/examples/basic/boltzmann_wealth_model/st_app.py,sha256=v3Je2hSe8nXPgfmZhX8lHM-7xs8dk2g1Zz0X81AqX3k,3466
47
+ mesa/examples/basic/conways_game_of_life/Readme.md,sha256=VRgN6roF6leQ_IMYwxFypSfFjZo9jnCd-rkPTjpp7II,1453
48
+ mesa/examples/basic/conways_game_of_life/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
+ mesa/examples/basic/conways_game_of_life/agents.py,sha256=ETn87GV8it9p0nlSn6f1qu5CDEmqokkr6Rq7KWaT-5U,1627
50
+ mesa/examples/basic/conways_game_of_life/app.py,sha256=DrA1CwiT43rDMZGSDO62B77_QymySkq486IeV9K8nJY,1433
51
+ mesa/examples/basic/conways_game_of_life/model.py,sha256=c7lwSelxTplbQlbfGjBSevS2TEg5DFJA8bvhbYbyD_s,1174
52
+ mesa/examples/basic/conways_game_of_life/st_app.py,sha256=_poqU2VR4rfiiq4WFXTbOUSW7liuM86iq913mW6LS50,2400
53
+ mesa/examples/basic/schelling/Readme.md,sha256=CRKBfYtnLJLlTKLsTRQ-7gsQRxVxDooOBN5uP8PEtaU,2296
54
+ mesa/examples/basic/schelling/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
55
+ mesa/examples/basic/schelling/agents.py,sha256=dvznzN2As979x-4EH8Y-i7HhlCuv1OdtWYebOdxTdhk,773
56
+ mesa/examples/basic/schelling/analysis.ipynb,sha256=JDJy6-U6eO-LrHWxZr1c3lkvtoY0DNHa-kJ4J-Z-wwo,5804
57
+ mesa/examples/basic/schelling/app.py,sha256=DlePd3iTkBSzurRy1vbZXlAugpxcEMFFR5Iy6b9RWp8,973
58
+ mesa/examples/basic/schelling/model.py,sha256=szYiw76JD-OMlZ2Op80Y9L2PZ3VMVfyuUNl1J_jC8BE,1856
59
+ mesa/examples/basic/virus_on_network/Readme.md,sha256=UnCkKiJK7wVw40a-oDR6qdf3QpCsBhgNOVZg-2UXPlc,2528
60
+ mesa/examples/basic/virus_on_network/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
61
+ mesa/examples/basic/virus_on_network/agents.py,sha256=a_WhqYblJlW6od67eXfU-nb7IMRyYpgxtf0le--VYoA,1975
62
+ mesa/examples/basic/virus_on_network/app.py,sha256=Bxjm2FHxnbjQd3V1absTM4GDOrWOlOYZtYMn3Yy0Ol8,2439
63
+ mesa/examples/basic/virus_on_network/model.py,sha256=jQoCmvygwCvhUrlL0l7V8GcDLv94CgwtuK7DDGU8q8g,2813
64
+ mesa/experimental/UserParam.py,sha256=f32nmFjroe76HpxU75ZCEOqFW2nAsDfmqIf8kQ1zt-E,2086
65
+ mesa/experimental/__init__.py,sha256=faBYyHSp-sFQPaBx8-WsLToVKCndpSzpt18HmNZtasM,385
66
+ mesa/experimental/solara_viz.py,sha256=uWrNQAX3oEWSftmyjNorN839dBCUp86hnhpL704dyGQ,15212
67
+ mesa/experimental/cell_space/__init__.py,sha256=-NtSCT7mA-aszLSAdqbICGqeFe2vBdb-GrcW562legY,999
68
+ mesa/experimental/cell_space/cell.py,sha256=lDm7NQhPDFf3-SZu5W594lDNGtzcdSPUSSsELFRg0bs,7166
69
+ mesa/experimental/cell_space/cell_agent.py,sha256=jvYOV9OIaBaqAsAG0YLV64X_f3BJe_wP7qfos_RXi0Y,3759
70
+ mesa/experimental/cell_space/cell_collection.py,sha256=ZcyuPEevCZEXW7jFnX6StjBMw4UBDQvUspZRcFi2dFg,3426
71
+ mesa/experimental/cell_space/discrete_space.py,sha256=sD5455phlIthnAK6OsgxVscQ4C_HSVWA9e476C3PuF0,5264
72
+ mesa/experimental/cell_space/grid.py,sha256=oWTy6kaaHXLPneA-w5XdqzwA0YItMWYgCq_UjNH9iA8,7711
73
+ mesa/experimental/cell_space/network.py,sha256=_x0zKlI-odNCSRb_Zqh4nBPjqnW5iVj8sVheKPCLzmU,1321
74
+ mesa/experimental/cell_space/voronoi.py,sha256=lSY8zQhELvOy0RfDyZIek09UMwY9_20UY9SPqFWsNoM,10014
75
+ mesa/experimental/components/altair.py,sha256=49OHgrm1JncfrKqDfw_5ifPtsbMKdgVYCacL9SMwucc,2624
76
+ mesa/experimental/components/matplotlib.py,sha256=j477UBk_7yW5vzT3rjhnuTixpA7PedDNghoK9TLgHVY,8043
77
+ mesa/experimental/devs/__init__.py,sha256=EByaC66ikUIu9G9p1geLm6ESEMWZOPTO9r9627S83j0,211
78
+ mesa/experimental/devs/eventlist.py,sha256=fPj2jfW-jTe-UnIE6TsF1BM2ITKe3jGfVUhu3gBv7UQ,6250
79
+ mesa/experimental/devs/simulator.py,sha256=wvqkLIDgbJNaem9nwMacyEYRp0W3ai5Oxptw3-QmbSw,10595
80
+ mesa/experimental/devs/examples/epstein_civil_violence.py,sha256=E8YSV3O5ihKsntGtnltHM-4IyS8eg2DSRUqmIiw_1iU,10916
81
+ mesa/experimental/devs/examples/wolf_sheep.py,sha256=1eb1CfYNQoprqSJat-LPYPvwWH1ENQdj39viEqwSk0s,8103
82
+ mesa/visualization/UserParam.py,sha256=Dl2WOwLYLf0pfLpabCZtIdFRyKZrK6Qtc3utZx5GPYg,2139
83
+ mesa/visualization/__init__.py,sha256=RSv-SKZgeadKq_QawaR7oTqi9JBQu99yqe717-0aUnA,742
84
+ mesa/visualization/mpl_space_drawing.py,sha256=E8IpP6Us8JLBBMDOKdWpfH7NuLQaZbuzFqviJbXuPWk,18862
85
+ mesa/visualization/solara_viz.py,sha256=2YDoj3HAFKG7LrdbOaLOBUYKnTnvWGnEGwqPqhXGPY0,15409
86
+ mesa/visualization/utils.py,sha256=lJHgRKF5BHLf72Tw3YpwyiWuRoIimaTKQ7xBCw_Rx3A,146
87
+ mesa/visualization/components/__init__.py,sha256=Bq3nrPikcaIo9BSs0O3zptWVLlUmAkLo3s0mEmpH1RE,3022
88
+ mesa/visualization/components/altair_components.py,sha256=wotpFFQgMY-ZR3lNVm_fRos-iDg0Wjnj6Tk67_7f1SQ,5847
89
+ mesa/visualization/components/matplotlib_components.py,sha256=eYd94MKufaWErYvpiYwq73Yx16Qfj_TdLIC77g5gF-Q,5411
90
+ mesa-3.0.0rc0.dist-info/METADATA,sha256=XJEJSgjqWZ14isamAG2WeKZoVMTQY83D6Z0dM80R2qg,9850
91
+ mesa-3.0.0rc0.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
92
+ mesa-3.0.0rc0.dist-info/entry_points.txt,sha256=IOcQtetGF8l4wHpOs_hGb19Rz-FS__BMXOJR10IBPsA,39
93
+ mesa-3.0.0rc0.dist-info/licenses/LICENSE,sha256=z8d0m5b2O9McPEK1xHG_dWgUBT6EfBDz6wA0F7xSPTA,11358
94
+ mesa-3.0.0rc0.dist-info/licenses/NOTICE,sha256=GbsWoK0QWv1JyZ_xer2s-jNilv0RtWl-0UrtlJANHPg,578
95
+ mesa-3.0.0rc0.dist-info/RECORD,,
@@ -1,146 +0,0 @@
1
- import mesa
2
-
3
- from .agent import Citizen, Cop
4
-
5
-
6
- class EpsteinCivilViolence(mesa.Model):
7
- """
8
- Model 1 from "Modeling civil violence: An agent-based computational
9
- approach," by Joshua Epstein.
10
- http://www.pnas.org/content/99/suppl_3/7243.full
11
- Attributes:
12
- height: grid height
13
- width: grid width
14
- citizen_density: approximate % of cells occupied by citizens.
15
- cop_density: approximate % of cells occupied by cops.
16
- citizen_vision: number of cells in each direction (N, S, E and W) that
17
- citizen can inspect
18
- cop_vision: number of cells in each direction (N, S, E and W) that cop
19
- can inspect
20
- legitimacy: (L) citizens' perception of regime legitimacy, equal
21
- across all citizens
22
- max_jail_term: (J_max)
23
- active_threshold: if (grievance - (risk_aversion * arrest_probability))
24
- > threshold, citizen rebels
25
- arrest_prob_constant: set to ensure agents make plausible arrest
26
- probability estimates
27
- movement: binary, whether agents try to move at step end
28
- max_iters: model may not have a natural stopping point, so we set a
29
- max.
30
- """
31
-
32
- def __init__(
33
- self,
34
- width=40,
35
- height=40,
36
- citizen_density=0.7,
37
- cop_density=0.074,
38
- citizen_vision=7,
39
- cop_vision=7,
40
- legitimacy=0.8,
41
- max_jail_term=1000,
42
- active_threshold=0.1,
43
- arrest_prob_constant=2.3,
44
- movement=True,
45
- max_iters=1000,
46
- ):
47
- super().__init__()
48
- self.width = width
49
- self.height = height
50
- self.citizen_density = citizen_density
51
- self.cop_density = cop_density
52
- self.citizen_vision = citizen_vision
53
- self.cop_vision = cop_vision
54
- self.legitimacy = legitimacy
55
- self.max_jail_term = max_jail_term
56
- self.active_threshold = active_threshold
57
- self.arrest_prob_constant = arrest_prob_constant
58
- self.movement = movement
59
- self.max_iters = max_iters
60
- self.iteration = 0
61
-
62
- self.grid = mesa.experimental.cell_space.OrthogonalMooreGrid(
63
- (width, height), capacity=1, torus=True
64
- )
65
-
66
- model_reporters = {
67
- "Quiescent": lambda m: self.count_type_citizens(m, "Quiescent"),
68
- "Active": lambda m: self.count_type_citizens(m, "Active"),
69
- "Jailed": self.count_jailed,
70
- "Cops": self.count_cops,
71
- }
72
- agent_reporters = {
73
- "x": lambda a: a.cell.coordinate[0],
74
- "y": lambda a: a.cell.coordinate[1],
75
- "breed": lambda a: type(a).__name__,
76
- "jail_sentence": lambda a: getattr(a, "jail_sentence", None),
77
- "condition": lambda a: getattr(a, "condition", None),
78
- "arrest_probability": lambda a: getattr(a, "arrest_probability", None),
79
- }
80
- self.datacollector = mesa.DataCollector(
81
- model_reporters=model_reporters, agent_reporters=agent_reporters
82
- )
83
- if self.cop_density + self.citizen_density > 1:
84
- raise ValueError("Cop density + citizen density must be less than 1")
85
-
86
- for cell in self.grid.all_cells:
87
- if self.random.random() < self.cop_density:
88
- cop = Cop(self, vision=self.cop_vision)
89
- cop.move_to(cell)
90
-
91
- elif self.random.random() < (self.cop_density + self.citizen_density):
92
- citizen = Citizen(
93
- self,
94
- hardship=self.random.random(),
95
- regime_legitimacy=self.legitimacy,
96
- risk_aversion=self.random.random(),
97
- threshold=self.active_threshold,
98
- vision=self.citizen_vision,
99
- )
100
- citizen.move_to(cell)
101
-
102
- self.running = True
103
- self.datacollector.collect(self)
104
-
105
- def step(self):
106
- """
107
- Advance the model by one step and collect data.
108
- """
109
- self.agents.shuffle_do("step")
110
- # collect data
111
- self.datacollector.collect(self)
112
- self.iteration += 1
113
- if self.iteration > self.max_iters:
114
- self.running = False
115
-
116
- @staticmethod
117
- def count_type_citizens(model, condition, exclude_jailed=True):
118
- """
119
- Helper method to count agents by Quiescent/Active.
120
- """
121
- citizens = model.agents_by_type[Citizen]
122
-
123
- if exclude_jailed:
124
- return len(
125
- [
126
- c
127
- for c in citizens
128
- if (c.condition == condition) and (c.jail_sentence == 0)
129
- ]
130
- )
131
- else:
132
- return len([c for c in citizens if c.condition == condition])
133
-
134
- @staticmethod
135
- def count_jailed(model):
136
- """
137
- Helper method to count jailed agents.
138
- """
139
- return len([a for a in model.agents_by_type[Citizen] if a.jail_sentence > 0])
140
-
141
- @staticmethod
142
- def count_cops(model):
143
- """
144
- Helper method to count jailed agents.
145
- """
146
- return len(model.agents_by_type[Cop])
@@ -1,33 +0,0 @@
1
- from .agent import Citizen, Cop
2
-
3
- COP_COLOR = "#000000"
4
- AGENT_QUIET_COLOR = "#0066CC"
5
- AGENT_REBEL_COLOR = "#CC0000"
6
- JAIL_COLOR = "#757575"
7
-
8
-
9
- def citizen_cop_portrayal(agent):
10
- if agent is None:
11
- return
12
-
13
- portrayal = {
14
- "Shape": "circle",
15
- "x": agent.pos[0],
16
- "y": agent.pos[1],
17
- "Filled": "true",
18
- }
19
-
20
- if isinstance(agent, Citizen):
21
- color = (
22
- AGENT_QUIET_COLOR if agent.condition == "Quiescent" else AGENT_REBEL_COLOR
23
- )
24
- color = JAIL_COLOR if agent.jail_sentence else color
25
- portrayal["Color"] = color
26
- portrayal["r"] = 0.8
27
- portrayal["Layer"] = 0
28
-
29
- elif isinstance(agent, Cop):
30
- portrayal["Color"] = COP_COLOR
31
- portrayal["r"] = 0.5
32
- portrayal["Layer"] = 1
33
- return portrayal
@@ -1,81 +0,0 @@
1
- import mesa
2
-
3
- from .agent import Citizen, Cop
4
- from .model import EpsteinCivilViolence
5
-
6
- COP_COLOR = "#000000"
7
- AGENT_QUIET_COLOR = "#648FFF"
8
- AGENT_REBEL_COLOR = "#FE6100"
9
- JAIL_COLOR = "#808080"
10
- JAIL_SHAPE = "rect"
11
-
12
-
13
- def citizen_cop_portrayal(agent):
14
- if agent is None:
15
- return
16
-
17
- portrayal = {
18
- "Shape": "circle",
19
- "x": agent.pos[0],
20
- "y": agent.pos[1],
21
- "Filled": "true",
22
- }
23
-
24
- if type(agent) is Citizen:
25
- color = (
26
- AGENT_QUIET_COLOR if agent.condition == "Quiescent" else AGENT_REBEL_COLOR
27
- )
28
- color = JAIL_COLOR if agent.jail_sentence else color
29
- shape = JAIL_SHAPE if agent.jail_sentence else "circle"
30
- portrayal["Color"] = color
31
- portrayal["Shape"] = shape
32
- if shape == "rect":
33
- portrayal["w"] = 0.9
34
- portrayal["h"] = 0.9
35
- else:
36
- portrayal["r"] = 0.5
37
- portrayal["Filled"] = "false"
38
- portrayal["Layer"] = 0
39
-
40
- elif type(agent) is Cop:
41
- portrayal["Color"] = COP_COLOR
42
- portrayal["r"] = 0.9
43
- portrayal["Layer"] = 1
44
-
45
- return portrayal
46
-
47
-
48
- model_params = {
49
- "height": 40,
50
- "width": 40,
51
- "citizen_density": mesa.visualization.Slider(
52
- "Initial Agent Density", 0.7, 0.0, 0.9, 0.1
53
- ),
54
- "cop_density": mesa.visualization.Slider(
55
- "Initial Cop Density", 0.04, 0.0, 0.1, 0.01
56
- ),
57
- "citizen_vision": mesa.visualization.Slider("Citizen Vision", 7, 1, 10, 1),
58
- "cop_vision": mesa.visualization.Slider("Cop Vision", 7, 1, 10, 1),
59
- "legitimacy": mesa.visualization.Slider(
60
- "Government Legitimacy", 0.82, 0.0, 1, 0.01
61
- ),
62
- "max_jail_term": mesa.visualization.Slider("Max Jail Term", 30, 0, 50, 1),
63
- }
64
- canvas_element = mesa.visualization.CanvasGrid(citizen_cop_portrayal, 40, 40, 480, 480)
65
- chart = mesa.visualization.ChartModule(
66
- [
67
- {"Label": "Quiescent", "Color": "#648FFF"},
68
- {"Label": "Active", "Color": "#FE6100"},
69
- {"Label": "Jailed", "Color": "#808080"},
70
- ],
71
- data_collector_name="datacollector",
72
- )
73
- server = mesa.visualization.ModularServer(
74
- EpsteinCivilViolence,
75
- [
76
- canvas_element,
77
- chart,
78
- ],
79
- "Epstein Civil Violence",
80
- model_params,
81
- )
@@ -1,3 +0,0 @@
1
- jupyter
2
- matplotlib
3
- mesa~=2.0
@@ -1,3 +0,0 @@
1
- from epstein_civil_violence.server import server
2
-
3
- server.launch(open_browser=True)
@@ -1,19 +0,0 @@
1
- def portrayPDAgent(agent):
2
- """
3
- This function is registered with the visualization server to be called
4
- each tick to indicate how to draw the agent in its current state.
5
- :param agent: the agent in the simulation
6
- :return: the portrayal dictionary
7
- """
8
- if agent is None:
9
- raise AssertionError
10
- return {
11
- "Shape": "rect",
12
- "w": 1,
13
- "h": 1,
14
- "Filled": "true",
15
- "Layer": 0,
16
- "x": agent.pos[0],
17
- "y": agent.pos[1],
18
- "Color": "blue" if agent.isCooroperating else "red",
19
- }
@@ -1,21 +0,0 @@
1
- import mesa
2
-
3
- from .model import PdGrid
4
- from .portrayal import portrayPDAgent
5
-
6
- # Make a world that is 50x50, on a 500x500 display.
7
- canvas_element = mesa.visualization.CanvasGrid(portrayPDAgent, 50, 50, 500, 500)
8
-
9
- model_params = {
10
- "height": 50,
11
- "width": 50,
12
- "activation_order": mesa.visualization.Choice(
13
- "Activation regime",
14
- value="Random",
15
- choices=PdGrid.activation_regimes,
16
- ),
17
- }
18
-
19
- server = mesa.visualization.ModularServer(
20
- PdGrid, [canvas_element], "Prisoner's Dilemma", model_params
21
- )
@@ -1,3 +0,0 @@
1
- jupyter
2
- matplotlib
3
- mesa~=2.0
@@ -1,3 +0,0 @@
1
- from pd_grid.server import server
2
-
3
- server.launch(open_browser=True)
@@ -1,6 +0,0 @@
1
- jupyter
2
- mesa~=2.0
3
- numpy
4
- matplotlib
5
- networkx
6
- pandas
@@ -1,105 +0,0 @@
1
- import sys
2
-
3
- import matplotlib.pyplot as plt
4
- import mesa
5
- import networkx as nx
6
- import pandas as pd
7
- from sugarscape_g1mt.model import SugarscapeG1mt
8
- from sugarscape_g1mt.server import server
9
-
10
-
11
- # Analysis
12
- def assess_results(results, single_agent):
13
- # Make dataframe of results
14
- results_df = pd.DataFrame(results)
15
- # Plot and show mean price
16
- plt.scatter(results_df["Step"], results_df["Price"], s=0.75)
17
- plt.show()
18
-
19
- if single_agent is not None:
20
- plt.plot(results_df["Step"], results_df["Trader"])
21
- plt.show()
22
- else:
23
- n = max(results_df["RunId"])
24
- # Plot number of Traders
25
- for i in range(n):
26
- results_explore = results_df[results_df["RunId"] == i]
27
- plt.plot(results_explore["Step"], results_explore["Trader"])
28
- plt.show()
29
-
30
- if single_agent is not None:
31
- results_df = single_agent
32
-
33
- # Show Trade Networks
34
- # create graph object
35
- print("Making Network")
36
- G = nx.Graph()
37
- trade = results_df.dropna(subset=["Trade Network"])
38
- # add agent keys to make initial node set
39
- G.add_nodes_from(list(trade["AgentID"].unique()))
40
-
41
- # create edge list
42
- for idx, row in trade.iterrows():
43
- if len(row["Trade Network"]) > 0:
44
- for agent in row["Trade Network"]:
45
- G.add_edge(row["AgentID"], agent)
46
-
47
- # Get Basic Network Statistics
48
- print(f"Node Connectivity {nx.node_connectivity(G)}")
49
- print(f"Average Clustering {nx.average_clustering(G)}")
50
- print(f"Global Efficiency {nx.global_efficiency(G)}")
51
-
52
- # Plot histogram of degree distribution
53
- degree_sequence = sorted((d for n, d in G.degree()), reverse=True)
54
- degree_sequence = [d for n, d in G.degree()]
55
- plt.hist(degree_sequence)
56
- plt.show()
57
-
58
- # Plot network
59
- nx.draw(G)
60
- plt.show()
61
-
62
-
63
- # Run the model
64
- def main():
65
- args = sys.argv[1:]
66
-
67
- if len(args) == 0:
68
- server.launch()
69
-
70
- elif args[0] == "-s":
71
- print("Running Single Model")
72
- model = SugarscapeG1mt()
73
- model.run_model()
74
- model_results = model.datacollector.get_model_vars_dataframe()
75
- model_results["Step"] = model_results.index
76
- agent_results = model.datacollector.get_agent_vars_dataframe()
77
- agent_results = agent_results.reset_index()
78
- assess_results(model_results, agent_results)
79
-
80
- elif args[0] == "-b":
81
- print("Conducting a Batch Run")
82
- params = {
83
- "width": 50,
84
- "height": 50,
85
- "vision_min": range(1, 4),
86
- "metabolism_max": [2, 3, 4, 5],
87
- }
88
-
89
- results_batch = mesa.batch_run(
90
- SugarscapeG1mt,
91
- parameters=params,
92
- iterations=1,
93
- number_processes=1,
94
- data_collection_period=1,
95
- display_progress=True,
96
- )
97
-
98
- assess_results(results_batch, None)
99
-
100
- else:
101
- raise Exception("Option not found")
102
-
103
-
104
- if __name__ == "__main__":
105
- main()
@@ -1,26 +0,0 @@
1
- from mesa.experimental.cell_space import FixedAgent
2
-
3
-
4
- class Resource(FixedAgent):
5
- """
6
- Resource:
7
- - contains an amount of sugar and spice
8
- - grows 1 amount of sugar at each turn
9
- - grows 1 amount of spice at each turn
10
- """
11
-
12
- def __init__(self, model, max_sugar, max_spice, cell):
13
- super().__init__(model)
14
- self.sugar_amount = max_sugar
15
- self.max_sugar = max_sugar
16
- self.spice_amount = max_spice
17
- self.max_spice = max_spice
18
- self.cell = cell
19
-
20
- def step(self):
21
- """
22
- Growth function, adds one unit of sugar and spice each step up to
23
- max amount
24
- """
25
- self.sugar_amount = min([self.max_sugar, self.sugar_amount + 1])
26
- self.spice_amount = min([self.max_spice, self.spice_amount + 1])
@@ -1,61 +0,0 @@
1
- import mesa
2
-
3
- from .model import SugarscapeG1mt
4
- from .resource_agents import Resource
5
- from .trader_agents import Trader
6
-
7
- sugar_dic = {4: "#005C00", 3: "#008300", 2: "#00AA00", 1: "#00F800"}
8
- spice_dic = {4: "#acac00", 3: "#c5c500", 2: "#dfdf00", 1: "#f8f800"}
9
-
10
-
11
- def Agent_portrayal(agent):
12
- if agent is None:
13
- return
14
-
15
- if isinstance(agent, Trader):
16
- return {
17
- "Shape": "circle",
18
- "Filled": "true",
19
- "r": 0.5,
20
- "Layer": 0,
21
- "Color": "#FF0A01",
22
- }
23
-
24
- elif isinstance(agent, Resource):
25
- resource_type = "sugar" if agent.max_sugar > agent.max_spice else "spice"
26
- if resource_type == "sugar":
27
- color = (
28
- sugar_dic[agent.sugar_amount] if agent.sugar_amount != 0 else "#D6F5D6"
29
- )
30
- layer = 1 if agent.sugar_amount > 2 else 0
31
- else:
32
- color = (
33
- spice_dic[agent.spice_amount] if agent.spice_amount != 0 else "#D6F5D6"
34
- )
35
- layer = 1 if agent.spice_amount > 2 else 0
36
- return {
37
- "Color": color,
38
- "Shape": "rect",
39
- "Filled": "true",
40
- "Layer": layer,
41
- "w": 1,
42
- "h": 1,
43
- }
44
-
45
- return {}
46
-
47
-
48
- canvas_element = mesa.visualization.CanvasGrid(Agent_portrayal, 50, 50, 500, 500)
49
- chart_element = mesa.visualization.ChartModule(
50
- [{"Label": "Trader", "Color": "#AA0000"}]
51
- )
52
- chart_element2 = mesa.visualization.ChartModule(
53
- [{"Label": "Price", "Color": "#000000"}]
54
- )
55
-
56
- server = mesa.visualization.ModularServer(
57
- SugarscapeG1mt,
58
- [canvas_element, chart_element, chart_element2],
59
- "Sugarscape with Traders",
60
- )
61
- # server.launch()
@@ -1 +0,0 @@
1
- mesa~=2.0
@@ -1,3 +0,0 @@
1
- from wolf_sheep.server import server
2
-
3
- server.launch(open_browser=True)