mettagrid 0.0.2__py3-none-any.whl → 0.0.3__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.
Files changed (66) hide show
  1. README.md +75 -2
  2. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/actions.cpython-311-darwin.so +0 -0
  3. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/attack.cpython-311-darwin.so +0 -0
  4. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/gift.cpython-311-darwin.so +0 -0
  5. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/move.cpython-311-darwin.so +0 -0
  6. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/noop.cpython-311-darwin.so +0 -0
  7. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/rotate.cpython-311-darwin.so +0 -0
  8. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/shield.cpython-311-darwin.so +0 -0
  9. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/use.cpython-311-darwin.so +0 -0
  10. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/mettagrid_c.cpython-311-darwin.so +0 -0
  11. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/objects.cpython-311-darwin.so +0 -0
  12. build/mettagrid/actions/actions.cpp +706 -593
  13. build/mettagrid/actions/attack.cpp +1589 -1185
  14. build/mettagrid/actions/gift.cpp +550 -515
  15. build/mettagrid/actions/move.cpp +739 -638
  16. build/mettagrid/actions/noop.cpp +32376 -0
  17. build/mettagrid/actions/rotate.cpp +550 -545
  18. build/mettagrid/actions/shield.cpp +594 -531
  19. build/mettagrid/actions/use.cpp +654 -589
  20. build/mettagrid/mettagrid.cpp +4011 -1495
  21. build/mettagrid/objects.cpp +1449 -824
  22. mettagrid/actions/actions.cpython-311-darwin.so +0 -0
  23. mettagrid/actions/actions.pxd +2 -2
  24. mettagrid/actions/actions.pyx +19 -5
  25. mettagrid/actions/attack.cpython-311-darwin.so +0 -0
  26. mettagrid/actions/attack.pyx +12 -3
  27. mettagrid/actions/gift.cpython-311-darwin.so +0 -0
  28. mettagrid/actions/gift.pyx +4 -1
  29. mettagrid/actions/move.cpython-311-darwin.so +0 -0
  30. mettagrid/actions/move.pyx +16 -6
  31. mettagrid/actions/noop.cpython-311-darwin.so +0 -0
  32. mettagrid/actions/noop.pxd +4 -0
  33. mettagrid/actions/noop.pyx +25 -0
  34. mettagrid/actions/rotate.cpython-311-darwin.so +0 -0
  35. mettagrid/actions/rotate.pyx +5 -3
  36. mettagrid/actions/shield.cpython-311-darwin.so +0 -0
  37. mettagrid/actions/shield.pyx +10 -3
  38. mettagrid/actions/use.cpython-311-darwin.so +0 -0
  39. mettagrid/actions/use.pyx +9 -4
  40. mettagrid/mettagrid.pyx +35 -1
  41. mettagrid/mettagrid_c.cpython-311-darwin.so +0 -0
  42. mettagrid/mettagrid_env.py +44 -72
  43. mettagrid/objects.cpython-311-darwin.so +0 -0
  44. mettagrid/objects.pxd +25 -12
  45. mettagrid/objects.pyx +19 -21
  46. mettagrid/renderer/assets/agent.png +0 -0
  47. mettagrid/renderer/assets/altar.png +0 -0
  48. mettagrid/renderer/assets/arial.ttf +0 -0
  49. mettagrid/renderer/assets/converter.png +0 -0
  50. mettagrid/renderer/assets/generator.png +0 -0
  51. mettagrid/renderer/json_renderer.py +0 -0
  52. mettagrid/renderer/raylib_renderer.py +410 -0
  53. mettagrid/renderer/render_code_example.py +56 -0
  54. mettagrid-0.0.3.dist-info/METADATA +96 -0
  55. mettagrid-0.0.3.dist-info/RECORD +81 -0
  56. setup.py +1 -0
  57. test_perf.py +2 -2
  58. mettagrid/actions.cpython-311-darwin.so +0 -0
  59. mettagrid/renderer/raylib_client.py +0 -180
  60. mettagrid-0.0.2.dist-info/METADATA +0 -23
  61. mettagrid-0.0.2.dist-info/RECORD +0 -70
  62. /mettagrid/renderer/assets/{tiny_galaxy_items.png → items.png} +0 -0
  63. /mettagrid/renderer/assets/{tiny_galaxy_monsters.png → monsters.png} +0 -0
  64. /mettagrid/renderer/assets/{wall1-0.png → wall.png} +0 -0
  65. {mettagrid-0.0.2.dist-info → mettagrid-0.0.3.dist-info}/LICENSE +0 -0
  66. {mettagrid-0.0.2.dist-info → mettagrid-0.0.3.dist-info}/WHEEL +0 -0
@@ -10,12 +10,12 @@
10
10
  ]
11
11
  ],
12
12
  "depends": [
13
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid/event.hpp",
14
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid/grid.hpp",
15
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid/grid_object.hpp"
13
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid/event.hpp",
14
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid/grid.hpp",
15
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid/grid_object.hpp"
16
16
  ],
17
17
  "include_dirs": [
18
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid"
18
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid"
19
19
  ],
20
20
  "language": "c++",
21
21
  "name": "mettagrid.actions.use",
@@ -1719,7 +1719,7 @@ typedef struct {
1719
1719
 
1720
1720
  /* #### Code section: numeric_typedefs ### */
1721
1721
 
1722
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":731
1722
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":731
1723
1723
  * # in Cython to enable them only on the right systems.
1724
1724
  *
1725
1725
  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
@@ -1728,7 +1728,7 @@ typedef struct {
1728
1728
  */
1729
1729
  typedef npy_int8 __pyx_t_5numpy_int8_t;
1730
1730
 
1731
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":732
1731
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":732
1732
1732
  *
1733
1733
  * ctypedef npy_int8 int8_t
1734
1734
  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
@@ -1737,7 +1737,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
1737
1737
  */
1738
1738
  typedef npy_int16 __pyx_t_5numpy_int16_t;
1739
1739
 
1740
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":733
1740
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":733
1741
1741
  * ctypedef npy_int8 int8_t
1742
1742
  * ctypedef npy_int16 int16_t
1743
1743
  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
@@ -1746,7 +1746,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
1746
1746
  */
1747
1747
  typedef npy_int32 __pyx_t_5numpy_int32_t;
1748
1748
 
1749
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":734
1749
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":734
1750
1750
  * ctypedef npy_int16 int16_t
1751
1751
  * ctypedef npy_int32 int32_t
1752
1752
  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
@@ -1755,7 +1755,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
1755
1755
  */
1756
1756
  typedef npy_int64 __pyx_t_5numpy_int64_t;
1757
1757
 
1758
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":738
1758
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":738
1759
1759
  * #ctypedef npy_int128 int128_t
1760
1760
  *
1761
1761
  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
@@ -1764,7 +1764,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
1764
1764
  */
1765
1765
  typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1766
1766
 
1767
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":739
1767
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":739
1768
1768
  *
1769
1769
  * ctypedef npy_uint8 uint8_t
1770
1770
  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
@@ -1773,7 +1773,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1773
1773
  */
1774
1774
  typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1775
1775
 
1776
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":740
1776
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":740
1777
1777
  * ctypedef npy_uint8 uint8_t
1778
1778
  * ctypedef npy_uint16 uint16_t
1779
1779
  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
@@ -1782,7 +1782,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1782
1782
  */
1783
1783
  typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1784
1784
 
1785
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":741
1785
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":741
1786
1786
  * ctypedef npy_uint16 uint16_t
1787
1787
  * ctypedef npy_uint32 uint32_t
1788
1788
  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
@@ -1791,7 +1791,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1791
1791
  */
1792
1792
  typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1793
1793
 
1794
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":745
1794
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":745
1795
1795
  * #ctypedef npy_uint128 uint128_t
1796
1796
  *
1797
1797
  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
@@ -1800,7 +1800,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1800
1800
  */
1801
1801
  typedef npy_float32 __pyx_t_5numpy_float32_t;
1802
1802
 
1803
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":746
1803
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":746
1804
1804
  *
1805
1805
  * ctypedef npy_float32 float32_t
1806
1806
  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
@@ -1809,7 +1809,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
1809
1809
  */
1810
1810
  typedef npy_float64 __pyx_t_5numpy_float64_t;
1811
1811
 
1812
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":755
1812
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":755
1813
1813
  * # The int types are mapped a bit surprising --
1814
1814
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1815
1815
  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
@@ -1818,7 +1818,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
1818
1818
  */
1819
1819
  typedef npy_long __pyx_t_5numpy_int_t;
1820
1820
 
1821
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":756
1821
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":756
1822
1822
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1823
1823
  * ctypedef npy_long int_t
1824
1824
  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
@@ -1827,7 +1827,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
1827
1827
  */
1828
1828
  typedef npy_longlong __pyx_t_5numpy_long_t;
1829
1829
 
1830
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":757
1830
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":757
1831
1831
  * ctypedef npy_long int_t
1832
1832
  * ctypedef npy_longlong long_t
1833
1833
  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
@@ -1836,7 +1836,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
1836
1836
  */
1837
1837
  typedef npy_longlong __pyx_t_5numpy_longlong_t;
1838
1838
 
1839
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":759
1839
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":759
1840
1840
  * ctypedef npy_longlong longlong_t
1841
1841
  *
1842
1842
  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
@@ -1845,7 +1845,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
1845
1845
  */
1846
1846
  typedef npy_ulong __pyx_t_5numpy_uint_t;
1847
1847
 
1848
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":760
1848
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":760
1849
1849
  *
1850
1850
  * ctypedef npy_ulong uint_t
1851
1851
  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
@@ -1854,7 +1854,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
1854
1854
  */
1855
1855
  typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1856
1856
 
1857
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":761
1857
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":761
1858
1858
  * ctypedef npy_ulong uint_t
1859
1859
  * ctypedef npy_ulonglong ulong_t
1860
1860
  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
@@ -1863,7 +1863,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1863
1863
  */
1864
1864
  typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1865
1865
 
1866
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":763
1866
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":763
1867
1867
  * ctypedef npy_ulonglong ulonglong_t
1868
1868
  *
1869
1869
  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
@@ -1872,7 +1872,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1872
1872
  */
1873
1873
  typedef npy_intp __pyx_t_5numpy_intp_t;
1874
1874
 
1875
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":764
1875
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":764
1876
1876
  *
1877
1877
  * ctypedef npy_intp intp_t
1878
1878
  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
@@ -1881,7 +1881,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
1881
1881
  */
1882
1882
  typedef npy_uintp __pyx_t_5numpy_uintp_t;
1883
1883
 
1884
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":766
1884
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":766
1885
1885
  * ctypedef npy_uintp uintp_t
1886
1886
  *
1887
1887
  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
@@ -1890,7 +1890,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
1890
1890
  */
1891
1891
  typedef npy_double __pyx_t_5numpy_float_t;
1892
1892
 
1893
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":767
1893
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":767
1894
1894
  *
1895
1895
  * ctypedef npy_double float_t
1896
1896
  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
@@ -1899,7 +1899,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
1899
1899
  */
1900
1900
  typedef npy_double __pyx_t_5numpy_double_t;
1901
1901
 
1902
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":768
1902
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":768
1903
1903
  * ctypedef npy_double float_t
1904
1904
  * ctypedef npy_double double_t
1905
1905
  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
@@ -1977,7 +1977,7 @@ struct __pyx_MemviewEnum_obj;
1977
1977
  struct __pyx_memoryview_obj;
1978
1978
  struct __pyx_memoryviewslice_obj;
1979
1979
 
1980
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":770
1980
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":770
1981
1981
  * ctypedef npy_longdouble longdouble_t
1982
1982
  *
1983
1983
  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
@@ -1986,7 +1986,7 @@ struct __pyx_memoryviewslice_obj;
1986
1986
  */
1987
1987
  typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1988
1988
 
1989
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":771
1989
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":771
1990
1990
  *
1991
1991
  * ctypedef npy_cfloat cfloat_t
1992
1992
  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
@@ -1995,7 +1995,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1995
1995
  */
1996
1996
  typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1997
1997
 
1998
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":772
1998
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":772
1999
1999
  * ctypedef npy_cfloat cfloat_t
2000
2000
  * ctypedef npy_cdouble cdouble_t
2001
2001
  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
@@ -2004,7 +2004,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
2004
2004
  */
2005
2005
  typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
2006
2006
 
2007
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":774
2007
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":774
2008
2008
  * ctypedef npy_clongdouble clongdouble_t
2009
2009
  *
2010
2010
  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
@@ -2020,7 +2020,7 @@ struct __pyx_t_9mettagrid_7objects_Generator;
2020
2020
  struct __pyx_t_9mettagrid_7objects_Converter;
2021
2021
  struct __pyx_t_9mettagrid_7objects_Altar;
2022
2022
 
2023
- /* "mettagrid/objects.pxd":15
2023
+ /* "mettagrid/objects.pxd":16
2024
2024
  * from puffergrid.event cimport EventHandler, EventArg
2025
2025
  *
2026
2026
  * cdef enum GridLayer: # <<<<<<<<<<<<<<
@@ -2032,7 +2032,7 @@ enum __pyx_t_9mettagrid_7objects_GridLayer {
2032
2032
  __pyx_e_9mettagrid_7objects_Object_Layer = 1
2033
2033
  };
2034
2034
 
2035
- /* "mettagrid/objects.pxd":46
2035
+ /* "mettagrid/objects.pxd":44
2036
2036
  * return this.ready and this.use_cost <= actor.energy
2037
2037
  *
2038
2038
  * cdef enum ObjectType: # <<<<<<<<<<<<<<
@@ -2048,7 +2048,7 @@ enum __pyx_t_9mettagrid_7objects_ObjectType {
2048
2048
  __pyx_e_9mettagrid_7objects_Count = 5
2049
2049
  };
2050
2050
 
2051
- /* "mettagrid/objects.pxd":56
2051
+ /* "mettagrid/objects.pxd":54
2052
2052
  * cdef vector[string] ObjectTypeNames # defined in objects.pyx
2053
2053
  *
2054
2054
  * cdef enum InventoryItem: # <<<<<<<<<<<<<<
@@ -2062,7 +2062,7 @@ enum __pyx_t_9mettagrid_7objects_InventoryItem {
2062
2062
  __pyx_e_9mettagrid_7objects_InventoryCount = 3
2063
2063
  };
2064
2064
 
2065
- /* "mettagrid/objects.pxd":191
2065
+ /* "mettagrid/objects.pxd":202
2066
2066
  * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
2067
2067
  *
2068
2068
  * cdef enum Events: # <<<<<<<<<<<<<<
@@ -2073,7 +2073,7 @@ enum __pyx_t_9mettagrid_7objects_Events {
2073
2073
  __pyx_e_9mettagrid_7objects_Reset = 0
2074
2074
  };
2075
2075
 
2076
- /* "mettagrid/objects.pxd":19
2076
+ /* "mettagrid/objects.pxd":20
2077
2077
  * Object_Layer = 1
2078
2078
  *
2079
2079
  * ctypedef map[string, int] ObjectConfig # <<<<<<<<<<<<<<
@@ -2083,7 +2083,7 @@ enum __pyx_t_9mettagrid_7objects_Events {
2083
2083
  typedef std::map<std::string,int> __pyx_t_9mettagrid_7objects_ObjectConfig;
2084
2084
  struct __pyx_t_9mettagrid_7objects_MettaObject : public GridObject {
2085
2085
 
2086
- /* "mettagrid/objects.pxd":21
2086
+ /* "mettagrid/objects.pxd":22
2087
2087
  * ctypedef map[string, int] ObjectConfig
2088
2088
  *
2089
2089
  * cdef cppclass MettaObject(GridObject): # <<<<<<<<<<<<<<
@@ -2092,14 +2092,13 @@ struct __pyx_t_9mettagrid_7objects_MettaObject : public GridObject {
2092
2092
  */
2093
2093
  unsigned int hp;
2094
2094
  virtual void init_mo(__pyx_t_9mettagrid_7objects_ObjectConfig);
2095
- virtual char usable(__pyx_t_9mettagrid_7objects_Agent const *);
2096
- virtual char attackable(void);
2095
+ virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
2097
2096
  virtual ~__pyx_t_9mettagrid_7objects_MettaObject() {
2098
2097
  }
2099
2098
  };
2100
2099
  struct __pyx_t_9mettagrid_7objects_Usable : public __pyx_t_9mettagrid_7objects_MettaObject {
2101
2100
 
2102
- /* "mettagrid/objects.pxd":33
2101
+ /* "mettagrid/objects.pxd":31
2103
2102
  * return False
2104
2103
  *
2105
2104
  * cdef cppclass Usable(MettaObject): # <<<<<<<<<<<<<<
@@ -2110,24 +2109,28 @@ struct __pyx_t_9mettagrid_7objects_Usable : public __pyx_t_9mettagrid_7objects_M
2110
2109
  unsigned int cooldown;
2111
2110
  unsigned char ready;
2112
2111
  virtual void init_usable(__pyx_t_9mettagrid_7objects_ObjectConfig);
2113
- virtual char usable(__pyx_t_9mettagrid_7objects_Agent const *);
2112
+ virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
2114
2113
  virtual ~__pyx_t_9mettagrid_7objects_Usable() {
2115
2114
  }
2116
2115
  };
2117
2116
  struct __pyx_t_9mettagrid_7objects_Agent : public __pyx_t_9mettagrid_7objects_MettaObject {
2118
2117
 
2119
- /* "mettagrid/objects.pxd":65
2118
+ /* "mettagrid/objects.pxd":63
2120
2119
  *
2121
2120
  *
2122
2121
  * cdef cppclass Agent(MettaObject): # <<<<<<<<<<<<<<
2123
- * char frozen
2124
- * unsigned int energy
2122
+ * unsigned int frozen
2123
+ * unsigned int freeze_duration
2125
2124
  */
2126
- char frozen;
2127
- unsigned int energy;
2125
+ unsigned int frozen;
2126
+ unsigned int freeze_duration;
2127
+ unsigned char energy;
2128
2128
  unsigned int orientation;
2129
- char shield;
2130
- std::vector<unsigned short> inventory;
2129
+ unsigned char shield;
2130
+ unsigned char shield_upkeep;
2131
+ std::vector<unsigned char> inventory;
2132
+ unsigned char max_items;
2133
+ unsigned char max_energy;
2131
2134
  void __pyx_f___init__Agent(GridCoord, GridCoord, __pyx_t_9mettagrid_7objects_ObjectConfig &);
2132
2135
  virtual void update_inventory(enum __pyx_t_9mettagrid_7objects_InventoryItem, short);
2133
2136
  virtual void obs(__Pyx_memviewslice);
@@ -2140,7 +2143,7 @@ struct __pyx_t_9mettagrid_7objects_Agent : public __pyx_t_9mettagrid_7objects_Me
2140
2143
  };
2141
2144
  struct __pyx_t_9mettagrid_7objects_Wall : public __pyx_t_9mettagrid_7objects_MettaObject {
2142
2145
 
2143
- /* "mettagrid/objects.pxd":104
2146
+ /* "mettagrid/objects.pxd":112
2144
2147
  * "agent:inv:" + n for n in InventoryItemNames]
2145
2148
  *
2146
2149
  * cdef cppclass Wall(MettaObject): # <<<<<<<<<<<<<<
@@ -2158,7 +2161,7 @@ struct __pyx_t_9mettagrid_7objects_Wall : public __pyx_t_9mettagrid_7objects_Met
2158
2161
  };
2159
2162
  struct __pyx_t_9mettagrid_7objects_Generator : public __pyx_t_9mettagrid_7objects_Usable {
2160
2163
 
2161
- /* "mettagrid/objects.pxd":117
2164
+ /* "mettagrid/objects.pxd":125
2162
2165
  * return ["wall", "wall:hp"]
2163
2166
  *
2164
2167
  * cdef cppclass Generator(Usable): # <<<<<<<<<<<<<<
@@ -2167,7 +2170,7 @@ struct __pyx_t_9mettagrid_7objects_Generator : public __pyx_t_9mettagrid_7object
2167
2170
  */
2168
2171
  unsigned int r1;
2169
2172
  void __pyx_f___init__Generator(GridCoord, GridCoord, __pyx_t_9mettagrid_7objects_ObjectConfig &);
2170
- virtual char usable(__pyx_t_9mettagrid_7objects_Agent const *);
2173
+ virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
2171
2174
  virtual void obs(__Pyx_memviewslice);
2172
2175
  static std::vector<std::string> feature_names(void);
2173
2176
  __pyx_t_9mettagrid_7objects_Generator(GridCoord __pyx_v_r, GridCoord __pyx_v_c, __pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
@@ -2178,7 +2181,7 @@ struct __pyx_t_9mettagrid_7objects_Generator : public __pyx_t_9mettagrid_7object
2178
2181
  };
2179
2182
  struct __pyx_t_9mettagrid_7objects_Converter : public __pyx_t_9mettagrid_7objects_Usable {
2180
2183
 
2181
- /* "mettagrid/objects.pxd":140
2184
+ /* "mettagrid/objects.pxd":148
2182
2185
  * return ["generator", "generator:hp", "generator:r1", "generator:ready"]
2183
2186
  *
2184
2187
  * cdef cppclass Converter(Usable): # <<<<<<<<<<<<<<
@@ -2189,7 +2192,7 @@ struct __pyx_t_9mettagrid_7objects_Converter : public __pyx_t_9mettagrid_7object
2189
2192
  enum __pyx_t_9mettagrid_7objects_InventoryItem output_resource;
2190
2193
  short output_energy;
2191
2194
  void __pyx_f___init__Converter(GridCoord, GridCoord, __pyx_t_9mettagrid_7objects_ObjectConfig &);
2192
- virtual char usable(__pyx_t_9mettagrid_7objects_Agent const *);
2195
+ virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
2193
2196
  virtual PyObject *obs(__Pyx_memviewslice);
2194
2197
  static std::vector<std::string> feature_names(void);
2195
2198
  __pyx_t_9mettagrid_7objects_Converter(GridCoord __pyx_v_r, GridCoord __pyx_v_c, __pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
@@ -2200,7 +2203,7 @@ struct __pyx_t_9mettagrid_7objects_Converter : public __pyx_t_9mettagrid_7object
2200
2203
  };
2201
2204
  struct __pyx_t_9mettagrid_7objects_Altar : public __pyx_t_9mettagrid_7objects_Usable {
2202
2205
 
2203
- /* "mettagrid/objects.pxd":168
2206
+ /* "mettagrid/objects.pxd":176
2204
2207
  * return ["converter", "converter:hp", "converter:input_resource", "converter:output_resource", "converter:output_energy", "converter:ready"]
2205
2208
  *
2206
2209
  * cdef cppclass Altar(Usable): # <<<<<<<<<<<<<<
@@ -2307,6 +2310,8 @@ struct __pyx_obj_10puffergrid_8grid_env_GridEnv {
2307
2310
  unsigned int _current_timestep;
2308
2311
  unsigned int _max_timestep;
2309
2312
  PyObject *_action_handlers;
2313
+ std::vector<unsigned char> _max_action_args;
2314
+ unsigned char _max_action_arg;
2310
2315
  struct __pyx_obj_10puffergrid_19observation_encoder_ObservationEncoder *_obs_encoder;
2311
2316
  unsigned short _obs_width;
2312
2317
  unsigned short _obs_height;
@@ -2340,7 +2345,7 @@ struct __pyx_obj_10puffergrid_6action_ActionHandler {
2340
2345
  };
2341
2346
 
2342
2347
 
2343
- /* "mettagrid/objects.pxd":185
2348
+ /* "mettagrid/objects.pxd":193
2344
2349
  * cdef map[TypeId, GridLayer] ObjectLayers
2345
2350
  *
2346
2351
  * cdef class ResetHandler(EventHandler): # <<<<<<<<<<<<<<
@@ -2352,17 +2357,18 @@ struct __pyx_obj_9mettagrid_7objects_ResetHandler {
2352
2357
  };
2353
2358
 
2354
2359
 
2355
- /* "mettagrid/objects.pxd":194
2360
+ /* "mettagrid/objects.pxd":205
2356
2361
  * Reset = 0
2357
2362
  *
2358
2363
  * cdef class MettaObservationEncoder(ObservationEncoder): # <<<<<<<<<<<<<<
2364
+ * cdef _encode(self, GridObject *obj, ObsType[:] obs, unsigned int offset)
2359
2365
  * cdef vector[short] _offsets
2360
- * cdef vector[string] _feature_names
2361
2366
  */
2362
2367
  struct __pyx_obj_9mettagrid_7objects_MettaObservationEncoder {
2363
2368
  struct __pyx_obj_10puffergrid_19observation_encoder_ObservationEncoder __pyx_base;
2364
2369
  std::vector<short> _offsets;
2365
2370
  std::vector<std::string> _feature_names;
2371
+ std::vector<std::vector<std::string> > _type_feature_names;
2366
2372
  };
2367
2373
 
2368
2374
 
@@ -2563,7 +2569,7 @@ struct __pyx_vtabstruct_10puffergrid_8grid_env_GridEnv {
2563
2569
  PyObject *(*get_episode_rewards)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, int __pyx_skip_dispatch);
2564
2570
  PyObject *(*get_buffers)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, int __pyx_skip_dispatch);
2565
2571
  PyArrayObject *(*render_ascii)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, PyObject *, int __pyx_skip_dispatch);
2566
- PyArrayObject *(*grid_objects)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, int __pyx_skip_dispatch);
2572
+ PyArrayObject *(*grid_objects_types)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, int __pyx_skip_dispatch);
2567
2573
  };
2568
2574
  static struct __pyx_vtabstruct_10puffergrid_8grid_env_GridEnv *__pyx_vtabptr_10puffergrid_8grid_env_GridEnv;
2569
2575
 
@@ -2578,12 +2584,13 @@ static struct __pyx_vtabstruct_10puffergrid_8grid_env_GridEnv *__pyx_vtabptr_10p
2578
2584
 
2579
2585
  struct __pyx_vtabstruct_10puffergrid_6action_ActionHandler {
2580
2586
  void (*init)(struct __pyx_obj_10puffergrid_6action_ActionHandler *, struct __pyx_obj_10puffergrid_8grid_env_GridEnv *);
2581
- char (*handle_action)(struct __pyx_obj_10puffergrid_6action_ActionHandler *, unsigned int, GridObjectId, __pyx_t_10puffergrid_6action_ActionArg);
2587
+ int (*handle_action)(struct __pyx_obj_10puffergrid_6action_ActionHandler *, unsigned int, GridObjectId, __pyx_t_10puffergrid_6action_ActionArg);
2588
+ unsigned char (*max_arg)(struct __pyx_obj_10puffergrid_6action_ActionHandler *);
2582
2589
  };
2583
2590
  static struct __pyx_vtabstruct_10puffergrid_6action_ActionHandler *__pyx_vtabptr_10puffergrid_6action_ActionHandler;
2584
2591
 
2585
2592
 
2586
- /* "mettagrid/objects.pxd":185
2593
+ /* "mettagrid/objects.pxd":193
2587
2594
  * cdef map[TypeId, GridLayer] ObjectLayers
2588
2595
  *
2589
2596
  * cdef class ResetHandler(EventHandler): # <<<<<<<<<<<<<<
@@ -2597,16 +2604,17 @@ struct __pyx_vtabstruct_9mettagrid_7objects_ResetHandler {
2597
2604
  static struct __pyx_vtabstruct_9mettagrid_7objects_ResetHandler *__pyx_vtabptr_9mettagrid_7objects_ResetHandler;
2598
2605
 
2599
2606
 
2600
- /* "mettagrid/objects.pxd":194
2607
+ /* "mettagrid/objects.pxd":205
2601
2608
  * Reset = 0
2602
2609
  *
2603
2610
  * cdef class MettaObservationEncoder(ObservationEncoder): # <<<<<<<<<<<<<<
2611
+ * cdef _encode(self, GridObject *obj, ObsType[:] obs, unsigned int offset)
2604
2612
  * cdef vector[short] _offsets
2605
- * cdef vector[string] _feature_names
2606
2613
  */
2607
2614
 
2608
2615
  struct __pyx_vtabstruct_9mettagrid_7objects_MettaObservationEncoder {
2609
2616
  struct __pyx_vtabstruct_10puffergrid_19observation_encoder_ObservationEncoder __pyx_base;
2617
+ PyObject *(*_encode)(struct __pyx_obj_9mettagrid_7objects_MettaObservationEncoder *, GridObject *, __Pyx_memviewslice, unsigned int);
2610
2618
  };
2611
2619
  static struct __pyx_vtabstruct_9mettagrid_7objects_MettaObservationEncoder *__pyx_vtabptr_9mettagrid_7objects_MettaObservationEncoder;
2612
2620
 
@@ -2621,7 +2629,7 @@ static struct __pyx_vtabstruct_9mettagrid_7objects_MettaObservationEncoder *__py
2621
2629
 
2622
2630
  struct __pyx_vtabstruct_9mettagrid_7actions_7actions_MettaActionHandler {
2623
2631
  struct __pyx_vtabstruct_10puffergrid_6action_ActionHandler __pyx_base;
2624
- char (*_handle_action)(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *, unsigned int, __pyx_t_9mettagrid_7objects_Agent *, __pyx_t_10puffergrid_6action_ActionArg);
2632
+ int (*_handle_action)(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *, unsigned int, __pyx_t_9mettagrid_7objects_Agent *, __pyx_t_10puffergrid_6action_ActionArg);
2625
2633
  };
2626
2634
  static struct __pyx_vtabstruct_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler;
2627
2635
 
@@ -3767,9 +3775,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_9mettagrid_7object
3767
3775
  /* CIntFromPy.proto */
3768
3776
  static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *);
3769
3777
 
3770
- /* CIntToPy.proto */
3771
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);
3772
-
3773
3778
  /* CIntFromPy.proto */
3774
3779
  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3775
3780
 
@@ -3829,7 +3834,8 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
3829
3834
  static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
3830
3835
  static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
3831
3836
  static void __pyx_f_9mettagrid_7objects_12ResetHandler_handle_event(struct __pyx_obj_9mettagrid_7objects_ResetHandler *__pyx_v_self, GridObjectId __pyx_v_obj_id, CYTHON_UNUSED EventArg __pyx_v_arg); /* proto*/
3832
- static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_obj_9mettagrid_7actions_3use_Use *__pyx_v_self, unsigned int __pyx_v_actor_id, __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, CYTHON_UNUSED __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg); /* proto*/
3837
+ static unsigned char __pyx_f_9mettagrid_7actions_3use_3Use_max_arg(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_3use_Use *__pyx_v_self); /* proto*/
3838
+ static int __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_obj_9mettagrid_7actions_3use_Use *__pyx_v_self, unsigned int __pyx_v_actor_id, __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, CYTHON_UNUSED __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg); /* proto*/
3833
3839
 
3834
3840
  /* Module declarations from "libc.string" */
3835
3841
 
@@ -4045,6 +4051,7 @@ static const char __pyx_k_pyx_state[] = "__pyx_state";
4045
4051
  static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
4046
4052
  static const char __pyx_k_IndexError[] = "IndexError";
4047
4053
  static const char __pyx_k_ValueError[] = "ValueError";
4054
+ static const char __pyx_k_max_energy[] = "max_energy";
4048
4055
  static const char __pyx_k_pyx_result[] = "__pyx_result";
4049
4056
  static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
4050
4057
  static const char __pyx_k_ImportError[] = "ImportError";
@@ -4064,7 +4071,9 @@ static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
4064
4071
  static const char __pyx_k_stringsource[] = "<stringsource>";
4065
4072
  static const char __pyx_k_version_info[] = "version_info";
4066
4073
  static const char __pyx_k_class_getitem[] = "__class_getitem__";
4074
+ static const char __pyx_k_max_inventory[] = "max_inventory";
4067
4075
  static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
4076
+ static const char __pyx_k_upkeep_shield[] = "upkeep.shield";
4068
4077
  static const char __pyx_k_AssertionError[] = "AssertionError";
4069
4078
  static const char __pyx_k_initial_energy[] = "initial_energy";
4070
4079
  static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
@@ -4072,6 +4081,7 @@ static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
4072
4081
  static const char __pyx_k_collections_abc[] = "collections.abc";
4073
4082
  static const char __pyx_k_converter_ready[] = "converter:ready";
4074
4083
  static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
4084
+ static const char __pyx_k_freeze_duration[] = "freeze_duration";
4075
4085
  static const char __pyx_k_generator_ready[] = "generator:ready";
4076
4086
  static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
4077
4087
  static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
@@ -19354,7 +19364,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
19354
19364
  return __pyx_r;
19355
19365
  }
19356
19366
 
19357
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19367
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19358
19368
  *
19359
19369
  * @property
19360
19370
  * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<<
@@ -19365,7 +19375,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
19365
19375
  static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
19366
19376
  PyObject *__pyx_r;
19367
19377
 
19368
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248
19378
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248
19369
19379
  * """Returns a borrowed reference to the object owning the data/memory.
19370
19380
  * """
19371
19381
  * return PyArray_BASE(self) # <<<<<<<<<<<<<<
@@ -19375,7 +19385,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject
19375
19385
  __pyx_r = PyArray_BASE(__pyx_v_self);
19376
19386
  goto __pyx_L0;
19377
19387
 
19378
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19388
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19379
19389
  *
19380
19390
  * @property
19381
19391
  * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<<
@@ -19388,7 +19398,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject
19388
19398
  return __pyx_r;
19389
19399
  }
19390
19400
 
19391
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19401
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19392
19402
  *
19393
19403
  * @property
19394
19404
  * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
@@ -19402,7 +19412,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19402
19412
  PyArray_Descr *__pyx_t_1;
19403
19413
  __Pyx_RefNannySetupContext("descr", 1);
19404
19414
 
19405
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254
19415
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254
19406
19416
  * """Returns an owned reference to the dtype of the array.
19407
19417
  * """
19408
19418
  * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
@@ -19415,7 +19425,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19415
19425
  __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19416
19426
  goto __pyx_L0;
19417
19427
 
19418
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19428
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19419
19429
  *
19420
19430
  * @property
19421
19431
  * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
@@ -19430,7 +19440,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19430
19440
  return __pyx_r;
19431
19441
  }
19432
19442
 
19433
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19443
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19434
19444
  *
19435
19445
  * @property
19436
19446
  * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<<
@@ -19441,7 +19451,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19441
19451
  static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
19442
19452
  int __pyx_r;
19443
19453
 
19444
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260
19454
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260
19445
19455
  * """Returns the number of dimensions in the array.
19446
19456
  * """
19447
19457
  * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
@@ -19451,7 +19461,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19451
19461
  __pyx_r = PyArray_NDIM(__pyx_v_self);
19452
19462
  goto __pyx_L0;
19453
19463
 
19454
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19464
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19455
19465
  *
19456
19466
  * @property
19457
19467
  * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<<
@@ -19464,7 +19474,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19464
19474
  return __pyx_r;
19465
19475
  }
19466
19476
 
19467
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19477
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19468
19478
  *
19469
19479
  * @property
19470
19480
  * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<<
@@ -19475,7 +19485,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19475
19485
  static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
19476
19486
  npy_intp *__pyx_r;
19477
19487
 
19478
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268
19488
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268
19479
19489
  * Can return NULL for 0-dimensional arrays.
19480
19490
  * """
19481
19491
  * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
@@ -19485,7 +19495,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19485
19495
  __pyx_r = PyArray_DIMS(__pyx_v_self);
19486
19496
  goto __pyx_L0;
19487
19497
 
19488
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19498
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19489
19499
  *
19490
19500
  * @property
19491
19501
  * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<<
@@ -19498,7 +19508,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19498
19508
  return __pyx_r;
19499
19509
  }
19500
19510
 
19501
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19511
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19502
19512
  *
19503
19513
  * @property
19504
19514
  * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<<
@@ -19509,7 +19519,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19509
19519
  static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
19510
19520
  npy_intp *__pyx_r;
19511
19521
 
19512
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275
19522
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275
19513
19523
  * The number of elements matches the number of dimensions of the array (ndim).
19514
19524
  * """
19515
19525
  * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
@@ -19519,7 +19529,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19519
19529
  __pyx_r = PyArray_STRIDES(__pyx_v_self);
19520
19530
  goto __pyx_L0;
19521
19531
 
19522
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19532
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19523
19533
  *
19524
19534
  * @property
19525
19535
  * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<<
@@ -19532,7 +19542,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19532
19542
  return __pyx_r;
19533
19543
  }
19534
19544
 
19535
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19545
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19536
19546
  *
19537
19547
  * @property
19538
19548
  * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<<
@@ -19543,7 +19553,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19543
19553
  static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
19544
19554
  npy_intp __pyx_r;
19545
19555
 
19546
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281
19556
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281
19547
19557
  * """Returns the total size (in number of elements) of the array.
19548
19558
  * """
19549
19559
  * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
@@ -19553,7 +19563,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19553
19563
  __pyx_r = PyArray_SIZE(__pyx_v_self);
19554
19564
  goto __pyx_L0;
19555
19565
 
19556
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19566
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19557
19567
  *
19558
19568
  * @property
19559
19569
  * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<<
@@ -19566,7 +19576,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19566
19576
  return __pyx_r;
19567
19577
  }
19568
19578
 
19569
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19579
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19570
19580
  *
19571
19581
  * @property
19572
19582
  * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<<
@@ -19577,7 +19587,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19577
19587
  static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
19578
19588
  char *__pyx_r;
19579
19589
 
19580
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290
19590
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290
19581
19591
  * of `PyArray_DATA()` instead, which returns a 'void*'.
19582
19592
  * """
19583
19593
  * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
@@ -19587,7 +19597,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p
19587
19597
  __pyx_r = PyArray_BYTES(__pyx_v_self);
19588
19598
  goto __pyx_L0;
19589
19599
 
19590
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19600
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19591
19601
  *
19592
19602
  * @property
19593
19603
  * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<<
@@ -19600,7 +19610,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p
19600
19610
  return __pyx_r;
19601
19611
  }
19602
19612
 
19603
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19613
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19604
19614
  * ctypedef npy_cdouble complex_t
19605
19615
  *
19606
19616
  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -19617,7 +19627,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19617
19627
  int __pyx_clineno = 0;
19618
19628
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
19619
19629
 
19620
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777
19630
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777
19621
19631
  *
19622
19632
  * cdef inline object PyArray_MultiIterNew1(a):
19623
19633
  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
@@ -19631,7 +19641,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19631
19641
  __pyx_t_1 = 0;
19632
19642
  goto __pyx_L0;
19633
19643
 
19634
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19644
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19635
19645
  * ctypedef npy_cdouble complex_t
19636
19646
  *
19637
19647
  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -19650,7 +19660,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19650
19660
  return __pyx_r;
19651
19661
  }
19652
19662
 
19653
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19663
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19654
19664
  * return PyArray_MultiIterNew(1, <void*>a)
19655
19665
  *
19656
19666
  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -19667,7 +19677,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19667
19677
  int __pyx_clineno = 0;
19668
19678
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
19669
19679
 
19670
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780
19680
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780
19671
19681
  *
19672
19682
  * cdef inline object PyArray_MultiIterNew2(a, b):
19673
19683
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
@@ -19681,7 +19691,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19681
19691
  __pyx_t_1 = 0;
19682
19692
  goto __pyx_L0;
19683
19693
 
19684
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19694
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19685
19695
  * return PyArray_MultiIterNew(1, <void*>a)
19686
19696
  *
19687
19697
  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -19700,7 +19710,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19700
19710
  return __pyx_r;
19701
19711
  }
19702
19712
 
19703
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19713
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19704
19714
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19705
19715
  *
19706
19716
  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -19717,7 +19727,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19717
19727
  int __pyx_clineno = 0;
19718
19728
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
19719
19729
 
19720
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783
19730
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783
19721
19731
  *
19722
19732
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
19723
19733
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
@@ -19731,7 +19741,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19731
19741
  __pyx_t_1 = 0;
19732
19742
  goto __pyx_L0;
19733
19743
 
19734
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19744
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19735
19745
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19736
19746
  *
19737
19747
  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -19750,7 +19760,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19750
19760
  return __pyx_r;
19751
19761
  }
19752
19762
 
19753
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19763
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19754
19764
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19755
19765
  *
19756
19766
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -19767,7 +19777,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19767
19777
  int __pyx_clineno = 0;
19768
19778
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
19769
19779
 
19770
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786
19780
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786
19771
19781
  *
19772
19782
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19773
19783
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
@@ -19781,7 +19791,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19781
19791
  __pyx_t_1 = 0;
19782
19792
  goto __pyx_L0;
19783
19793
 
19784
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19794
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19785
19795
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19786
19796
  *
19787
19797
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -19800,7 +19810,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19800
19810
  return __pyx_r;
19801
19811
  }
19802
19812
 
19803
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19813
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19804
19814
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19805
19815
  *
19806
19816
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -19817,7 +19827,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19817
19827
  int __pyx_clineno = 0;
19818
19828
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
19819
19829
 
19820
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789
19830
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789
19821
19831
  *
19822
19832
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19823
19833
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
@@ -19831,7 +19841,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19831
19841
  __pyx_t_1 = 0;
19832
19842
  goto __pyx_L0;
19833
19843
 
19834
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19844
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19835
19845
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19836
19846
  *
19837
19847
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -19850,7 +19860,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19850
19860
  return __pyx_r;
19851
19861
  }
19852
19862
 
19853
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
19863
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
19854
19864
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19855
19865
  *
19856
19866
  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
@@ -19864,7 +19874,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19864
19874
  int __pyx_t_1;
19865
19875
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
19866
19876
 
19867
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
19877
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
19868
19878
  *
19869
19879
  * cdef inline tuple PyDataType_SHAPE(dtype d):
19870
19880
  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
@@ -19874,7 +19884,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19874
19884
  __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
19875
19885
  if (__pyx_t_1) {
19876
19886
 
19877
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":793
19887
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":793
19878
19888
  * cdef inline tuple PyDataType_SHAPE(dtype d):
19879
19889
  * if PyDataType_HASSUBARRAY(d):
19880
19890
  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
@@ -19886,7 +19896,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19886
19896
  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
19887
19897
  goto __pyx_L0;
19888
19898
 
19889
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
19899
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
19890
19900
  *
19891
19901
  * cdef inline tuple PyDataType_SHAPE(dtype d):
19892
19902
  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
@@ -19895,7 +19905,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19895
19905
  */
19896
19906
  }
19897
19907
 
19898
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":795
19908
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":795
19899
19909
  * return <tuple>d.subarray.shape
19900
19910
  * else:
19901
19911
  * return () # <<<<<<<<<<<<<<
@@ -19909,7 +19919,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19909
19919
  goto __pyx_L0;
19910
19920
  }
19911
19921
 
19912
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
19922
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
19913
19923
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19914
19924
  *
19915
19925
  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
@@ -19924,7 +19934,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19924
19934
  return __pyx_r;
19925
19935
  }
19926
19936
 
19927
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
19937
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
19928
19938
  * int _import_umath() except -1
19929
19939
  *
19930
19940
  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -19934,7 +19944,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19934
19944
 
19935
19945
  static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
19936
19946
 
19937
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971
19947
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971
19938
19948
  *
19939
19949
  * cdef inline void set_array_base(ndarray arr, object base):
19940
19950
  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
@@ -19943,7 +19953,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
19943
19953
  */
19944
19954
  Py_INCREF(__pyx_v_base);
19945
19955
 
19946
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972
19956
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972
19947
19957
  * cdef inline void set_array_base(ndarray arr, object base):
19948
19958
  * Py_INCREF(base) # important to do this before stealing the reference below!
19949
19959
  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
@@ -19952,7 +19962,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
19952
19962
  */
19953
19963
  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
19954
19964
 
19955
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
19965
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
19956
19966
  * int _import_umath() except -1
19957
19967
  *
19958
19968
  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -19963,7 +19973,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
19963
19973
  /* function exit code */
19964
19974
  }
19965
19975
 
19966
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
19976
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
19967
19977
  * PyArray_SetBaseObject(arr, base)
19968
19978
  *
19969
19979
  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -19978,7 +19988,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19978
19988
  int __pyx_t_1;
19979
19989
  __Pyx_RefNannySetupContext("get_array_base", 1);
19980
19990
 
19981
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975
19991
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975
19982
19992
  *
19983
19993
  * cdef inline object get_array_base(ndarray arr):
19984
19994
  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
@@ -19987,7 +19997,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19987
19997
  */
19988
19998
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
19989
19999
 
19990
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
20000
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
19991
20001
  * cdef inline object get_array_base(ndarray arr):
19992
20002
  * base = PyArray_BASE(arr)
19993
20003
  * if base is NULL: # <<<<<<<<<<<<<<
@@ -19997,7 +20007,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19997
20007
  __pyx_t_1 = (__pyx_v_base == NULL);
19998
20008
  if (__pyx_t_1) {
19999
20009
 
20000
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":977
20010
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":977
20001
20011
  * base = PyArray_BASE(arr)
20002
20012
  * if base is NULL:
20003
20013
  * return None # <<<<<<<<<<<<<<
@@ -20008,7 +20018,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20008
20018
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20009
20019
  goto __pyx_L0;
20010
20020
 
20011
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
20021
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
20012
20022
  * cdef inline object get_array_base(ndarray arr):
20013
20023
  * base = PyArray_BASE(arr)
20014
20024
  * if base is NULL: # <<<<<<<<<<<<<<
@@ -20017,7 +20027,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20017
20027
  */
20018
20028
  }
20019
20029
 
20020
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":978
20030
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":978
20021
20031
  * if base is NULL:
20022
20032
  * return None
20023
20033
  * return <object>base # <<<<<<<<<<<<<<
@@ -20029,7 +20039,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20029
20039
  __pyx_r = ((PyObject *)__pyx_v_base);
20030
20040
  goto __pyx_L0;
20031
20041
 
20032
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
20042
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
20033
20043
  * PyArray_SetBaseObject(arr, base)
20034
20044
  *
20035
20045
  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -20044,7 +20054,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20044
20054
  return __pyx_r;
20045
20055
  }
20046
20056
 
20047
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20057
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20048
20058
  * # Versions of the import_* functions which are more suitable for
20049
20059
  * # Cython code.
20050
20060
  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
@@ -20068,7 +20078,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20068
20078
  int __pyx_clineno = 0;
20069
20079
  __Pyx_RefNannySetupContext("import_array", 1);
20070
20080
 
20071
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20081
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20072
20082
  * # Cython code.
20073
20083
  * cdef inline int import_array() except -1:
20074
20084
  * try: # <<<<<<<<<<<<<<
@@ -20084,7 +20094,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20084
20094
  __Pyx_XGOTREF(__pyx_t_3);
20085
20095
  /*try:*/ {
20086
20096
 
20087
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984
20097
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984
20088
20098
  * cdef inline int import_array() except -1:
20089
20099
  * try:
20090
20100
  * __pyx_import_array() # <<<<<<<<<<<<<<
@@ -20093,7 +20103,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20093
20103
  */
20094
20104
  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 984, __pyx_L3_error)
20095
20105
 
20096
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20106
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20097
20107
  * # Cython code.
20098
20108
  * cdef inline int import_array() except -1:
20099
20109
  * try: # <<<<<<<<<<<<<<
@@ -20107,7 +20117,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20107
20117
  goto __pyx_L8_try_end;
20108
20118
  __pyx_L3_error:;
20109
20119
 
20110
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985
20120
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985
20111
20121
  * try:
20112
20122
  * __pyx_import_array()
20113
20123
  * except Exception: # <<<<<<<<<<<<<<
@@ -20122,7 +20132,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20122
20132
  __Pyx_XGOTREF(__pyx_t_6);
20123
20133
  __Pyx_XGOTREF(__pyx_t_7);
20124
20134
 
20125
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
20135
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
20126
20136
  * __pyx_import_array()
20127
20137
  * except Exception:
20128
20138
  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
@@ -20137,7 +20147,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20137
20147
  }
20138
20148
  goto __pyx_L5_except_error;
20139
20149
 
20140
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20150
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20141
20151
  * # Cython code.
20142
20152
  * cdef inline int import_array() except -1:
20143
20153
  * try: # <<<<<<<<<<<<<<
@@ -20153,7 +20163,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20153
20163
  __pyx_L8_try_end:;
20154
20164
  }
20155
20165
 
20156
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20166
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20157
20167
  * # Versions of the import_* functions which are more suitable for
20158
20168
  * # Cython code.
20159
20169
  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
@@ -20176,7 +20186,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20176
20186
  return __pyx_r;
20177
20187
  }
20178
20188
 
20179
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20189
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20180
20190
  * raise ImportError("numpy.core.multiarray failed to import")
20181
20191
  *
20182
20192
  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
@@ -20200,7 +20210,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20200
20210
  int __pyx_clineno = 0;
20201
20211
  __Pyx_RefNannySetupContext("import_umath", 1);
20202
20212
 
20203
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20213
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20204
20214
  *
20205
20215
  * cdef inline int import_umath() except -1:
20206
20216
  * try: # <<<<<<<<<<<<<<
@@ -20216,7 +20226,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20216
20226
  __Pyx_XGOTREF(__pyx_t_3);
20217
20227
  /*try:*/ {
20218
20228
 
20219
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990
20229
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990
20220
20230
  * cdef inline int import_umath() except -1:
20221
20231
  * try:
20222
20232
  * _import_umath() # <<<<<<<<<<<<<<
@@ -20225,7 +20235,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20225
20235
  */
20226
20236
  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 990, __pyx_L3_error)
20227
20237
 
20228
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20238
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20229
20239
  *
20230
20240
  * cdef inline int import_umath() except -1:
20231
20241
  * try: # <<<<<<<<<<<<<<
@@ -20239,7 +20249,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20239
20249
  goto __pyx_L8_try_end;
20240
20250
  __pyx_L3_error:;
20241
20251
 
20242
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991
20252
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991
20243
20253
  * try:
20244
20254
  * _import_umath()
20245
20255
  * except Exception: # <<<<<<<<<<<<<<
@@ -20254,7 +20264,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20254
20264
  __Pyx_XGOTREF(__pyx_t_6);
20255
20265
  __Pyx_XGOTREF(__pyx_t_7);
20256
20266
 
20257
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
20267
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
20258
20268
  * _import_umath()
20259
20269
  * except Exception:
20260
20270
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -20269,7 +20279,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20269
20279
  }
20270
20280
  goto __pyx_L5_except_error;
20271
20281
 
20272
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20282
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20273
20283
  *
20274
20284
  * cdef inline int import_umath() except -1:
20275
20285
  * try: # <<<<<<<<<<<<<<
@@ -20285,7 +20295,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20285
20295
  __pyx_L8_try_end:;
20286
20296
  }
20287
20297
 
20288
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20298
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20289
20299
  * raise ImportError("numpy.core.multiarray failed to import")
20290
20300
  *
20291
20301
  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
@@ -20308,7 +20318,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20308
20318
  return __pyx_r;
20309
20319
  }
20310
20320
 
20311
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20321
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20312
20322
  * raise ImportError("numpy.core.umath failed to import")
20313
20323
  *
20314
20324
  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
@@ -20332,7 +20342,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20332
20342
  int __pyx_clineno = 0;
20333
20343
  __Pyx_RefNannySetupContext("import_ufunc", 1);
20334
20344
 
20335
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20345
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20336
20346
  *
20337
20347
  * cdef inline int import_ufunc() except -1:
20338
20348
  * try: # <<<<<<<<<<<<<<
@@ -20348,7 +20358,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20348
20358
  __Pyx_XGOTREF(__pyx_t_3);
20349
20359
  /*try:*/ {
20350
20360
 
20351
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996
20361
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996
20352
20362
  * cdef inline int import_ufunc() except -1:
20353
20363
  * try:
20354
20364
  * _import_umath() # <<<<<<<<<<<<<<
@@ -20357,7 +20367,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20357
20367
  */
20358
20368
  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 996, __pyx_L3_error)
20359
20369
 
20360
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20370
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20361
20371
  *
20362
20372
  * cdef inline int import_ufunc() except -1:
20363
20373
  * try: # <<<<<<<<<<<<<<
@@ -20371,7 +20381,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20371
20381
  goto __pyx_L8_try_end;
20372
20382
  __pyx_L3_error:;
20373
20383
 
20374
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":997
20384
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":997
20375
20385
  * try:
20376
20386
  * _import_umath()
20377
20387
  * except Exception: # <<<<<<<<<<<<<<
@@ -20386,7 +20396,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20386
20396
  __Pyx_XGOTREF(__pyx_t_6);
20387
20397
  __Pyx_XGOTREF(__pyx_t_7);
20388
20398
 
20389
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998
20399
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998
20390
20400
  * _import_umath()
20391
20401
  * except Exception:
20392
20402
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -20401,7 +20411,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20401
20411
  }
20402
20412
  goto __pyx_L5_except_error;
20403
20413
 
20404
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20414
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20405
20415
  *
20406
20416
  * cdef inline int import_ufunc() except -1:
20407
20417
  * try: # <<<<<<<<<<<<<<
@@ -20417,7 +20427,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20417
20427
  __pyx_L8_try_end:;
20418
20428
  }
20419
20429
 
20420
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20430
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20421
20431
  * raise ImportError("numpy.core.umath failed to import")
20422
20432
  *
20423
20433
  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
@@ -20440,7 +20450,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20440
20450
  return __pyx_r;
20441
20451
  }
20442
20452
 
20443
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20453
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20444
20454
  *
20445
20455
  *
20446
20456
  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
@@ -20451,7 +20461,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20451
20461
  static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
20452
20462
  int __pyx_r;
20453
20463
 
20454
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013
20464
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013
20455
20465
  * bool
20456
20466
  * """
20457
20467
  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
@@ -20461,7 +20471,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20461
20471
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
20462
20472
  goto __pyx_L0;
20463
20473
 
20464
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20474
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20465
20475
  *
20466
20476
  *
20467
20477
  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
@@ -20474,7 +20484,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20474
20484
  return __pyx_r;
20475
20485
  }
20476
20486
 
20477
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20487
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20478
20488
  *
20479
20489
  *
20480
20490
  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
@@ -20485,7 +20495,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20485
20495
  static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
20486
20496
  int __pyx_r;
20487
20497
 
20488
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028
20498
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028
20489
20499
  * bool
20490
20500
  * """
20491
20501
  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
@@ -20495,7 +20505,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20495
20505
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
20496
20506
  goto __pyx_L0;
20497
20507
 
20498
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20508
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20499
20509
  *
20500
20510
  *
20501
20511
  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
@@ -20508,7 +20518,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20508
20518
  return __pyx_r;
20509
20519
  }
20510
20520
 
20511
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20521
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20512
20522
  *
20513
20523
  *
20514
20524
  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20519,7 +20529,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20519
20529
  static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
20520
20530
  npy_datetime __pyx_r;
20521
20531
 
20522
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038
20532
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038
20523
20533
  * also needed. That can be found using `get_datetime64_unit`.
20524
20534
  * """
20525
20535
  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
@@ -20529,7 +20539,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20529
20539
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
20530
20540
  goto __pyx_L0;
20531
20541
 
20532
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20542
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20533
20543
  *
20534
20544
  *
20535
20545
  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20542,7 +20552,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20542
20552
  return __pyx_r;
20543
20553
  }
20544
20554
 
20545
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20555
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20546
20556
  *
20547
20557
  *
20548
20558
  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20553,7 +20563,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20553
20563
  static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
20554
20564
  npy_timedelta __pyx_r;
20555
20565
 
20556
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045
20566
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045
20557
20567
  * returns the int64 value underlying scalar numpy timedelta64 object
20558
20568
  * """
20559
20569
  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
@@ -20563,7 +20573,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20563
20573
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
20564
20574
  goto __pyx_L0;
20565
20575
 
20566
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20576
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20567
20577
  *
20568
20578
  *
20569
20579
  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20576,7 +20586,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20576
20586
  return __pyx_r;
20577
20587
  }
20578
20588
 
20579
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20589
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20580
20590
  *
20581
20591
  *
20582
20592
  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20587,7 +20597,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20587
20597
  static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
20588
20598
  NPY_DATETIMEUNIT __pyx_r;
20589
20599
 
20590
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1052
20600
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1052
20591
20601
  * returns the unit part of the dtype for a numpy datetime64 object.
20592
20602
  * """
20593
20603
  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
@@ -20595,7 +20605,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20595
20605
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
20596
20606
  goto __pyx_L0;
20597
20607
 
20598
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20608
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20599
20609
  *
20600
20610
  *
20601
20611
  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20608,7 +20618,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20608
20618
  return __pyx_r;
20609
20619
  }
20610
20620
 
20611
- /* "mettagrid/objects.pxd":24
20621
+ /* "mettagrid/objects.pxd":25
20612
20622
  * unsigned int hp
20613
20623
  *
20614
20624
  * inline void init_mo(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20618,16 +20628,16 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20618
20628
 
20619
20629
  void __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
20620
20630
 
20621
- /* "mettagrid/objects.pxd":25
20631
+ /* "mettagrid/objects.pxd":26
20622
20632
  *
20623
20633
  * inline void init_mo(ObjectConfig cfg):
20624
20634
  * this.hp = cfg[b"hp"] # <<<<<<<<<<<<<<
20625
20635
  *
20626
- * inline char usable(const Agent *actor):
20636
+ * inline bint usable(const Agent *actor):
20627
20637
  */
20628
20638
  this->hp = (__pyx_v_cfg[__pyx_k_hp]);
20629
20639
 
20630
- /* "mettagrid/objects.pxd":24
20640
+ /* "mettagrid/objects.pxd":25
20631
20641
  * unsigned int hp
20632
20642
  *
20633
20643
  * inline void init_mo(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20638,54 +20648,20 @@ void __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_t_9mettagrid_7object
20638
20648
  /* function exit code */
20639
20649
  }
20640
20650
 
20641
- /* "mettagrid/objects.pxd":27
20651
+ /* "mettagrid/objects.pxd":28
20642
20652
  * this.hp = cfg[b"hp"]
20643
20653
  *
20644
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20654
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20645
20655
  * return False
20646
20656
  *
20647
20657
  */
20648
20658
 
20649
- char __pyx_t_9mettagrid_7objects_MettaObject::usable(CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20650
- char __pyx_r;
20651
-
20652
- /* "mettagrid/objects.pxd":28
20653
- *
20654
- * inline char usable(const Agent *actor):
20655
- * return False # <<<<<<<<<<<<<<
20656
- *
20657
- * inline char attackable():
20658
- */
20659
- __pyx_r = 0;
20660
- goto __pyx_L0;
20661
-
20662
- /* "mettagrid/objects.pxd":27
20663
- * this.hp = cfg[b"hp"]
20664
- *
20665
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20666
- * return False
20667
- *
20668
- */
20669
-
20670
- /* function exit code */
20671
- __pyx_L0:;
20672
- return __pyx_r;
20673
- }
20674
-
20675
- /* "mettagrid/objects.pxd":30
20676
- * return False
20677
- *
20678
- * inline char attackable(): # <<<<<<<<<<<<<<
20679
- * return False
20680
- *
20681
- */
20682
-
20683
- char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20684
- char __pyx_r;
20659
+ int __pyx_t_9mettagrid_7objects_MettaObject::usable(CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20660
+ int __pyx_r;
20685
20661
 
20686
- /* "mettagrid/objects.pxd":31
20662
+ /* "mettagrid/objects.pxd":29
20687
20663
  *
20688
- * inline char attackable():
20664
+ * inline bint usable(const Agent *actor):
20689
20665
  * return False # <<<<<<<<<<<<<<
20690
20666
  *
20691
20667
  * cdef cppclass Usable(MettaObject):
@@ -20693,10 +20669,10 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20693
20669
  __pyx_r = 0;
20694
20670
  goto __pyx_L0;
20695
20671
 
20696
- /* "mettagrid/objects.pxd":30
20697
- * return False
20672
+ /* "mettagrid/objects.pxd":28
20673
+ * this.hp = cfg[b"hp"]
20698
20674
  *
20699
- * inline char attackable(): # <<<<<<<<<<<<<<
20675
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20700
20676
  * return False
20701
20677
  *
20702
20678
  */
@@ -20706,7 +20682,7 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20706
20682
  return __pyx_r;
20707
20683
  }
20708
20684
 
20709
- /* "mettagrid/objects.pxd":38
20685
+ /* "mettagrid/objects.pxd":36
20710
20686
  * unsigned char ready
20711
20687
  *
20712
20688
  * inline void init_usable(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20716,7 +20692,7 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20716
20692
 
20717
20693
  void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
20718
20694
 
20719
- /* "mettagrid/objects.pxd":39
20695
+ /* "mettagrid/objects.pxd":37
20720
20696
  *
20721
20697
  * inline void init_usable(ObjectConfig cfg):
20722
20698
  * this.use_cost = cfg[b"use_cost"] # <<<<<<<<<<<<<<
@@ -20725,7 +20701,7 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20725
20701
  */
20726
20702
  this->use_cost = (__pyx_v_cfg[__pyx_k_use_cost]);
20727
20703
 
20728
- /* "mettagrid/objects.pxd":40
20704
+ /* "mettagrid/objects.pxd":38
20729
20705
  * inline void init_usable(ObjectConfig cfg):
20730
20706
  * this.use_cost = cfg[b"use_cost"]
20731
20707
  * this.cooldown = cfg[b"cooldown"] # <<<<<<<<<<<<<<
@@ -20734,16 +20710,16 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20734
20710
  */
20735
20711
  this->cooldown = (__pyx_v_cfg[__pyx_k_cooldown]);
20736
20712
 
20737
- /* "mettagrid/objects.pxd":41
20713
+ /* "mettagrid/objects.pxd":39
20738
20714
  * this.use_cost = cfg[b"use_cost"]
20739
20715
  * this.cooldown = cfg[b"cooldown"]
20740
20716
  * this.ready = 1 # <<<<<<<<<<<<<<
20741
20717
  *
20742
- * inline char usable(const Agent *actor):
20718
+ * inline bint usable(const Agent *actor):
20743
20719
  */
20744
20720
  this->ready = 1;
20745
20721
 
20746
- /* "mettagrid/objects.pxd":38
20722
+ /* "mettagrid/objects.pxd":36
20747
20723
  * unsigned char ready
20748
20724
  *
20749
20725
  * inline void init_usable(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20754,29 +20730,30 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20754
20730
  /* function exit code */
20755
20731
  }
20756
20732
 
20757
- /* "mettagrid/objects.pxd":43
20733
+ /* "mettagrid/objects.pxd":41
20758
20734
  * this.ready = 1
20759
20735
  *
20760
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20736
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20761
20737
  * return this.ready and this.use_cost <= actor.energy
20762
20738
  *
20763
20739
  */
20764
20740
 
20765
- char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20766
- char __pyx_r;
20767
- char __pyx_t_1;
20741
+ int __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20742
+ int __pyx_r;
20743
+ int __pyx_t_1;
20768
20744
  int __pyx_t_2;
20769
20745
 
20770
- /* "mettagrid/objects.pxd":44
20746
+ /* "mettagrid/objects.pxd":42
20771
20747
  *
20772
- * inline char usable(const Agent *actor):
20748
+ * inline bint usable(const Agent *actor):
20773
20749
  * return this.ready and this.use_cost <= actor.energy # <<<<<<<<<<<<<<
20774
20750
  *
20775
20751
  * cdef enum ObjectType:
20776
20752
  */
20777
- if (this->ready) {
20753
+ __pyx_t_2 = (this->ready != 0);
20754
+ if (__pyx_t_2) {
20778
20755
  } else {
20779
- __pyx_t_1 = this->ready;
20756
+ __pyx_t_1 = __pyx_t_2;
20780
20757
  goto __pyx_L3_bool_binop_done;
20781
20758
  }
20782
20759
  __pyx_t_2 = (this->use_cost <= __pyx_v_actor->energy);
@@ -20785,10 +20762,10 @@ char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agen
20785
20762
  __pyx_r = __pyx_t_1;
20786
20763
  goto __pyx_L0;
20787
20764
 
20788
- /* "mettagrid/objects.pxd":43
20765
+ /* "mettagrid/objects.pxd":41
20789
20766
  * this.ready = 1
20790
20767
  *
20791
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20768
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20792
20769
  * return this.ready and this.use_cost <= actor.energy
20793
20770
  *
20794
20771
  */
@@ -20798,8 +20775,8 @@ char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agen
20798
20775
  return __pyx_r;
20799
20776
  }
20800
20777
 
20801
- /* "mettagrid/objects.pxd":72
20802
- * vector[unsigned short] inventory
20778
+ /* "mettagrid/objects.pxd":74
20779
+ * unsigned char max_energy
20803
20780
  *
20804
20781
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
20805
20782
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
@@ -20811,67 +20788,103 @@ void __pyx_t_9mettagrid_7objects_Agent::__pyx_f___init__Agent(GridCoord __pyx_v_
20811
20788
  const char *__pyx_filename = NULL;
20812
20789
  int __pyx_clineno = 0;
20813
20790
 
20814
- /* "mettagrid/objects.pxd":73
20791
+ /* "mettagrid/objects.pxd":75
20815
20792
  *
20816
20793
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg):
20817
20794
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer)) # <<<<<<<<<<<<<<
20818
20795
  * MettaObject.init_mo(cfg)
20819
- * this.frozen = False
20796
+ * this.frozen = 0
20820
20797
  */
20821
20798
  GridObject::init(__pyx_e_9mettagrid_7objects_AgentT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Agent_Layer));
20822
20799
 
20823
- /* "mettagrid/objects.pxd":74
20800
+ /* "mettagrid/objects.pxd":76
20824
20801
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg):
20825
20802
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
20826
20803
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
20827
- * this.frozen = False
20828
- * this.energy = cfg[b"initial_energy"]
20804
+ * this.frozen = 0
20805
+ * this.freeze_duration = cfg[b"freeze_duration"]
20829
20806
  */
20830
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 74, __pyx_L1_error)
20807
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 76, __pyx_L1_error)
20831
20808
 
20832
- /* "mettagrid/objects.pxd":75
20809
+ /* "mettagrid/objects.pxd":77
20833
20810
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
20834
20811
  * MettaObject.init_mo(cfg)
20835
- * this.frozen = False # <<<<<<<<<<<<<<
20812
+ * this.frozen = 0 # <<<<<<<<<<<<<<
20813
+ * this.freeze_duration = cfg[b"freeze_duration"]
20836
20814
  * this.energy = cfg[b"initial_energy"]
20837
- * this.orientation = 0
20838
20815
  */
20839
20816
  this->frozen = 0;
20840
20817
 
20841
- /* "mettagrid/objects.pxd":76
20818
+ /* "mettagrid/objects.pxd":78
20842
20819
  * MettaObject.init_mo(cfg)
20843
- * this.frozen = False
20820
+ * this.frozen = 0
20821
+ * this.freeze_duration = cfg[b"freeze_duration"] # <<<<<<<<<<<<<<
20822
+ * this.energy = cfg[b"initial_energy"]
20823
+ * this.max_energy = cfg[b"max_energy"]
20824
+ */
20825
+ this->freeze_duration = (__pyx_v_cfg[__pyx_k_freeze_duration]);
20826
+
20827
+ /* "mettagrid/objects.pxd":79
20828
+ * this.frozen = 0
20829
+ * this.freeze_duration = cfg[b"freeze_duration"]
20844
20830
  * this.energy = cfg[b"initial_energy"] # <<<<<<<<<<<<<<
20845
- * this.orientation = 0
20846
- * this.inventory.resize(InventoryItem.InventoryCount)
20831
+ * this.max_energy = cfg[b"max_energy"]
20832
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20847
20833
  */
20848
20834
  this->energy = (__pyx_v_cfg[__pyx_k_initial_energy]);
20849
20835
 
20850
- /* "mettagrid/objects.pxd":77
20851
- * this.frozen = False
20836
+ /* "mettagrid/objects.pxd":80
20837
+ * this.freeze_duration = cfg[b"freeze_duration"]
20852
20838
  * this.energy = cfg[b"initial_energy"]
20839
+ * this.max_energy = cfg[b"max_energy"] # <<<<<<<<<<<<<<
20840
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20841
+ * this.orientation = 0
20842
+ */
20843
+ this->max_energy = (__pyx_v_cfg[__pyx_k_max_energy]);
20844
+
20845
+ /* "mettagrid/objects.pxd":81
20846
+ * this.energy = cfg[b"initial_energy"]
20847
+ * this.max_energy = cfg[b"max_energy"]
20848
+ * this.shield_upkeep = cfg[b"upkeep.shield"] # <<<<<<<<<<<<<<
20849
+ * this.orientation = 0
20850
+ * this.inventory.resize(InventoryItem.InventoryCount)
20851
+ */
20852
+ this->shield_upkeep = (__pyx_v_cfg[__pyx_k_upkeep_shield]);
20853
+
20854
+ /* "mettagrid/objects.pxd":82
20855
+ * this.max_energy = cfg[b"max_energy"]
20856
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20853
20857
  * this.orientation = 0 # <<<<<<<<<<<<<<
20854
20858
  * this.inventory.resize(InventoryItem.InventoryCount)
20855
- *
20859
+ * this.max_items = cfg[b"max_inventory"]
20856
20860
  */
20857
20861
  this->orientation = 0;
20858
20862
 
20859
- /* "mettagrid/objects.pxd":78
20860
- * this.energy = cfg[b"initial_energy"]
20863
+ /* "mettagrid/objects.pxd":83
20864
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20861
20865
  * this.orientation = 0
20862
20866
  * this.inventory.resize(InventoryItem.InventoryCount) # <<<<<<<<<<<<<<
20867
+ * this.max_items = cfg[b"max_inventory"]
20863
20868
  *
20864
- * inline void update_inventory(InventoryItem item, short amount):
20865
20869
  */
20866
20870
  try {
20867
20871
  this->inventory.resize(__pyx_e_9mettagrid_7objects_InventoryCount);
20868
20872
  } catch(...) {
20869
20873
  __Pyx_CppExn2PyErr();
20870
- __PYX_ERR(3, 78, __pyx_L1_error)
20874
+ __PYX_ERR(3, 83, __pyx_L1_error)
20871
20875
  }
20872
20876
 
20873
- /* "mettagrid/objects.pxd":72
20874
- * vector[unsigned short] inventory
20877
+ /* "mettagrid/objects.pxd":84
20878
+ * this.orientation = 0
20879
+ * this.inventory.resize(InventoryItem.InventoryCount)
20880
+ * this.max_items = cfg[b"max_inventory"] # <<<<<<<<<<<<<<
20881
+ *
20882
+ * inline void update_inventory(InventoryItem item, short amount):
20883
+ */
20884
+ this->max_items = (__pyx_v_cfg[__pyx_k_max_inventory]);
20885
+
20886
+ /* "mettagrid/objects.pxd":74
20887
+ * unsigned char max_energy
20875
20888
  *
20876
20889
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
20877
20890
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
@@ -20885,40 +20898,71 @@ void __pyx_t_9mettagrid_7objects_Agent::__pyx_f___init__Agent(GridCoord __pyx_v_
20885
20898
  __pyx_L0:;
20886
20899
  }
20887
20900
 
20888
- /* "mettagrid/objects.pxd":80
20889
- * this.inventory.resize(InventoryItem.InventoryCount)
20901
+ /* "mettagrid/objects.pxd":86
20902
+ * this.max_items = cfg[b"max_inventory"]
20890
20903
  *
20891
20904
  * inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
20892
20905
  * this.inventory[<InventoryItem>item] += amount
20893
- *
20906
+ * if this.inventory[<InventoryItem>item] > this.max_items:
20894
20907
  */
20895
20908
 
20896
20909
  void __pyx_t_9mettagrid_7objects_Agent::update_inventory(enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_v_item, short __pyx_v_amount) {
20897
20910
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_1;
20911
+ int __pyx_t_2;
20912
+ unsigned char __pyx_t_3;
20898
20913
 
20899
- /* "mettagrid/objects.pxd":81
20914
+ /* "mettagrid/objects.pxd":87
20900
20915
  *
20901
20916
  * inline void update_inventory(InventoryItem item, short amount):
20902
20917
  * this.inventory[<InventoryItem>item] += amount # <<<<<<<<<<<<<<
20903
- *
20904
- * inline void obs(ObsType[:] obs):
20918
+ * if this.inventory[<InventoryItem>item] > this.max_items:
20919
+ * this.inventory[<InventoryItem>item] = this.max_items
20905
20920
  */
20906
20921
  __pyx_t_1 = ((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item);
20907
20922
  (this->inventory[__pyx_t_1]) = ((this->inventory[__pyx_t_1]) + __pyx_v_amount);
20908
20923
 
20909
- /* "mettagrid/objects.pxd":80
20910
- * this.inventory.resize(InventoryItem.InventoryCount)
20924
+ /* "mettagrid/objects.pxd":88
20925
+ * inline void update_inventory(InventoryItem item, short amount):
20926
+ * this.inventory[<InventoryItem>item] += amount
20927
+ * if this.inventory[<InventoryItem>item] > this.max_items: # <<<<<<<<<<<<<<
20928
+ * this.inventory[<InventoryItem>item] = this.max_items
20911
20929
  *
20912
- * inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
20930
+ */
20931
+ __pyx_t_2 = ((this->inventory[((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item)]) > this->max_items);
20932
+ if (__pyx_t_2) {
20933
+
20934
+ /* "mettagrid/objects.pxd":89
20935
+ * this.inventory[<InventoryItem>item] += amount
20936
+ * if this.inventory[<InventoryItem>item] > this.max_items:
20937
+ * this.inventory[<InventoryItem>item] = this.max_items # <<<<<<<<<<<<<<
20938
+ *
20939
+ * inline void obs(ObsType[:] obs):
20940
+ */
20941
+ __pyx_t_3 = this->max_items;
20942
+ (this->inventory[((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item)]) = __pyx_t_3;
20943
+
20944
+ /* "mettagrid/objects.pxd":88
20945
+ * inline void update_inventory(InventoryItem item, short amount):
20913
20946
  * this.inventory[<InventoryItem>item] += amount
20947
+ * if this.inventory[<InventoryItem>item] > this.max_items: # <<<<<<<<<<<<<<
20948
+ * this.inventory[<InventoryItem>item] = this.max_items
20914
20949
  *
20950
+ */
20951
+ }
20952
+
20953
+ /* "mettagrid/objects.pxd":86
20954
+ * this.max_items = cfg[b"max_inventory"]
20955
+ *
20956
+ * inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
20957
+ * this.inventory[<InventoryItem>item] += amount
20958
+ * if this.inventory[<InventoryItem>item] > this.max_items:
20915
20959
  */
20916
20960
 
20917
20961
  /* function exit code */
20918
20962
  }
20919
20963
 
20920
- /* "mettagrid/objects.pxd":83
20921
- * this.inventory[<InventoryItem>item] += amount
20964
+ /* "mettagrid/objects.pxd":91
20965
+ * this.inventory[<InventoryItem>item] = this.max_items
20922
20966
  *
20923
20967
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
20924
20968
  * obs[0] = 1
@@ -20930,12 +20974,12 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20930
20974
  unsigned short __pyx_v_i;
20931
20975
  Py_ssize_t __pyx_t_1;
20932
20976
  unsigned int __pyx_t_2;
20933
- char __pyx_t_3;
20977
+ unsigned char __pyx_t_3;
20934
20978
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_4;
20935
20979
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_5;
20936
20980
  unsigned short __pyx_t_6;
20937
20981
 
20938
- /* "mettagrid/objects.pxd":84
20982
+ /* "mettagrid/objects.pxd":92
20939
20983
  *
20940
20984
  * inline void obs(ObsType[:] obs):
20941
20985
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -20945,7 +20989,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20945
20989
  __pyx_t_1 = 0;
20946
20990
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
20947
20991
 
20948
- /* "mettagrid/objects.pxd":85
20992
+ /* "mettagrid/objects.pxd":93
20949
20993
  * inline void obs(ObsType[:] obs):
20950
20994
  * obs[0] = 1
20951
20995
  * obs[1] = this.hp # <<<<<<<<<<<<<<
@@ -20956,29 +21000,29 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20956
21000
  __pyx_t_1 = 1;
20957
21001
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
20958
21002
 
20959
- /* "mettagrid/objects.pxd":86
21003
+ /* "mettagrid/objects.pxd":94
20960
21004
  * obs[0] = 1
20961
21005
  * obs[1] = this.hp
20962
21006
  * obs[2] = this.frozen # <<<<<<<<<<<<<<
20963
21007
  * obs[3] = this.energy
20964
21008
  * obs[4] = this.orientation
20965
21009
  */
20966
- __pyx_t_3 = this->frozen;
21010
+ __pyx_t_2 = this->frozen;
20967
21011
  __pyx_t_1 = 2;
20968
- *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
21012
+ *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
20969
21013
 
20970
- /* "mettagrid/objects.pxd":87
21014
+ /* "mettagrid/objects.pxd":95
20971
21015
  * obs[1] = this.hp
20972
21016
  * obs[2] = this.frozen
20973
21017
  * obs[3] = this.energy # <<<<<<<<<<<<<<
20974
21018
  * obs[4] = this.orientation
20975
21019
  * obs[5] = this.shield
20976
21020
  */
20977
- __pyx_t_2 = this->energy;
21021
+ __pyx_t_3 = this->energy;
20978
21022
  __pyx_t_1 = 3;
20979
- *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21023
+ *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
20980
21024
 
20981
- /* "mettagrid/objects.pxd":88
21025
+ /* "mettagrid/objects.pxd":96
20982
21026
  * obs[2] = this.frozen
20983
21027
  * obs[3] = this.energy
20984
21028
  * obs[4] = this.orientation # <<<<<<<<<<<<<<
@@ -20989,7 +21033,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20989
21033
  __pyx_t_1 = 4;
20990
21034
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
20991
21035
 
20992
- /* "mettagrid/objects.pxd":89
21036
+ /* "mettagrid/objects.pxd":97
20993
21037
  * obs[3] = this.energy
20994
21038
  * obs[4] = this.orientation
20995
21039
  * obs[5] = this.shield # <<<<<<<<<<<<<<
@@ -21000,7 +21044,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21000
21044
  __pyx_t_1 = 5;
21001
21045
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
21002
21046
 
21003
- /* "mettagrid/objects.pxd":91
21047
+ /* "mettagrid/objects.pxd":99
21004
21048
  * obs[5] = this.shield
21005
21049
  *
21006
21050
  * cdef unsigned short idx = 6 # <<<<<<<<<<<<<<
@@ -21009,7 +21053,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21009
21053
  */
21010
21054
  __pyx_v_idx = 6;
21011
21055
 
21012
- /* "mettagrid/objects.pxd":93
21056
+ /* "mettagrid/objects.pxd":101
21013
21057
  * cdef unsigned short idx = 6
21014
21058
  * cdef unsigned short i
21015
21059
  * for i in range(InventoryItem.InventoryCount): # <<<<<<<<<<<<<<
@@ -21021,7 +21065,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21021
21065
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21022
21066
  __pyx_v_i = __pyx_t_6;
21023
21067
 
21024
- /* "mettagrid/objects.pxd":94
21068
+ /* "mettagrid/objects.pxd":102
21025
21069
  * cdef unsigned short i
21026
21070
  * for i in range(InventoryItem.InventoryCount):
21027
21071
  * obs[idx + i] = this.inventory[i] # <<<<<<<<<<<<<<
@@ -21032,8 +21076,8 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21032
21076
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = (this->inventory[__pyx_v_i]);
21033
21077
  }
21034
21078
 
21035
- /* "mettagrid/objects.pxd":83
21036
- * this.inventory[<InventoryItem>item] += amount
21079
+ /* "mettagrid/objects.pxd":91
21080
+ * this.inventory[<InventoryItem>item] = this.max_items
21037
21081
  *
21038
21082
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
21039
21083
  * obs[0] = 1
@@ -21043,7 +21087,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21043
21087
  /* function exit code */
21044
21088
  }
21045
21089
 
21046
- /* "mettagrid/objects.pxd":97
21090
+ /* "mettagrid/objects.pxd":105
21047
21091
  *
21048
21092
  * @staticmethod
21049
21093
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21067,46 +21111,46 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21067
21111
  int __pyx_clineno = 0;
21068
21112
  __Pyx_RefNannySetupContext("feature_names", 1);
21069
21113
 
21070
- /* "mettagrid/objects.pxd":98
21114
+ /* "mettagrid/objects.pxd":106
21071
21115
  * @staticmethod
21072
21116
  * inline vector[string] feature_names():
21073
21117
  * return [ # <<<<<<<<<<<<<<
21074
21118
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21075
21119
  * "agent:shield"
21076
21120
  */
21077
- __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 98, __pyx_L1_error)
21121
+ __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 106, __pyx_L1_error)
21078
21122
  __Pyx_GOTREF(__pyx_t_1);
21079
21123
  __Pyx_INCREF(__pyx_n_u_agent);
21080
21124
  __Pyx_GIVEREF(__pyx_n_u_agent);
21081
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_agent)) __PYX_ERR(3, 98, __pyx_L1_error);
21125
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_agent)) __PYX_ERR(3, 106, __pyx_L1_error);
21082
21126
  __Pyx_INCREF(__pyx_kp_u_agent_hp);
21083
21127
  __Pyx_GIVEREF(__pyx_kp_u_agent_hp);
21084
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_agent_hp)) __PYX_ERR(3, 98, __pyx_L1_error);
21128
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_agent_hp)) __PYX_ERR(3, 106, __pyx_L1_error);
21085
21129
  __Pyx_INCREF(__pyx_kp_u_agent_frozen);
21086
21130
  __Pyx_GIVEREF(__pyx_kp_u_agent_frozen);
21087
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_agent_frozen)) __PYX_ERR(3, 98, __pyx_L1_error);
21131
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_agent_frozen)) __PYX_ERR(3, 106, __pyx_L1_error);
21088
21132
  __Pyx_INCREF(__pyx_kp_u_agent_energy);
21089
21133
  __Pyx_GIVEREF(__pyx_kp_u_agent_energy);
21090
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_agent_energy)) __PYX_ERR(3, 98, __pyx_L1_error);
21134
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_agent_energy)) __PYX_ERR(3, 106, __pyx_L1_error);
21091
21135
  __Pyx_INCREF(__pyx_kp_u_agent_orientation);
21092
21136
  __Pyx_GIVEREF(__pyx_kp_u_agent_orientation);
21093
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_agent_orientation)) __PYX_ERR(3, 98, __pyx_L1_error);
21137
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_agent_orientation)) __PYX_ERR(3, 106, __pyx_L1_error);
21094
21138
  __Pyx_INCREF(__pyx_kp_u_agent_shield);
21095
21139
  __Pyx_GIVEREF(__pyx_kp_u_agent_shield);
21096
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_agent_shield)) __PYX_ERR(3, 98, __pyx_L1_error);
21140
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_agent_shield)) __PYX_ERR(3, 106, __pyx_L1_error);
21097
21141
  { /* enter inner scope */
21098
21142
 
21099
- /* "mettagrid/objects.pxd":101
21143
+ /* "mettagrid/objects.pxd":109
21100
21144
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21101
21145
  * "agent:shield"
21102
21146
  * ] + [ # <<<<<<<<<<<<<<
21103
21147
  * "agent:inv:" + n for n in InventoryItemNames]
21104
21148
  *
21105
21149
  */
21106
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 101, __pyx_L1_error)
21150
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 109, __pyx_L1_error)
21107
21151
  __Pyx_GOTREF(__pyx_t_2);
21108
21152
 
21109
- /* "mettagrid/objects.pxd":102
21153
+ /* "mettagrid/objects.pxd":110
21110
21154
  * "agent:shield"
21111
21155
  * ] + [
21112
21156
  * "agent:inv:" + n for n in InventoryItemNames] # <<<<<<<<<<<<<<
@@ -21119,33 +21163,33 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21119
21163
  __pyx_t_4 = *__pyx_t_3;
21120
21164
  ++__pyx_t_3;
21121
21165
  __pyx_7genexpr__pyx_v_n = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);
21122
- __pyx_t_5 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(__pyx_7genexpr__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 102, __pyx_L1_error)
21166
+ __pyx_t_5 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(__pyx_7genexpr__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 110, __pyx_L1_error)
21123
21167
  __Pyx_GOTREF(__pyx_t_5);
21124
- __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_agent_inv, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 102, __pyx_L1_error)
21168
+ __pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_agent_inv, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 110, __pyx_L1_error)
21125
21169
  __Pyx_GOTREF(__pyx_t_6);
21126
21170
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21127
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 101, __pyx_L1_error)
21171
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 109, __pyx_L1_error)
21128
21172
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21129
21173
  }
21130
21174
  } /* exit inner scope */
21131
21175
 
21132
- /* "mettagrid/objects.pxd":101
21176
+ /* "mettagrid/objects.pxd":109
21133
21177
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21134
21178
  * "agent:shield"
21135
21179
  * ] + [ # <<<<<<<<<<<<<<
21136
21180
  * "agent:inv:" + n for n in InventoryItemNames]
21137
21181
  *
21138
21182
  */
21139
- __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 101, __pyx_L1_error)
21183
+ __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 109, __pyx_L1_error)
21140
21184
  __Pyx_GOTREF(__pyx_t_6);
21141
21185
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21142
21186
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21143
- __pyx_t_7 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 101, __pyx_L1_error)
21187
+ __pyx_t_7 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 109, __pyx_L1_error)
21144
21188
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21145
21189
  __pyx_r = __pyx_t_7;
21146
21190
  goto __pyx_L0;
21147
21191
 
21148
- /* "mettagrid/objects.pxd":97
21192
+ /* "mettagrid/objects.pxd":105
21149
21193
  *
21150
21194
  * @staticmethod
21151
21195
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21166,7 +21210,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21166
21210
  return __pyx_r;
21167
21211
  }
21168
21212
 
21169
- /* "mettagrid/objects.pxd":105
21213
+ /* "mettagrid/objects.pxd":113
21170
21214
  *
21171
21215
  * cdef cppclass Wall(MettaObject):
21172
21216
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21179,7 +21223,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21179
21223
  const char *__pyx_filename = NULL;
21180
21224
  int __pyx_clineno = 0;
21181
21225
 
21182
- /* "mettagrid/objects.pxd":106
21226
+ /* "mettagrid/objects.pxd":114
21183
21227
  * cdef cppclass Wall(MettaObject):
21184
21228
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg):
21185
21229
  * GridObject.init(ObjectType.WallT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21188,16 +21232,16 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21188
21232
  */
21189
21233
  GridObject::init(__pyx_e_9mettagrid_7objects_WallT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21190
21234
 
21191
- /* "mettagrid/objects.pxd":107
21235
+ /* "mettagrid/objects.pxd":115
21192
21236
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg):
21193
21237
  * GridObject.init(ObjectType.WallT, GridLocation(r, c, GridLayer.Object_Layer))
21194
21238
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21195
21239
  *
21196
21240
  * inline void obs(ObsType[:] obs):
21197
21241
  */
21198
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 107, __pyx_L1_error)
21242
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 115, __pyx_L1_error)
21199
21243
 
21200
- /* "mettagrid/objects.pxd":105
21244
+ /* "mettagrid/objects.pxd":113
21201
21245
  *
21202
21246
  * cdef cppclass Wall(MettaObject):
21203
21247
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21212,7 +21256,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21212
21256
  __pyx_L0:;
21213
21257
  }
21214
21258
 
21215
- /* "mettagrid/objects.pxd":109
21259
+ /* "mettagrid/objects.pxd":117
21216
21260
  * MettaObject.init_mo(cfg)
21217
21261
  *
21218
21262
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21223,7 +21267,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21223
21267
  void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21224
21268
  Py_ssize_t __pyx_t_1;
21225
21269
 
21226
- /* "mettagrid/objects.pxd":110
21270
+ /* "mettagrid/objects.pxd":118
21227
21271
  *
21228
21272
  * inline void obs(ObsType[:] obs):
21229
21273
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21233,7 +21277,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21233
21277
  __pyx_t_1 = 0;
21234
21278
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21235
21279
 
21236
- /* "mettagrid/objects.pxd":111
21280
+ /* "mettagrid/objects.pxd":119
21237
21281
  * inline void obs(ObsType[:] obs):
21238
21282
  * obs[0] = 1
21239
21283
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -21243,7 +21287,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21243
21287
  __pyx_t_1 = 1;
21244
21288
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
21245
21289
 
21246
- /* "mettagrid/objects.pxd":109
21290
+ /* "mettagrid/objects.pxd":117
21247
21291
  * MettaObject.init_mo(cfg)
21248
21292
  *
21249
21293
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21254,7 +21298,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21254
21298
  /* function exit code */
21255
21299
  }
21256
21300
 
21257
- /* "mettagrid/objects.pxd":114
21301
+ /* "mettagrid/objects.pxd":122
21258
21302
  *
21259
21303
  * @staticmethod
21260
21304
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21272,27 +21316,27 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Wall::feature_names(void)
21272
21316
  int __pyx_clineno = 0;
21273
21317
  __Pyx_RefNannySetupContext("feature_names", 1);
21274
21318
 
21275
- /* "mettagrid/objects.pxd":115
21319
+ /* "mettagrid/objects.pxd":123
21276
21320
  * @staticmethod
21277
21321
  * inline vector[string] feature_names():
21278
21322
  * return ["wall", "wall:hp"] # <<<<<<<<<<<<<<
21279
21323
  *
21280
21324
  * cdef cppclass Generator(Usable):
21281
21325
  */
21282
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 115, __pyx_L1_error)
21326
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 123, __pyx_L1_error)
21283
21327
  __Pyx_GOTREF(__pyx_t_1);
21284
21328
  __Pyx_INCREF(__pyx_n_u_wall);
21285
21329
  __Pyx_GIVEREF(__pyx_n_u_wall);
21286
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_wall)) __PYX_ERR(3, 115, __pyx_L1_error);
21330
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_wall)) __PYX_ERR(3, 123, __pyx_L1_error);
21287
21331
  __Pyx_INCREF(__pyx_kp_u_wall_hp);
21288
21332
  __Pyx_GIVEREF(__pyx_kp_u_wall_hp);
21289
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_wall_hp)) __PYX_ERR(3, 115, __pyx_L1_error);
21290
- __pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 115, __pyx_L1_error)
21333
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_wall_hp)) __PYX_ERR(3, 123, __pyx_L1_error);
21334
+ __pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 123, __pyx_L1_error)
21291
21335
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21292
21336
  __pyx_r = __pyx_t_2;
21293
21337
  goto __pyx_L0;
21294
21338
 
21295
- /* "mettagrid/objects.pxd":114
21339
+ /* "mettagrid/objects.pxd":122
21296
21340
  *
21297
21341
  * @staticmethod
21298
21342
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21310,7 +21354,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Wall::feature_names(void)
21310
21354
  return __pyx_r;
21311
21355
  }
21312
21356
 
21313
- /* "mettagrid/objects.pxd":120
21357
+ /* "mettagrid/objects.pxd":128
21314
21358
  * unsigned int r1
21315
21359
  *
21316
21360
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21323,7 +21367,7 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21323
21367
  const char *__pyx_filename = NULL;
21324
21368
  int __pyx_clineno = 0;
21325
21369
 
21326
- /* "mettagrid/objects.pxd":121
21370
+ /* "mettagrid/objects.pxd":129
21327
21371
  *
21328
21372
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg):
21329
21373
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21332,34 +21376,34 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21332
21376
  */
21333
21377
  GridObject::init(__pyx_e_9mettagrid_7objects_GeneratorT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21334
21378
 
21335
- /* "mettagrid/objects.pxd":122
21379
+ /* "mettagrid/objects.pxd":130
21336
21380
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg):
21337
21381
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer))
21338
21382
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21339
21383
  * Usable.init_usable(cfg)
21340
21384
  * this.r1 = cfg[b"initial_resources"]
21341
21385
  */
21342
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 122, __pyx_L1_error)
21386
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 130, __pyx_L1_error)
21343
21387
 
21344
- /* "mettagrid/objects.pxd":123
21388
+ /* "mettagrid/objects.pxd":131
21345
21389
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer))
21346
21390
  * MettaObject.init_mo(cfg)
21347
21391
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
21348
21392
  * this.r1 = cfg[b"initial_resources"]
21349
21393
  *
21350
21394
  */
21351
- __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 123, __pyx_L1_error)
21395
+ __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 131, __pyx_L1_error)
21352
21396
 
21353
- /* "mettagrid/objects.pxd":124
21397
+ /* "mettagrid/objects.pxd":132
21354
21398
  * MettaObject.init_mo(cfg)
21355
21399
  * Usable.init_usable(cfg)
21356
21400
  * this.r1 = cfg[b"initial_resources"] # <<<<<<<<<<<<<<
21357
21401
  *
21358
- * inline char usable(const Agent *actor):
21402
+ * inline bint usable(const Agent *actor):
21359
21403
  */
21360
21404
  this->r1 = (__pyx_v_cfg[__pyx_k_initial_resources]);
21361
21405
 
21362
- /* "mettagrid/objects.pxd":120
21406
+ /* "mettagrid/objects.pxd":128
21363
21407
  * unsigned int r1
21364
21408
  *
21365
21409
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21374,46 +21418,45 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21374
21418
  __pyx_L0:;
21375
21419
  }
21376
21420
 
21377
- /* "mettagrid/objects.pxd":126
21421
+ /* "mettagrid/objects.pxd":134
21378
21422
  * this.r1 = cfg[b"initial_resources"]
21379
21423
  *
21380
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21424
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21381
21425
  * return Usable.usable(actor) and this.r1 > 0
21382
21426
  *
21383
21427
  */
21384
21428
 
21385
- char __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21386
- char __pyx_r;
21387
- char __pyx_t_1;
21388
- char __pyx_t_2;
21389
- int __pyx_t_3;
21429
+ int __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21430
+ int __pyx_r;
21431
+ int __pyx_t_1;
21432
+ int __pyx_t_2;
21390
21433
  int __pyx_lineno = 0;
21391
21434
  const char *__pyx_filename = NULL;
21392
21435
  int __pyx_clineno = 0;
21393
21436
 
21394
- /* "mettagrid/objects.pxd":127
21437
+ /* "mettagrid/objects.pxd":135
21395
21438
  *
21396
- * inline char usable(const Agent *actor):
21439
+ * inline bint usable(const Agent *actor):
21397
21440
  * return Usable.usable(actor) and this.r1 > 0 # <<<<<<<<<<<<<<
21398
21441
  *
21399
21442
  * inline void obs(ObsType[:] obs):
21400
21443
  */
21401
- __pyx_t_2 = __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_v_actor); if (unlikely(__pyx_t_2 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(3, 127, __pyx_L1_error)
21444
+ __pyx_t_2 = __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_v_actor); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(3, 135, __pyx_L1_error)
21402
21445
  if (__pyx_t_2) {
21403
21446
  } else {
21404
21447
  __pyx_t_1 = __pyx_t_2;
21405
21448
  goto __pyx_L3_bool_binop_done;
21406
21449
  }
21407
- __pyx_t_3 = (this->r1 > 0);
21408
- __pyx_t_1 = __pyx_t_3;
21450
+ __pyx_t_2 = (this->r1 > 0);
21451
+ __pyx_t_1 = __pyx_t_2;
21409
21452
  __pyx_L3_bool_binop_done:;
21410
21453
  __pyx_r = __pyx_t_1;
21411
21454
  goto __pyx_L0;
21412
21455
 
21413
- /* "mettagrid/objects.pxd":126
21456
+ /* "mettagrid/objects.pxd":134
21414
21457
  * this.r1 = cfg[b"initial_resources"]
21415
21458
  *
21416
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21459
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21417
21460
  * return Usable.usable(actor) and this.r1 > 0
21418
21461
  *
21419
21462
  */
@@ -21426,7 +21469,7 @@ char __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_A
21426
21469
  return __pyx_r;
21427
21470
  }
21428
21471
 
21429
- /* "mettagrid/objects.pxd":129
21472
+ /* "mettagrid/objects.pxd":137
21430
21473
  * return Usable.usable(actor) and this.r1 > 0
21431
21474
  *
21432
21475
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21439,7 +21482,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21439
21482
  unsigned int __pyx_t_2;
21440
21483
  unsigned char __pyx_t_3;
21441
21484
 
21442
- /* "mettagrid/objects.pxd":130
21485
+ /* "mettagrid/objects.pxd":138
21443
21486
  *
21444
21487
  * inline void obs(ObsType[:] obs):
21445
21488
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21449,7 +21492,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21449
21492
  __pyx_t_1 = 0;
21450
21493
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21451
21494
 
21452
- /* "mettagrid/objects.pxd":131
21495
+ /* "mettagrid/objects.pxd":139
21453
21496
  * inline void obs(ObsType[:] obs):
21454
21497
  * obs[0] = 1
21455
21498
  * obs[1] = this.hp # <<<<<<<<<<<<<<
@@ -21460,7 +21503,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21460
21503
  __pyx_t_1 = 1;
21461
21504
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21462
21505
 
21463
- /* "mettagrid/objects.pxd":132
21506
+ /* "mettagrid/objects.pxd":140
21464
21507
  * obs[0] = 1
21465
21508
  * obs[1] = this.hp
21466
21509
  * obs[2] = this.r1 # <<<<<<<<<<<<<<
@@ -21471,7 +21514,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21471
21514
  __pyx_t_1 = 2;
21472
21515
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21473
21516
 
21474
- /* "mettagrid/objects.pxd":133
21517
+ /* "mettagrid/objects.pxd":141
21475
21518
  * obs[1] = this.hp
21476
21519
  * obs[2] = this.r1
21477
21520
  * obs[3] = this.ready # <<<<<<<<<<<<<<
@@ -21482,7 +21525,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21482
21525
  __pyx_t_1 = 3;
21483
21526
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
21484
21527
 
21485
- /* "mettagrid/objects.pxd":129
21528
+ /* "mettagrid/objects.pxd":137
21486
21529
  * return Usable.usable(actor) and this.r1 > 0
21487
21530
  *
21488
21531
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21493,7 +21536,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21493
21536
  /* function exit code */
21494
21537
  }
21495
21538
 
21496
- /* "mettagrid/objects.pxd":137
21539
+ /* "mettagrid/objects.pxd":145
21497
21540
  *
21498
21541
  * @staticmethod
21499
21542
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21511,33 +21554,33 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Generator::feature_names(v
21511
21554
  int __pyx_clineno = 0;
21512
21555
  __Pyx_RefNannySetupContext("feature_names", 1);
21513
21556
 
21514
- /* "mettagrid/objects.pxd":138
21557
+ /* "mettagrid/objects.pxd":146
21515
21558
  * @staticmethod
21516
21559
  * inline vector[string] feature_names():
21517
21560
  * return ["generator", "generator:hp", "generator:r1", "generator:ready"] # <<<<<<<<<<<<<<
21518
21561
  *
21519
21562
  * cdef cppclass Converter(Usable):
21520
21563
  */
21521
- __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 138, __pyx_L1_error)
21564
+ __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 146, __pyx_L1_error)
21522
21565
  __Pyx_GOTREF(__pyx_t_1);
21523
21566
  __Pyx_INCREF(__pyx_n_u_generator);
21524
21567
  __Pyx_GIVEREF(__pyx_n_u_generator);
21525
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_generator)) __PYX_ERR(3, 138, __pyx_L1_error);
21568
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_generator)) __PYX_ERR(3, 146, __pyx_L1_error);
21526
21569
  __Pyx_INCREF(__pyx_kp_u_generator_hp);
21527
21570
  __Pyx_GIVEREF(__pyx_kp_u_generator_hp);
21528
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_generator_hp)) __PYX_ERR(3, 138, __pyx_L1_error);
21571
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_generator_hp)) __PYX_ERR(3, 146, __pyx_L1_error);
21529
21572
  __Pyx_INCREF(__pyx_kp_u_generator_r1);
21530
21573
  __Pyx_GIVEREF(__pyx_kp_u_generator_r1);
21531
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_generator_r1)) __PYX_ERR(3, 138, __pyx_L1_error);
21574
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_generator_r1)) __PYX_ERR(3, 146, __pyx_L1_error);
21532
21575
  __Pyx_INCREF(__pyx_kp_u_generator_ready);
21533
21576
  __Pyx_GIVEREF(__pyx_kp_u_generator_ready);
21534
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_generator_ready)) __PYX_ERR(3, 138, __pyx_L1_error);
21535
- __pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 138, __pyx_L1_error)
21577
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_generator_ready)) __PYX_ERR(3, 146, __pyx_L1_error);
21578
+ __pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 146, __pyx_L1_error)
21536
21579
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21537
21580
  __pyx_r = __pyx_t_2;
21538
21581
  goto __pyx_L0;
21539
21582
 
21540
- /* "mettagrid/objects.pxd":137
21583
+ /* "mettagrid/objects.pxd":145
21541
21584
  *
21542
21585
  * @staticmethod
21543
21586
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21555,7 +21598,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Generator::feature_names(v
21555
21598
  return __pyx_r;
21556
21599
  }
21557
21600
 
21558
- /* "mettagrid/objects.pxd":145
21601
+ /* "mettagrid/objects.pxd":153
21559
21602
  * short output_energy
21560
21603
  *
21561
21604
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21568,7 +21611,7 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21568
21611
  const char *__pyx_filename = NULL;
21569
21612
  int __pyx_clineno = 0;
21570
21613
 
21571
- /* "mettagrid/objects.pxd":146
21614
+ /* "mettagrid/objects.pxd":154
21572
21615
  *
21573
21616
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg):
21574
21617
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21577,25 +21620,25 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21577
21620
  */
21578
21621
  GridObject::init(__pyx_e_9mettagrid_7objects_ConverterT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21579
21622
 
21580
- /* "mettagrid/objects.pxd":147
21623
+ /* "mettagrid/objects.pxd":155
21581
21624
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg):
21582
21625
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer))
21583
21626
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21584
21627
  * Usable.init_usable(cfg)
21585
21628
  * this.input_resource = InventoryItem.r1
21586
21629
  */
21587
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 147, __pyx_L1_error)
21630
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 155, __pyx_L1_error)
21588
21631
 
21589
- /* "mettagrid/objects.pxd":148
21632
+ /* "mettagrid/objects.pxd":156
21590
21633
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer))
21591
21634
  * MettaObject.init_mo(cfg)
21592
21635
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
21593
21636
  * this.input_resource = InventoryItem.r1
21594
21637
  * this.output_resource = InventoryItem.r2
21595
21638
  */
21596
- __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 148, __pyx_L1_error)
21639
+ __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 156, __pyx_L1_error)
21597
21640
 
21598
- /* "mettagrid/objects.pxd":149
21641
+ /* "mettagrid/objects.pxd":157
21599
21642
  * MettaObject.init_mo(cfg)
21600
21643
  * Usable.init_usable(cfg)
21601
21644
  * this.input_resource = InventoryItem.r1 # <<<<<<<<<<<<<<
@@ -21604,7 +21647,7 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21604
21647
  */
21605
21648
  this->input_resource = __pyx_e_9mettagrid_7objects_r1;
21606
21649
 
21607
- /* "mettagrid/objects.pxd":150
21650
+ /* "mettagrid/objects.pxd":158
21608
21651
  * Usable.init_usable(cfg)
21609
21652
  * this.input_resource = InventoryItem.r1
21610
21653
  * this.output_resource = InventoryItem.r2 # <<<<<<<<<<<<<<
@@ -21613,16 +21656,16 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21613
21656
  */
21614
21657
  this->output_resource = __pyx_e_9mettagrid_7objects_r2;
21615
21658
 
21616
- /* "mettagrid/objects.pxd":151
21659
+ /* "mettagrid/objects.pxd":159
21617
21660
  * this.input_resource = InventoryItem.r1
21618
21661
  * this.output_resource = InventoryItem.r2
21619
21662
  * this.output_energy = cfg[b"energy_output.r1"] # <<<<<<<<<<<<<<
21620
21663
  *
21621
- * inline char usable(const Agent *actor):
21664
+ * inline bint usable(const Agent *actor):
21622
21665
  */
21623
21666
  this->output_energy = (__pyx_v_cfg[__pyx_k_energy_output_r1]);
21624
21667
 
21625
- /* "mettagrid/objects.pxd":145
21668
+ /* "mettagrid/objects.pxd":153
21626
21669
  * short output_energy
21627
21670
  *
21628
21671
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21637,46 +21680,45 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21637
21680
  __pyx_L0:;
21638
21681
  }
21639
21682
 
21640
- /* "mettagrid/objects.pxd":153
21683
+ /* "mettagrid/objects.pxd":161
21641
21684
  * this.output_energy = cfg[b"energy_output.r1"]
21642
21685
  *
21643
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21686
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21644
21687
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21645
21688
  *
21646
21689
  */
21647
21690
 
21648
- char __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21649
- char __pyx_r;
21650
- char __pyx_t_1;
21651
- char __pyx_t_2;
21652
- int __pyx_t_3;
21691
+ int __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21692
+ int __pyx_r;
21693
+ int __pyx_t_1;
21694
+ int __pyx_t_2;
21653
21695
  int __pyx_lineno = 0;
21654
21696
  const char *__pyx_filename = NULL;
21655
21697
  int __pyx_clineno = 0;
21656
21698
 
21657
- /* "mettagrid/objects.pxd":154
21699
+ /* "mettagrid/objects.pxd":162
21658
21700
  *
21659
- * inline char usable(const Agent *actor):
21701
+ * inline bint usable(const Agent *actor):
21660
21702
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0 # <<<<<<<<<<<<<<
21661
21703
  *
21662
21704
  * inline obs(ObsType[:] obs):
21663
21705
  */
21664
- __pyx_t_2 = __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_v_actor); if (unlikely(__pyx_t_2 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(3, 154, __pyx_L1_error)
21706
+ __pyx_t_2 = __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_v_actor); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(3, 162, __pyx_L1_error)
21665
21707
  if (__pyx_t_2) {
21666
21708
  } else {
21667
21709
  __pyx_t_1 = __pyx_t_2;
21668
21710
  goto __pyx_L3_bool_binop_done;
21669
21711
  }
21670
- __pyx_t_3 = ((__pyx_v_actor->inventory[this->input_resource]) > 0);
21671
- __pyx_t_1 = __pyx_t_3;
21712
+ __pyx_t_2 = ((__pyx_v_actor->inventory[this->input_resource]) > 0);
21713
+ __pyx_t_1 = __pyx_t_2;
21672
21714
  __pyx_L3_bool_binop_done:;
21673
21715
  __pyx_r = __pyx_t_1;
21674
21716
  goto __pyx_L0;
21675
21717
 
21676
- /* "mettagrid/objects.pxd":153
21718
+ /* "mettagrid/objects.pxd":161
21677
21719
  * this.output_energy = cfg[b"energy_output.r1"]
21678
21720
  *
21679
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21721
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21680
21722
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21681
21723
  *
21682
21724
  */
@@ -21689,7 +21731,7 @@ char __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_A
21689
21731
  return __pyx_r;
21690
21732
  }
21691
21733
 
21692
- /* "mettagrid/objects.pxd":156
21734
+ /* "mettagrid/objects.pxd":164
21693
21735
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21694
21736
  *
21695
21737
  * inline obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21703,7 +21745,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21703
21745
  Py_ssize_t __pyx_t_1;
21704
21746
  __Pyx_RefNannySetupContext("obs", 1);
21705
21747
 
21706
- /* "mettagrid/objects.pxd":157
21748
+ /* "mettagrid/objects.pxd":165
21707
21749
  *
21708
21750
  * inline obs(ObsType[:] obs):
21709
21751
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21713,7 +21755,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21713
21755
  __pyx_t_1 = 0;
21714
21756
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21715
21757
 
21716
- /* "mettagrid/objects.pxd":158
21758
+ /* "mettagrid/objects.pxd":166
21717
21759
  * inline obs(ObsType[:] obs):
21718
21760
  * obs[0] = 1
21719
21761
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -21723,7 +21765,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21723
21765
  __pyx_t_1 = 1;
21724
21766
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
21725
21767
 
21726
- /* "mettagrid/objects.pxd":159
21768
+ /* "mettagrid/objects.pxd":167
21727
21769
  * obs[0] = 1
21728
21770
  * obs[1] = hp
21729
21771
  * obs[2] = input_resource # <<<<<<<<<<<<<<
@@ -21733,7 +21775,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21733
21775
  __pyx_t_1 = 2;
21734
21776
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = input_resource;
21735
21777
 
21736
- /* "mettagrid/objects.pxd":160
21778
+ /* "mettagrid/objects.pxd":168
21737
21779
  * obs[1] = hp
21738
21780
  * obs[2] = input_resource
21739
21781
  * obs[3] = output_resource # <<<<<<<<<<<<<<
@@ -21743,7 +21785,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21743
21785
  __pyx_t_1 = 3;
21744
21786
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = output_resource;
21745
21787
 
21746
- /* "mettagrid/objects.pxd":161
21788
+ /* "mettagrid/objects.pxd":169
21747
21789
  * obs[2] = input_resource
21748
21790
  * obs[3] = output_resource
21749
21791
  * obs[4] = output_energy # <<<<<<<<<<<<<<
@@ -21753,7 +21795,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21753
21795
  __pyx_t_1 = 4;
21754
21796
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = output_energy;
21755
21797
 
21756
- /* "mettagrid/objects.pxd":162
21798
+ /* "mettagrid/objects.pxd":170
21757
21799
  * obs[3] = output_resource
21758
21800
  * obs[4] = output_energy
21759
21801
  * obs[5] = ready # <<<<<<<<<<<<<<
@@ -21763,7 +21805,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21763
21805
  __pyx_t_1 = 5;
21764
21806
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = ready;
21765
21807
 
21766
- /* "mettagrid/objects.pxd":156
21808
+ /* "mettagrid/objects.pxd":164
21767
21809
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21768
21810
  *
21769
21811
  * inline obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21778,7 +21820,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21778
21820
  return __pyx_r;
21779
21821
  }
21780
21822
 
21781
- /* "mettagrid/objects.pxd":165
21823
+ /* "mettagrid/objects.pxd":173
21782
21824
  *
21783
21825
  * @staticmethod
21784
21826
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21796,39 +21838,39 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Converter::feature_names(v
21796
21838
  int __pyx_clineno = 0;
21797
21839
  __Pyx_RefNannySetupContext("feature_names", 1);
21798
21840
 
21799
- /* "mettagrid/objects.pxd":166
21841
+ /* "mettagrid/objects.pxd":174
21800
21842
  * @staticmethod
21801
21843
  * inline vector[string] feature_names():
21802
21844
  * return ["converter", "converter:hp", "converter:input_resource", "converter:output_resource", "converter:output_energy", "converter:ready"] # <<<<<<<<<<<<<<
21803
21845
  *
21804
21846
  * cdef cppclass Altar(Usable):
21805
21847
  */
21806
- __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 166, __pyx_L1_error)
21848
+ __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 174, __pyx_L1_error)
21807
21849
  __Pyx_GOTREF(__pyx_t_1);
21808
21850
  __Pyx_INCREF(__pyx_n_u_converter);
21809
21851
  __Pyx_GIVEREF(__pyx_n_u_converter);
21810
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_converter)) __PYX_ERR(3, 166, __pyx_L1_error);
21852
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_converter)) __PYX_ERR(3, 174, __pyx_L1_error);
21811
21853
  __Pyx_INCREF(__pyx_kp_u_converter_hp);
21812
21854
  __Pyx_GIVEREF(__pyx_kp_u_converter_hp);
21813
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_converter_hp)) __PYX_ERR(3, 166, __pyx_L1_error);
21855
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_converter_hp)) __PYX_ERR(3, 174, __pyx_L1_error);
21814
21856
  __Pyx_INCREF(__pyx_kp_u_converter_input_resource);
21815
21857
  __Pyx_GIVEREF(__pyx_kp_u_converter_input_resource);
21816
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_converter_input_resource)) __PYX_ERR(3, 166, __pyx_L1_error);
21858
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_converter_input_resource)) __PYX_ERR(3, 174, __pyx_L1_error);
21817
21859
  __Pyx_INCREF(__pyx_kp_u_converter_output_resource);
21818
21860
  __Pyx_GIVEREF(__pyx_kp_u_converter_output_resource);
21819
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_converter_output_resource)) __PYX_ERR(3, 166, __pyx_L1_error);
21861
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_converter_output_resource)) __PYX_ERR(3, 174, __pyx_L1_error);
21820
21862
  __Pyx_INCREF(__pyx_kp_u_converter_output_energy);
21821
21863
  __Pyx_GIVEREF(__pyx_kp_u_converter_output_energy);
21822
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_converter_output_energy)) __PYX_ERR(3, 166, __pyx_L1_error);
21864
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_converter_output_energy)) __PYX_ERR(3, 174, __pyx_L1_error);
21823
21865
  __Pyx_INCREF(__pyx_kp_u_converter_ready);
21824
21866
  __Pyx_GIVEREF(__pyx_kp_u_converter_ready);
21825
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_converter_ready)) __PYX_ERR(3, 166, __pyx_L1_error);
21826
- __pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 166, __pyx_L1_error)
21867
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_converter_ready)) __PYX_ERR(3, 174, __pyx_L1_error);
21868
+ __pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 174, __pyx_L1_error)
21827
21869
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21828
21870
  __pyx_r = __pyx_t_2;
21829
21871
  goto __pyx_L0;
21830
21872
 
21831
- /* "mettagrid/objects.pxd":165
21873
+ /* "mettagrid/objects.pxd":173
21832
21874
  *
21833
21875
  * @staticmethod
21834
21876
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21846,7 +21888,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Converter::feature_names(v
21846
21888
  return __pyx_r;
21847
21889
  }
21848
21890
 
21849
- /* "mettagrid/objects.pxd":169
21891
+ /* "mettagrid/objects.pxd":177
21850
21892
  *
21851
21893
  * cdef cppclass Altar(Usable):
21852
21894
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21859,7 +21901,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21859
21901
  const char *__pyx_filename = NULL;
21860
21902
  int __pyx_clineno = 0;
21861
21903
 
21862
- /* "mettagrid/objects.pxd":170
21904
+ /* "mettagrid/objects.pxd":178
21863
21905
  * cdef cppclass Altar(Usable):
21864
21906
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg):
21865
21907
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21868,25 +21910,25 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21868
21910
  */
21869
21911
  GridObject::init(__pyx_e_9mettagrid_7objects_AltarT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21870
21912
 
21871
- /* "mettagrid/objects.pxd":171
21913
+ /* "mettagrid/objects.pxd":179
21872
21914
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg):
21873
21915
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer))
21874
21916
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21875
21917
  * Usable.init_usable(cfg)
21876
21918
  *
21877
21919
  */
21878
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 171, __pyx_L1_error)
21920
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 179, __pyx_L1_error)
21879
21921
 
21880
- /* "mettagrid/objects.pxd":172
21922
+ /* "mettagrid/objects.pxd":180
21881
21923
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer))
21882
21924
  * MettaObject.init_mo(cfg)
21883
21925
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
21884
21926
  *
21885
21927
  * inline void obs(ObsType[:] obs):
21886
21928
  */
21887
- __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 172, __pyx_L1_error)
21929
+ __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 180, __pyx_L1_error)
21888
21930
 
21889
- /* "mettagrid/objects.pxd":169
21931
+ /* "mettagrid/objects.pxd":177
21890
21932
  *
21891
21933
  * cdef cppclass Altar(Usable):
21892
21934
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21901,7 +21943,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21901
21943
  __pyx_L0:;
21902
21944
  }
21903
21945
 
21904
- /* "mettagrid/objects.pxd":174
21946
+ /* "mettagrid/objects.pxd":182
21905
21947
  * Usable.init_usable(cfg)
21906
21948
  *
21907
21949
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21912,7 +21954,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21912
21954
  void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21913
21955
  Py_ssize_t __pyx_t_1;
21914
21956
 
21915
- /* "mettagrid/objects.pxd":175
21957
+ /* "mettagrid/objects.pxd":183
21916
21958
  *
21917
21959
  * inline void obs(ObsType[:] obs):
21918
21960
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21922,7 +21964,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21922
21964
  __pyx_t_1 = 0;
21923
21965
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21924
21966
 
21925
- /* "mettagrid/objects.pxd":176
21967
+ /* "mettagrid/objects.pxd":184
21926
21968
  * inline void obs(ObsType[:] obs):
21927
21969
  * obs[0] = 1
21928
21970
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -21932,7 +21974,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21932
21974
  __pyx_t_1 = 1;
21933
21975
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
21934
21976
 
21935
- /* "mettagrid/objects.pxd":177
21977
+ /* "mettagrid/objects.pxd":185
21936
21978
  * obs[0] = 1
21937
21979
  * obs[1] = hp
21938
21980
  * obs[2] = ready # <<<<<<<<<<<<<<
@@ -21942,7 +21984,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21942
21984
  __pyx_t_1 = 2;
21943
21985
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = ready;
21944
21986
 
21945
- /* "mettagrid/objects.pxd":174
21987
+ /* "mettagrid/objects.pxd":182
21946
21988
  * Usable.init_usable(cfg)
21947
21989
  *
21948
21990
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21953,7 +21995,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21953
21995
  /* function exit code */
21954
21996
  }
21955
21997
 
21956
- /* "mettagrid/objects.pxd":180
21998
+ /* "mettagrid/objects.pxd":188
21957
21999
  *
21958
22000
  * @staticmethod
21959
22001
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21971,30 +22013,30 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Altar::feature_names(void)
21971
22013
  int __pyx_clineno = 0;
21972
22014
  __Pyx_RefNannySetupContext("feature_names", 1);
21973
22015
 
21974
- /* "mettagrid/objects.pxd":181
22016
+ /* "mettagrid/objects.pxd":189
21975
22017
  * @staticmethod
21976
22018
  * inline vector[string] feature_names():
21977
22019
  * return ["altar", "altar:hp", "altar:ready"] # <<<<<<<<<<<<<<
21978
22020
  *
21979
22021
  * cdef map[TypeId, GridLayer] ObjectLayers
21980
22022
  */
21981
- __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 181, __pyx_L1_error)
22023
+ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 189, __pyx_L1_error)
21982
22024
  __Pyx_GOTREF(__pyx_t_1);
21983
22025
  __Pyx_INCREF(__pyx_n_u_altar);
21984
22026
  __Pyx_GIVEREF(__pyx_n_u_altar);
21985
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_altar)) __PYX_ERR(3, 181, __pyx_L1_error);
22027
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_altar)) __PYX_ERR(3, 189, __pyx_L1_error);
21986
22028
  __Pyx_INCREF(__pyx_kp_u_altar_hp);
21987
22029
  __Pyx_GIVEREF(__pyx_kp_u_altar_hp);
21988
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_altar_hp)) __PYX_ERR(3, 181, __pyx_L1_error);
22030
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_altar_hp)) __PYX_ERR(3, 189, __pyx_L1_error);
21989
22031
  __Pyx_INCREF(__pyx_kp_u_altar_ready);
21990
22032
  __Pyx_GIVEREF(__pyx_kp_u_altar_ready);
21991
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_altar_ready)) __PYX_ERR(3, 181, __pyx_L1_error);
21992
- __pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 181, __pyx_L1_error)
22033
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_altar_ready)) __PYX_ERR(3, 189, __pyx_L1_error);
22034
+ __pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 189, __pyx_L1_error)
21993
22035
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21994
22036
  __pyx_r = __pyx_t_2;
21995
22037
  goto __pyx_L0;
21996
22038
 
21997
- /* "mettagrid/objects.pxd":180
22039
+ /* "mettagrid/objects.pxd":188
21998
22040
  *
21999
22041
  * @staticmethod
22000
22042
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -22012,72 +22054,101 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Altar::feature_names(void)
22012
22054
  return __pyx_r;
22013
22055
  }
22014
22056
 
22015
- /* "mettagrid/objects.pxd":186
22057
+ /* "mettagrid/objects.pxd":194
22016
22058
  *
22017
22059
  * cdef class ResetHandler(EventHandler):
22018
22060
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg): # <<<<<<<<<<<<<<
22019
22061
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22020
- * usable.ready = True
22062
+ * if usable is NULL:
22021
22063
  */
22022
22064
 
22023
22065
  static void __pyx_f_9mettagrid_7objects_12ResetHandler_handle_event(struct __pyx_obj_9mettagrid_7objects_ResetHandler *__pyx_v_self, GridObjectId __pyx_v_obj_id, CYTHON_UNUSED EventArg __pyx_v_arg) {
22024
22066
  __pyx_t_9mettagrid_7objects_Usable *__pyx_v_usable;
22025
22067
  __Pyx_RefNannyDeclarations
22026
- PyObject *__pyx_t_1 = NULL;
22068
+ int __pyx_t_1;
22027
22069
  PyObject *__pyx_t_2 = NULL;
22028
- char const *__pyx_t_3;
22070
+ PyObject *__pyx_t_3 = NULL;
22071
+ char const *__pyx_t_4;
22029
22072
  int __pyx_lineno = 0;
22030
22073
  const char *__pyx_filename = NULL;
22031
22074
  int __pyx_clineno = 0;
22032
22075
  __Pyx_RefNannySetupContext("handle_event", 1);
22033
22076
 
22034
- /* "mettagrid/objects.pxd":187
22077
+ /* "mettagrid/objects.pxd":195
22035
22078
  * cdef class ResetHandler(EventHandler):
22036
22079
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
22037
22080
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id) # <<<<<<<<<<<<<<
22038
- * usable.ready = True
22039
- * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
22081
+ * if usable is NULL:
22082
+ * return
22040
22083
  */
22041
22084
  __pyx_v_usable = ((__pyx_t_9mettagrid_7objects_Usable *)__pyx_v_self->__pyx_base.env->_grid->object(__pyx_v_obj_id));
22042
22085
 
22043
- /* "mettagrid/objects.pxd":188
22086
+ /* "mettagrid/objects.pxd":196
22087
+ * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
22088
+ * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22089
+ * if usable is NULL: # <<<<<<<<<<<<<<
22090
+ * return
22091
+ *
22092
+ */
22093
+ __pyx_t_1 = (__pyx_v_usable == NULL);
22094
+ if (__pyx_t_1) {
22095
+
22096
+ /* "mettagrid/objects.pxd":197
22097
+ * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22098
+ * if usable is NULL:
22099
+ * return # <<<<<<<<<<<<<<
22100
+ *
22101
+ * usable.ready = True
22102
+ */
22103
+ goto __pyx_L0;
22104
+
22105
+ /* "mettagrid/objects.pxd":196
22044
22106
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
22045
22107
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22108
+ * if usable is NULL: # <<<<<<<<<<<<<<
22109
+ * return
22110
+ *
22111
+ */
22112
+ }
22113
+
22114
+ /* "mettagrid/objects.pxd":199
22115
+ * return
22116
+ *
22046
22117
  * usable.ready = True # <<<<<<<<<<<<<<
22047
22118
  * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
22048
22119
  *
22049
22120
  */
22050
22121
  __pyx_v_usable->ready = 1;
22051
22122
 
22052
- /* "mettagrid/objects.pxd":189
22053
- * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22123
+ /* "mettagrid/objects.pxd":200
22124
+ *
22054
22125
  * usable.ready = True
22055
22126
  * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id]) # <<<<<<<<<<<<<<
22056
22127
  *
22057
22128
  * cdef enum Events:
22058
22129
  */
22059
- __pyx_t_1 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string((__pyx_v_9mettagrid_7objects_ObjectTypeNames[__pyx_v_usable->_type_id])); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 189, __pyx_L1_error)
22060
- __Pyx_GOTREF(__pyx_t_1);
22061
- __pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_resets, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 189, __pyx_L1_error)
22130
+ __pyx_t_2 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string((__pyx_v_9mettagrid_7objects_ObjectTypeNames[__pyx_v_usable->_type_id])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 200, __pyx_L1_error)
22062
22131
  __Pyx_GOTREF(__pyx_t_2);
22063
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22064
- __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(3, 189, __pyx_L1_error)
22065
- ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->game_incr(__pyx_v_self->__pyx_base.env->_stats, __pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 189, __pyx_L1_error)
22132
+ __pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_resets, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 200, __pyx_L1_error)
22133
+ __Pyx_GOTREF(__pyx_t_3);
22066
22134
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22135
+ __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(3, 200, __pyx_L1_error)
22136
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->game_incr(__pyx_v_self->__pyx_base.env->_stats, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 200, __pyx_L1_error)
22137
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22067
22138
 
22068
- /* "mettagrid/objects.pxd":186
22139
+ /* "mettagrid/objects.pxd":194
22069
22140
  *
22070
22141
  * cdef class ResetHandler(EventHandler):
22071
22142
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg): # <<<<<<<<<<<<<<
22072
22143
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22073
- * usable.ready = True
22144
+ * if usable is NULL:
22074
22145
  */
22075
22146
 
22076
22147
  /* function exit code */
22077
22148
  goto __pyx_L0;
22078
22149
  __pyx_L1_error:;
22079
- __Pyx_XDECREF(__pyx_t_1);
22080
22150
  __Pyx_XDECREF(__pyx_t_2);
22151
+ __Pyx_XDECREF(__pyx_t_3);
22081
22152
  __Pyx_AddTraceback("mettagrid.objects.ResetHandler.handle_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
22082
22153
  __pyx_L0:;
22083
22154
  __Pyx_RefNannyFinishContext();
@@ -22187,7 +22258,7 @@ static int __pyx_pf_9mettagrid_7actions_3use_3Use___init__(struct __pyx_obj_9met
22187
22258
  * def __init__(self, cfg: OmegaConf):
22188
22259
  * MettaActionHandler.__init__(self, cfg, "use") # <<<<<<<<<<<<<<
22189
22260
  *
22190
- * cdef char _handle_action(
22261
+ * cdef unsigned char max_arg(self):
22191
22262
  */
22192
22263
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
22193
22264
  __Pyx_GOTREF(__pyx_t_2);
@@ -22240,31 +22311,69 @@ static int __pyx_pf_9mettagrid_7actions_3use_3Use___init__(struct __pyx_obj_9met
22240
22311
  /* "mettagrid/actions/use.pyx":16
22241
22312
  * MettaActionHandler.__init__(self, cfg, "use")
22242
22313
  *
22243
- * cdef char _handle_action( # <<<<<<<<<<<<<<
22314
+ * cdef unsigned char max_arg(self): # <<<<<<<<<<<<<<
22315
+ * return 0
22316
+ *
22317
+ */
22318
+
22319
+ static unsigned char __pyx_f_9mettagrid_7actions_3use_3Use_max_arg(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_3use_Use *__pyx_v_self) {
22320
+ unsigned char __pyx_r;
22321
+
22322
+ /* "mettagrid/actions/use.pyx":17
22323
+ *
22324
+ * cdef unsigned char max_arg(self):
22325
+ * return 0 # <<<<<<<<<<<<<<
22326
+ *
22327
+ * cdef bint _handle_action(
22328
+ */
22329
+ __pyx_r = 0;
22330
+ goto __pyx_L0;
22331
+
22332
+ /* "mettagrid/actions/use.pyx":16
22333
+ * MettaActionHandler.__init__(self, cfg, "use")
22334
+ *
22335
+ * cdef unsigned char max_arg(self): # <<<<<<<<<<<<<<
22336
+ * return 0
22337
+ *
22338
+ */
22339
+
22340
+ /* function exit code */
22341
+ __pyx_L0:;
22342
+ return __pyx_r;
22343
+ }
22344
+
22345
+ /* "mettagrid/actions/use.pyx":19
22346
+ * return 0
22347
+ *
22348
+ * cdef bint _handle_action( # <<<<<<<<<<<<<<
22244
22349
  * self,
22245
22350
  * unsigned int actor_id,
22246
22351
  */
22247
22352
 
22248
- static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_obj_9mettagrid_7actions_3use_Use *__pyx_v_self, unsigned int __pyx_v_actor_id, __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, CYTHON_UNUSED __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg) {
22353
+ static int __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_obj_9mettagrid_7actions_3use_Use *__pyx_v_self, unsigned int __pyx_v_actor_id, __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, CYTHON_UNUSED __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg) {
22249
22354
  GridLocation __pyx_v_target_loc;
22250
22355
  __pyx_t_9mettagrid_7objects_MettaObject *__pyx_v_target;
22251
22356
  __pyx_t_9mettagrid_7objects_Usable *__pyx_v_usable;
22252
22357
  __pyx_t_9mettagrid_7objects_Generator *__pyx_v_generator;
22253
22358
  __pyx_t_9mettagrid_7objects_Converter *__pyx_v_converter;
22254
- char __pyx_r;
22359
+ unsigned int __pyx_v_energy_gain;
22360
+ int __pyx_r;
22255
22361
  __Pyx_RefNannyDeclarations
22256
22362
  int __pyx_t_1;
22257
- char __pyx_t_2;
22363
+ int __pyx_t_2;
22258
22364
  size_t __pyx_t_3;
22259
22365
  PyObject *__pyx_t_4 = NULL;
22260
22366
  PyObject *__pyx_t_5 = NULL;
22261
22367
  char const *__pyx_t_6;
22368
+ short __pyx_t_7;
22369
+ int __pyx_t_8;
22370
+ int __pyx_t_9;
22262
22371
  int __pyx_lineno = 0;
22263
22372
  const char *__pyx_filename = NULL;
22264
22373
  int __pyx_clineno = 0;
22265
22374
  __Pyx_RefNannySetupContext("_handle_action", 1);
22266
22375
 
22267
- /* "mettagrid/actions/use.pyx":22
22376
+ /* "mettagrid/actions/use.pyx":25
22268
22377
  * ActionArg arg):
22269
22378
  *
22270
22379
  * cdef GridLocation target_loc = self.env._grid.relative_location( # <<<<<<<<<<<<<<
@@ -22273,7 +22382,7 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22273
22382
  */
22274
22383
  __pyx_v_target_loc = __pyx_v_self->__pyx_base.__pyx_base.env->_grid->relative_location(__pyx_v_actor->location, ((Orientation)__pyx_v_actor->orientation));
22275
22384
 
22276
- /* "mettagrid/actions/use.pyx":26
22385
+ /* "mettagrid/actions/use.pyx":29
22277
22386
  * <Orientation>actor.orientation
22278
22387
  * )
22279
22388
  * target_loc.layer = GridLayer.Object_Layer # <<<<<<<<<<<<<<
@@ -22282,7 +22391,7 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22282
22391
  */
22283
22392
  __pyx_v_target_loc.layer = __pyx_e_9mettagrid_7objects_Object_Layer;
22284
22393
 
22285
- /* "mettagrid/actions/use.pyx":27
22394
+ /* "mettagrid/actions/use.pyx":30
22286
22395
  * )
22287
22396
  * target_loc.layer = GridLayer.Object_Layer
22288
22397
  * cdef MettaObject *target = <MettaObject*>self.env._grid.object_at(target_loc) # <<<<<<<<<<<<<<
@@ -22291,7 +22400,7 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22291
22400
  */
22292
22401
  __pyx_v_target = ((__pyx_t_9mettagrid_7objects_MettaObject *)__pyx_v_self->__pyx_base.__pyx_base.env->_grid->object_at(__pyx_v_target_loc));
22293
22402
 
22294
- /* "mettagrid/actions/use.pyx":28
22403
+ /* "mettagrid/actions/use.pyx":31
22295
22404
  * target_loc.layer = GridLayer.Object_Layer
22296
22405
  * cdef MettaObject *target = <MettaObject*>self.env._grid.object_at(target_loc)
22297
22406
  * if target == NULL: # <<<<<<<<<<<<<<
@@ -22301,7 +22410,7 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22301
22410
  __pyx_t_1 = (__pyx_v_target == NULL);
22302
22411
  if (__pyx_t_1) {
22303
22412
 
22304
- /* "mettagrid/actions/use.pyx":29
22413
+ /* "mettagrid/actions/use.pyx":32
22305
22414
  * cdef MettaObject *target = <MettaObject*>self.env._grid.object_at(target_loc)
22306
22415
  * if target == NULL:
22307
22416
  * return False # <<<<<<<<<<<<<<
@@ -22311,7 +22420,7 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22311
22420
  __pyx_r = 0;
22312
22421
  goto __pyx_L0;
22313
22422
 
22314
- /* "mettagrid/actions/use.pyx":28
22423
+ /* "mettagrid/actions/use.pyx":31
22315
22424
  * target_loc.layer = GridLayer.Object_Layer
22316
22425
  * cdef MettaObject *target = <MettaObject*>self.env._grid.object_at(target_loc)
22317
22426
  * if target == NULL: # <<<<<<<<<<<<<<
@@ -22320,18 +22429,18 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22320
22429
  */
22321
22430
  }
22322
22431
 
22323
- /* "mettagrid/actions/use.pyx":31
22432
+ /* "mettagrid/actions/use.pyx":34
22324
22433
  * return False
22325
22434
  *
22326
22435
  * if not target.usable(actor): # <<<<<<<<<<<<<<
22327
22436
  * return False
22328
22437
  *
22329
22438
  */
22330
- __pyx_t_2 = __pyx_v_target->usable(__pyx_v_actor); if (unlikely(__pyx_t_2 == ((char)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error)
22331
- __pyx_t_1 = (!(__pyx_t_2 != 0));
22332
- if (__pyx_t_1) {
22439
+ __pyx_t_1 = __pyx_v_target->usable(__pyx_v_actor); if (unlikely(__pyx_t_1 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(1, 34, __pyx_L1_error)
22440
+ __pyx_t_2 = (!__pyx_t_1);
22441
+ if (__pyx_t_2) {
22333
22442
 
22334
- /* "mettagrid/actions/use.pyx":32
22443
+ /* "mettagrid/actions/use.pyx":35
22335
22444
  *
22336
22445
  * if not target.usable(actor):
22337
22446
  * return False # <<<<<<<<<<<<<<
@@ -22341,7 +22450,7 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22341
22450
  __pyx_r = 0;
22342
22451
  goto __pyx_L0;
22343
22452
 
22344
- /* "mettagrid/actions/use.pyx":31
22453
+ /* "mettagrid/actions/use.pyx":34
22345
22454
  * return False
22346
22455
  *
22347
22456
  * if not target.usable(actor): # <<<<<<<<<<<<<<
@@ -22350,7 +22459,7 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22350
22459
  */
22351
22460
  }
22352
22461
 
22353
- /* "mettagrid/actions/use.pyx":34
22462
+ /* "mettagrid/actions/use.pyx":37
22354
22463
  * return False
22355
22464
  *
22356
22465
  * cdef Usable *usable = <Usable*> target # <<<<<<<<<<<<<<
@@ -22359,7 +22468,7 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22359
22468
  */
22360
22469
  __pyx_v_usable = ((__pyx_t_9mettagrid_7objects_Usable *)__pyx_v_target);
22361
22470
 
22362
- /* "mettagrid/actions/use.pyx":35
22471
+ /* "mettagrid/actions/use.pyx":38
22363
22472
  *
22364
22473
  * cdef Usable *usable = <Usable*> target
22365
22474
  * actor.energy -= usable.use_cost # <<<<<<<<<<<<<<
@@ -22368,7 +22477,7 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22368
22477
  */
22369
22478
  __pyx_v_actor->energy = (__pyx_v_actor->energy - __pyx_v_usable->use_cost);
22370
22479
 
22371
- /* "mettagrid/actions/use.pyx":37
22480
+ /* "mettagrid/actions/use.pyx":40
22372
22481
  * actor.energy -= usable.use_cost
22373
22482
  *
22374
22483
  * usable.ready = 0 # <<<<<<<<<<<<<<
@@ -22377,44 +22486,44 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22377
22486
  */
22378
22487
  __pyx_v_usable->ready = 0;
22379
22488
 
22380
- /* "mettagrid/actions/use.pyx":38
22489
+ /* "mettagrid/actions/use.pyx":41
22381
22490
  *
22382
22491
  * usable.ready = 0
22383
22492
  * self.env._event_manager.schedule_event(Events.Reset, usable.cooldown, usable.id, 0) # <<<<<<<<<<<<<<
22384
22493
  *
22385
22494
  * self.env._stats.agent_incr(actor_id, self._stats.target[target._type_id].c_str())
22386
22495
  */
22387
- ((struct __pyx_vtabstruct_10puffergrid_5event_EventManager *)__pyx_v_self->__pyx_base.__pyx_base.env->_event_manager->__pyx_vtab)->schedule_event(__pyx_v_self->__pyx_base.__pyx_base.env->_event_manager, __pyx_e_9mettagrid_7objects_Reset, __pyx_v_usable->cooldown, __pyx_v_usable->id, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 38, __pyx_L1_error)
22496
+ ((struct __pyx_vtabstruct_10puffergrid_5event_EventManager *)__pyx_v_self->__pyx_base.__pyx_base.env->_event_manager->__pyx_vtab)->schedule_event(__pyx_v_self->__pyx_base.__pyx_base.env->_event_manager, __pyx_e_9mettagrid_7objects_Reset, __pyx_v_usable->cooldown, __pyx_v_usable->id, 0); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L1_error)
22388
22497
 
22389
- /* "mettagrid/actions/use.pyx":40
22498
+ /* "mettagrid/actions/use.pyx":43
22390
22499
  * self.env._event_manager.schedule_event(Events.Reset, usable.cooldown, usable.id, 0)
22391
22500
  *
22392
22501
  * self.env._stats.agent_incr(actor_id, self._stats.target[target._type_id].c_str()) # <<<<<<<<<<<<<<
22393
22502
  * self.env._stats.agent_add(actor_id, self._stats.target_energy[target._type_id].c_str(), usable.use_cost + self.action_cost)
22394
22503
  *
22395
22504
  */
22396
- ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, (__pyx_v_self->__pyx_base._stats.target[__pyx_v_target->_type_id]).c_str()); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 40, __pyx_L1_error)
22505
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, (__pyx_v_self->__pyx_base._stats.target[__pyx_v_target->_type_id]).c_str()); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 43, __pyx_L1_error)
22397
22506
 
22398
- /* "mettagrid/actions/use.pyx":41
22507
+ /* "mettagrid/actions/use.pyx":44
22399
22508
  *
22400
22509
  * self.env._stats.agent_incr(actor_id, self._stats.target[target._type_id].c_str())
22401
22510
  * self.env._stats.agent_add(actor_id, self._stats.target_energy[target._type_id].c_str(), usable.use_cost + self.action_cost) # <<<<<<<<<<<<<<
22402
22511
  *
22403
22512
  * if target._type_id == ObjectType.AltarT:
22404
22513
  */
22405
- ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_add(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, (__pyx_v_self->__pyx_base._stats.target_energy[__pyx_v_target->_type_id]).c_str(), (__pyx_v_usable->use_cost + __pyx_v_self->__pyx_base.action_cost)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L1_error)
22514
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_add(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, (__pyx_v_self->__pyx_base._stats.target_energy[__pyx_v_target->_type_id]).c_str(), (__pyx_v_usable->use_cost + __pyx_v_self->__pyx_base.action_cost)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 44, __pyx_L1_error)
22406
22515
 
22407
- /* "mettagrid/actions/use.pyx":43
22516
+ /* "mettagrid/actions/use.pyx":46
22408
22517
  * self.env._stats.agent_add(actor_id, self._stats.target_energy[target._type_id].c_str(), usable.use_cost + self.action_cost)
22409
22518
  *
22410
22519
  * if target._type_id == ObjectType.AltarT: # <<<<<<<<<<<<<<
22411
22520
  * self.env._rewards[actor_id] += 1
22412
22521
  *
22413
22522
  */
22414
- __pyx_t_1 = (__pyx_v_target->_type_id == __pyx_e_9mettagrid_7objects_AltarT);
22415
- if (__pyx_t_1) {
22523
+ __pyx_t_2 = (__pyx_v_target->_type_id == __pyx_e_9mettagrid_7objects_AltarT);
22524
+ if (__pyx_t_2) {
22416
22525
 
22417
- /* "mettagrid/actions/use.pyx":44
22526
+ /* "mettagrid/actions/use.pyx":47
22418
22527
  *
22419
22528
  * if target._type_id == ObjectType.AltarT:
22420
22529
  * self.env._rewards[actor_id] += 1 # <<<<<<<<<<<<<<
@@ -22424,7 +22533,7 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22424
22533
  __pyx_t_3 = __pyx_v_actor_id;
22425
22534
  *((float *) ( /* dim=0 */ (__pyx_v_self->__pyx_base.__pyx_base.env->_rewards.data + __pyx_t_3 * __pyx_v_self->__pyx_base.__pyx_base.env->_rewards.strides[0]) )) += 1.0;
22426
22535
 
22427
- /* "mettagrid/actions/use.pyx":43
22536
+ /* "mettagrid/actions/use.pyx":46
22428
22537
  * self.env._stats.agent_add(actor_id, self._stats.target_energy[target._type_id].c_str(), usable.use_cost + self.action_cost)
22429
22538
  *
22430
22539
  * if target._type_id == ObjectType.AltarT: # <<<<<<<<<<<<<<
@@ -22433,17 +22542,17 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22433
22542
  */
22434
22543
  }
22435
22544
 
22436
- /* "mettagrid/actions/use.pyx":47
22545
+ /* "mettagrid/actions/use.pyx":50
22437
22546
  *
22438
22547
  * cdef Generator *generator
22439
22548
  * if target._type_id == ObjectType.GeneratorT: # <<<<<<<<<<<<<<
22440
22549
  * generator = <Generator*>target
22441
22550
  * generator.r1 -= 1
22442
22551
  */
22443
- __pyx_t_1 = (__pyx_v_target->_type_id == __pyx_e_9mettagrid_7objects_GeneratorT);
22444
- if (__pyx_t_1) {
22552
+ __pyx_t_2 = (__pyx_v_target->_type_id == __pyx_e_9mettagrid_7objects_GeneratorT);
22553
+ if (__pyx_t_2) {
22445
22554
 
22446
- /* "mettagrid/actions/use.pyx":48
22555
+ /* "mettagrid/actions/use.pyx":51
22447
22556
  * cdef Generator *generator
22448
22557
  * if target._type_id == ObjectType.GeneratorT:
22449
22558
  * generator = <Generator*>target # <<<<<<<<<<<<<<
@@ -22452,7 +22561,7 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22452
22561
  */
22453
22562
  __pyx_v_generator = ((__pyx_t_9mettagrid_7objects_Generator *)__pyx_v_target);
22454
22563
 
22455
- /* "mettagrid/actions/use.pyx":49
22564
+ /* "mettagrid/actions/use.pyx":52
22456
22565
  * if target._type_id == ObjectType.GeneratorT:
22457
22566
  * generator = <Generator*>target
22458
22567
  * generator.r1 -= 1 # <<<<<<<<<<<<<<
@@ -22461,34 +22570,34 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22461
22570
  */
22462
22571
  __pyx_v_generator->r1 = (__pyx_v_generator->r1 - 1);
22463
22572
 
22464
- /* "mettagrid/actions/use.pyx":50
22573
+ /* "mettagrid/actions/use.pyx":53
22465
22574
  * generator = <Generator*>target
22466
22575
  * generator.r1 -= 1
22467
22576
  * actor.update_inventory(InventoryItem.r1, 1) # <<<<<<<<<<<<<<
22468
22577
  * self.env._stats.agent_incr(actor_id, "r1.gained")
22469
22578
  * self.env._stats.game_incr("r1.harvested")
22470
22579
  */
22471
- __pyx_v_actor->update_inventory(__pyx_e_9mettagrid_7objects_r1, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 50, __pyx_L1_error)
22580
+ __pyx_v_actor->update_inventory(__pyx_e_9mettagrid_7objects_r1, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 53, __pyx_L1_error)
22472
22581
 
22473
- /* "mettagrid/actions/use.pyx":51
22582
+ /* "mettagrid/actions/use.pyx":54
22474
22583
  * generator.r1 -= 1
22475
22584
  * actor.update_inventory(InventoryItem.r1, 1)
22476
22585
  * self.env._stats.agent_incr(actor_id, "r1.gained") # <<<<<<<<<<<<<<
22477
22586
  * self.env._stats.game_incr("r1.harvested")
22478
22587
  *
22479
22588
  */
22480
- ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, ((char const *)"r1.gained")); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L1_error)
22589
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, ((char const *)"r1.gained")); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 54, __pyx_L1_error)
22481
22590
 
22482
- /* "mettagrid/actions/use.pyx":52
22591
+ /* "mettagrid/actions/use.pyx":55
22483
22592
  * actor.update_inventory(InventoryItem.r1, 1)
22484
22593
  * self.env._stats.agent_incr(actor_id, "r1.gained")
22485
22594
  * self.env._stats.game_incr("r1.harvested") # <<<<<<<<<<<<<<
22486
22595
  *
22487
22596
  * cdef Converter *converter
22488
22597
  */
22489
- ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->game_incr(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, ((char const *)"r1.harvested")); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 52, __pyx_L1_error)
22598
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->game_incr(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, ((char const *)"r1.harvested")); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 55, __pyx_L1_error)
22490
22599
 
22491
- /* "mettagrid/actions/use.pyx":47
22600
+ /* "mettagrid/actions/use.pyx":50
22492
22601
  *
22493
22602
  * cdef Generator *generator
22494
22603
  * if target._type_id == ObjectType.GeneratorT: # <<<<<<<<<<<<<<
@@ -22497,18 +22606,27 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22497
22606
  */
22498
22607
  }
22499
22608
 
22500
- /* "mettagrid/actions/use.pyx":55
22609
+ /* "mettagrid/actions/use.pyx":58
22501
22610
  *
22502
22611
  * cdef Converter *converter
22612
+ * cdef unsigned int energy_gain = 0 # <<<<<<<<<<<<<<
22613
+ * if target._type_id == ObjectType.ConverterT:
22614
+ * converter = <Converter*>target
22615
+ */
22616
+ __pyx_v_energy_gain = 0;
22617
+
22618
+ /* "mettagrid/actions/use.pyx":59
22619
+ * cdef Converter *converter
22620
+ * cdef unsigned int energy_gain = 0
22503
22621
  * if target._type_id == ObjectType.ConverterT: # <<<<<<<<<<<<<<
22504
22622
  * converter = <Converter*>target
22505
22623
  * actor.update_inventory(converter.input_resource, -1)
22506
22624
  */
22507
- __pyx_t_1 = (__pyx_v_target->_type_id == __pyx_e_9mettagrid_7objects_ConverterT);
22508
- if (__pyx_t_1) {
22625
+ __pyx_t_2 = (__pyx_v_target->_type_id == __pyx_e_9mettagrid_7objects_ConverterT);
22626
+ if (__pyx_t_2) {
22509
22627
 
22510
- /* "mettagrid/actions/use.pyx":56
22511
- * cdef Converter *converter
22628
+ /* "mettagrid/actions/use.pyx":60
22629
+ * cdef unsigned int energy_gain = 0
22512
22630
  * if target._type_id == ObjectType.ConverterT:
22513
22631
  * converter = <Converter*>target # <<<<<<<<<<<<<<
22514
22632
  * actor.update_inventory(converter.input_resource, -1)
@@ -22516,95 +22634,112 @@ static char __pyx_f_9mettagrid_7actions_3use_3Use__handle_action(struct __pyx_ob
22516
22634
  */
22517
22635
  __pyx_v_converter = ((__pyx_t_9mettagrid_7objects_Converter *)__pyx_v_target);
22518
22636
 
22519
- /* "mettagrid/actions/use.pyx":57
22637
+ /* "mettagrid/actions/use.pyx":61
22520
22638
  * if target._type_id == ObjectType.ConverterT:
22521
22639
  * converter = <Converter*>target
22522
22640
  * actor.update_inventory(converter.input_resource, -1) # <<<<<<<<<<<<<<
22523
22641
  * self.env._stats.agent_incr(actor_id, InventoryItemNames[converter.input_resource] + ".used")
22524
22642
  *
22525
22643
  */
22526
- __pyx_v_actor->update_inventory(__pyx_v_converter->input_resource, -1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 57, __pyx_L1_error)
22644
+ __pyx_v_actor->update_inventory(__pyx_v_converter->input_resource, -1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L1_error)
22527
22645
 
22528
- /* "mettagrid/actions/use.pyx":58
22646
+ /* "mettagrid/actions/use.pyx":62
22529
22647
  * converter = <Converter*>target
22530
22648
  * actor.update_inventory(converter.input_resource, -1)
22531
22649
  * self.env._stats.agent_incr(actor_id, InventoryItemNames[converter.input_resource] + ".used") # <<<<<<<<<<<<<<
22532
22650
  *
22533
22651
  * actor.update_inventory(converter.output_resource, 1)
22534
22652
  */
22535
- __pyx_t_4 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string((__pyx_v_9mettagrid_7objects_InventoryItemNames[__pyx_v_converter->input_resource])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 58, __pyx_L1_error)
22653
+ __pyx_t_4 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string((__pyx_v_9mettagrid_7objects_InventoryItemNames[__pyx_v_converter->input_resource])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 62, __pyx_L1_error)
22536
22654
  __Pyx_GOTREF(__pyx_t_4);
22537
- __pyx_t_5 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_4, __pyx_kp_u_used); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 58, __pyx_L1_error)
22655
+ __pyx_t_5 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_4, __pyx_kp_u_used); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 62, __pyx_L1_error)
22538
22656
  __Pyx_GOTREF(__pyx_t_5);
22539
22657
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22540
- __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error)
22541
- ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 58, __pyx_L1_error)
22658
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_t_5); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 62, __pyx_L1_error)
22659
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 62, __pyx_L1_error)
22542
22660
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22543
22661
 
22544
- /* "mettagrid/actions/use.pyx":60
22662
+ /* "mettagrid/actions/use.pyx":64
22545
22663
  * self.env._stats.agent_incr(actor_id, InventoryItemNames[converter.input_resource] + ".used")
22546
22664
  *
22547
22665
  * actor.update_inventory(converter.output_resource, 1) # <<<<<<<<<<<<<<
22548
- * self.env._stats.agent_incr(actor_id, InventoryItemNames[converter.input_resource] + ".gained")
22666
+ * self.env._stats.agent_incr(actor_id, InventoryItemNames[converter.output_resource] + ".gained")
22549
22667
  *
22550
22668
  */
22551
- __pyx_v_actor->update_inventory(__pyx_v_converter->output_resource, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 60, __pyx_L1_error)
22669
+ __pyx_v_actor->update_inventory(__pyx_v_converter->output_resource, 1); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 64, __pyx_L1_error)
22552
22670
 
22553
- /* "mettagrid/actions/use.pyx":61
22671
+ /* "mettagrid/actions/use.pyx":65
22554
22672
  *
22555
22673
  * actor.update_inventory(converter.output_resource, 1)
22556
- * self.env._stats.agent_incr(actor_id, InventoryItemNames[converter.input_resource] + ".gained") # <<<<<<<<<<<<<<
22674
+ * self.env._stats.agent_incr(actor_id, InventoryItemNames[converter.output_resource] + ".gained") # <<<<<<<<<<<<<<
22557
22675
  *
22558
- * actor.energy += converter.output_energy
22676
+ * energy_gain = min(actor.max_energy - actor.energy, converter.output_energy)
22559
22677
  */
22560
- __pyx_t_5 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string((__pyx_v_9mettagrid_7objects_InventoryItemNames[__pyx_v_converter->input_resource])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 61, __pyx_L1_error)
22678
+ __pyx_t_5 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string((__pyx_v_9mettagrid_7objects_InventoryItemNames[__pyx_v_converter->output_resource])); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 65, __pyx_L1_error)
22561
22679
  __Pyx_GOTREF(__pyx_t_5);
22562
- __pyx_t_4 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_5, __pyx_kp_u_gained); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 61, __pyx_L1_error)
22680
+ __pyx_t_4 = __Pyx_PyUnicode_ConcatInPlace(__pyx_t_5, __pyx_kp_u_gained); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 65, __pyx_L1_error)
22563
22681
  __Pyx_GOTREF(__pyx_t_4);
22564
22682
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
22565
- __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L1_error)
22566
- ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L1_error)
22683
+ __pyx_t_6 = __Pyx_PyObject_AsString(__pyx_t_4); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L1_error)
22684
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, __pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 65, __pyx_L1_error)
22567
22685
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
22568
22686
 
22569
- /* "mettagrid/actions/use.pyx":63
22570
- * self.env._stats.agent_incr(actor_id, InventoryItemNames[converter.input_resource] + ".gained")
22571
- *
22572
- * actor.energy += converter.output_energy # <<<<<<<<<<<<<<
22573
- * self.env._stats.agent_add(actor_id, "energy.gained", converter.output_energy)
22687
+ /* "mettagrid/actions/use.pyx":67
22688
+ * self.env._stats.agent_incr(actor_id, InventoryItemNames[converter.output_resource] + ".gained")
22574
22689
  *
22690
+ * energy_gain = min(actor.max_energy - actor.energy, converter.output_energy) # <<<<<<<<<<<<<<
22691
+ * actor.energy += energy_gain
22692
+ * self.env._stats.agent_add(actor_id, "energy.gained", energy_gain)
22575
22693
  */
22576
- __pyx_v_actor->energy = (__pyx_v_actor->energy + __pyx_v_converter->output_energy);
22694
+ __pyx_t_7 = __pyx_v_converter->output_energy;
22695
+ __pyx_t_8 = (__pyx_v_actor->max_energy - __pyx_v_actor->energy);
22696
+ __pyx_t_2 = (__pyx_t_7 < __pyx_t_8);
22697
+ if (__pyx_t_2) {
22698
+ __pyx_t_9 = __pyx_t_7;
22699
+ } else {
22700
+ __pyx_t_9 = __pyx_t_8;
22701
+ }
22702
+ __pyx_v_energy_gain = __pyx_t_9;
22577
22703
 
22578
- /* "mettagrid/actions/use.pyx":64
22704
+ /* "mettagrid/actions/use.pyx":68
22579
22705
  *
22580
- * actor.energy += converter.output_energy
22581
- * self.env._stats.agent_add(actor_id, "energy.gained", converter.output_energy) # <<<<<<<<<<<<<<
22706
+ * energy_gain = min(actor.max_energy - actor.energy, converter.output_energy)
22707
+ * actor.energy += energy_gain # <<<<<<<<<<<<<<
22708
+ * self.env._stats.agent_add(actor_id, "energy.gained", energy_gain)
22582
22709
  *
22583
- * return True
22584
22710
  */
22585
- ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_add(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, ((char const *)"energy.gained"), __pyx_v_converter->output_energy); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 64, __pyx_L1_error)
22711
+ __pyx_v_actor->energy = (__pyx_v_actor->energy + __pyx_v_energy_gain);
22586
22712
 
22587
- /* "mettagrid/actions/use.pyx":55
22713
+ /* "mettagrid/actions/use.pyx":69
22714
+ * energy_gain = min(actor.max_energy - actor.energy, converter.output_energy)
22715
+ * actor.energy += energy_gain
22716
+ * self.env._stats.agent_add(actor_id, "energy.gained", energy_gain) # <<<<<<<<<<<<<<
22588
22717
  *
22718
+ * return True
22719
+ */
22720
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.__pyx_base.env->_stats->__pyx_vtab)->agent_add(__pyx_v_self->__pyx_base.__pyx_base.env->_stats, __pyx_v_actor_id, ((char const *)"energy.gained"), __pyx_v_energy_gain); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 69, __pyx_L1_error)
22721
+
22722
+ /* "mettagrid/actions/use.pyx":59
22589
22723
  * cdef Converter *converter
22724
+ * cdef unsigned int energy_gain = 0
22590
22725
  * if target._type_id == ObjectType.ConverterT: # <<<<<<<<<<<<<<
22591
22726
  * converter = <Converter*>target
22592
22727
  * actor.update_inventory(converter.input_resource, -1)
22593
22728
  */
22594
22729
  }
22595
22730
 
22596
- /* "mettagrid/actions/use.pyx":66
22597
- * self.env._stats.agent_add(actor_id, "energy.gained", converter.output_energy)
22731
+ /* "mettagrid/actions/use.pyx":71
22732
+ * self.env._stats.agent_add(actor_id, "energy.gained", energy_gain)
22598
22733
  *
22599
22734
  * return True # <<<<<<<<<<<<<<
22600
22735
  */
22601
22736
  __pyx_r = 1;
22602
22737
  goto __pyx_L0;
22603
22738
 
22604
- /* "mettagrid/actions/use.pyx":16
22605
- * MettaActionHandler.__init__(self, cfg, "use")
22739
+ /* "mettagrid/actions/use.pyx":19
22740
+ * return 0
22606
22741
  *
22607
- * cdef char _handle_action( # <<<<<<<<<<<<<<
22742
+ * cdef bint _handle_action( # <<<<<<<<<<<<<<
22608
22743
  * self,
22609
22744
  * unsigned int actor_id,
22610
22745
  */
@@ -24158,7 +24293,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
24158
24293
  __Pyx_GOTREF(__pyx_tuple__8);
24159
24294
  __Pyx_GIVEREF(__pyx_tuple__8);
24160
24295
 
24161
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
24296
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
24162
24297
  * __pyx_import_array()
24163
24298
  * except Exception:
24164
24299
  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
@@ -24169,7 +24304,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
24169
24304
  __Pyx_GOTREF(__pyx_tuple__9);
24170
24305
  __Pyx_GIVEREF(__pyx_tuple__9);
24171
24306
 
24172
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
24307
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
24173
24308
  * _import_umath()
24174
24309
  * except Exception:
24175
24310
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -24383,7 +24518,8 @@ static int __Pyx_modinit_type_init_code(void) {
24383
24518
  __pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler = (struct __pyx_vtabstruct_9mettagrid_7actions_7actions_MettaActionHandler*)__Pyx_GetVtable(__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler); if (unlikely(!__pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler)) __PYX_ERR(1, 2, __pyx_L1_error)
24384
24519
  __pyx_vtabptr_9mettagrid_7actions_3use_Use = &__pyx_vtable_9mettagrid_7actions_3use_Use;
24385
24520
  __pyx_vtable_9mettagrid_7actions_3use_Use.__pyx_base = *__pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler;
24386
- __pyx_vtable_9mettagrid_7actions_3use_Use.__pyx_base._handle_action = (char (*)(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *, unsigned int, __pyx_t_9mettagrid_7objects_Agent *, __pyx_t_10puffergrid_6action_ActionArg))__pyx_f_9mettagrid_7actions_3use_3Use__handle_action;
24521
+ __pyx_vtable_9mettagrid_7actions_3use_Use.__pyx_base.__pyx_base.max_arg = (unsigned char (*)(struct __pyx_obj_10puffergrid_6action_ActionHandler *))__pyx_f_9mettagrid_7actions_3use_3Use_max_arg;
24522
+ __pyx_vtable_9mettagrid_7actions_3use_Use.__pyx_base._handle_action = (int (*)(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *, unsigned int, __pyx_t_9mettagrid_7objects_Agent *, __pyx_t_10puffergrid_6action_ActionArg))__pyx_f_9mettagrid_7actions_3use_3Use__handle_action;
24387
24523
  #if CYTHON_USE_TYPE_SPECS
24388
24524
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error)
24389
24525
  __Pyx_GOTREF(__pyx_t_2);
@@ -24632,12 +24768,12 @@ static int __Pyx_modinit_type_import_code(void) {
24632
24768
  __pyx_ptype_10puffergrid_6action_ActionHandler = __Pyx_ImportType_3_0_11(__pyx_t_1, "puffergrid.action", "ActionHandler", sizeof(struct __pyx_obj_10puffergrid_6action_ActionHandler), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_10puffergrid_6action_ActionHandler),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_10puffergrid_6action_ActionHandler) __PYX_ERR(9, 5, __pyx_L1_error)
24633
24769
  __pyx_vtabptr_10puffergrid_6action_ActionHandler = (struct __pyx_vtabstruct_10puffergrid_6action_ActionHandler*)__Pyx_GetVtable(__pyx_ptype_10puffergrid_6action_ActionHandler); if (unlikely(!__pyx_vtabptr_10puffergrid_6action_ActionHandler)) __PYX_ERR(9, 5, __pyx_L1_error)
24634
24770
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24635
- __pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 185, __pyx_L1_error)
24771
+ __pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 193, __pyx_L1_error)
24636
24772
  __Pyx_GOTREF(__pyx_t_1);
24637
- __pyx_ptype_9mettagrid_7objects_ResetHandler = __Pyx_ImportType_3_0_11(__pyx_t_1, "mettagrid.objects", "ResetHandler", sizeof(struct __pyx_obj_9mettagrid_7objects_ResetHandler), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_9mettagrid_7objects_ResetHandler),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_9mettagrid_7objects_ResetHandler) __PYX_ERR(3, 185, __pyx_L1_error)
24638
- __pyx_vtabptr_9mettagrid_7objects_ResetHandler = (struct __pyx_vtabstruct_9mettagrid_7objects_ResetHandler*)__Pyx_GetVtable(__pyx_ptype_9mettagrid_7objects_ResetHandler); if (unlikely(!__pyx_vtabptr_9mettagrid_7objects_ResetHandler)) __PYX_ERR(3, 185, __pyx_L1_error)
24639
- __pyx_ptype_9mettagrid_7objects_MettaObservationEncoder = __Pyx_ImportType_3_0_11(__pyx_t_1, "mettagrid.objects", "MettaObservationEncoder", sizeof(struct __pyx_obj_9mettagrid_7objects_MettaObservationEncoder), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_9mettagrid_7objects_MettaObservationEncoder),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_9mettagrid_7objects_MettaObservationEncoder) __PYX_ERR(3, 194, __pyx_L1_error)
24640
- __pyx_vtabptr_9mettagrid_7objects_MettaObservationEncoder = (struct __pyx_vtabstruct_9mettagrid_7objects_MettaObservationEncoder*)__Pyx_GetVtable(__pyx_ptype_9mettagrid_7objects_MettaObservationEncoder); if (unlikely(!__pyx_vtabptr_9mettagrid_7objects_MettaObservationEncoder)) __PYX_ERR(3, 194, __pyx_L1_error)
24773
+ __pyx_ptype_9mettagrid_7objects_ResetHandler = __Pyx_ImportType_3_0_11(__pyx_t_1, "mettagrid.objects", "ResetHandler", sizeof(struct __pyx_obj_9mettagrid_7objects_ResetHandler), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_9mettagrid_7objects_ResetHandler),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_9mettagrid_7objects_ResetHandler) __PYX_ERR(3, 193, __pyx_L1_error)
24774
+ __pyx_vtabptr_9mettagrid_7objects_ResetHandler = (struct __pyx_vtabstruct_9mettagrid_7objects_ResetHandler*)__Pyx_GetVtable(__pyx_ptype_9mettagrid_7objects_ResetHandler); if (unlikely(!__pyx_vtabptr_9mettagrid_7objects_ResetHandler)) __PYX_ERR(3, 193, __pyx_L1_error)
24775
+ __pyx_ptype_9mettagrid_7objects_MettaObservationEncoder = __Pyx_ImportType_3_0_11(__pyx_t_1, "mettagrid.objects", "MettaObservationEncoder", sizeof(struct __pyx_obj_9mettagrid_7objects_MettaObservationEncoder), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_9mettagrid_7objects_MettaObservationEncoder),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_9mettagrid_7objects_MettaObservationEncoder) __PYX_ERR(3, 205, __pyx_L1_error)
24776
+ __pyx_vtabptr_9mettagrid_7objects_MettaObservationEncoder = (struct __pyx_vtabstruct_9mettagrid_7objects_MettaObservationEncoder*)__Pyx_GetVtable(__pyx_ptype_9mettagrid_7objects_MettaObservationEncoder); if (unlikely(!__pyx_vtabptr_9mettagrid_7objects_MettaObservationEncoder)) __PYX_ERR(3, 205, __pyx_L1_error)
24641
24777
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24642
24778
  __Pyx_RefNannyFinishContext();
24643
24779
  return 0;
@@ -31364,77 +31500,6 @@ raise_neg_overflow:
31364
31500
  return (unsigned short) -1;
31365
31501
  }
31366
31502
 
31367
- /* CIntToPy */
31368
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
31369
- #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31370
- #pragma GCC diagnostic push
31371
- #pragma GCC diagnostic ignored "-Wconversion"
31372
- #endif
31373
- const char neg_one = (char) -1, const_zero = (char) 0;
31374
- #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31375
- #pragma GCC diagnostic pop
31376
- #endif
31377
- const int is_unsigned = neg_one > const_zero;
31378
- if (is_unsigned) {
31379
- if (sizeof(char) < sizeof(long)) {
31380
- return PyInt_FromLong((long) value);
31381
- } else if (sizeof(char) <= sizeof(unsigned long)) {
31382
- return PyLong_FromUnsignedLong((unsigned long) value);
31383
- #ifdef HAVE_LONG_LONG
31384
- } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
31385
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
31386
- #endif
31387
- }
31388
- } else {
31389
- if (sizeof(char) <= sizeof(long)) {
31390
- return PyInt_FromLong((long) value);
31391
- #ifdef HAVE_LONG_LONG
31392
- } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
31393
- return PyLong_FromLongLong((PY_LONG_LONG) value);
31394
- #endif
31395
- }
31396
- }
31397
- {
31398
- unsigned char *bytes = (unsigned char *)&value;
31399
- #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
31400
- if (is_unsigned) {
31401
- return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
31402
- } else {
31403
- return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
31404
- }
31405
- #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
31406
- int one = 1; int little = (int)*(unsigned char *)&one;
31407
- return _PyLong_FromByteArray(bytes, sizeof(char),
31408
- little, !is_unsigned);
31409
- #else
31410
- int one = 1; int little = (int)*(unsigned char *)&one;
31411
- PyObject *from_bytes, *result = NULL;
31412
- PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
31413
- from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
31414
- if (!from_bytes) return NULL;
31415
- py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(char));
31416
- if (!py_bytes) goto limited_bad;
31417
- order_str = PyUnicode_FromString(little ? "little" : "big");
31418
- if (!order_str) goto limited_bad;
31419
- arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
31420
- if (!arg_tuple) goto limited_bad;
31421
- if (!is_unsigned) {
31422
- kwds = PyDict_New();
31423
- if (!kwds) goto limited_bad;
31424
- if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
31425
- }
31426
- result = PyObject_Call(from_bytes, arg_tuple, kwds);
31427
- limited_bad:
31428
- Py_XDECREF(kwds);
31429
- Py_XDECREF(arg_tuple);
31430
- Py_XDECREF(order_str);
31431
- Py_XDECREF(py_bytes);
31432
- Py_XDECREF(from_bytes);
31433
- return result;
31434
- #endif
31435
- }
31436
- }
31437
-
31438
31503
  /* CIntFromPy */
31439
31504
  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
31440
31505
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC