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.

Potentially problematic release.


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

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.rotate",
@@ -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
 
@@ -3749,9 +3757,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_9mettagrid_7object
3749
3757
  /* CIntFromPy.proto */
3750
3758
  static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *);
3751
3759
 
3752
- /* CIntToPy.proto */
3753
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);
3754
-
3755
3760
  /* CIntFromPy.proto */
3756
3761
  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3757
3762
 
@@ -3811,7 +3816,8 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
3811
3816
  static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
3812
3817
  static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
3813
3818
  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*/
3814
- static char __pyx_f_9mettagrid_7actions_6rotate_6Rotate__handle_action(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_6rotate_Rotate *__pyx_v_self, CYTHON_UNUSED unsigned int __pyx_v_actor_id, __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg); /* proto*/
3819
+ static unsigned char __pyx_f_9mettagrid_7actions_6rotate_6Rotate_max_arg(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_6rotate_Rotate *__pyx_v_self); /* proto*/
3820
+ static int __pyx_f_9mettagrid_7actions_6rotate_6Rotate__handle_action(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_6rotate_Rotate *__pyx_v_self, CYTHON_UNUSED unsigned int __pyx_v_actor_id, __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg); /* proto*/
3815
3821
 
3816
3822
  /* Module declarations from "libc.string" */
3817
3823
 
@@ -4025,6 +4031,7 @@ static const char __pyx_k_pyx_state[] = "__pyx_state";
4025
4031
  static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
4026
4032
  static const char __pyx_k_IndexError[] = "IndexError";
4027
4033
  static const char __pyx_k_ValueError[] = "ValueError";
4034
+ static const char __pyx_k_max_energy[] = "max_energy";
4028
4035
  static const char __pyx_k_pyx_result[] = "__pyx_result";
4029
4036
  static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
4030
4037
  static const char __pyx_k_ImportError[] = "ImportError";
@@ -4044,7 +4051,9 @@ static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
4044
4051
  static const char __pyx_k_stringsource[] = "<stringsource>";
4045
4052
  static const char __pyx_k_version_info[] = "version_info";
4046
4053
  static const char __pyx_k_class_getitem[] = "__class_getitem__";
4054
+ static const char __pyx_k_max_inventory[] = "max_inventory";
4047
4055
  static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
4056
+ static const char __pyx_k_upkeep_shield[] = "upkeep.shield";
4048
4057
  static const char __pyx_k_AssertionError[] = "AssertionError";
4049
4058
  static const char __pyx_k_initial_energy[] = "initial_energy";
4050
4059
  static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
@@ -4052,6 +4061,7 @@ static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
4052
4061
  static const char __pyx_k_collections_abc[] = "collections.abc";
4053
4062
  static const char __pyx_k_converter_ready[] = "converter:ready";
4054
4063
  static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
4064
+ static const char __pyx_k_freeze_duration[] = "freeze_duration";
4055
4065
  static const char __pyx_k_generator_ready[] = "generator:ready";
4056
4066
  static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
4057
4067
  static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
@@ -19326,7 +19336,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
19326
19336
  return __pyx_r;
19327
19337
  }
19328
19338
 
19329
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19339
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19330
19340
  *
19331
19341
  * @property
19332
19342
  * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<<
@@ -19337,7 +19347,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
19337
19347
  static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
19338
19348
  PyObject *__pyx_r;
19339
19349
 
19340
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248
19350
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248
19341
19351
  * """Returns a borrowed reference to the object owning the data/memory.
19342
19352
  * """
19343
19353
  * return PyArray_BASE(self) # <<<<<<<<<<<<<<
@@ -19347,7 +19357,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject
19347
19357
  __pyx_r = PyArray_BASE(__pyx_v_self);
19348
19358
  goto __pyx_L0;
19349
19359
 
19350
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19360
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19351
19361
  *
19352
19362
  * @property
19353
19363
  * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<<
@@ -19360,7 +19370,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject
19360
19370
  return __pyx_r;
19361
19371
  }
19362
19372
 
19363
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19373
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19364
19374
  *
19365
19375
  * @property
19366
19376
  * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
@@ -19374,7 +19384,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19374
19384
  PyArray_Descr *__pyx_t_1;
19375
19385
  __Pyx_RefNannySetupContext("descr", 1);
19376
19386
 
19377
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254
19387
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254
19378
19388
  * """Returns an owned reference to the dtype of the array.
19379
19389
  * """
19380
19390
  * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
@@ -19387,7 +19397,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19387
19397
  __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19388
19398
  goto __pyx_L0;
19389
19399
 
19390
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19400
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19391
19401
  *
19392
19402
  * @property
19393
19403
  * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
@@ -19402,7 +19412,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19402
19412
  return __pyx_r;
19403
19413
  }
19404
19414
 
19405
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19415
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19406
19416
  *
19407
19417
  * @property
19408
19418
  * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<<
@@ -19413,7 +19423,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19413
19423
  static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
19414
19424
  int __pyx_r;
19415
19425
 
19416
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260
19426
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260
19417
19427
  * """Returns the number of dimensions in the array.
19418
19428
  * """
19419
19429
  * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
@@ -19423,7 +19433,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19423
19433
  __pyx_r = PyArray_NDIM(__pyx_v_self);
19424
19434
  goto __pyx_L0;
19425
19435
 
19426
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19436
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19427
19437
  *
19428
19438
  * @property
19429
19439
  * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<<
@@ -19436,7 +19446,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19436
19446
  return __pyx_r;
19437
19447
  }
19438
19448
 
19439
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19449
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19440
19450
  *
19441
19451
  * @property
19442
19452
  * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<<
@@ -19447,7 +19457,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19447
19457
  static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
19448
19458
  npy_intp *__pyx_r;
19449
19459
 
19450
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268
19460
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268
19451
19461
  * Can return NULL for 0-dimensional arrays.
19452
19462
  * """
19453
19463
  * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
@@ -19457,7 +19467,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19457
19467
  __pyx_r = PyArray_DIMS(__pyx_v_self);
19458
19468
  goto __pyx_L0;
19459
19469
 
19460
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19470
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19461
19471
  *
19462
19472
  * @property
19463
19473
  * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<<
@@ -19470,7 +19480,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19470
19480
  return __pyx_r;
19471
19481
  }
19472
19482
 
19473
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19483
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19474
19484
  *
19475
19485
  * @property
19476
19486
  * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<<
@@ -19481,7 +19491,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19481
19491
  static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
19482
19492
  npy_intp *__pyx_r;
19483
19493
 
19484
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275
19494
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275
19485
19495
  * The number of elements matches the number of dimensions of the array (ndim).
19486
19496
  * """
19487
19497
  * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
@@ -19491,7 +19501,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19491
19501
  __pyx_r = PyArray_STRIDES(__pyx_v_self);
19492
19502
  goto __pyx_L0;
19493
19503
 
19494
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19504
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19495
19505
  *
19496
19506
  * @property
19497
19507
  * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<<
@@ -19504,7 +19514,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19504
19514
  return __pyx_r;
19505
19515
  }
19506
19516
 
19507
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19517
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19508
19518
  *
19509
19519
  * @property
19510
19520
  * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<<
@@ -19515,7 +19525,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19515
19525
  static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
19516
19526
  npy_intp __pyx_r;
19517
19527
 
19518
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281
19528
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281
19519
19529
  * """Returns the total size (in number of elements) of the array.
19520
19530
  * """
19521
19531
  * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
@@ -19525,7 +19535,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19525
19535
  __pyx_r = PyArray_SIZE(__pyx_v_self);
19526
19536
  goto __pyx_L0;
19527
19537
 
19528
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19538
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19529
19539
  *
19530
19540
  * @property
19531
19541
  * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<<
@@ -19538,7 +19548,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19538
19548
  return __pyx_r;
19539
19549
  }
19540
19550
 
19541
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19551
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19542
19552
  *
19543
19553
  * @property
19544
19554
  * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<<
@@ -19549,7 +19559,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19549
19559
  static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
19550
19560
  char *__pyx_r;
19551
19561
 
19552
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290
19562
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290
19553
19563
  * of `PyArray_DATA()` instead, which returns a 'void*'.
19554
19564
  * """
19555
19565
  * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
@@ -19559,7 +19569,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p
19559
19569
  __pyx_r = PyArray_BYTES(__pyx_v_self);
19560
19570
  goto __pyx_L0;
19561
19571
 
19562
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19572
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19563
19573
  *
19564
19574
  * @property
19565
19575
  * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<<
@@ -19572,7 +19582,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p
19572
19582
  return __pyx_r;
19573
19583
  }
19574
19584
 
19575
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19585
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19576
19586
  * ctypedef npy_cdouble complex_t
19577
19587
  *
19578
19588
  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -19589,7 +19599,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19589
19599
  int __pyx_clineno = 0;
19590
19600
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
19591
19601
 
19592
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777
19602
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777
19593
19603
  *
19594
19604
  * cdef inline object PyArray_MultiIterNew1(a):
19595
19605
  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
@@ -19603,7 +19613,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19603
19613
  __pyx_t_1 = 0;
19604
19614
  goto __pyx_L0;
19605
19615
 
19606
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19616
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19607
19617
  * ctypedef npy_cdouble complex_t
19608
19618
  *
19609
19619
  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -19622,7 +19632,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19622
19632
  return __pyx_r;
19623
19633
  }
19624
19634
 
19625
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19635
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19626
19636
  * return PyArray_MultiIterNew(1, <void*>a)
19627
19637
  *
19628
19638
  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -19639,7 +19649,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19639
19649
  int __pyx_clineno = 0;
19640
19650
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
19641
19651
 
19642
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780
19652
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780
19643
19653
  *
19644
19654
  * cdef inline object PyArray_MultiIterNew2(a, b):
19645
19655
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
@@ -19653,7 +19663,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19653
19663
  __pyx_t_1 = 0;
19654
19664
  goto __pyx_L0;
19655
19665
 
19656
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19666
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19657
19667
  * return PyArray_MultiIterNew(1, <void*>a)
19658
19668
  *
19659
19669
  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -19672,7 +19682,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19672
19682
  return __pyx_r;
19673
19683
  }
19674
19684
 
19675
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19685
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19676
19686
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19677
19687
  *
19678
19688
  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -19689,7 +19699,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19689
19699
  int __pyx_clineno = 0;
19690
19700
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
19691
19701
 
19692
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783
19702
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783
19693
19703
  *
19694
19704
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
19695
19705
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
@@ -19703,7 +19713,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19703
19713
  __pyx_t_1 = 0;
19704
19714
  goto __pyx_L0;
19705
19715
 
19706
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19716
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19707
19717
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19708
19718
  *
19709
19719
  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -19722,7 +19732,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19722
19732
  return __pyx_r;
19723
19733
  }
19724
19734
 
19725
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19735
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19726
19736
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19727
19737
  *
19728
19738
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -19739,7 +19749,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19739
19749
  int __pyx_clineno = 0;
19740
19750
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
19741
19751
 
19742
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786
19752
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786
19743
19753
  *
19744
19754
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19745
19755
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
@@ -19753,7 +19763,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19753
19763
  __pyx_t_1 = 0;
19754
19764
  goto __pyx_L0;
19755
19765
 
19756
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19766
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19757
19767
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19758
19768
  *
19759
19769
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -19772,7 +19782,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19772
19782
  return __pyx_r;
19773
19783
  }
19774
19784
 
19775
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19785
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19776
19786
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19777
19787
  *
19778
19788
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -19789,7 +19799,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19789
19799
  int __pyx_clineno = 0;
19790
19800
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
19791
19801
 
19792
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789
19802
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789
19793
19803
  *
19794
19804
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19795
19805
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
@@ -19803,7 +19813,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19803
19813
  __pyx_t_1 = 0;
19804
19814
  goto __pyx_L0;
19805
19815
 
19806
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19816
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19807
19817
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19808
19818
  *
19809
19819
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -19822,7 +19832,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19822
19832
  return __pyx_r;
19823
19833
  }
19824
19834
 
19825
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
19835
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
19826
19836
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19827
19837
  *
19828
19838
  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
@@ -19836,7 +19846,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19836
19846
  int __pyx_t_1;
19837
19847
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
19838
19848
 
19839
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
19849
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
19840
19850
  *
19841
19851
  * cdef inline tuple PyDataType_SHAPE(dtype d):
19842
19852
  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
@@ -19846,7 +19856,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19846
19856
  __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
19847
19857
  if (__pyx_t_1) {
19848
19858
 
19849
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":793
19859
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":793
19850
19860
  * cdef inline tuple PyDataType_SHAPE(dtype d):
19851
19861
  * if PyDataType_HASSUBARRAY(d):
19852
19862
  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
@@ -19858,7 +19868,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19858
19868
  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
19859
19869
  goto __pyx_L0;
19860
19870
 
19861
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
19871
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
19862
19872
  *
19863
19873
  * cdef inline tuple PyDataType_SHAPE(dtype d):
19864
19874
  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
@@ -19867,7 +19877,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19867
19877
  */
19868
19878
  }
19869
19879
 
19870
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":795
19880
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":795
19871
19881
  * return <tuple>d.subarray.shape
19872
19882
  * else:
19873
19883
  * return () # <<<<<<<<<<<<<<
@@ -19881,7 +19891,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19881
19891
  goto __pyx_L0;
19882
19892
  }
19883
19893
 
19884
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
19894
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
19885
19895
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19886
19896
  *
19887
19897
  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
@@ -19896,7 +19906,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19896
19906
  return __pyx_r;
19897
19907
  }
19898
19908
 
19899
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
19909
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
19900
19910
  * int _import_umath() except -1
19901
19911
  *
19902
19912
  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -19906,7 +19916,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19906
19916
 
19907
19917
  static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
19908
19918
 
19909
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971
19919
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971
19910
19920
  *
19911
19921
  * cdef inline void set_array_base(ndarray arr, object base):
19912
19922
  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
@@ -19915,7 +19925,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
19915
19925
  */
19916
19926
  Py_INCREF(__pyx_v_base);
19917
19927
 
19918
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972
19928
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972
19919
19929
  * cdef inline void set_array_base(ndarray arr, object base):
19920
19930
  * Py_INCREF(base) # important to do this before stealing the reference below!
19921
19931
  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
@@ -19924,7 +19934,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
19924
19934
  */
19925
19935
  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
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): # <<<<<<<<<<<<<<
@@ -19935,7 +19945,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
19935
19945
  /* function exit code */
19936
19946
  }
19937
19947
 
19938
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
19948
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
19939
19949
  * PyArray_SetBaseObject(arr, base)
19940
19950
  *
19941
19951
  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -19950,7 +19960,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19950
19960
  int __pyx_t_1;
19951
19961
  __Pyx_RefNannySetupContext("get_array_base", 1);
19952
19962
 
19953
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975
19963
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975
19954
19964
  *
19955
19965
  * cdef inline object get_array_base(ndarray arr):
19956
19966
  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
@@ -19959,7 +19969,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19959
19969
  */
19960
19970
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
19961
19971
 
19962
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
19972
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
19963
19973
  * cdef inline object get_array_base(ndarray arr):
19964
19974
  * base = PyArray_BASE(arr)
19965
19975
  * if base is NULL: # <<<<<<<<<<<<<<
@@ -19969,7 +19979,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19969
19979
  __pyx_t_1 = (__pyx_v_base == NULL);
19970
19980
  if (__pyx_t_1) {
19971
19981
 
19972
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":977
19982
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":977
19973
19983
  * base = PyArray_BASE(arr)
19974
19984
  * if base is NULL:
19975
19985
  * return None # <<<<<<<<<<<<<<
@@ -19980,7 +19990,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19980
19990
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19981
19991
  goto __pyx_L0;
19982
19992
 
19983
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
19993
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
19984
19994
  * cdef inline object get_array_base(ndarray arr):
19985
19995
  * base = PyArray_BASE(arr)
19986
19996
  * if base is NULL: # <<<<<<<<<<<<<<
@@ -19989,7 +19999,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19989
19999
  */
19990
20000
  }
19991
20001
 
19992
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":978
20002
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":978
19993
20003
  * if base is NULL:
19994
20004
  * return None
19995
20005
  * return <object>base # <<<<<<<<<<<<<<
@@ -20001,7 +20011,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20001
20011
  __pyx_r = ((PyObject *)__pyx_v_base);
20002
20012
  goto __pyx_L0;
20003
20013
 
20004
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
20014
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
20005
20015
  * PyArray_SetBaseObject(arr, base)
20006
20016
  *
20007
20017
  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -20016,7 +20026,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20016
20026
  return __pyx_r;
20017
20027
  }
20018
20028
 
20019
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20029
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20020
20030
  * # Versions of the import_* functions which are more suitable for
20021
20031
  * # Cython code.
20022
20032
  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
@@ -20040,7 +20050,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20040
20050
  int __pyx_clineno = 0;
20041
20051
  __Pyx_RefNannySetupContext("import_array", 1);
20042
20052
 
20043
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20053
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20044
20054
  * # Cython code.
20045
20055
  * cdef inline int import_array() except -1:
20046
20056
  * try: # <<<<<<<<<<<<<<
@@ -20056,7 +20066,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20056
20066
  __Pyx_XGOTREF(__pyx_t_3);
20057
20067
  /*try:*/ {
20058
20068
 
20059
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984
20069
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984
20060
20070
  * cdef inline int import_array() except -1:
20061
20071
  * try:
20062
20072
  * __pyx_import_array() # <<<<<<<<<<<<<<
@@ -20065,7 +20075,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20065
20075
  */
20066
20076
  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 984, __pyx_L3_error)
20067
20077
 
20068
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20078
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20069
20079
  * # Cython code.
20070
20080
  * cdef inline int import_array() except -1:
20071
20081
  * try: # <<<<<<<<<<<<<<
@@ -20079,7 +20089,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20079
20089
  goto __pyx_L8_try_end;
20080
20090
  __pyx_L3_error:;
20081
20091
 
20082
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985
20092
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985
20083
20093
  * try:
20084
20094
  * __pyx_import_array()
20085
20095
  * except Exception: # <<<<<<<<<<<<<<
@@ -20094,7 +20104,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20094
20104
  __Pyx_XGOTREF(__pyx_t_6);
20095
20105
  __Pyx_XGOTREF(__pyx_t_7);
20096
20106
 
20097
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
20107
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
20098
20108
  * __pyx_import_array()
20099
20109
  * except Exception:
20100
20110
  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
@@ -20109,7 +20119,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20109
20119
  }
20110
20120
  goto __pyx_L5_except_error;
20111
20121
 
20112
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20122
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20113
20123
  * # Cython code.
20114
20124
  * cdef inline int import_array() except -1:
20115
20125
  * try: # <<<<<<<<<<<<<<
@@ -20125,7 +20135,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20125
20135
  __pyx_L8_try_end:;
20126
20136
  }
20127
20137
 
20128
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20138
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20129
20139
  * # Versions of the import_* functions which are more suitable for
20130
20140
  * # Cython code.
20131
20141
  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
@@ -20148,7 +20158,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20148
20158
  return __pyx_r;
20149
20159
  }
20150
20160
 
20151
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20161
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20152
20162
  * raise ImportError("numpy.core.multiarray failed to import")
20153
20163
  *
20154
20164
  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
@@ -20172,7 +20182,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20172
20182
  int __pyx_clineno = 0;
20173
20183
  __Pyx_RefNannySetupContext("import_umath", 1);
20174
20184
 
20175
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20185
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20176
20186
  *
20177
20187
  * cdef inline int import_umath() except -1:
20178
20188
  * try: # <<<<<<<<<<<<<<
@@ -20188,7 +20198,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20188
20198
  __Pyx_XGOTREF(__pyx_t_3);
20189
20199
  /*try:*/ {
20190
20200
 
20191
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990
20201
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990
20192
20202
  * cdef inline int import_umath() except -1:
20193
20203
  * try:
20194
20204
  * _import_umath() # <<<<<<<<<<<<<<
@@ -20197,7 +20207,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20197
20207
  */
20198
20208
  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 990, __pyx_L3_error)
20199
20209
 
20200
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20210
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20201
20211
  *
20202
20212
  * cdef inline int import_umath() except -1:
20203
20213
  * try: # <<<<<<<<<<<<<<
@@ -20211,7 +20221,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20211
20221
  goto __pyx_L8_try_end;
20212
20222
  __pyx_L3_error:;
20213
20223
 
20214
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991
20224
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991
20215
20225
  * try:
20216
20226
  * _import_umath()
20217
20227
  * except Exception: # <<<<<<<<<<<<<<
@@ -20226,7 +20236,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20226
20236
  __Pyx_XGOTREF(__pyx_t_6);
20227
20237
  __Pyx_XGOTREF(__pyx_t_7);
20228
20238
 
20229
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
20239
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
20230
20240
  * _import_umath()
20231
20241
  * except Exception:
20232
20242
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -20241,7 +20251,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20241
20251
  }
20242
20252
  goto __pyx_L5_except_error;
20243
20253
 
20244
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20254
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20245
20255
  *
20246
20256
  * cdef inline int import_umath() except -1:
20247
20257
  * try: # <<<<<<<<<<<<<<
@@ -20257,7 +20267,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20257
20267
  __pyx_L8_try_end:;
20258
20268
  }
20259
20269
 
20260
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20270
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20261
20271
  * raise ImportError("numpy.core.multiarray failed to import")
20262
20272
  *
20263
20273
  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
@@ -20280,7 +20290,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20280
20290
  return __pyx_r;
20281
20291
  }
20282
20292
 
20283
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20293
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20284
20294
  * raise ImportError("numpy.core.umath failed to import")
20285
20295
  *
20286
20296
  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
@@ -20304,7 +20314,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20304
20314
  int __pyx_clineno = 0;
20305
20315
  __Pyx_RefNannySetupContext("import_ufunc", 1);
20306
20316
 
20307
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20317
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20308
20318
  *
20309
20319
  * cdef inline int import_ufunc() except -1:
20310
20320
  * try: # <<<<<<<<<<<<<<
@@ -20320,7 +20330,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20320
20330
  __Pyx_XGOTREF(__pyx_t_3);
20321
20331
  /*try:*/ {
20322
20332
 
20323
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996
20333
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996
20324
20334
  * cdef inline int import_ufunc() except -1:
20325
20335
  * try:
20326
20336
  * _import_umath() # <<<<<<<<<<<<<<
@@ -20329,7 +20339,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20329
20339
  */
20330
20340
  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 996, __pyx_L3_error)
20331
20341
 
20332
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20342
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20333
20343
  *
20334
20344
  * cdef inline int import_ufunc() except -1:
20335
20345
  * try: # <<<<<<<<<<<<<<
@@ -20343,7 +20353,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20343
20353
  goto __pyx_L8_try_end;
20344
20354
  __pyx_L3_error:;
20345
20355
 
20346
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":997
20356
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":997
20347
20357
  * try:
20348
20358
  * _import_umath()
20349
20359
  * except Exception: # <<<<<<<<<<<<<<
@@ -20358,7 +20368,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20358
20368
  __Pyx_XGOTREF(__pyx_t_6);
20359
20369
  __Pyx_XGOTREF(__pyx_t_7);
20360
20370
 
20361
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998
20371
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998
20362
20372
  * _import_umath()
20363
20373
  * except Exception:
20364
20374
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -20373,7 +20383,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20373
20383
  }
20374
20384
  goto __pyx_L5_except_error;
20375
20385
 
20376
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20386
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20377
20387
  *
20378
20388
  * cdef inline int import_ufunc() except -1:
20379
20389
  * try: # <<<<<<<<<<<<<<
@@ -20389,7 +20399,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20389
20399
  __pyx_L8_try_end:;
20390
20400
  }
20391
20401
 
20392
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20402
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20393
20403
  * raise ImportError("numpy.core.umath failed to import")
20394
20404
  *
20395
20405
  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
@@ -20412,7 +20422,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20412
20422
  return __pyx_r;
20413
20423
  }
20414
20424
 
20415
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20425
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20416
20426
  *
20417
20427
  *
20418
20428
  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
@@ -20423,7 +20433,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20423
20433
  static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
20424
20434
  int __pyx_r;
20425
20435
 
20426
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013
20436
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013
20427
20437
  * bool
20428
20438
  * """
20429
20439
  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
@@ -20433,7 +20443,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20433
20443
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
20434
20444
  goto __pyx_L0;
20435
20445
 
20436
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20446
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20437
20447
  *
20438
20448
  *
20439
20449
  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
@@ -20446,7 +20456,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20446
20456
  return __pyx_r;
20447
20457
  }
20448
20458
 
20449
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20459
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20450
20460
  *
20451
20461
  *
20452
20462
  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
@@ -20457,7 +20467,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20457
20467
  static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
20458
20468
  int __pyx_r;
20459
20469
 
20460
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028
20470
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028
20461
20471
  * bool
20462
20472
  * """
20463
20473
  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
@@ -20467,7 +20477,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20467
20477
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
20468
20478
  goto __pyx_L0;
20469
20479
 
20470
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20480
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20471
20481
  *
20472
20482
  *
20473
20483
  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
@@ -20480,7 +20490,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20480
20490
  return __pyx_r;
20481
20491
  }
20482
20492
 
20483
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20493
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20484
20494
  *
20485
20495
  *
20486
20496
  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20491,7 +20501,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20491
20501
  static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
20492
20502
  npy_datetime __pyx_r;
20493
20503
 
20494
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038
20504
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038
20495
20505
  * also needed. That can be found using `get_datetime64_unit`.
20496
20506
  * """
20497
20507
  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
@@ -20501,7 +20511,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20501
20511
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
20502
20512
  goto __pyx_L0;
20503
20513
 
20504
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20514
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20505
20515
  *
20506
20516
  *
20507
20517
  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20514,7 +20524,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20514
20524
  return __pyx_r;
20515
20525
  }
20516
20526
 
20517
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20527
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20518
20528
  *
20519
20529
  *
20520
20530
  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20525,7 +20535,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20525
20535
  static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
20526
20536
  npy_timedelta __pyx_r;
20527
20537
 
20528
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045
20538
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045
20529
20539
  * returns the int64 value underlying scalar numpy timedelta64 object
20530
20540
  * """
20531
20541
  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
@@ -20535,7 +20545,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20535
20545
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
20536
20546
  goto __pyx_L0;
20537
20547
 
20538
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20548
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20539
20549
  *
20540
20550
  *
20541
20551
  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20548,7 +20558,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20548
20558
  return __pyx_r;
20549
20559
  }
20550
20560
 
20551
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20561
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20552
20562
  *
20553
20563
  *
20554
20564
  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20559,7 +20569,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20559
20569
  static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
20560
20570
  NPY_DATETIMEUNIT __pyx_r;
20561
20571
 
20562
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1052
20572
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1052
20563
20573
  * returns the unit part of the dtype for a numpy datetime64 object.
20564
20574
  * """
20565
20575
  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
@@ -20567,7 +20577,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20567
20577
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
20568
20578
  goto __pyx_L0;
20569
20579
 
20570
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20580
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20571
20581
  *
20572
20582
  *
20573
20583
  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20580,7 +20590,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20580
20590
  return __pyx_r;
20581
20591
  }
20582
20592
 
20583
- /* "mettagrid/objects.pxd":24
20593
+ /* "mettagrid/objects.pxd":25
20584
20594
  * unsigned int hp
20585
20595
  *
20586
20596
  * inline void init_mo(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20590,16 +20600,16 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20590
20600
 
20591
20601
  void __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
20592
20602
 
20593
- /* "mettagrid/objects.pxd":25
20603
+ /* "mettagrid/objects.pxd":26
20594
20604
  *
20595
20605
  * inline void init_mo(ObjectConfig cfg):
20596
20606
  * this.hp = cfg[b"hp"] # <<<<<<<<<<<<<<
20597
20607
  *
20598
- * inline char usable(const Agent *actor):
20608
+ * inline bint usable(const Agent *actor):
20599
20609
  */
20600
20610
  this->hp = (__pyx_v_cfg[__pyx_k_hp]);
20601
20611
 
20602
- /* "mettagrid/objects.pxd":24
20612
+ /* "mettagrid/objects.pxd":25
20603
20613
  * unsigned int hp
20604
20614
  *
20605
20615
  * inline void init_mo(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20610,54 +20620,20 @@ void __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_t_9mettagrid_7object
20610
20620
  /* function exit code */
20611
20621
  }
20612
20622
 
20613
- /* "mettagrid/objects.pxd":27
20623
+ /* "mettagrid/objects.pxd":28
20614
20624
  * this.hp = cfg[b"hp"]
20615
20625
  *
20616
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20626
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20617
20627
  * return False
20618
20628
  *
20619
20629
  */
20620
20630
 
20621
- char __pyx_t_9mettagrid_7objects_MettaObject::usable(CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20622
- char __pyx_r;
20623
-
20624
- /* "mettagrid/objects.pxd":28
20625
- *
20626
- * inline char usable(const Agent *actor):
20627
- * return False # <<<<<<<<<<<<<<
20628
- *
20629
- * inline char attackable():
20630
- */
20631
- __pyx_r = 0;
20632
- goto __pyx_L0;
20633
-
20634
- /* "mettagrid/objects.pxd":27
20635
- * this.hp = cfg[b"hp"]
20636
- *
20637
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20638
- * return False
20639
- *
20640
- */
20641
-
20642
- /* function exit code */
20643
- __pyx_L0:;
20644
- return __pyx_r;
20645
- }
20646
-
20647
- /* "mettagrid/objects.pxd":30
20648
- * return False
20649
- *
20650
- * inline char attackable(): # <<<<<<<<<<<<<<
20651
- * return False
20652
- *
20653
- */
20654
-
20655
- char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20656
- char __pyx_r;
20631
+ int __pyx_t_9mettagrid_7objects_MettaObject::usable(CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20632
+ int __pyx_r;
20657
20633
 
20658
- /* "mettagrid/objects.pxd":31
20634
+ /* "mettagrid/objects.pxd":29
20659
20635
  *
20660
- * inline char attackable():
20636
+ * inline bint usable(const Agent *actor):
20661
20637
  * return False # <<<<<<<<<<<<<<
20662
20638
  *
20663
20639
  * cdef cppclass Usable(MettaObject):
@@ -20665,10 +20641,10 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20665
20641
  __pyx_r = 0;
20666
20642
  goto __pyx_L0;
20667
20643
 
20668
- /* "mettagrid/objects.pxd":30
20669
- * return False
20644
+ /* "mettagrid/objects.pxd":28
20645
+ * this.hp = cfg[b"hp"]
20670
20646
  *
20671
- * inline char attackable(): # <<<<<<<<<<<<<<
20647
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20672
20648
  * return False
20673
20649
  *
20674
20650
  */
@@ -20678,7 +20654,7 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20678
20654
  return __pyx_r;
20679
20655
  }
20680
20656
 
20681
- /* "mettagrid/objects.pxd":38
20657
+ /* "mettagrid/objects.pxd":36
20682
20658
  * unsigned char ready
20683
20659
  *
20684
20660
  * inline void init_usable(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20688,7 +20664,7 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20688
20664
 
20689
20665
  void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
20690
20666
 
20691
- /* "mettagrid/objects.pxd":39
20667
+ /* "mettagrid/objects.pxd":37
20692
20668
  *
20693
20669
  * inline void init_usable(ObjectConfig cfg):
20694
20670
  * this.use_cost = cfg[b"use_cost"] # <<<<<<<<<<<<<<
@@ -20697,7 +20673,7 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20697
20673
  */
20698
20674
  this->use_cost = (__pyx_v_cfg[__pyx_k_use_cost]);
20699
20675
 
20700
- /* "mettagrid/objects.pxd":40
20676
+ /* "mettagrid/objects.pxd":38
20701
20677
  * inline void init_usable(ObjectConfig cfg):
20702
20678
  * this.use_cost = cfg[b"use_cost"]
20703
20679
  * this.cooldown = cfg[b"cooldown"] # <<<<<<<<<<<<<<
@@ -20706,16 +20682,16 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20706
20682
  */
20707
20683
  this->cooldown = (__pyx_v_cfg[__pyx_k_cooldown]);
20708
20684
 
20709
- /* "mettagrid/objects.pxd":41
20685
+ /* "mettagrid/objects.pxd":39
20710
20686
  * this.use_cost = cfg[b"use_cost"]
20711
20687
  * this.cooldown = cfg[b"cooldown"]
20712
20688
  * this.ready = 1 # <<<<<<<<<<<<<<
20713
20689
  *
20714
- * inline char usable(const Agent *actor):
20690
+ * inline bint usable(const Agent *actor):
20715
20691
  */
20716
20692
  this->ready = 1;
20717
20693
 
20718
- /* "mettagrid/objects.pxd":38
20694
+ /* "mettagrid/objects.pxd":36
20719
20695
  * unsigned char ready
20720
20696
  *
20721
20697
  * inline void init_usable(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20726,29 +20702,30 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20726
20702
  /* function exit code */
20727
20703
  }
20728
20704
 
20729
- /* "mettagrid/objects.pxd":43
20705
+ /* "mettagrid/objects.pxd":41
20730
20706
  * this.ready = 1
20731
20707
  *
20732
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20708
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20733
20709
  * return this.ready and this.use_cost <= actor.energy
20734
20710
  *
20735
20711
  */
20736
20712
 
20737
- char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20738
- char __pyx_r;
20739
- char __pyx_t_1;
20713
+ int __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20714
+ int __pyx_r;
20715
+ int __pyx_t_1;
20740
20716
  int __pyx_t_2;
20741
20717
 
20742
- /* "mettagrid/objects.pxd":44
20718
+ /* "mettagrid/objects.pxd":42
20743
20719
  *
20744
- * inline char usable(const Agent *actor):
20720
+ * inline bint usable(const Agent *actor):
20745
20721
  * return this.ready and this.use_cost <= actor.energy # <<<<<<<<<<<<<<
20746
20722
  *
20747
20723
  * cdef enum ObjectType:
20748
20724
  */
20749
- if (this->ready) {
20725
+ __pyx_t_2 = (this->ready != 0);
20726
+ if (__pyx_t_2) {
20750
20727
  } else {
20751
- __pyx_t_1 = this->ready;
20728
+ __pyx_t_1 = __pyx_t_2;
20752
20729
  goto __pyx_L3_bool_binop_done;
20753
20730
  }
20754
20731
  __pyx_t_2 = (this->use_cost <= __pyx_v_actor->energy);
@@ -20757,10 +20734,10 @@ char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agen
20757
20734
  __pyx_r = __pyx_t_1;
20758
20735
  goto __pyx_L0;
20759
20736
 
20760
- /* "mettagrid/objects.pxd":43
20737
+ /* "mettagrid/objects.pxd":41
20761
20738
  * this.ready = 1
20762
20739
  *
20763
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20740
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20764
20741
  * return this.ready and this.use_cost <= actor.energy
20765
20742
  *
20766
20743
  */
@@ -20770,8 +20747,8 @@ char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agen
20770
20747
  return __pyx_r;
20771
20748
  }
20772
20749
 
20773
- /* "mettagrid/objects.pxd":72
20774
- * vector[unsigned short] inventory
20750
+ /* "mettagrid/objects.pxd":74
20751
+ * unsigned char max_energy
20775
20752
  *
20776
20753
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
20777
20754
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
@@ -20783,67 +20760,103 @@ void __pyx_t_9mettagrid_7objects_Agent::__pyx_f___init__Agent(GridCoord __pyx_v_
20783
20760
  const char *__pyx_filename = NULL;
20784
20761
  int __pyx_clineno = 0;
20785
20762
 
20786
- /* "mettagrid/objects.pxd":73
20763
+ /* "mettagrid/objects.pxd":75
20787
20764
  *
20788
20765
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg):
20789
20766
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer)) # <<<<<<<<<<<<<<
20790
20767
  * MettaObject.init_mo(cfg)
20791
- * this.frozen = False
20768
+ * this.frozen = 0
20792
20769
  */
20793
20770
  GridObject::init(__pyx_e_9mettagrid_7objects_AgentT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Agent_Layer));
20794
20771
 
20795
- /* "mettagrid/objects.pxd":74
20772
+ /* "mettagrid/objects.pxd":76
20796
20773
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg):
20797
20774
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
20798
20775
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
20799
- * this.frozen = False
20800
- * this.energy = cfg[b"initial_energy"]
20776
+ * this.frozen = 0
20777
+ * this.freeze_duration = cfg[b"freeze_duration"]
20801
20778
  */
20802
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 74, __pyx_L1_error)
20779
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 76, __pyx_L1_error)
20803
20780
 
20804
- /* "mettagrid/objects.pxd":75
20781
+ /* "mettagrid/objects.pxd":77
20805
20782
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
20806
20783
  * MettaObject.init_mo(cfg)
20807
- * this.frozen = False # <<<<<<<<<<<<<<
20784
+ * this.frozen = 0 # <<<<<<<<<<<<<<
20785
+ * this.freeze_duration = cfg[b"freeze_duration"]
20808
20786
  * this.energy = cfg[b"initial_energy"]
20809
- * this.orientation = 0
20810
20787
  */
20811
20788
  this->frozen = 0;
20812
20789
 
20813
- /* "mettagrid/objects.pxd":76
20790
+ /* "mettagrid/objects.pxd":78
20814
20791
  * MettaObject.init_mo(cfg)
20815
- * this.frozen = False
20792
+ * this.frozen = 0
20793
+ * this.freeze_duration = cfg[b"freeze_duration"] # <<<<<<<<<<<<<<
20794
+ * this.energy = cfg[b"initial_energy"]
20795
+ * this.max_energy = cfg[b"max_energy"]
20796
+ */
20797
+ this->freeze_duration = (__pyx_v_cfg[__pyx_k_freeze_duration]);
20798
+
20799
+ /* "mettagrid/objects.pxd":79
20800
+ * this.frozen = 0
20801
+ * this.freeze_duration = cfg[b"freeze_duration"]
20816
20802
  * this.energy = cfg[b"initial_energy"] # <<<<<<<<<<<<<<
20817
- * this.orientation = 0
20818
- * this.inventory.resize(InventoryItem.InventoryCount)
20803
+ * this.max_energy = cfg[b"max_energy"]
20804
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20819
20805
  */
20820
20806
  this->energy = (__pyx_v_cfg[__pyx_k_initial_energy]);
20821
20807
 
20822
- /* "mettagrid/objects.pxd":77
20823
- * this.frozen = False
20808
+ /* "mettagrid/objects.pxd":80
20809
+ * this.freeze_duration = cfg[b"freeze_duration"]
20810
+ * this.energy = cfg[b"initial_energy"]
20811
+ * this.max_energy = cfg[b"max_energy"] # <<<<<<<<<<<<<<
20812
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20813
+ * this.orientation = 0
20814
+ */
20815
+ this->max_energy = (__pyx_v_cfg[__pyx_k_max_energy]);
20816
+
20817
+ /* "mettagrid/objects.pxd":81
20824
20818
  * this.energy = cfg[b"initial_energy"]
20819
+ * this.max_energy = cfg[b"max_energy"]
20820
+ * this.shield_upkeep = cfg[b"upkeep.shield"] # <<<<<<<<<<<<<<
20821
+ * this.orientation = 0
20822
+ * this.inventory.resize(InventoryItem.InventoryCount)
20823
+ */
20824
+ this->shield_upkeep = (__pyx_v_cfg[__pyx_k_upkeep_shield]);
20825
+
20826
+ /* "mettagrid/objects.pxd":82
20827
+ * this.max_energy = cfg[b"max_energy"]
20828
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20825
20829
  * this.orientation = 0 # <<<<<<<<<<<<<<
20826
20830
  * this.inventory.resize(InventoryItem.InventoryCount)
20827
- *
20831
+ * this.max_items = cfg[b"max_inventory"]
20828
20832
  */
20829
20833
  this->orientation = 0;
20830
20834
 
20831
- /* "mettagrid/objects.pxd":78
20832
- * this.energy = cfg[b"initial_energy"]
20835
+ /* "mettagrid/objects.pxd":83
20836
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20833
20837
  * this.orientation = 0
20834
20838
  * this.inventory.resize(InventoryItem.InventoryCount) # <<<<<<<<<<<<<<
20839
+ * this.max_items = cfg[b"max_inventory"]
20835
20840
  *
20836
- * inline void update_inventory(InventoryItem item, short amount):
20837
20841
  */
20838
20842
  try {
20839
20843
  this->inventory.resize(__pyx_e_9mettagrid_7objects_InventoryCount);
20840
20844
  } catch(...) {
20841
20845
  __Pyx_CppExn2PyErr();
20842
- __PYX_ERR(3, 78, __pyx_L1_error)
20846
+ __PYX_ERR(3, 83, __pyx_L1_error)
20843
20847
  }
20844
20848
 
20845
- /* "mettagrid/objects.pxd":72
20846
- * vector[unsigned short] inventory
20849
+ /* "mettagrid/objects.pxd":84
20850
+ * this.orientation = 0
20851
+ * this.inventory.resize(InventoryItem.InventoryCount)
20852
+ * this.max_items = cfg[b"max_inventory"] # <<<<<<<<<<<<<<
20853
+ *
20854
+ * inline void update_inventory(InventoryItem item, short amount):
20855
+ */
20856
+ this->max_items = (__pyx_v_cfg[__pyx_k_max_inventory]);
20857
+
20858
+ /* "mettagrid/objects.pxd":74
20859
+ * unsigned char max_energy
20847
20860
  *
20848
20861
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
20849
20862
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
@@ -20857,40 +20870,71 @@ void __pyx_t_9mettagrid_7objects_Agent::__pyx_f___init__Agent(GridCoord __pyx_v_
20857
20870
  __pyx_L0:;
20858
20871
  }
20859
20872
 
20860
- /* "mettagrid/objects.pxd":80
20861
- * this.inventory.resize(InventoryItem.InventoryCount)
20873
+ /* "mettagrid/objects.pxd":86
20874
+ * this.max_items = cfg[b"max_inventory"]
20862
20875
  *
20863
20876
  * inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
20864
20877
  * this.inventory[<InventoryItem>item] += amount
20865
- *
20878
+ * if this.inventory[<InventoryItem>item] > this.max_items:
20866
20879
  */
20867
20880
 
20868
20881
  void __pyx_t_9mettagrid_7objects_Agent::update_inventory(enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_v_item, short __pyx_v_amount) {
20869
20882
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_1;
20883
+ int __pyx_t_2;
20884
+ unsigned char __pyx_t_3;
20870
20885
 
20871
- /* "mettagrid/objects.pxd":81
20886
+ /* "mettagrid/objects.pxd":87
20872
20887
  *
20873
20888
  * inline void update_inventory(InventoryItem item, short amount):
20874
20889
  * this.inventory[<InventoryItem>item] += amount # <<<<<<<<<<<<<<
20875
- *
20876
- * inline void obs(ObsType[:] obs):
20890
+ * if this.inventory[<InventoryItem>item] > this.max_items:
20891
+ * this.inventory[<InventoryItem>item] = this.max_items
20877
20892
  */
20878
20893
  __pyx_t_1 = ((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item);
20879
20894
  (this->inventory[__pyx_t_1]) = ((this->inventory[__pyx_t_1]) + __pyx_v_amount);
20880
20895
 
20881
- /* "mettagrid/objects.pxd":80
20882
- * this.inventory.resize(InventoryItem.InventoryCount)
20896
+ /* "mettagrid/objects.pxd":88
20897
+ * inline void update_inventory(InventoryItem item, short amount):
20898
+ * this.inventory[<InventoryItem>item] += amount
20899
+ * if this.inventory[<InventoryItem>item] > this.max_items: # <<<<<<<<<<<<<<
20900
+ * this.inventory[<InventoryItem>item] = this.max_items
20883
20901
  *
20884
- * inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
20902
+ */
20903
+ __pyx_t_2 = ((this->inventory[((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item)]) > this->max_items);
20904
+ if (__pyx_t_2) {
20905
+
20906
+ /* "mettagrid/objects.pxd":89
20907
+ * this.inventory[<InventoryItem>item] += amount
20908
+ * if this.inventory[<InventoryItem>item] > this.max_items:
20909
+ * this.inventory[<InventoryItem>item] = this.max_items # <<<<<<<<<<<<<<
20910
+ *
20911
+ * inline void obs(ObsType[:] obs):
20912
+ */
20913
+ __pyx_t_3 = this->max_items;
20914
+ (this->inventory[((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item)]) = __pyx_t_3;
20915
+
20916
+ /* "mettagrid/objects.pxd":88
20917
+ * inline void update_inventory(InventoryItem item, short amount):
20885
20918
  * this.inventory[<InventoryItem>item] += amount
20919
+ * if this.inventory[<InventoryItem>item] > this.max_items: # <<<<<<<<<<<<<<
20920
+ * this.inventory[<InventoryItem>item] = this.max_items
20886
20921
  *
20922
+ */
20923
+ }
20924
+
20925
+ /* "mettagrid/objects.pxd":86
20926
+ * this.max_items = cfg[b"max_inventory"]
20927
+ *
20928
+ * inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
20929
+ * this.inventory[<InventoryItem>item] += amount
20930
+ * if this.inventory[<InventoryItem>item] > this.max_items:
20887
20931
  */
20888
20932
 
20889
20933
  /* function exit code */
20890
20934
  }
20891
20935
 
20892
- /* "mettagrid/objects.pxd":83
20893
- * this.inventory[<InventoryItem>item] += amount
20936
+ /* "mettagrid/objects.pxd":91
20937
+ * this.inventory[<InventoryItem>item] = this.max_items
20894
20938
  *
20895
20939
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
20896
20940
  * obs[0] = 1
@@ -20902,12 +20946,12 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20902
20946
  unsigned short __pyx_v_i;
20903
20947
  Py_ssize_t __pyx_t_1;
20904
20948
  unsigned int __pyx_t_2;
20905
- char __pyx_t_3;
20949
+ unsigned char __pyx_t_3;
20906
20950
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_4;
20907
20951
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_5;
20908
20952
  unsigned short __pyx_t_6;
20909
20953
 
20910
- /* "mettagrid/objects.pxd":84
20954
+ /* "mettagrid/objects.pxd":92
20911
20955
  *
20912
20956
  * inline void obs(ObsType[:] obs):
20913
20957
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -20917,7 +20961,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20917
20961
  __pyx_t_1 = 0;
20918
20962
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
20919
20963
 
20920
- /* "mettagrid/objects.pxd":85
20964
+ /* "mettagrid/objects.pxd":93
20921
20965
  * inline void obs(ObsType[:] obs):
20922
20966
  * obs[0] = 1
20923
20967
  * obs[1] = this.hp # <<<<<<<<<<<<<<
@@ -20928,29 +20972,29 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20928
20972
  __pyx_t_1 = 1;
20929
20973
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
20930
20974
 
20931
- /* "mettagrid/objects.pxd":86
20975
+ /* "mettagrid/objects.pxd":94
20932
20976
  * obs[0] = 1
20933
20977
  * obs[1] = this.hp
20934
20978
  * obs[2] = this.frozen # <<<<<<<<<<<<<<
20935
20979
  * obs[3] = this.energy
20936
20980
  * obs[4] = this.orientation
20937
20981
  */
20938
- __pyx_t_3 = this->frozen;
20982
+ __pyx_t_2 = this->frozen;
20939
20983
  __pyx_t_1 = 2;
20940
- *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
20984
+ *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
20941
20985
 
20942
- /* "mettagrid/objects.pxd":87
20986
+ /* "mettagrid/objects.pxd":95
20943
20987
  * obs[1] = this.hp
20944
20988
  * obs[2] = this.frozen
20945
20989
  * obs[3] = this.energy # <<<<<<<<<<<<<<
20946
20990
  * obs[4] = this.orientation
20947
20991
  * obs[5] = this.shield
20948
20992
  */
20949
- __pyx_t_2 = this->energy;
20993
+ __pyx_t_3 = this->energy;
20950
20994
  __pyx_t_1 = 3;
20951
- *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
20995
+ *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
20952
20996
 
20953
- /* "mettagrid/objects.pxd":88
20997
+ /* "mettagrid/objects.pxd":96
20954
20998
  * obs[2] = this.frozen
20955
20999
  * obs[3] = this.energy
20956
21000
  * obs[4] = this.orientation # <<<<<<<<<<<<<<
@@ -20961,7 +21005,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20961
21005
  __pyx_t_1 = 4;
20962
21006
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
20963
21007
 
20964
- /* "mettagrid/objects.pxd":89
21008
+ /* "mettagrid/objects.pxd":97
20965
21009
  * obs[3] = this.energy
20966
21010
  * obs[4] = this.orientation
20967
21011
  * obs[5] = this.shield # <<<<<<<<<<<<<<
@@ -20972,7 +21016,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20972
21016
  __pyx_t_1 = 5;
20973
21017
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
20974
21018
 
20975
- /* "mettagrid/objects.pxd":91
21019
+ /* "mettagrid/objects.pxd":99
20976
21020
  * obs[5] = this.shield
20977
21021
  *
20978
21022
  * cdef unsigned short idx = 6 # <<<<<<<<<<<<<<
@@ -20981,7 +21025,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20981
21025
  */
20982
21026
  __pyx_v_idx = 6;
20983
21027
 
20984
- /* "mettagrid/objects.pxd":93
21028
+ /* "mettagrid/objects.pxd":101
20985
21029
  * cdef unsigned short idx = 6
20986
21030
  * cdef unsigned short i
20987
21031
  * for i in range(InventoryItem.InventoryCount): # <<<<<<<<<<<<<<
@@ -20993,7 +21037,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20993
21037
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20994
21038
  __pyx_v_i = __pyx_t_6;
20995
21039
 
20996
- /* "mettagrid/objects.pxd":94
21040
+ /* "mettagrid/objects.pxd":102
20997
21041
  * cdef unsigned short i
20998
21042
  * for i in range(InventoryItem.InventoryCount):
20999
21043
  * obs[idx + i] = this.inventory[i] # <<<<<<<<<<<<<<
@@ -21004,8 +21048,8 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21004
21048
  *((__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]);
21005
21049
  }
21006
21050
 
21007
- /* "mettagrid/objects.pxd":83
21008
- * this.inventory[<InventoryItem>item] += amount
21051
+ /* "mettagrid/objects.pxd":91
21052
+ * this.inventory[<InventoryItem>item] = this.max_items
21009
21053
  *
21010
21054
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
21011
21055
  * obs[0] = 1
@@ -21015,7 +21059,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21015
21059
  /* function exit code */
21016
21060
  }
21017
21061
 
21018
- /* "mettagrid/objects.pxd":97
21062
+ /* "mettagrid/objects.pxd":105
21019
21063
  *
21020
21064
  * @staticmethod
21021
21065
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21039,46 +21083,46 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21039
21083
  int __pyx_clineno = 0;
21040
21084
  __Pyx_RefNannySetupContext("feature_names", 1);
21041
21085
 
21042
- /* "mettagrid/objects.pxd":98
21086
+ /* "mettagrid/objects.pxd":106
21043
21087
  * @staticmethod
21044
21088
  * inline vector[string] feature_names():
21045
21089
  * return [ # <<<<<<<<<<<<<<
21046
21090
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21047
21091
  * "agent:shield"
21048
21092
  */
21049
- __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 98, __pyx_L1_error)
21093
+ __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 106, __pyx_L1_error)
21050
21094
  __Pyx_GOTREF(__pyx_t_1);
21051
21095
  __Pyx_INCREF(__pyx_n_u_agent);
21052
21096
  __Pyx_GIVEREF(__pyx_n_u_agent);
21053
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_agent)) __PYX_ERR(3, 98, __pyx_L1_error);
21097
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_agent)) __PYX_ERR(3, 106, __pyx_L1_error);
21054
21098
  __Pyx_INCREF(__pyx_kp_u_agent_hp);
21055
21099
  __Pyx_GIVEREF(__pyx_kp_u_agent_hp);
21056
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_agent_hp)) __PYX_ERR(3, 98, __pyx_L1_error);
21100
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_agent_hp)) __PYX_ERR(3, 106, __pyx_L1_error);
21057
21101
  __Pyx_INCREF(__pyx_kp_u_agent_frozen);
21058
21102
  __Pyx_GIVEREF(__pyx_kp_u_agent_frozen);
21059
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_agent_frozen)) __PYX_ERR(3, 98, __pyx_L1_error);
21103
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_agent_frozen)) __PYX_ERR(3, 106, __pyx_L1_error);
21060
21104
  __Pyx_INCREF(__pyx_kp_u_agent_energy);
21061
21105
  __Pyx_GIVEREF(__pyx_kp_u_agent_energy);
21062
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_agent_energy)) __PYX_ERR(3, 98, __pyx_L1_error);
21106
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_agent_energy)) __PYX_ERR(3, 106, __pyx_L1_error);
21063
21107
  __Pyx_INCREF(__pyx_kp_u_agent_orientation);
21064
21108
  __Pyx_GIVEREF(__pyx_kp_u_agent_orientation);
21065
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_agent_orientation)) __PYX_ERR(3, 98, __pyx_L1_error);
21109
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_agent_orientation)) __PYX_ERR(3, 106, __pyx_L1_error);
21066
21110
  __Pyx_INCREF(__pyx_kp_u_agent_shield);
21067
21111
  __Pyx_GIVEREF(__pyx_kp_u_agent_shield);
21068
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_agent_shield)) __PYX_ERR(3, 98, __pyx_L1_error);
21112
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_agent_shield)) __PYX_ERR(3, 106, __pyx_L1_error);
21069
21113
  { /* enter inner scope */
21070
21114
 
21071
- /* "mettagrid/objects.pxd":101
21115
+ /* "mettagrid/objects.pxd":109
21072
21116
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21073
21117
  * "agent:shield"
21074
21118
  * ] + [ # <<<<<<<<<<<<<<
21075
21119
  * "agent:inv:" + n for n in InventoryItemNames]
21076
21120
  *
21077
21121
  */
21078
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 101, __pyx_L1_error)
21122
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 109, __pyx_L1_error)
21079
21123
  __Pyx_GOTREF(__pyx_t_2);
21080
21124
 
21081
- /* "mettagrid/objects.pxd":102
21125
+ /* "mettagrid/objects.pxd":110
21082
21126
  * "agent:shield"
21083
21127
  * ] + [
21084
21128
  * "agent:inv:" + n for n in InventoryItemNames] # <<<<<<<<<<<<<<
@@ -21091,33 +21135,33 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21091
21135
  __pyx_t_4 = *__pyx_t_3;
21092
21136
  ++__pyx_t_3;
21093
21137
  __pyx_7genexpr__pyx_v_n = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);
21094
- __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)
21138
+ __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)
21095
21139
  __Pyx_GOTREF(__pyx_t_5);
21096
- __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)
21140
+ __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)
21097
21141
  __Pyx_GOTREF(__pyx_t_6);
21098
21142
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21099
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 101, __pyx_L1_error)
21143
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 109, __pyx_L1_error)
21100
21144
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21101
21145
  }
21102
21146
  } /* exit inner scope */
21103
21147
 
21104
- /* "mettagrid/objects.pxd":101
21148
+ /* "mettagrid/objects.pxd":109
21105
21149
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21106
21150
  * "agent:shield"
21107
21151
  * ] + [ # <<<<<<<<<<<<<<
21108
21152
  * "agent:inv:" + n for n in InventoryItemNames]
21109
21153
  *
21110
21154
  */
21111
- __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 101, __pyx_L1_error)
21155
+ __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 109, __pyx_L1_error)
21112
21156
  __Pyx_GOTREF(__pyx_t_6);
21113
21157
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21114
21158
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21115
- __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)
21159
+ __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)
21116
21160
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21117
21161
  __pyx_r = __pyx_t_7;
21118
21162
  goto __pyx_L0;
21119
21163
 
21120
- /* "mettagrid/objects.pxd":97
21164
+ /* "mettagrid/objects.pxd":105
21121
21165
  *
21122
21166
  * @staticmethod
21123
21167
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21138,7 +21182,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21138
21182
  return __pyx_r;
21139
21183
  }
21140
21184
 
21141
- /* "mettagrid/objects.pxd":105
21185
+ /* "mettagrid/objects.pxd":113
21142
21186
  *
21143
21187
  * cdef cppclass Wall(MettaObject):
21144
21188
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21151,7 +21195,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21151
21195
  const char *__pyx_filename = NULL;
21152
21196
  int __pyx_clineno = 0;
21153
21197
 
21154
- /* "mettagrid/objects.pxd":106
21198
+ /* "mettagrid/objects.pxd":114
21155
21199
  * cdef cppclass Wall(MettaObject):
21156
21200
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg):
21157
21201
  * GridObject.init(ObjectType.WallT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21160,16 +21204,16 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21160
21204
  */
21161
21205
  GridObject::init(__pyx_e_9mettagrid_7objects_WallT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21162
21206
 
21163
- /* "mettagrid/objects.pxd":107
21207
+ /* "mettagrid/objects.pxd":115
21164
21208
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg):
21165
21209
  * GridObject.init(ObjectType.WallT, GridLocation(r, c, GridLayer.Object_Layer))
21166
21210
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21167
21211
  *
21168
21212
  * inline void obs(ObsType[:] obs):
21169
21213
  */
21170
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 107, __pyx_L1_error)
21214
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 115, __pyx_L1_error)
21171
21215
 
21172
- /* "mettagrid/objects.pxd":105
21216
+ /* "mettagrid/objects.pxd":113
21173
21217
  *
21174
21218
  * cdef cppclass Wall(MettaObject):
21175
21219
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21184,7 +21228,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21184
21228
  __pyx_L0:;
21185
21229
  }
21186
21230
 
21187
- /* "mettagrid/objects.pxd":109
21231
+ /* "mettagrid/objects.pxd":117
21188
21232
  * MettaObject.init_mo(cfg)
21189
21233
  *
21190
21234
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21195,7 +21239,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21195
21239
  void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21196
21240
  Py_ssize_t __pyx_t_1;
21197
21241
 
21198
- /* "mettagrid/objects.pxd":110
21242
+ /* "mettagrid/objects.pxd":118
21199
21243
  *
21200
21244
  * inline void obs(ObsType[:] obs):
21201
21245
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21205,7 +21249,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21205
21249
  __pyx_t_1 = 0;
21206
21250
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21207
21251
 
21208
- /* "mettagrid/objects.pxd":111
21252
+ /* "mettagrid/objects.pxd":119
21209
21253
  * inline void obs(ObsType[:] obs):
21210
21254
  * obs[0] = 1
21211
21255
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -21215,7 +21259,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21215
21259
  __pyx_t_1 = 1;
21216
21260
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
21217
21261
 
21218
- /* "mettagrid/objects.pxd":109
21262
+ /* "mettagrid/objects.pxd":117
21219
21263
  * MettaObject.init_mo(cfg)
21220
21264
  *
21221
21265
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21226,7 +21270,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21226
21270
  /* function exit code */
21227
21271
  }
21228
21272
 
21229
- /* "mettagrid/objects.pxd":114
21273
+ /* "mettagrid/objects.pxd":122
21230
21274
  *
21231
21275
  * @staticmethod
21232
21276
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21244,27 +21288,27 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Wall::feature_names(void)
21244
21288
  int __pyx_clineno = 0;
21245
21289
  __Pyx_RefNannySetupContext("feature_names", 1);
21246
21290
 
21247
- /* "mettagrid/objects.pxd":115
21291
+ /* "mettagrid/objects.pxd":123
21248
21292
  * @staticmethod
21249
21293
  * inline vector[string] feature_names():
21250
21294
  * return ["wall", "wall:hp"] # <<<<<<<<<<<<<<
21251
21295
  *
21252
21296
  * cdef cppclass Generator(Usable):
21253
21297
  */
21254
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 115, __pyx_L1_error)
21298
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 123, __pyx_L1_error)
21255
21299
  __Pyx_GOTREF(__pyx_t_1);
21256
21300
  __Pyx_INCREF(__pyx_n_u_wall);
21257
21301
  __Pyx_GIVEREF(__pyx_n_u_wall);
21258
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_wall)) __PYX_ERR(3, 115, __pyx_L1_error);
21302
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_wall)) __PYX_ERR(3, 123, __pyx_L1_error);
21259
21303
  __Pyx_INCREF(__pyx_kp_u_wall_hp);
21260
21304
  __Pyx_GIVEREF(__pyx_kp_u_wall_hp);
21261
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_wall_hp)) __PYX_ERR(3, 115, __pyx_L1_error);
21262
- __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)
21305
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_wall_hp)) __PYX_ERR(3, 123, __pyx_L1_error);
21306
+ __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)
21263
21307
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21264
21308
  __pyx_r = __pyx_t_2;
21265
21309
  goto __pyx_L0;
21266
21310
 
21267
- /* "mettagrid/objects.pxd":114
21311
+ /* "mettagrid/objects.pxd":122
21268
21312
  *
21269
21313
  * @staticmethod
21270
21314
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21282,7 +21326,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Wall::feature_names(void)
21282
21326
  return __pyx_r;
21283
21327
  }
21284
21328
 
21285
- /* "mettagrid/objects.pxd":120
21329
+ /* "mettagrid/objects.pxd":128
21286
21330
  * unsigned int r1
21287
21331
  *
21288
21332
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21295,7 +21339,7 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21295
21339
  const char *__pyx_filename = NULL;
21296
21340
  int __pyx_clineno = 0;
21297
21341
 
21298
- /* "mettagrid/objects.pxd":121
21342
+ /* "mettagrid/objects.pxd":129
21299
21343
  *
21300
21344
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg):
21301
21345
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21304,34 +21348,34 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21304
21348
  */
21305
21349
  GridObject::init(__pyx_e_9mettagrid_7objects_GeneratorT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21306
21350
 
21307
- /* "mettagrid/objects.pxd":122
21351
+ /* "mettagrid/objects.pxd":130
21308
21352
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg):
21309
21353
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer))
21310
21354
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21311
21355
  * Usable.init_usable(cfg)
21312
21356
  * this.r1 = cfg[b"initial_resources"]
21313
21357
  */
21314
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 122, __pyx_L1_error)
21358
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 130, __pyx_L1_error)
21315
21359
 
21316
- /* "mettagrid/objects.pxd":123
21360
+ /* "mettagrid/objects.pxd":131
21317
21361
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer))
21318
21362
  * MettaObject.init_mo(cfg)
21319
21363
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
21320
21364
  * this.r1 = cfg[b"initial_resources"]
21321
21365
  *
21322
21366
  */
21323
- __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 123, __pyx_L1_error)
21367
+ __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 131, __pyx_L1_error)
21324
21368
 
21325
- /* "mettagrid/objects.pxd":124
21369
+ /* "mettagrid/objects.pxd":132
21326
21370
  * MettaObject.init_mo(cfg)
21327
21371
  * Usable.init_usable(cfg)
21328
21372
  * this.r1 = cfg[b"initial_resources"] # <<<<<<<<<<<<<<
21329
21373
  *
21330
- * inline char usable(const Agent *actor):
21374
+ * inline bint usable(const Agent *actor):
21331
21375
  */
21332
21376
  this->r1 = (__pyx_v_cfg[__pyx_k_initial_resources]);
21333
21377
 
21334
- /* "mettagrid/objects.pxd":120
21378
+ /* "mettagrid/objects.pxd":128
21335
21379
  * unsigned int r1
21336
21380
  *
21337
21381
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21346,46 +21390,45 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21346
21390
  __pyx_L0:;
21347
21391
  }
21348
21392
 
21349
- /* "mettagrid/objects.pxd":126
21393
+ /* "mettagrid/objects.pxd":134
21350
21394
  * this.r1 = cfg[b"initial_resources"]
21351
21395
  *
21352
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21396
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21353
21397
  * return Usable.usable(actor) and this.r1 > 0
21354
21398
  *
21355
21399
  */
21356
21400
 
21357
- char __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21358
- char __pyx_r;
21359
- char __pyx_t_1;
21360
- char __pyx_t_2;
21361
- int __pyx_t_3;
21401
+ int __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21402
+ int __pyx_r;
21403
+ int __pyx_t_1;
21404
+ int __pyx_t_2;
21362
21405
  int __pyx_lineno = 0;
21363
21406
  const char *__pyx_filename = NULL;
21364
21407
  int __pyx_clineno = 0;
21365
21408
 
21366
- /* "mettagrid/objects.pxd":127
21409
+ /* "mettagrid/objects.pxd":135
21367
21410
  *
21368
- * inline char usable(const Agent *actor):
21411
+ * inline bint usable(const Agent *actor):
21369
21412
  * return Usable.usable(actor) and this.r1 > 0 # <<<<<<<<<<<<<<
21370
21413
  *
21371
21414
  * inline void obs(ObsType[:] obs):
21372
21415
  */
21373
- __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)
21416
+ __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)
21374
21417
  if (__pyx_t_2) {
21375
21418
  } else {
21376
21419
  __pyx_t_1 = __pyx_t_2;
21377
21420
  goto __pyx_L3_bool_binop_done;
21378
21421
  }
21379
- __pyx_t_3 = (this->r1 > 0);
21380
- __pyx_t_1 = __pyx_t_3;
21422
+ __pyx_t_2 = (this->r1 > 0);
21423
+ __pyx_t_1 = __pyx_t_2;
21381
21424
  __pyx_L3_bool_binop_done:;
21382
21425
  __pyx_r = __pyx_t_1;
21383
21426
  goto __pyx_L0;
21384
21427
 
21385
- /* "mettagrid/objects.pxd":126
21428
+ /* "mettagrid/objects.pxd":134
21386
21429
  * this.r1 = cfg[b"initial_resources"]
21387
21430
  *
21388
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21431
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21389
21432
  * return Usable.usable(actor) and this.r1 > 0
21390
21433
  *
21391
21434
  */
@@ -21398,7 +21441,7 @@ char __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_A
21398
21441
  return __pyx_r;
21399
21442
  }
21400
21443
 
21401
- /* "mettagrid/objects.pxd":129
21444
+ /* "mettagrid/objects.pxd":137
21402
21445
  * return Usable.usable(actor) and this.r1 > 0
21403
21446
  *
21404
21447
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21411,7 +21454,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21411
21454
  unsigned int __pyx_t_2;
21412
21455
  unsigned char __pyx_t_3;
21413
21456
 
21414
- /* "mettagrid/objects.pxd":130
21457
+ /* "mettagrid/objects.pxd":138
21415
21458
  *
21416
21459
  * inline void obs(ObsType[:] obs):
21417
21460
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21421,7 +21464,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21421
21464
  __pyx_t_1 = 0;
21422
21465
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21423
21466
 
21424
- /* "mettagrid/objects.pxd":131
21467
+ /* "mettagrid/objects.pxd":139
21425
21468
  * inline void obs(ObsType[:] obs):
21426
21469
  * obs[0] = 1
21427
21470
  * obs[1] = this.hp # <<<<<<<<<<<<<<
@@ -21432,7 +21475,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21432
21475
  __pyx_t_1 = 1;
21433
21476
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21434
21477
 
21435
- /* "mettagrid/objects.pxd":132
21478
+ /* "mettagrid/objects.pxd":140
21436
21479
  * obs[0] = 1
21437
21480
  * obs[1] = this.hp
21438
21481
  * obs[2] = this.r1 # <<<<<<<<<<<<<<
@@ -21443,7 +21486,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21443
21486
  __pyx_t_1 = 2;
21444
21487
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21445
21488
 
21446
- /* "mettagrid/objects.pxd":133
21489
+ /* "mettagrid/objects.pxd":141
21447
21490
  * obs[1] = this.hp
21448
21491
  * obs[2] = this.r1
21449
21492
  * obs[3] = this.ready # <<<<<<<<<<<<<<
@@ -21454,7 +21497,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21454
21497
  __pyx_t_1 = 3;
21455
21498
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
21456
21499
 
21457
- /* "mettagrid/objects.pxd":129
21500
+ /* "mettagrid/objects.pxd":137
21458
21501
  * return Usable.usable(actor) and this.r1 > 0
21459
21502
  *
21460
21503
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21465,7 +21508,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21465
21508
  /* function exit code */
21466
21509
  }
21467
21510
 
21468
- /* "mettagrid/objects.pxd":137
21511
+ /* "mettagrid/objects.pxd":145
21469
21512
  *
21470
21513
  * @staticmethod
21471
21514
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21483,33 +21526,33 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Generator::feature_names(v
21483
21526
  int __pyx_clineno = 0;
21484
21527
  __Pyx_RefNannySetupContext("feature_names", 1);
21485
21528
 
21486
- /* "mettagrid/objects.pxd":138
21529
+ /* "mettagrid/objects.pxd":146
21487
21530
  * @staticmethod
21488
21531
  * inline vector[string] feature_names():
21489
21532
  * return ["generator", "generator:hp", "generator:r1", "generator:ready"] # <<<<<<<<<<<<<<
21490
21533
  *
21491
21534
  * cdef cppclass Converter(Usable):
21492
21535
  */
21493
- __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 138, __pyx_L1_error)
21536
+ __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 146, __pyx_L1_error)
21494
21537
  __Pyx_GOTREF(__pyx_t_1);
21495
21538
  __Pyx_INCREF(__pyx_n_u_generator);
21496
21539
  __Pyx_GIVEREF(__pyx_n_u_generator);
21497
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_generator)) __PYX_ERR(3, 138, __pyx_L1_error);
21540
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_generator)) __PYX_ERR(3, 146, __pyx_L1_error);
21498
21541
  __Pyx_INCREF(__pyx_kp_u_generator_hp);
21499
21542
  __Pyx_GIVEREF(__pyx_kp_u_generator_hp);
21500
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_generator_hp)) __PYX_ERR(3, 138, __pyx_L1_error);
21543
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_generator_hp)) __PYX_ERR(3, 146, __pyx_L1_error);
21501
21544
  __Pyx_INCREF(__pyx_kp_u_generator_r1);
21502
21545
  __Pyx_GIVEREF(__pyx_kp_u_generator_r1);
21503
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_generator_r1)) __PYX_ERR(3, 138, __pyx_L1_error);
21546
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_generator_r1)) __PYX_ERR(3, 146, __pyx_L1_error);
21504
21547
  __Pyx_INCREF(__pyx_kp_u_generator_ready);
21505
21548
  __Pyx_GIVEREF(__pyx_kp_u_generator_ready);
21506
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_generator_ready)) __PYX_ERR(3, 138, __pyx_L1_error);
21507
- __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)
21549
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_generator_ready)) __PYX_ERR(3, 146, __pyx_L1_error);
21550
+ __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)
21508
21551
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21509
21552
  __pyx_r = __pyx_t_2;
21510
21553
  goto __pyx_L0;
21511
21554
 
21512
- /* "mettagrid/objects.pxd":137
21555
+ /* "mettagrid/objects.pxd":145
21513
21556
  *
21514
21557
  * @staticmethod
21515
21558
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21527,7 +21570,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Generator::feature_names(v
21527
21570
  return __pyx_r;
21528
21571
  }
21529
21572
 
21530
- /* "mettagrid/objects.pxd":145
21573
+ /* "mettagrid/objects.pxd":153
21531
21574
  * short output_energy
21532
21575
  *
21533
21576
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21540,7 +21583,7 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21540
21583
  const char *__pyx_filename = NULL;
21541
21584
  int __pyx_clineno = 0;
21542
21585
 
21543
- /* "mettagrid/objects.pxd":146
21586
+ /* "mettagrid/objects.pxd":154
21544
21587
  *
21545
21588
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg):
21546
21589
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21549,25 +21592,25 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21549
21592
  */
21550
21593
  GridObject::init(__pyx_e_9mettagrid_7objects_ConverterT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21551
21594
 
21552
- /* "mettagrid/objects.pxd":147
21595
+ /* "mettagrid/objects.pxd":155
21553
21596
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg):
21554
21597
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer))
21555
21598
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21556
21599
  * Usable.init_usable(cfg)
21557
21600
  * this.input_resource = InventoryItem.r1
21558
21601
  */
21559
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 147, __pyx_L1_error)
21602
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 155, __pyx_L1_error)
21560
21603
 
21561
- /* "mettagrid/objects.pxd":148
21604
+ /* "mettagrid/objects.pxd":156
21562
21605
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer))
21563
21606
  * MettaObject.init_mo(cfg)
21564
21607
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
21565
21608
  * this.input_resource = InventoryItem.r1
21566
21609
  * this.output_resource = InventoryItem.r2
21567
21610
  */
21568
- __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 148, __pyx_L1_error)
21611
+ __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 156, __pyx_L1_error)
21569
21612
 
21570
- /* "mettagrid/objects.pxd":149
21613
+ /* "mettagrid/objects.pxd":157
21571
21614
  * MettaObject.init_mo(cfg)
21572
21615
  * Usable.init_usable(cfg)
21573
21616
  * this.input_resource = InventoryItem.r1 # <<<<<<<<<<<<<<
@@ -21576,7 +21619,7 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21576
21619
  */
21577
21620
  this->input_resource = __pyx_e_9mettagrid_7objects_r1;
21578
21621
 
21579
- /* "mettagrid/objects.pxd":150
21622
+ /* "mettagrid/objects.pxd":158
21580
21623
  * Usable.init_usable(cfg)
21581
21624
  * this.input_resource = InventoryItem.r1
21582
21625
  * this.output_resource = InventoryItem.r2 # <<<<<<<<<<<<<<
@@ -21585,16 +21628,16 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21585
21628
  */
21586
21629
  this->output_resource = __pyx_e_9mettagrid_7objects_r2;
21587
21630
 
21588
- /* "mettagrid/objects.pxd":151
21631
+ /* "mettagrid/objects.pxd":159
21589
21632
  * this.input_resource = InventoryItem.r1
21590
21633
  * this.output_resource = InventoryItem.r2
21591
21634
  * this.output_energy = cfg[b"energy_output.r1"] # <<<<<<<<<<<<<<
21592
21635
  *
21593
- * inline char usable(const Agent *actor):
21636
+ * inline bint usable(const Agent *actor):
21594
21637
  */
21595
21638
  this->output_energy = (__pyx_v_cfg[__pyx_k_energy_output_r1]);
21596
21639
 
21597
- /* "mettagrid/objects.pxd":145
21640
+ /* "mettagrid/objects.pxd":153
21598
21641
  * short output_energy
21599
21642
  *
21600
21643
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21609,46 +21652,45 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21609
21652
  __pyx_L0:;
21610
21653
  }
21611
21654
 
21612
- /* "mettagrid/objects.pxd":153
21655
+ /* "mettagrid/objects.pxd":161
21613
21656
  * this.output_energy = cfg[b"energy_output.r1"]
21614
21657
  *
21615
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21658
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21616
21659
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21617
21660
  *
21618
21661
  */
21619
21662
 
21620
- char __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21621
- char __pyx_r;
21622
- char __pyx_t_1;
21623
- char __pyx_t_2;
21624
- int __pyx_t_3;
21663
+ int __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21664
+ int __pyx_r;
21665
+ int __pyx_t_1;
21666
+ int __pyx_t_2;
21625
21667
  int __pyx_lineno = 0;
21626
21668
  const char *__pyx_filename = NULL;
21627
21669
  int __pyx_clineno = 0;
21628
21670
 
21629
- /* "mettagrid/objects.pxd":154
21671
+ /* "mettagrid/objects.pxd":162
21630
21672
  *
21631
- * inline char usable(const Agent *actor):
21673
+ * inline bint usable(const Agent *actor):
21632
21674
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0 # <<<<<<<<<<<<<<
21633
21675
  *
21634
21676
  * inline obs(ObsType[:] obs):
21635
21677
  */
21636
- __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)
21678
+ __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)
21637
21679
  if (__pyx_t_2) {
21638
21680
  } else {
21639
21681
  __pyx_t_1 = __pyx_t_2;
21640
21682
  goto __pyx_L3_bool_binop_done;
21641
21683
  }
21642
- __pyx_t_3 = ((__pyx_v_actor->inventory[this->input_resource]) > 0);
21643
- __pyx_t_1 = __pyx_t_3;
21684
+ __pyx_t_2 = ((__pyx_v_actor->inventory[this->input_resource]) > 0);
21685
+ __pyx_t_1 = __pyx_t_2;
21644
21686
  __pyx_L3_bool_binop_done:;
21645
21687
  __pyx_r = __pyx_t_1;
21646
21688
  goto __pyx_L0;
21647
21689
 
21648
- /* "mettagrid/objects.pxd":153
21690
+ /* "mettagrid/objects.pxd":161
21649
21691
  * this.output_energy = cfg[b"energy_output.r1"]
21650
21692
  *
21651
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21693
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21652
21694
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21653
21695
  *
21654
21696
  */
@@ -21661,7 +21703,7 @@ char __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_A
21661
21703
  return __pyx_r;
21662
21704
  }
21663
21705
 
21664
- /* "mettagrid/objects.pxd":156
21706
+ /* "mettagrid/objects.pxd":164
21665
21707
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21666
21708
  *
21667
21709
  * inline obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21675,7 +21717,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21675
21717
  Py_ssize_t __pyx_t_1;
21676
21718
  __Pyx_RefNannySetupContext("obs", 1);
21677
21719
 
21678
- /* "mettagrid/objects.pxd":157
21720
+ /* "mettagrid/objects.pxd":165
21679
21721
  *
21680
21722
  * inline obs(ObsType[:] obs):
21681
21723
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21685,7 +21727,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21685
21727
  __pyx_t_1 = 0;
21686
21728
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21687
21729
 
21688
- /* "mettagrid/objects.pxd":158
21730
+ /* "mettagrid/objects.pxd":166
21689
21731
  * inline obs(ObsType[:] obs):
21690
21732
  * obs[0] = 1
21691
21733
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -21695,7 +21737,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21695
21737
  __pyx_t_1 = 1;
21696
21738
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
21697
21739
 
21698
- /* "mettagrid/objects.pxd":159
21740
+ /* "mettagrid/objects.pxd":167
21699
21741
  * obs[0] = 1
21700
21742
  * obs[1] = hp
21701
21743
  * obs[2] = input_resource # <<<<<<<<<<<<<<
@@ -21705,7 +21747,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21705
21747
  __pyx_t_1 = 2;
21706
21748
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = input_resource;
21707
21749
 
21708
- /* "mettagrid/objects.pxd":160
21750
+ /* "mettagrid/objects.pxd":168
21709
21751
  * obs[1] = hp
21710
21752
  * obs[2] = input_resource
21711
21753
  * obs[3] = output_resource # <<<<<<<<<<<<<<
@@ -21715,7 +21757,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21715
21757
  __pyx_t_1 = 3;
21716
21758
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = output_resource;
21717
21759
 
21718
- /* "mettagrid/objects.pxd":161
21760
+ /* "mettagrid/objects.pxd":169
21719
21761
  * obs[2] = input_resource
21720
21762
  * obs[3] = output_resource
21721
21763
  * obs[4] = output_energy # <<<<<<<<<<<<<<
@@ -21725,7 +21767,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21725
21767
  __pyx_t_1 = 4;
21726
21768
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = output_energy;
21727
21769
 
21728
- /* "mettagrid/objects.pxd":162
21770
+ /* "mettagrid/objects.pxd":170
21729
21771
  * obs[3] = output_resource
21730
21772
  * obs[4] = output_energy
21731
21773
  * obs[5] = ready # <<<<<<<<<<<<<<
@@ -21735,7 +21777,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21735
21777
  __pyx_t_1 = 5;
21736
21778
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = ready;
21737
21779
 
21738
- /* "mettagrid/objects.pxd":156
21780
+ /* "mettagrid/objects.pxd":164
21739
21781
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21740
21782
  *
21741
21783
  * inline obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21750,7 +21792,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21750
21792
  return __pyx_r;
21751
21793
  }
21752
21794
 
21753
- /* "mettagrid/objects.pxd":165
21795
+ /* "mettagrid/objects.pxd":173
21754
21796
  *
21755
21797
  * @staticmethod
21756
21798
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21768,39 +21810,39 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Converter::feature_names(v
21768
21810
  int __pyx_clineno = 0;
21769
21811
  __Pyx_RefNannySetupContext("feature_names", 1);
21770
21812
 
21771
- /* "mettagrid/objects.pxd":166
21813
+ /* "mettagrid/objects.pxd":174
21772
21814
  * @staticmethod
21773
21815
  * inline vector[string] feature_names():
21774
21816
  * return ["converter", "converter:hp", "converter:input_resource", "converter:output_resource", "converter:output_energy", "converter:ready"] # <<<<<<<<<<<<<<
21775
21817
  *
21776
21818
  * cdef cppclass Altar(Usable):
21777
21819
  */
21778
- __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 166, __pyx_L1_error)
21820
+ __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 174, __pyx_L1_error)
21779
21821
  __Pyx_GOTREF(__pyx_t_1);
21780
21822
  __Pyx_INCREF(__pyx_n_u_converter);
21781
21823
  __Pyx_GIVEREF(__pyx_n_u_converter);
21782
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_converter)) __PYX_ERR(3, 166, __pyx_L1_error);
21824
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_converter)) __PYX_ERR(3, 174, __pyx_L1_error);
21783
21825
  __Pyx_INCREF(__pyx_kp_u_converter_hp);
21784
21826
  __Pyx_GIVEREF(__pyx_kp_u_converter_hp);
21785
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_converter_hp)) __PYX_ERR(3, 166, __pyx_L1_error);
21827
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_converter_hp)) __PYX_ERR(3, 174, __pyx_L1_error);
21786
21828
  __Pyx_INCREF(__pyx_kp_u_converter_input_resource);
21787
21829
  __Pyx_GIVEREF(__pyx_kp_u_converter_input_resource);
21788
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_converter_input_resource)) __PYX_ERR(3, 166, __pyx_L1_error);
21830
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_converter_input_resource)) __PYX_ERR(3, 174, __pyx_L1_error);
21789
21831
  __Pyx_INCREF(__pyx_kp_u_converter_output_resource);
21790
21832
  __Pyx_GIVEREF(__pyx_kp_u_converter_output_resource);
21791
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_converter_output_resource)) __PYX_ERR(3, 166, __pyx_L1_error);
21833
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_converter_output_resource)) __PYX_ERR(3, 174, __pyx_L1_error);
21792
21834
  __Pyx_INCREF(__pyx_kp_u_converter_output_energy);
21793
21835
  __Pyx_GIVEREF(__pyx_kp_u_converter_output_energy);
21794
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_converter_output_energy)) __PYX_ERR(3, 166, __pyx_L1_error);
21836
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_converter_output_energy)) __PYX_ERR(3, 174, __pyx_L1_error);
21795
21837
  __Pyx_INCREF(__pyx_kp_u_converter_ready);
21796
21838
  __Pyx_GIVEREF(__pyx_kp_u_converter_ready);
21797
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_converter_ready)) __PYX_ERR(3, 166, __pyx_L1_error);
21798
- __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)
21839
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_converter_ready)) __PYX_ERR(3, 174, __pyx_L1_error);
21840
+ __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)
21799
21841
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21800
21842
  __pyx_r = __pyx_t_2;
21801
21843
  goto __pyx_L0;
21802
21844
 
21803
- /* "mettagrid/objects.pxd":165
21845
+ /* "mettagrid/objects.pxd":173
21804
21846
  *
21805
21847
  * @staticmethod
21806
21848
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21818,7 +21860,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Converter::feature_names(v
21818
21860
  return __pyx_r;
21819
21861
  }
21820
21862
 
21821
- /* "mettagrid/objects.pxd":169
21863
+ /* "mettagrid/objects.pxd":177
21822
21864
  *
21823
21865
  * cdef cppclass Altar(Usable):
21824
21866
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21831,7 +21873,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21831
21873
  const char *__pyx_filename = NULL;
21832
21874
  int __pyx_clineno = 0;
21833
21875
 
21834
- /* "mettagrid/objects.pxd":170
21876
+ /* "mettagrid/objects.pxd":178
21835
21877
  * cdef cppclass Altar(Usable):
21836
21878
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg):
21837
21879
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21840,25 +21882,25 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21840
21882
  */
21841
21883
  GridObject::init(__pyx_e_9mettagrid_7objects_AltarT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21842
21884
 
21843
- /* "mettagrid/objects.pxd":171
21885
+ /* "mettagrid/objects.pxd":179
21844
21886
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg):
21845
21887
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer))
21846
21888
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21847
21889
  * Usable.init_usable(cfg)
21848
21890
  *
21849
21891
  */
21850
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 171, __pyx_L1_error)
21892
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 179, __pyx_L1_error)
21851
21893
 
21852
- /* "mettagrid/objects.pxd":172
21894
+ /* "mettagrid/objects.pxd":180
21853
21895
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer))
21854
21896
  * MettaObject.init_mo(cfg)
21855
21897
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
21856
21898
  *
21857
21899
  * inline void obs(ObsType[:] obs):
21858
21900
  */
21859
- __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 172, __pyx_L1_error)
21901
+ __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 180, __pyx_L1_error)
21860
21902
 
21861
- /* "mettagrid/objects.pxd":169
21903
+ /* "mettagrid/objects.pxd":177
21862
21904
  *
21863
21905
  * cdef cppclass Altar(Usable):
21864
21906
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21873,7 +21915,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21873
21915
  __pyx_L0:;
21874
21916
  }
21875
21917
 
21876
- /* "mettagrid/objects.pxd":174
21918
+ /* "mettagrid/objects.pxd":182
21877
21919
  * Usable.init_usable(cfg)
21878
21920
  *
21879
21921
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21884,7 +21926,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21884
21926
  void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21885
21927
  Py_ssize_t __pyx_t_1;
21886
21928
 
21887
- /* "mettagrid/objects.pxd":175
21929
+ /* "mettagrid/objects.pxd":183
21888
21930
  *
21889
21931
  * inline void obs(ObsType[:] obs):
21890
21932
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21894,7 +21936,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21894
21936
  __pyx_t_1 = 0;
21895
21937
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21896
21938
 
21897
- /* "mettagrid/objects.pxd":176
21939
+ /* "mettagrid/objects.pxd":184
21898
21940
  * inline void obs(ObsType[:] obs):
21899
21941
  * obs[0] = 1
21900
21942
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -21904,7 +21946,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21904
21946
  __pyx_t_1 = 1;
21905
21947
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
21906
21948
 
21907
- /* "mettagrid/objects.pxd":177
21949
+ /* "mettagrid/objects.pxd":185
21908
21950
  * obs[0] = 1
21909
21951
  * obs[1] = hp
21910
21952
  * obs[2] = ready # <<<<<<<<<<<<<<
@@ -21914,7 +21956,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21914
21956
  __pyx_t_1 = 2;
21915
21957
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = ready;
21916
21958
 
21917
- /* "mettagrid/objects.pxd":174
21959
+ /* "mettagrid/objects.pxd":182
21918
21960
  * Usable.init_usable(cfg)
21919
21961
  *
21920
21962
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21925,7 +21967,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21925
21967
  /* function exit code */
21926
21968
  }
21927
21969
 
21928
- /* "mettagrid/objects.pxd":180
21970
+ /* "mettagrid/objects.pxd":188
21929
21971
  *
21930
21972
  * @staticmethod
21931
21973
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21943,30 +21985,30 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Altar::feature_names(void)
21943
21985
  int __pyx_clineno = 0;
21944
21986
  __Pyx_RefNannySetupContext("feature_names", 1);
21945
21987
 
21946
- /* "mettagrid/objects.pxd":181
21988
+ /* "mettagrid/objects.pxd":189
21947
21989
  * @staticmethod
21948
21990
  * inline vector[string] feature_names():
21949
21991
  * return ["altar", "altar:hp", "altar:ready"] # <<<<<<<<<<<<<<
21950
21992
  *
21951
21993
  * cdef map[TypeId, GridLayer] ObjectLayers
21952
21994
  */
21953
- __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 181, __pyx_L1_error)
21995
+ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 189, __pyx_L1_error)
21954
21996
  __Pyx_GOTREF(__pyx_t_1);
21955
21997
  __Pyx_INCREF(__pyx_n_u_altar);
21956
21998
  __Pyx_GIVEREF(__pyx_n_u_altar);
21957
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_altar)) __PYX_ERR(3, 181, __pyx_L1_error);
21999
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_altar)) __PYX_ERR(3, 189, __pyx_L1_error);
21958
22000
  __Pyx_INCREF(__pyx_kp_u_altar_hp);
21959
22001
  __Pyx_GIVEREF(__pyx_kp_u_altar_hp);
21960
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_altar_hp)) __PYX_ERR(3, 181, __pyx_L1_error);
22002
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_altar_hp)) __PYX_ERR(3, 189, __pyx_L1_error);
21961
22003
  __Pyx_INCREF(__pyx_kp_u_altar_ready);
21962
22004
  __Pyx_GIVEREF(__pyx_kp_u_altar_ready);
21963
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_altar_ready)) __PYX_ERR(3, 181, __pyx_L1_error);
21964
- __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)
22005
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_altar_ready)) __PYX_ERR(3, 189, __pyx_L1_error);
22006
+ __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)
21965
22007
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21966
22008
  __pyx_r = __pyx_t_2;
21967
22009
  goto __pyx_L0;
21968
22010
 
21969
- /* "mettagrid/objects.pxd":180
22011
+ /* "mettagrid/objects.pxd":188
21970
22012
  *
21971
22013
  * @staticmethod
21972
22014
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21984,72 +22026,101 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Altar::feature_names(void)
21984
22026
  return __pyx_r;
21985
22027
  }
21986
22028
 
21987
- /* "mettagrid/objects.pxd":186
22029
+ /* "mettagrid/objects.pxd":194
21988
22030
  *
21989
22031
  * cdef class ResetHandler(EventHandler):
21990
22032
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg): # <<<<<<<<<<<<<<
21991
22033
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
21992
- * usable.ready = True
22034
+ * if usable is NULL:
21993
22035
  */
21994
22036
 
21995
22037
  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) {
21996
22038
  __pyx_t_9mettagrid_7objects_Usable *__pyx_v_usable;
21997
22039
  __Pyx_RefNannyDeclarations
21998
- PyObject *__pyx_t_1 = NULL;
22040
+ int __pyx_t_1;
21999
22041
  PyObject *__pyx_t_2 = NULL;
22000
- char const *__pyx_t_3;
22042
+ PyObject *__pyx_t_3 = NULL;
22043
+ char const *__pyx_t_4;
22001
22044
  int __pyx_lineno = 0;
22002
22045
  const char *__pyx_filename = NULL;
22003
22046
  int __pyx_clineno = 0;
22004
22047
  __Pyx_RefNannySetupContext("handle_event", 1);
22005
22048
 
22006
- /* "mettagrid/objects.pxd":187
22049
+ /* "mettagrid/objects.pxd":195
22007
22050
  * cdef class ResetHandler(EventHandler):
22008
22051
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
22009
22052
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id) # <<<<<<<<<<<<<<
22010
- * usable.ready = True
22011
- * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
22053
+ * if usable is NULL:
22054
+ * return
22012
22055
  */
22013
22056
  __pyx_v_usable = ((__pyx_t_9mettagrid_7objects_Usable *)__pyx_v_self->__pyx_base.env->_grid->object(__pyx_v_obj_id));
22014
22057
 
22015
- /* "mettagrid/objects.pxd":188
22058
+ /* "mettagrid/objects.pxd":196
22016
22059
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
22017
22060
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22061
+ * if usable is NULL: # <<<<<<<<<<<<<<
22062
+ * return
22063
+ *
22064
+ */
22065
+ __pyx_t_1 = (__pyx_v_usable == NULL);
22066
+ if (__pyx_t_1) {
22067
+
22068
+ /* "mettagrid/objects.pxd":197
22069
+ * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22070
+ * if usable is NULL:
22071
+ * return # <<<<<<<<<<<<<<
22072
+ *
22073
+ * usable.ready = True
22074
+ */
22075
+ goto __pyx_L0;
22076
+
22077
+ /* "mettagrid/objects.pxd":196
22078
+ * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
22079
+ * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22080
+ * if usable is NULL: # <<<<<<<<<<<<<<
22081
+ * return
22082
+ *
22083
+ */
22084
+ }
22085
+
22086
+ /* "mettagrid/objects.pxd":199
22087
+ * return
22088
+ *
22018
22089
  * usable.ready = True # <<<<<<<<<<<<<<
22019
22090
  * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
22020
22091
  *
22021
22092
  */
22022
22093
  __pyx_v_usable->ready = 1;
22023
22094
 
22024
- /* "mettagrid/objects.pxd":189
22025
- * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22095
+ /* "mettagrid/objects.pxd":200
22096
+ *
22026
22097
  * usable.ready = True
22027
22098
  * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id]) # <<<<<<<<<<<<<<
22028
22099
  *
22029
22100
  * cdef enum Events:
22030
22101
  */
22031
- __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)
22032
- __Pyx_GOTREF(__pyx_t_1);
22033
- __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)
22102
+ __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)
22034
22103
  __Pyx_GOTREF(__pyx_t_2);
22035
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22036
- __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(3, 189, __pyx_L1_error)
22037
- ((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)
22104
+ __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)
22105
+ __Pyx_GOTREF(__pyx_t_3);
22038
22106
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22107
+ __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(3, 200, __pyx_L1_error)
22108
+ ((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)
22109
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22039
22110
 
22040
- /* "mettagrid/objects.pxd":186
22111
+ /* "mettagrid/objects.pxd":194
22041
22112
  *
22042
22113
  * cdef class ResetHandler(EventHandler):
22043
22114
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg): # <<<<<<<<<<<<<<
22044
22115
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22045
- * usable.ready = True
22116
+ * if usable is NULL:
22046
22117
  */
22047
22118
 
22048
22119
  /* function exit code */
22049
22120
  goto __pyx_L0;
22050
22121
  __pyx_L1_error:;
22051
- __Pyx_XDECREF(__pyx_t_1);
22052
22122
  __Pyx_XDECREF(__pyx_t_2);
22123
+ __Pyx_XDECREF(__pyx_t_3);
22053
22124
  __Pyx_AddTraceback("mettagrid.objects.ResetHandler.handle_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
22054
22125
  __pyx_L0:;
22055
22126
  __Pyx_RefNannyFinishContext();
@@ -22159,7 +22230,7 @@ static int __pyx_pf_9mettagrid_7actions_6rotate_6Rotate___init__(struct __pyx_ob
22159
22230
  * def __init__(self, cfg: OmegaConf):
22160
22231
  * MettaActionHandler.__init__(self, cfg, "rotate") # <<<<<<<<<<<<<<
22161
22232
  *
22162
- * cdef char _handle_action(
22233
+ * cdef unsigned char max_arg(self):
22163
22234
  */
22164
22235
  __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, 15, __pyx_L1_error)
22165
22236
  __Pyx_GOTREF(__pyx_t_2);
@@ -22212,63 +22283,67 @@ static int __pyx_pf_9mettagrid_7actions_6rotate_6Rotate___init__(struct __pyx_ob
22212
22283
  /* "mettagrid/actions/rotate.pyx":17
22213
22284
  * MettaActionHandler.__init__(self, cfg, "rotate")
22214
22285
  *
22215
- * cdef char _handle_action( # <<<<<<<<<<<<<<
22216
- * self,
22217
- * unsigned int actor_id,
22286
+ * cdef unsigned char max_arg(self): # <<<<<<<<<<<<<<
22287
+ * return 3
22288
+ *
22218
22289
  */
22219
22290
 
22220
- static char __pyx_f_9mettagrid_7actions_6rotate_6Rotate__handle_action(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_6rotate_Rotate *__pyx_v_self, CYTHON_UNUSED unsigned int __pyx_v_actor_id, __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg) {
22221
- unsigned short __pyx_v_orientation;
22222
- char __pyx_r;
22223
- int __pyx_t_1;
22291
+ static unsigned char __pyx_f_9mettagrid_7actions_6rotate_6Rotate_max_arg(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_6rotate_Rotate *__pyx_v_self) {
22292
+ unsigned char __pyx_r;
22224
22293
 
22225
- /* "mettagrid/actions/rotate.pyx":23
22226
- * ActionArg arg):
22294
+ /* "mettagrid/actions/rotate.pyx":18
22295
+ *
22296
+ * cdef unsigned char max_arg(self):
22297
+ * return 3 # <<<<<<<<<<<<<<
22298
+ *
22227
22299
  *
22228
- * cdef unsigned short orientation = arg # <<<<<<<<<<<<<<
22229
- * if orientation >= 4:
22230
- * return False
22231
22300
  */
22232
- __pyx_v_orientation = __pyx_v_arg;
22301
+ __pyx_r = 3;
22302
+ goto __pyx_L0;
22233
22303
 
22234
- /* "mettagrid/actions/rotate.pyx":24
22304
+ /* "mettagrid/actions/rotate.pyx":17
22305
+ * MettaActionHandler.__init__(self, cfg, "rotate")
22235
22306
  *
22236
- * cdef unsigned short orientation = arg
22237
- * if orientation >= 4: # <<<<<<<<<<<<<<
22238
- * return False
22307
+ * cdef unsigned char max_arg(self): # <<<<<<<<<<<<<<
22308
+ * return 3
22239
22309
  *
22240
22310
  */
22241
- __pyx_t_1 = (__pyx_v_orientation >= 4);
22242
- if (__pyx_t_1) {
22243
22311
 
22244
- /* "mettagrid/actions/rotate.pyx":25
22245
- * cdef unsigned short orientation = arg
22246
- * if orientation >= 4:
22247
- * return False # <<<<<<<<<<<<<<
22312
+ /* function exit code */
22313
+ __pyx_L0:;
22314
+ return __pyx_r;
22315
+ }
22316
+
22317
+ /* "mettagrid/actions/rotate.pyx":21
22248
22318
  *
22249
- * actor.orientation = orientation
22319
+ *
22320
+ * cdef bint _handle_action( # <<<<<<<<<<<<<<
22321
+ * self,
22322
+ * unsigned int actor_id,
22250
22323
  */
22251
- __pyx_r = 0;
22252
- goto __pyx_L0;
22253
22324
 
22254
- /* "mettagrid/actions/rotate.pyx":24
22325
+ static int __pyx_f_9mettagrid_7actions_6rotate_6Rotate__handle_action(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_6rotate_Rotate *__pyx_v_self, CYTHON_UNUSED unsigned int __pyx_v_actor_id, __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg) {
22326
+ unsigned short __pyx_v_orientation;
22327
+ int __pyx_r;
22328
+
22329
+ /* "mettagrid/actions/rotate.pyx":27
22330
+ * ActionArg arg):
22255
22331
  *
22256
- * cdef unsigned short orientation = arg
22257
- * if orientation >= 4: # <<<<<<<<<<<<<<
22258
- * return False
22332
+ * cdef unsigned short orientation = arg # <<<<<<<<<<<<<<
22259
22333
  *
22334
+ * actor.orientation = orientation
22260
22335
  */
22261
- }
22336
+ __pyx_v_orientation = __pyx_v_arg;
22262
22337
 
22263
- /* "mettagrid/actions/rotate.pyx":27
22264
- * return False
22338
+ /* "mettagrid/actions/rotate.pyx":29
22339
+ * cdef unsigned short orientation = arg
22265
22340
  *
22266
22341
  * actor.orientation = orientation # <<<<<<<<<<<<<<
22267
22342
  * return True
22268
22343
  */
22269
22344
  __pyx_v_actor->orientation = __pyx_v_orientation;
22270
22345
 
22271
- /* "mettagrid/actions/rotate.pyx":28
22346
+ /* "mettagrid/actions/rotate.pyx":30
22272
22347
  *
22273
22348
  * actor.orientation = orientation
22274
22349
  * return True # <<<<<<<<<<<<<<
@@ -22276,10 +22351,10 @@ static char __pyx_f_9mettagrid_7actions_6rotate_6Rotate__handle_action(CYTHON_UN
22276
22351
  __pyx_r = 1;
22277
22352
  goto __pyx_L0;
22278
22353
 
22279
- /* "mettagrid/actions/rotate.pyx":17
22280
- * MettaActionHandler.__init__(self, cfg, "rotate")
22354
+ /* "mettagrid/actions/rotate.pyx":21
22355
+ *
22281
22356
  *
22282
- * cdef char _handle_action( # <<<<<<<<<<<<<<
22357
+ * cdef bint _handle_action( # <<<<<<<<<<<<<<
22283
22358
  * self,
22284
22359
  * unsigned int actor_id,
22285
22360
  */
@@ -23825,7 +23900,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
23825
23900
  __Pyx_GOTREF(__pyx_tuple__8);
23826
23901
  __Pyx_GIVEREF(__pyx_tuple__8);
23827
23902
 
23828
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
23903
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
23829
23904
  * __pyx_import_array()
23830
23905
  * except Exception:
23831
23906
  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
@@ -23836,7 +23911,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
23836
23911
  __Pyx_GOTREF(__pyx_tuple__9);
23837
23912
  __Pyx_GIVEREF(__pyx_tuple__9);
23838
23913
 
23839
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
23914
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
23840
23915
  * _import_umath()
23841
23916
  * except Exception:
23842
23917
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -24050,7 +24125,8 @@ static int __Pyx_modinit_type_init_code(void) {
24050
24125
  __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)
24051
24126
  __pyx_vtabptr_9mettagrid_7actions_6rotate_Rotate = &__pyx_vtable_9mettagrid_7actions_6rotate_Rotate;
24052
24127
  __pyx_vtable_9mettagrid_7actions_6rotate_Rotate.__pyx_base = *__pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler;
24053
- __pyx_vtable_9mettagrid_7actions_6rotate_Rotate.__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_6rotate_6Rotate__handle_action;
24128
+ __pyx_vtable_9mettagrid_7actions_6rotate_Rotate.__pyx_base.__pyx_base.max_arg = (unsigned char (*)(struct __pyx_obj_10puffergrid_6action_ActionHandler *))__pyx_f_9mettagrid_7actions_6rotate_6Rotate_max_arg;
24129
+ __pyx_vtable_9mettagrid_7actions_6rotate_Rotate.__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_6rotate_6Rotate__handle_action;
24054
24130
  #if CYTHON_USE_TYPE_SPECS
24055
24131
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
24056
24132
  __Pyx_GOTREF(__pyx_t_2);
@@ -24299,12 +24375,12 @@ static int __Pyx_modinit_type_import_code(void) {
24299
24375
  __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)
24300
24376
  __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)
24301
24377
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24302
- __pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 185, __pyx_L1_error)
24378
+ __pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 193, __pyx_L1_error)
24303
24379
  __Pyx_GOTREF(__pyx_t_1);
24304
- __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)
24305
- __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)
24306
- __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)
24307
- __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)
24380
+ __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)
24381
+ __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)
24382
+ __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)
24383
+ __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)
24308
24384
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24309
24385
  __Pyx_RefNannyFinishContext();
24310
24386
  return 0;
@@ -30967,77 +31043,6 @@ raise_neg_overflow:
30967
31043
  return (unsigned short) -1;
30968
31044
  }
30969
31045
 
30970
- /* CIntToPy */
30971
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
30972
- #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30973
- #pragma GCC diagnostic push
30974
- #pragma GCC diagnostic ignored "-Wconversion"
30975
- #endif
30976
- const char neg_one = (char) -1, const_zero = (char) 0;
30977
- #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
30978
- #pragma GCC diagnostic pop
30979
- #endif
30980
- const int is_unsigned = neg_one > const_zero;
30981
- if (is_unsigned) {
30982
- if (sizeof(char) < sizeof(long)) {
30983
- return PyInt_FromLong((long) value);
30984
- } else if (sizeof(char) <= sizeof(unsigned long)) {
30985
- return PyLong_FromUnsignedLong((unsigned long) value);
30986
- #ifdef HAVE_LONG_LONG
30987
- } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
30988
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
30989
- #endif
30990
- }
30991
- } else {
30992
- if (sizeof(char) <= sizeof(long)) {
30993
- return PyInt_FromLong((long) value);
30994
- #ifdef HAVE_LONG_LONG
30995
- } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
30996
- return PyLong_FromLongLong((PY_LONG_LONG) value);
30997
- #endif
30998
- }
30999
- }
31000
- {
31001
- unsigned char *bytes = (unsigned char *)&value;
31002
- #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
31003
- if (is_unsigned) {
31004
- return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
31005
- } else {
31006
- return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
31007
- }
31008
- #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
31009
- int one = 1; int little = (int)*(unsigned char *)&one;
31010
- return _PyLong_FromByteArray(bytes, sizeof(char),
31011
- little, !is_unsigned);
31012
- #else
31013
- int one = 1; int little = (int)*(unsigned char *)&one;
31014
- PyObject *from_bytes, *result = NULL;
31015
- PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
31016
- from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
31017
- if (!from_bytes) return NULL;
31018
- py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(char));
31019
- if (!py_bytes) goto limited_bad;
31020
- order_str = PyUnicode_FromString(little ? "little" : "big");
31021
- if (!order_str) goto limited_bad;
31022
- arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
31023
- if (!arg_tuple) goto limited_bad;
31024
- if (!is_unsigned) {
31025
- kwds = PyDict_New();
31026
- if (!kwds) goto limited_bad;
31027
- if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
31028
- }
31029
- result = PyObject_Call(from_bytes, arg_tuple, kwds);
31030
- limited_bad:
31031
- Py_XDECREF(kwds);
31032
- Py_XDECREF(arg_tuple);
31033
- Py_XDECREF(order_str);
31034
- Py_XDECREF(py_bytes);
31035
- Py_XDECREF(from_bytes);
31036
- return result;
31037
- #endif
31038
- }
31039
- }
31040
-
31041
31046
  /* CIntFromPy */
31042
31047
  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
31043
31048
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC