mettagrid 0.0.2__py3-none-any.whl → 0.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. README.md +75 -2
  2. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/actions.cpython-311-darwin.so +0 -0
  3. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/attack.cpython-311-darwin.so +0 -0
  4. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/gift.cpython-311-darwin.so +0 -0
  5. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/move.cpython-311-darwin.so +0 -0
  6. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/noop.cpython-311-darwin.so +0 -0
  7. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/rotate.cpython-311-darwin.so +0 -0
  8. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/shield.cpython-311-darwin.so +0 -0
  9. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/use.cpython-311-darwin.so +0 -0
  10. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/mettagrid_c.cpython-311-darwin.so +0 -0
  11. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/objects.cpython-311-darwin.so +0 -0
  12. build/mettagrid/actions/actions.cpp +706 -593
  13. build/mettagrid/actions/attack.cpp +1589 -1185
  14. build/mettagrid/actions/gift.cpp +550 -515
  15. build/mettagrid/actions/move.cpp +739 -638
  16. build/mettagrid/actions/noop.cpp +32376 -0
  17. build/mettagrid/actions/rotate.cpp +550 -545
  18. build/mettagrid/actions/shield.cpp +594 -531
  19. build/mettagrid/actions/use.cpp +654 -589
  20. build/mettagrid/mettagrid.cpp +4011 -1495
  21. build/mettagrid/objects.cpp +1449 -824
  22. mettagrid/actions/actions.cpython-311-darwin.so +0 -0
  23. mettagrid/actions/actions.pxd +2 -2
  24. mettagrid/actions/actions.pyx +19 -5
  25. mettagrid/actions/attack.cpython-311-darwin.so +0 -0
  26. mettagrid/actions/attack.pyx +12 -3
  27. mettagrid/actions/gift.cpython-311-darwin.so +0 -0
  28. mettagrid/actions/gift.pyx +4 -1
  29. mettagrid/actions/move.cpython-311-darwin.so +0 -0
  30. mettagrid/actions/move.pyx +16 -6
  31. mettagrid/actions/noop.cpython-311-darwin.so +0 -0
  32. mettagrid/actions/noop.pxd +4 -0
  33. mettagrid/actions/noop.pyx +25 -0
  34. mettagrid/actions/rotate.cpython-311-darwin.so +0 -0
  35. mettagrid/actions/rotate.pyx +5 -3
  36. mettagrid/actions/shield.cpython-311-darwin.so +0 -0
  37. mettagrid/actions/shield.pyx +10 -3
  38. mettagrid/actions/use.cpython-311-darwin.so +0 -0
  39. mettagrid/actions/use.pyx +9 -4
  40. mettagrid/mettagrid.pyx +35 -1
  41. mettagrid/mettagrid_c.cpython-311-darwin.so +0 -0
  42. mettagrid/mettagrid_env.py +44 -72
  43. mettagrid/objects.cpython-311-darwin.so +0 -0
  44. mettagrid/objects.pxd +25 -12
  45. mettagrid/objects.pyx +19 -21
  46. mettagrid/renderer/assets/agent.png +0 -0
  47. mettagrid/renderer/assets/altar.png +0 -0
  48. mettagrid/renderer/assets/arial.ttf +0 -0
  49. mettagrid/renderer/assets/converter.png +0 -0
  50. mettagrid/renderer/assets/generator.png +0 -0
  51. mettagrid/renderer/json_renderer.py +0 -0
  52. mettagrid/renderer/raylib_renderer.py +410 -0
  53. mettagrid/renderer/render_code_example.py +56 -0
  54. mettagrid-0.0.3.dist-info/METADATA +96 -0
  55. mettagrid-0.0.3.dist-info/RECORD +81 -0
  56. setup.py +1 -0
  57. test_perf.py +2 -2
  58. mettagrid/actions.cpython-311-darwin.so +0 -0
  59. mettagrid/renderer/raylib_client.py +0 -180
  60. mettagrid-0.0.2.dist-info/METADATA +0 -23
  61. mettagrid-0.0.2.dist-info/RECORD +0 -70
  62. /mettagrid/renderer/assets/{tiny_galaxy_items.png → items.png} +0 -0
  63. /mettagrid/renderer/assets/{tiny_galaxy_monsters.png → monsters.png} +0 -0
  64. /mettagrid/renderer/assets/{wall1-0.png → wall.png} +0 -0
  65. {mettagrid-0.0.2.dist-info → mettagrid-0.0.3.dist-info}/LICENSE +0 -0
  66. {mettagrid-0.0.2.dist-info → mettagrid-0.0.3.dist-info}/WHEEL +0 -0
@@ -10,12 +10,12 @@
10
10
  ]
11
11
  ],
12
12
  "depends": [
13
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid/event.hpp",
14
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid/grid.hpp",
15
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid/grid_object.hpp"
13
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid/event.hpp",
14
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid/grid.hpp",
15
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid/grid_object.hpp"
16
16
  ],
17
17
  "include_dirs": [
18
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid"
18
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid"
19
19
  ],
20
20
  "language": "c++",
21
21
  "name": "mettagrid.actions.move",
@@ -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,12 +2629,12 @@ 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
 
2628
2636
 
2629
- /* "mettagrid/actions/move.pyx":12
2637
+ /* "mettagrid/actions/move.pyx":11
2630
2638
  * from mettagrid.actions.actions cimport MettaActionHandler
2631
2639
  *
2632
2640
  * cdef class Move(MettaActionHandler): # <<<<<<<<<<<<<<
@@ -3286,9 +3294,6 @@ static void __Pyx_WriteUnraisable(const char *name, int clineno,
3286
3294
  #define __PYX_STD_MOVE_IF_SUPPORTED(x) x
3287
3295
  #endif
3288
3296
 
3289
- /* ModInt[long].proto */
3290
- static CYTHON_INLINE long __Pyx_mod_long(long, long);
3291
-
3292
3297
  /* CallNextTpTraverse.proto */
3293
3298
  static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
3294
3299
 
@@ -3752,9 +3757,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_9mettagrid_7object
3752
3757
  /* CIntFromPy.proto */
3753
3758
  static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *);
3754
3759
 
3755
- /* CIntToPy.proto */
3756
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);
3757
-
3758
3760
  /* CIntFromPy.proto */
3759
3761
  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
3760
3762
 
@@ -3814,7 +3816,8 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
3814
3816
  static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
3815
3817
  static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
3816
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*/
3817
- static char __pyx_f_9mettagrid_7actions_4move_4Move__handle_action(struct __pyx_obj_9mettagrid_7actions_4move_Move *__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_4move_4Move_max_arg(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_4move_Move *__pyx_v_self); /* proto*/
3820
+ static int __pyx_f_9mettagrid_7actions_4move_4Move__handle_action(struct __pyx_obj_9mettagrid_7actions_4move_Move *__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*/
3818
3821
 
3819
3822
  /* Module declarations from "libc.string" */
3820
3823
 
@@ -4028,6 +4031,7 @@ static const char __pyx_k_pyx_state[] = "__pyx_state";
4028
4031
  static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
4029
4032
  static const char __pyx_k_IndexError[] = "IndexError";
4030
4033
  static const char __pyx_k_ValueError[] = "ValueError";
4034
+ static const char __pyx_k_max_energy[] = "max_energy";
4031
4035
  static const char __pyx_k_pyx_result[] = "__pyx_result";
4032
4036
  static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
4033
4037
  static const char __pyx_k_ImportError[] = "ImportError";
@@ -4047,7 +4051,9 @@ static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
4047
4051
  static const char __pyx_k_stringsource[] = "<stringsource>";
4048
4052
  static const char __pyx_k_version_info[] = "version_info";
4049
4053
  static const char __pyx_k_class_getitem[] = "__class_getitem__";
4054
+ static const char __pyx_k_max_inventory[] = "max_inventory";
4050
4055
  static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
4056
+ static const char __pyx_k_upkeep_shield[] = "upkeep.shield";
4051
4057
  static const char __pyx_k_AssertionError[] = "AssertionError";
4052
4058
  static const char __pyx_k_initial_energy[] = "initial_energy";
4053
4059
  static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
@@ -4055,6 +4061,7 @@ static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
4055
4061
  static const char __pyx_k_collections_abc[] = "collections.abc";
4056
4062
  static const char __pyx_k_converter_ready[] = "converter:ready";
4057
4063
  static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
4064
+ static const char __pyx_k_freeze_duration[] = "freeze_duration";
4058
4065
  static const char __pyx_k_generator_ready[] = "generator:ready";
4059
4066
  static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
4060
4067
  static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
@@ -19329,7 +19336,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
19329
19336
  return __pyx_r;
19330
19337
  }
19331
19338
 
19332
- /* "../../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
19333
19340
  *
19334
19341
  * @property
19335
19342
  * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<<
@@ -19340,7 +19347,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
19340
19347
  static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
19341
19348
  PyObject *__pyx_r;
19342
19349
 
19343
- /* "../../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
19344
19351
  * """Returns a borrowed reference to the object owning the data/memory.
19345
19352
  * """
19346
19353
  * return PyArray_BASE(self) # <<<<<<<<<<<<<<
@@ -19350,7 +19357,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject
19350
19357
  __pyx_r = PyArray_BASE(__pyx_v_self);
19351
19358
  goto __pyx_L0;
19352
19359
 
19353
- /* "../../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
19354
19361
  *
19355
19362
  * @property
19356
19363
  * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<<
@@ -19363,7 +19370,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject
19363
19370
  return __pyx_r;
19364
19371
  }
19365
19372
 
19366
- /* "../../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
19367
19374
  *
19368
19375
  * @property
19369
19376
  * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
@@ -19377,7 +19384,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19377
19384
  PyArray_Descr *__pyx_t_1;
19378
19385
  __Pyx_RefNannySetupContext("descr", 1);
19379
19386
 
19380
- /* "../../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
19381
19388
  * """Returns an owned reference to the dtype of the array.
19382
19389
  * """
19383
19390
  * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
@@ -19390,7 +19397,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19390
19397
  __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19391
19398
  goto __pyx_L0;
19392
19399
 
19393
- /* "../../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
19394
19401
  *
19395
19402
  * @property
19396
19403
  * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
@@ -19405,7 +19412,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19405
19412
  return __pyx_r;
19406
19413
  }
19407
19414
 
19408
- /* "../../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
19409
19416
  *
19410
19417
  * @property
19411
19418
  * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<<
@@ -19416,7 +19423,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19416
19423
  static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
19417
19424
  int __pyx_r;
19418
19425
 
19419
- /* "../../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
19420
19427
  * """Returns the number of dimensions in the array.
19421
19428
  * """
19422
19429
  * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
@@ -19426,7 +19433,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19426
19433
  __pyx_r = PyArray_NDIM(__pyx_v_self);
19427
19434
  goto __pyx_L0;
19428
19435
 
19429
- /* "../../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
19430
19437
  *
19431
19438
  * @property
19432
19439
  * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<<
@@ -19439,7 +19446,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19439
19446
  return __pyx_r;
19440
19447
  }
19441
19448
 
19442
- /* "../../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
19443
19450
  *
19444
19451
  * @property
19445
19452
  * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<<
@@ -19450,7 +19457,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19450
19457
  static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
19451
19458
  npy_intp *__pyx_r;
19452
19459
 
19453
- /* "../../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
19454
19461
  * Can return NULL for 0-dimensional arrays.
19455
19462
  * """
19456
19463
  * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
@@ -19460,7 +19467,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19460
19467
  __pyx_r = PyArray_DIMS(__pyx_v_self);
19461
19468
  goto __pyx_L0;
19462
19469
 
19463
- /* "../../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
19464
19471
  *
19465
19472
  * @property
19466
19473
  * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<<
@@ -19473,7 +19480,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19473
19480
  return __pyx_r;
19474
19481
  }
19475
19482
 
19476
- /* "../../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
19477
19484
  *
19478
19485
  * @property
19479
19486
  * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<<
@@ -19484,7 +19491,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19484
19491
  static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
19485
19492
  npy_intp *__pyx_r;
19486
19493
 
19487
- /* "../../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
19488
19495
  * The number of elements matches the number of dimensions of the array (ndim).
19489
19496
  * """
19490
19497
  * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
@@ -19494,7 +19501,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19494
19501
  __pyx_r = PyArray_STRIDES(__pyx_v_self);
19495
19502
  goto __pyx_L0;
19496
19503
 
19497
- /* "../../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
19498
19505
  *
19499
19506
  * @property
19500
19507
  * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<<
@@ -19507,7 +19514,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19507
19514
  return __pyx_r;
19508
19515
  }
19509
19516
 
19510
- /* "../../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
19511
19518
  *
19512
19519
  * @property
19513
19520
  * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<<
@@ -19518,7 +19525,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19518
19525
  static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
19519
19526
  npy_intp __pyx_r;
19520
19527
 
19521
- /* "../../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
19522
19529
  * """Returns the total size (in number of elements) of the array.
19523
19530
  * """
19524
19531
  * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
@@ -19528,7 +19535,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19528
19535
  __pyx_r = PyArray_SIZE(__pyx_v_self);
19529
19536
  goto __pyx_L0;
19530
19537
 
19531
- /* "../../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
19532
19539
  *
19533
19540
  * @property
19534
19541
  * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<<
@@ -19541,7 +19548,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19541
19548
  return __pyx_r;
19542
19549
  }
19543
19550
 
19544
- /* "../../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
19545
19552
  *
19546
19553
  * @property
19547
19554
  * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<<
@@ -19552,7 +19559,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19552
19559
  static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
19553
19560
  char *__pyx_r;
19554
19561
 
19555
- /* "../../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
19556
19563
  * of `PyArray_DATA()` instead, which returns a 'void*'.
19557
19564
  * """
19558
19565
  * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
@@ -19562,7 +19569,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p
19562
19569
  __pyx_r = PyArray_BYTES(__pyx_v_self);
19563
19570
  goto __pyx_L0;
19564
19571
 
19565
- /* "../../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
19566
19573
  *
19567
19574
  * @property
19568
19575
  * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<<
@@ -19575,7 +19582,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p
19575
19582
  return __pyx_r;
19576
19583
  }
19577
19584
 
19578
- /* "../../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
19579
19586
  * ctypedef npy_cdouble complex_t
19580
19587
  *
19581
19588
  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -19592,7 +19599,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19592
19599
  int __pyx_clineno = 0;
19593
19600
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
19594
19601
 
19595
- /* "../../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
19596
19603
  *
19597
19604
  * cdef inline object PyArray_MultiIterNew1(a):
19598
19605
  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
@@ -19606,7 +19613,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19606
19613
  __pyx_t_1 = 0;
19607
19614
  goto __pyx_L0;
19608
19615
 
19609
- /* "../../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
19610
19617
  * ctypedef npy_cdouble complex_t
19611
19618
  *
19612
19619
  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -19625,7 +19632,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19625
19632
  return __pyx_r;
19626
19633
  }
19627
19634
 
19628
- /* "../../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
19629
19636
  * return PyArray_MultiIterNew(1, <void*>a)
19630
19637
  *
19631
19638
  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -19642,7 +19649,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19642
19649
  int __pyx_clineno = 0;
19643
19650
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
19644
19651
 
19645
- /* "../../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
19646
19653
  *
19647
19654
  * cdef inline object PyArray_MultiIterNew2(a, b):
19648
19655
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
@@ -19656,7 +19663,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19656
19663
  __pyx_t_1 = 0;
19657
19664
  goto __pyx_L0;
19658
19665
 
19659
- /* "../../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
19660
19667
  * return PyArray_MultiIterNew(1, <void*>a)
19661
19668
  *
19662
19669
  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -19675,7 +19682,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19675
19682
  return __pyx_r;
19676
19683
  }
19677
19684
 
19678
- /* "../../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
19679
19686
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19680
19687
  *
19681
19688
  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -19692,7 +19699,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19692
19699
  int __pyx_clineno = 0;
19693
19700
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
19694
19701
 
19695
- /* "../../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
19696
19703
  *
19697
19704
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
19698
19705
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
@@ -19706,7 +19713,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19706
19713
  __pyx_t_1 = 0;
19707
19714
  goto __pyx_L0;
19708
19715
 
19709
- /* "../../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
19710
19717
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19711
19718
  *
19712
19719
  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -19725,7 +19732,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19725
19732
  return __pyx_r;
19726
19733
  }
19727
19734
 
19728
- /* "../../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
19729
19736
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19730
19737
  *
19731
19738
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -19742,7 +19749,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19742
19749
  int __pyx_clineno = 0;
19743
19750
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
19744
19751
 
19745
- /* "../../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
19746
19753
  *
19747
19754
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19748
19755
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
@@ -19756,7 +19763,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19756
19763
  __pyx_t_1 = 0;
19757
19764
  goto __pyx_L0;
19758
19765
 
19759
- /* "../../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
19760
19767
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19761
19768
  *
19762
19769
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -19775,7 +19782,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19775
19782
  return __pyx_r;
19776
19783
  }
19777
19784
 
19778
- /* "../../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
19779
19786
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19780
19787
  *
19781
19788
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -19792,7 +19799,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19792
19799
  int __pyx_clineno = 0;
19793
19800
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
19794
19801
 
19795
- /* "../../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
19796
19803
  *
19797
19804
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19798
19805
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
@@ -19806,7 +19813,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19806
19813
  __pyx_t_1 = 0;
19807
19814
  goto __pyx_L0;
19808
19815
 
19809
- /* "../../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
19810
19817
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19811
19818
  *
19812
19819
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -19825,7 +19832,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19825
19832
  return __pyx_r;
19826
19833
  }
19827
19834
 
19828
- /* "../../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
19829
19836
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19830
19837
  *
19831
19838
  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
@@ -19839,7 +19846,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19839
19846
  int __pyx_t_1;
19840
19847
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
19841
19848
 
19842
- /* "../../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
19843
19850
  *
19844
19851
  * cdef inline tuple PyDataType_SHAPE(dtype d):
19845
19852
  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
@@ -19849,7 +19856,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19849
19856
  __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
19850
19857
  if (__pyx_t_1) {
19851
19858
 
19852
- /* "../../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
19853
19860
  * cdef inline tuple PyDataType_SHAPE(dtype d):
19854
19861
  * if PyDataType_HASSUBARRAY(d):
19855
19862
  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
@@ -19861,7 +19868,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19861
19868
  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
19862
19869
  goto __pyx_L0;
19863
19870
 
19864
- /* "../../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
19865
19872
  *
19866
19873
  * cdef inline tuple PyDataType_SHAPE(dtype d):
19867
19874
  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
@@ -19870,7 +19877,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19870
19877
  */
19871
19878
  }
19872
19879
 
19873
- /* "../../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
19874
19881
  * return <tuple>d.subarray.shape
19875
19882
  * else:
19876
19883
  * return () # <<<<<<<<<<<<<<
@@ -19884,7 +19891,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19884
19891
  goto __pyx_L0;
19885
19892
  }
19886
19893
 
19887
- /* "../../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
19888
19895
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19889
19896
  *
19890
19897
  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
@@ -19899,7 +19906,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19899
19906
  return __pyx_r;
19900
19907
  }
19901
19908
 
19902
- /* "../../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
19903
19910
  * int _import_umath() except -1
19904
19911
  *
19905
19912
  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -19909,7 +19916,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19909
19916
 
19910
19917
  static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
19911
19918
 
19912
- /* "../../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
19913
19920
  *
19914
19921
  * cdef inline void set_array_base(ndarray arr, object base):
19915
19922
  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
@@ -19918,7 +19925,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
19918
19925
  */
19919
19926
  Py_INCREF(__pyx_v_base);
19920
19927
 
19921
- /* "../../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
19922
19929
  * cdef inline void set_array_base(ndarray arr, object base):
19923
19930
  * Py_INCREF(base) # important to do this before stealing the reference below!
19924
19931
  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
@@ -19927,7 +19934,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
19927
19934
  */
19928
19935
  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
19929
19936
 
19930
- /* "../../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
19931
19938
  * int _import_umath() except -1
19932
19939
  *
19933
19940
  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -19938,7 +19945,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
19938
19945
  /* function exit code */
19939
19946
  }
19940
19947
 
19941
- /* "../../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
19942
19949
  * PyArray_SetBaseObject(arr, base)
19943
19950
  *
19944
19951
  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -19953,7 +19960,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19953
19960
  int __pyx_t_1;
19954
19961
  __Pyx_RefNannySetupContext("get_array_base", 1);
19955
19962
 
19956
- /* "../../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
19957
19964
  *
19958
19965
  * cdef inline object get_array_base(ndarray arr):
19959
19966
  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
@@ -19962,7 +19969,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19962
19969
  */
19963
19970
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
19964
19971
 
19965
- /* "../../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
19966
19973
  * cdef inline object get_array_base(ndarray arr):
19967
19974
  * base = PyArray_BASE(arr)
19968
19975
  * if base is NULL: # <<<<<<<<<<<<<<
@@ -19972,7 +19979,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19972
19979
  __pyx_t_1 = (__pyx_v_base == NULL);
19973
19980
  if (__pyx_t_1) {
19974
19981
 
19975
- /* "../../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
19976
19983
  * base = PyArray_BASE(arr)
19977
19984
  * if base is NULL:
19978
19985
  * return None # <<<<<<<<<<<<<<
@@ -19983,7 +19990,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19983
19990
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19984
19991
  goto __pyx_L0;
19985
19992
 
19986
- /* "../../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
19987
19994
  * cdef inline object get_array_base(ndarray arr):
19988
19995
  * base = PyArray_BASE(arr)
19989
19996
  * if base is NULL: # <<<<<<<<<<<<<<
@@ -19992,7 +19999,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
19992
19999
  */
19993
20000
  }
19994
20001
 
19995
- /* "../../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
19996
20003
  * if base is NULL:
19997
20004
  * return None
19998
20005
  * return <object>base # <<<<<<<<<<<<<<
@@ -20004,7 +20011,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20004
20011
  __pyx_r = ((PyObject *)__pyx_v_base);
20005
20012
  goto __pyx_L0;
20006
20013
 
20007
- /* "../../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
20008
20015
  * PyArray_SetBaseObject(arr, base)
20009
20016
  *
20010
20017
  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -20019,7 +20026,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20019
20026
  return __pyx_r;
20020
20027
  }
20021
20028
 
20022
- /* "../../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
20023
20030
  * # Versions of the import_* functions which are more suitable for
20024
20031
  * # Cython code.
20025
20032
  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
@@ -20043,7 +20050,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20043
20050
  int __pyx_clineno = 0;
20044
20051
  __Pyx_RefNannySetupContext("import_array", 1);
20045
20052
 
20046
- /* "../../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
20047
20054
  * # Cython code.
20048
20055
  * cdef inline int import_array() except -1:
20049
20056
  * try: # <<<<<<<<<<<<<<
@@ -20059,7 +20066,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20059
20066
  __Pyx_XGOTREF(__pyx_t_3);
20060
20067
  /*try:*/ {
20061
20068
 
20062
- /* "../../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
20063
20070
  * cdef inline int import_array() except -1:
20064
20071
  * try:
20065
20072
  * __pyx_import_array() # <<<<<<<<<<<<<<
@@ -20068,7 +20075,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20068
20075
  */
20069
20076
  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 984, __pyx_L3_error)
20070
20077
 
20071
- /* "../../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
20072
20079
  * # Cython code.
20073
20080
  * cdef inline int import_array() except -1:
20074
20081
  * try: # <<<<<<<<<<<<<<
@@ -20082,7 +20089,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20082
20089
  goto __pyx_L8_try_end;
20083
20090
  __pyx_L3_error:;
20084
20091
 
20085
- /* "../../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
20086
20093
  * try:
20087
20094
  * __pyx_import_array()
20088
20095
  * except Exception: # <<<<<<<<<<<<<<
@@ -20097,7 +20104,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20097
20104
  __Pyx_XGOTREF(__pyx_t_6);
20098
20105
  __Pyx_XGOTREF(__pyx_t_7);
20099
20106
 
20100
- /* "../../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
20101
20108
  * __pyx_import_array()
20102
20109
  * except Exception:
20103
20110
  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
@@ -20112,7 +20119,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20112
20119
  }
20113
20120
  goto __pyx_L5_except_error;
20114
20121
 
20115
- /* "../../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
20116
20123
  * # Cython code.
20117
20124
  * cdef inline int import_array() except -1:
20118
20125
  * try: # <<<<<<<<<<<<<<
@@ -20128,7 +20135,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20128
20135
  __pyx_L8_try_end:;
20129
20136
  }
20130
20137
 
20131
- /* "../../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
20132
20139
  * # Versions of the import_* functions which are more suitable for
20133
20140
  * # Cython code.
20134
20141
  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
@@ -20151,7 +20158,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20151
20158
  return __pyx_r;
20152
20159
  }
20153
20160
 
20154
- /* "../../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
20155
20162
  * raise ImportError("numpy.core.multiarray failed to import")
20156
20163
  *
20157
20164
  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
@@ -20175,7 +20182,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20175
20182
  int __pyx_clineno = 0;
20176
20183
  __Pyx_RefNannySetupContext("import_umath", 1);
20177
20184
 
20178
- /* "../../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
20179
20186
  *
20180
20187
  * cdef inline int import_umath() except -1:
20181
20188
  * try: # <<<<<<<<<<<<<<
@@ -20191,7 +20198,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20191
20198
  __Pyx_XGOTREF(__pyx_t_3);
20192
20199
  /*try:*/ {
20193
20200
 
20194
- /* "../../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
20195
20202
  * cdef inline int import_umath() except -1:
20196
20203
  * try:
20197
20204
  * _import_umath() # <<<<<<<<<<<<<<
@@ -20200,7 +20207,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20200
20207
  */
20201
20208
  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 990, __pyx_L3_error)
20202
20209
 
20203
- /* "../../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
20204
20211
  *
20205
20212
  * cdef inline int import_umath() except -1:
20206
20213
  * try: # <<<<<<<<<<<<<<
@@ -20214,7 +20221,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20214
20221
  goto __pyx_L8_try_end;
20215
20222
  __pyx_L3_error:;
20216
20223
 
20217
- /* "../../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
20218
20225
  * try:
20219
20226
  * _import_umath()
20220
20227
  * except Exception: # <<<<<<<<<<<<<<
@@ -20229,7 +20236,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20229
20236
  __Pyx_XGOTREF(__pyx_t_6);
20230
20237
  __Pyx_XGOTREF(__pyx_t_7);
20231
20238
 
20232
- /* "../../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
20233
20240
  * _import_umath()
20234
20241
  * except Exception:
20235
20242
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -20244,7 +20251,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20244
20251
  }
20245
20252
  goto __pyx_L5_except_error;
20246
20253
 
20247
- /* "../../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
20248
20255
  *
20249
20256
  * cdef inline int import_umath() except -1:
20250
20257
  * try: # <<<<<<<<<<<<<<
@@ -20260,7 +20267,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20260
20267
  __pyx_L8_try_end:;
20261
20268
  }
20262
20269
 
20263
- /* "../../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
20264
20271
  * raise ImportError("numpy.core.multiarray failed to import")
20265
20272
  *
20266
20273
  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
@@ -20283,7 +20290,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20283
20290
  return __pyx_r;
20284
20291
  }
20285
20292
 
20286
- /* "../../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
20287
20294
  * raise ImportError("numpy.core.umath failed to import")
20288
20295
  *
20289
20296
  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
@@ -20307,7 +20314,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20307
20314
  int __pyx_clineno = 0;
20308
20315
  __Pyx_RefNannySetupContext("import_ufunc", 1);
20309
20316
 
20310
- /* "../../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
20311
20318
  *
20312
20319
  * cdef inline int import_ufunc() except -1:
20313
20320
  * try: # <<<<<<<<<<<<<<
@@ -20323,7 +20330,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20323
20330
  __Pyx_XGOTREF(__pyx_t_3);
20324
20331
  /*try:*/ {
20325
20332
 
20326
- /* "../../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
20327
20334
  * cdef inline int import_ufunc() except -1:
20328
20335
  * try:
20329
20336
  * _import_umath() # <<<<<<<<<<<<<<
@@ -20332,7 +20339,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20332
20339
  */
20333
20340
  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 996, __pyx_L3_error)
20334
20341
 
20335
- /* "../../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
20336
20343
  *
20337
20344
  * cdef inline int import_ufunc() except -1:
20338
20345
  * try: # <<<<<<<<<<<<<<
@@ -20346,7 +20353,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20346
20353
  goto __pyx_L8_try_end;
20347
20354
  __pyx_L3_error:;
20348
20355
 
20349
- /* "../../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
20350
20357
  * try:
20351
20358
  * _import_umath()
20352
20359
  * except Exception: # <<<<<<<<<<<<<<
@@ -20361,7 +20368,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20361
20368
  __Pyx_XGOTREF(__pyx_t_6);
20362
20369
  __Pyx_XGOTREF(__pyx_t_7);
20363
20370
 
20364
- /* "../../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
20365
20372
  * _import_umath()
20366
20373
  * except Exception:
20367
20374
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -20376,7 +20383,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20376
20383
  }
20377
20384
  goto __pyx_L5_except_error;
20378
20385
 
20379
- /* "../../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
20380
20387
  *
20381
20388
  * cdef inline int import_ufunc() except -1:
20382
20389
  * try: # <<<<<<<<<<<<<<
@@ -20392,7 +20399,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20392
20399
  __pyx_L8_try_end:;
20393
20400
  }
20394
20401
 
20395
- /* "../../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
20396
20403
  * raise ImportError("numpy.core.umath failed to import")
20397
20404
  *
20398
20405
  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
@@ -20415,7 +20422,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20415
20422
  return __pyx_r;
20416
20423
  }
20417
20424
 
20418
- /* "../../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
20419
20426
  *
20420
20427
  *
20421
20428
  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
@@ -20426,7 +20433,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20426
20433
  static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
20427
20434
  int __pyx_r;
20428
20435
 
20429
- /* "../../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
20430
20437
  * bool
20431
20438
  * """
20432
20439
  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
@@ -20436,7 +20443,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20436
20443
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
20437
20444
  goto __pyx_L0;
20438
20445
 
20439
- /* "../../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
20440
20447
  *
20441
20448
  *
20442
20449
  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
@@ -20449,7 +20456,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20449
20456
  return __pyx_r;
20450
20457
  }
20451
20458
 
20452
- /* "../../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
20453
20460
  *
20454
20461
  *
20455
20462
  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
@@ -20460,7 +20467,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20460
20467
  static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
20461
20468
  int __pyx_r;
20462
20469
 
20463
- /* "../../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
20464
20471
  * bool
20465
20472
  * """
20466
20473
  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
@@ -20470,7 +20477,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20470
20477
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
20471
20478
  goto __pyx_L0;
20472
20479
 
20473
- /* "../../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
20474
20481
  *
20475
20482
  *
20476
20483
  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
@@ -20483,7 +20490,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20483
20490
  return __pyx_r;
20484
20491
  }
20485
20492
 
20486
- /* "../../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
20487
20494
  *
20488
20495
  *
20489
20496
  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20494,7 +20501,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20494
20501
  static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
20495
20502
  npy_datetime __pyx_r;
20496
20503
 
20497
- /* "../../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
20498
20505
  * also needed. That can be found using `get_datetime64_unit`.
20499
20506
  * """
20500
20507
  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
@@ -20504,7 +20511,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20504
20511
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
20505
20512
  goto __pyx_L0;
20506
20513
 
20507
- /* "../../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
20508
20515
  *
20509
20516
  *
20510
20517
  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20517,7 +20524,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20517
20524
  return __pyx_r;
20518
20525
  }
20519
20526
 
20520
- /* "../../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
20521
20528
  *
20522
20529
  *
20523
20530
  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20528,7 +20535,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20528
20535
  static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
20529
20536
  npy_timedelta __pyx_r;
20530
20537
 
20531
- /* "../../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
20532
20539
  * returns the int64 value underlying scalar numpy timedelta64 object
20533
20540
  * """
20534
20541
  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
@@ -20538,7 +20545,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20538
20545
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
20539
20546
  goto __pyx_L0;
20540
20547
 
20541
- /* "../../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
20542
20549
  *
20543
20550
  *
20544
20551
  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20551,7 +20558,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20551
20558
  return __pyx_r;
20552
20559
  }
20553
20560
 
20554
- /* "../../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
20555
20562
  *
20556
20563
  *
20557
20564
  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20562,7 +20569,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20562
20569
  static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
20563
20570
  NPY_DATETIMEUNIT __pyx_r;
20564
20571
 
20565
- /* "../../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
20566
20573
  * returns the unit part of the dtype for a numpy datetime64 object.
20567
20574
  * """
20568
20575
  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
@@ -20570,7 +20577,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20570
20577
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
20571
20578
  goto __pyx_L0;
20572
20579
 
20573
- /* "../../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
20574
20581
  *
20575
20582
  *
20576
20583
  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20583,7 +20590,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20583
20590
  return __pyx_r;
20584
20591
  }
20585
20592
 
20586
- /* "mettagrid/objects.pxd":24
20593
+ /* "mettagrid/objects.pxd":25
20587
20594
  * unsigned int hp
20588
20595
  *
20589
20596
  * inline void init_mo(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20593,16 +20600,16 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20593
20600
 
20594
20601
  void __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
20595
20602
 
20596
- /* "mettagrid/objects.pxd":25
20603
+ /* "mettagrid/objects.pxd":26
20597
20604
  *
20598
20605
  * inline void init_mo(ObjectConfig cfg):
20599
20606
  * this.hp = cfg[b"hp"] # <<<<<<<<<<<<<<
20600
20607
  *
20601
- * inline char usable(const Agent *actor):
20608
+ * inline bint usable(const Agent *actor):
20602
20609
  */
20603
20610
  this->hp = (__pyx_v_cfg[__pyx_k_hp]);
20604
20611
 
20605
- /* "mettagrid/objects.pxd":24
20612
+ /* "mettagrid/objects.pxd":25
20606
20613
  * unsigned int hp
20607
20614
  *
20608
20615
  * inline void init_mo(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20613,54 +20620,20 @@ void __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_t_9mettagrid_7object
20613
20620
  /* function exit code */
20614
20621
  }
20615
20622
 
20616
- /* "mettagrid/objects.pxd":27
20623
+ /* "mettagrid/objects.pxd":28
20617
20624
  * this.hp = cfg[b"hp"]
20618
20625
  *
20619
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20626
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20620
20627
  * return False
20621
20628
  *
20622
20629
  */
20623
20630
 
20624
- char __pyx_t_9mettagrid_7objects_MettaObject::usable(CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20625
- char __pyx_r;
20626
-
20627
- /* "mettagrid/objects.pxd":28
20628
- *
20629
- * inline char usable(const Agent *actor):
20630
- * return False # <<<<<<<<<<<<<<
20631
- *
20632
- * inline char attackable():
20633
- */
20634
- __pyx_r = 0;
20635
- goto __pyx_L0;
20636
-
20637
- /* "mettagrid/objects.pxd":27
20638
- * this.hp = cfg[b"hp"]
20639
- *
20640
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20641
- * return False
20642
- *
20643
- */
20644
-
20645
- /* function exit code */
20646
- __pyx_L0:;
20647
- return __pyx_r;
20648
- }
20649
-
20650
- /* "mettagrid/objects.pxd":30
20651
- * return False
20652
- *
20653
- * inline char attackable(): # <<<<<<<<<<<<<<
20654
- * return False
20655
- *
20656
- */
20657
-
20658
- char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20659
- 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;
20660
20633
 
20661
- /* "mettagrid/objects.pxd":31
20634
+ /* "mettagrid/objects.pxd":29
20662
20635
  *
20663
- * inline char attackable():
20636
+ * inline bint usable(const Agent *actor):
20664
20637
  * return False # <<<<<<<<<<<<<<
20665
20638
  *
20666
20639
  * cdef cppclass Usable(MettaObject):
@@ -20668,10 +20641,10 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20668
20641
  __pyx_r = 0;
20669
20642
  goto __pyx_L0;
20670
20643
 
20671
- /* "mettagrid/objects.pxd":30
20672
- * return False
20644
+ /* "mettagrid/objects.pxd":28
20645
+ * this.hp = cfg[b"hp"]
20673
20646
  *
20674
- * inline char attackable(): # <<<<<<<<<<<<<<
20647
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20675
20648
  * return False
20676
20649
  *
20677
20650
  */
@@ -20681,7 +20654,7 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20681
20654
  return __pyx_r;
20682
20655
  }
20683
20656
 
20684
- /* "mettagrid/objects.pxd":38
20657
+ /* "mettagrid/objects.pxd":36
20685
20658
  * unsigned char ready
20686
20659
  *
20687
20660
  * inline void init_usable(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20691,7 +20664,7 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20691
20664
 
20692
20665
  void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
20693
20666
 
20694
- /* "mettagrid/objects.pxd":39
20667
+ /* "mettagrid/objects.pxd":37
20695
20668
  *
20696
20669
  * inline void init_usable(ObjectConfig cfg):
20697
20670
  * this.use_cost = cfg[b"use_cost"] # <<<<<<<<<<<<<<
@@ -20700,7 +20673,7 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20700
20673
  */
20701
20674
  this->use_cost = (__pyx_v_cfg[__pyx_k_use_cost]);
20702
20675
 
20703
- /* "mettagrid/objects.pxd":40
20676
+ /* "mettagrid/objects.pxd":38
20704
20677
  * inline void init_usable(ObjectConfig cfg):
20705
20678
  * this.use_cost = cfg[b"use_cost"]
20706
20679
  * this.cooldown = cfg[b"cooldown"] # <<<<<<<<<<<<<<
@@ -20709,16 +20682,16 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20709
20682
  */
20710
20683
  this->cooldown = (__pyx_v_cfg[__pyx_k_cooldown]);
20711
20684
 
20712
- /* "mettagrid/objects.pxd":41
20685
+ /* "mettagrid/objects.pxd":39
20713
20686
  * this.use_cost = cfg[b"use_cost"]
20714
20687
  * this.cooldown = cfg[b"cooldown"]
20715
20688
  * this.ready = 1 # <<<<<<<<<<<<<<
20716
20689
  *
20717
- * inline char usable(const Agent *actor):
20690
+ * inline bint usable(const Agent *actor):
20718
20691
  */
20719
20692
  this->ready = 1;
20720
20693
 
20721
- /* "mettagrid/objects.pxd":38
20694
+ /* "mettagrid/objects.pxd":36
20722
20695
  * unsigned char ready
20723
20696
  *
20724
20697
  * inline void init_usable(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20729,29 +20702,30 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20729
20702
  /* function exit code */
20730
20703
  }
20731
20704
 
20732
- /* "mettagrid/objects.pxd":43
20705
+ /* "mettagrid/objects.pxd":41
20733
20706
  * this.ready = 1
20734
20707
  *
20735
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20708
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20736
20709
  * return this.ready and this.use_cost <= actor.energy
20737
20710
  *
20738
20711
  */
20739
20712
 
20740
- char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20741
- char __pyx_r;
20742
- 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;
20743
20716
  int __pyx_t_2;
20744
20717
 
20745
- /* "mettagrid/objects.pxd":44
20718
+ /* "mettagrid/objects.pxd":42
20746
20719
  *
20747
- * inline char usable(const Agent *actor):
20720
+ * inline bint usable(const Agent *actor):
20748
20721
  * return this.ready and this.use_cost <= actor.energy # <<<<<<<<<<<<<<
20749
20722
  *
20750
20723
  * cdef enum ObjectType:
20751
20724
  */
20752
- if (this->ready) {
20725
+ __pyx_t_2 = (this->ready != 0);
20726
+ if (__pyx_t_2) {
20753
20727
  } else {
20754
- __pyx_t_1 = this->ready;
20728
+ __pyx_t_1 = __pyx_t_2;
20755
20729
  goto __pyx_L3_bool_binop_done;
20756
20730
  }
20757
20731
  __pyx_t_2 = (this->use_cost <= __pyx_v_actor->energy);
@@ -20760,10 +20734,10 @@ char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agen
20760
20734
  __pyx_r = __pyx_t_1;
20761
20735
  goto __pyx_L0;
20762
20736
 
20763
- /* "mettagrid/objects.pxd":43
20737
+ /* "mettagrid/objects.pxd":41
20764
20738
  * this.ready = 1
20765
20739
  *
20766
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20740
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20767
20741
  * return this.ready and this.use_cost <= actor.energy
20768
20742
  *
20769
20743
  */
@@ -20773,8 +20747,8 @@ char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agen
20773
20747
  return __pyx_r;
20774
20748
  }
20775
20749
 
20776
- /* "mettagrid/objects.pxd":72
20777
- * vector[unsigned short] inventory
20750
+ /* "mettagrid/objects.pxd":74
20751
+ * unsigned char max_energy
20778
20752
  *
20779
20753
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
20780
20754
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
@@ -20786,67 +20760,103 @@ void __pyx_t_9mettagrid_7objects_Agent::__pyx_f___init__Agent(GridCoord __pyx_v_
20786
20760
  const char *__pyx_filename = NULL;
20787
20761
  int __pyx_clineno = 0;
20788
20762
 
20789
- /* "mettagrid/objects.pxd":73
20763
+ /* "mettagrid/objects.pxd":75
20790
20764
  *
20791
20765
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg):
20792
20766
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer)) # <<<<<<<<<<<<<<
20793
20767
  * MettaObject.init_mo(cfg)
20794
- * this.frozen = False
20768
+ * this.frozen = 0
20795
20769
  */
20796
20770
  GridObject::init(__pyx_e_9mettagrid_7objects_AgentT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Agent_Layer));
20797
20771
 
20798
- /* "mettagrid/objects.pxd":74
20772
+ /* "mettagrid/objects.pxd":76
20799
20773
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg):
20800
20774
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
20801
20775
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
20802
- * this.frozen = False
20803
- * this.energy = cfg[b"initial_energy"]
20776
+ * this.frozen = 0
20777
+ * this.freeze_duration = cfg[b"freeze_duration"]
20804
20778
  */
20805
- __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)
20806
20780
 
20807
- /* "mettagrid/objects.pxd":75
20781
+ /* "mettagrid/objects.pxd":77
20808
20782
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
20809
20783
  * MettaObject.init_mo(cfg)
20810
- * this.frozen = False # <<<<<<<<<<<<<<
20784
+ * this.frozen = 0 # <<<<<<<<<<<<<<
20785
+ * this.freeze_duration = cfg[b"freeze_duration"]
20811
20786
  * this.energy = cfg[b"initial_energy"]
20812
- * this.orientation = 0
20813
20787
  */
20814
20788
  this->frozen = 0;
20815
20789
 
20816
- /* "mettagrid/objects.pxd":76
20790
+ /* "mettagrid/objects.pxd":78
20817
20791
  * MettaObject.init_mo(cfg)
20818
- * 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"]
20819
20802
  * this.energy = cfg[b"initial_energy"] # <<<<<<<<<<<<<<
20820
- * this.orientation = 0
20821
- * this.inventory.resize(InventoryItem.InventoryCount)
20803
+ * this.max_energy = cfg[b"max_energy"]
20804
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20822
20805
  */
20823
20806
  this->energy = (__pyx_v_cfg[__pyx_k_initial_energy]);
20824
20807
 
20825
- /* "mettagrid/objects.pxd":77
20826
- * this.frozen = False
20808
+ /* "mettagrid/objects.pxd":80
20809
+ * this.freeze_duration = cfg[b"freeze_duration"]
20827
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
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"]
20828
20829
  * this.orientation = 0 # <<<<<<<<<<<<<<
20829
20830
  * this.inventory.resize(InventoryItem.InventoryCount)
20830
- *
20831
+ * this.max_items = cfg[b"max_inventory"]
20831
20832
  */
20832
20833
  this->orientation = 0;
20833
20834
 
20834
- /* "mettagrid/objects.pxd":78
20835
- * this.energy = cfg[b"initial_energy"]
20835
+ /* "mettagrid/objects.pxd":83
20836
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20836
20837
  * this.orientation = 0
20837
20838
  * this.inventory.resize(InventoryItem.InventoryCount) # <<<<<<<<<<<<<<
20839
+ * this.max_items = cfg[b"max_inventory"]
20838
20840
  *
20839
- * inline void update_inventory(InventoryItem item, short amount):
20840
20841
  */
20841
20842
  try {
20842
20843
  this->inventory.resize(__pyx_e_9mettagrid_7objects_InventoryCount);
20843
20844
  } catch(...) {
20844
20845
  __Pyx_CppExn2PyErr();
20845
- __PYX_ERR(3, 78, __pyx_L1_error)
20846
+ __PYX_ERR(3, 83, __pyx_L1_error)
20846
20847
  }
20847
20848
 
20848
- /* "mettagrid/objects.pxd":72
20849
- * 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
20850
20860
  *
20851
20861
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
20852
20862
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
@@ -20860,40 +20870,71 @@ void __pyx_t_9mettagrid_7objects_Agent::__pyx_f___init__Agent(GridCoord __pyx_v_
20860
20870
  __pyx_L0:;
20861
20871
  }
20862
20872
 
20863
- /* "mettagrid/objects.pxd":80
20864
- * this.inventory.resize(InventoryItem.InventoryCount)
20873
+ /* "mettagrid/objects.pxd":86
20874
+ * this.max_items = cfg[b"max_inventory"]
20865
20875
  *
20866
20876
  * inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
20867
20877
  * this.inventory[<InventoryItem>item] += amount
20868
- *
20878
+ * if this.inventory[<InventoryItem>item] > this.max_items:
20869
20879
  */
20870
20880
 
20871
20881
  void __pyx_t_9mettagrid_7objects_Agent::update_inventory(enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_v_item, short __pyx_v_amount) {
20872
20882
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_1;
20883
+ int __pyx_t_2;
20884
+ unsigned char __pyx_t_3;
20873
20885
 
20874
- /* "mettagrid/objects.pxd":81
20886
+ /* "mettagrid/objects.pxd":87
20875
20887
  *
20876
20888
  * inline void update_inventory(InventoryItem item, short amount):
20877
20889
  * this.inventory[<InventoryItem>item] += amount # <<<<<<<<<<<<<<
20878
- *
20879
- * inline void obs(ObsType[:] obs):
20890
+ * if this.inventory[<InventoryItem>item] > this.max_items:
20891
+ * this.inventory[<InventoryItem>item] = this.max_items
20880
20892
  */
20881
20893
  __pyx_t_1 = ((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item);
20882
20894
  (this->inventory[__pyx_t_1]) = ((this->inventory[__pyx_t_1]) + __pyx_v_amount);
20883
20895
 
20884
- /* "mettagrid/objects.pxd":80
20885
- * 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
20886
20901
  *
20887
- * 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):
20888
20918
  * this.inventory[<InventoryItem>item] += amount
20919
+ * if this.inventory[<InventoryItem>item] > this.max_items: # <<<<<<<<<<<<<<
20920
+ * this.inventory[<InventoryItem>item] = this.max_items
20889
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:
20890
20931
  */
20891
20932
 
20892
20933
  /* function exit code */
20893
20934
  }
20894
20935
 
20895
- /* "mettagrid/objects.pxd":83
20896
- * this.inventory[<InventoryItem>item] += amount
20936
+ /* "mettagrid/objects.pxd":91
20937
+ * this.inventory[<InventoryItem>item] = this.max_items
20897
20938
  *
20898
20939
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
20899
20940
  * obs[0] = 1
@@ -20905,12 +20946,12 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20905
20946
  unsigned short __pyx_v_i;
20906
20947
  Py_ssize_t __pyx_t_1;
20907
20948
  unsigned int __pyx_t_2;
20908
- char __pyx_t_3;
20949
+ unsigned char __pyx_t_3;
20909
20950
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_4;
20910
20951
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_5;
20911
20952
  unsigned short __pyx_t_6;
20912
20953
 
20913
- /* "mettagrid/objects.pxd":84
20954
+ /* "mettagrid/objects.pxd":92
20914
20955
  *
20915
20956
  * inline void obs(ObsType[:] obs):
20916
20957
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -20920,7 +20961,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20920
20961
  __pyx_t_1 = 0;
20921
20962
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
20922
20963
 
20923
- /* "mettagrid/objects.pxd":85
20964
+ /* "mettagrid/objects.pxd":93
20924
20965
  * inline void obs(ObsType[:] obs):
20925
20966
  * obs[0] = 1
20926
20967
  * obs[1] = this.hp # <<<<<<<<<<<<<<
@@ -20931,29 +20972,29 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20931
20972
  __pyx_t_1 = 1;
20932
20973
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
20933
20974
 
20934
- /* "mettagrid/objects.pxd":86
20975
+ /* "mettagrid/objects.pxd":94
20935
20976
  * obs[0] = 1
20936
20977
  * obs[1] = this.hp
20937
20978
  * obs[2] = this.frozen # <<<<<<<<<<<<<<
20938
20979
  * obs[3] = this.energy
20939
20980
  * obs[4] = this.orientation
20940
20981
  */
20941
- __pyx_t_3 = this->frozen;
20982
+ __pyx_t_2 = this->frozen;
20942
20983
  __pyx_t_1 = 2;
20943
- *((__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;
20944
20985
 
20945
- /* "mettagrid/objects.pxd":87
20986
+ /* "mettagrid/objects.pxd":95
20946
20987
  * obs[1] = this.hp
20947
20988
  * obs[2] = this.frozen
20948
20989
  * obs[3] = this.energy # <<<<<<<<<<<<<<
20949
20990
  * obs[4] = this.orientation
20950
20991
  * obs[5] = this.shield
20951
20992
  */
20952
- __pyx_t_2 = this->energy;
20993
+ __pyx_t_3 = this->energy;
20953
20994
  __pyx_t_1 = 3;
20954
- *((__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;
20955
20996
 
20956
- /* "mettagrid/objects.pxd":88
20997
+ /* "mettagrid/objects.pxd":96
20957
20998
  * obs[2] = this.frozen
20958
20999
  * obs[3] = this.energy
20959
21000
  * obs[4] = this.orientation # <<<<<<<<<<<<<<
@@ -20964,7 +21005,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20964
21005
  __pyx_t_1 = 4;
20965
21006
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
20966
21007
 
20967
- /* "mettagrid/objects.pxd":89
21008
+ /* "mettagrid/objects.pxd":97
20968
21009
  * obs[3] = this.energy
20969
21010
  * obs[4] = this.orientation
20970
21011
  * obs[5] = this.shield # <<<<<<<<<<<<<<
@@ -20975,7 +21016,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20975
21016
  __pyx_t_1 = 5;
20976
21017
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
20977
21018
 
20978
- /* "mettagrid/objects.pxd":91
21019
+ /* "mettagrid/objects.pxd":99
20979
21020
  * obs[5] = this.shield
20980
21021
  *
20981
21022
  * cdef unsigned short idx = 6 # <<<<<<<<<<<<<<
@@ -20984,7 +21025,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20984
21025
  */
20985
21026
  __pyx_v_idx = 6;
20986
21027
 
20987
- /* "mettagrid/objects.pxd":93
21028
+ /* "mettagrid/objects.pxd":101
20988
21029
  * cdef unsigned short idx = 6
20989
21030
  * cdef unsigned short i
20990
21031
  * for i in range(InventoryItem.InventoryCount): # <<<<<<<<<<<<<<
@@ -20996,7 +21037,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
20996
21037
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
20997
21038
  __pyx_v_i = __pyx_t_6;
20998
21039
 
20999
- /* "mettagrid/objects.pxd":94
21040
+ /* "mettagrid/objects.pxd":102
21000
21041
  * cdef unsigned short i
21001
21042
  * for i in range(InventoryItem.InventoryCount):
21002
21043
  * obs[idx + i] = this.inventory[i] # <<<<<<<<<<<<<<
@@ -21007,8 +21048,8 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21007
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]);
21008
21049
  }
21009
21050
 
21010
- /* "mettagrid/objects.pxd":83
21011
- * this.inventory[<InventoryItem>item] += amount
21051
+ /* "mettagrid/objects.pxd":91
21052
+ * this.inventory[<InventoryItem>item] = this.max_items
21012
21053
  *
21013
21054
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
21014
21055
  * obs[0] = 1
@@ -21018,7 +21059,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21018
21059
  /* function exit code */
21019
21060
  }
21020
21061
 
21021
- /* "mettagrid/objects.pxd":97
21062
+ /* "mettagrid/objects.pxd":105
21022
21063
  *
21023
21064
  * @staticmethod
21024
21065
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21042,46 +21083,46 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21042
21083
  int __pyx_clineno = 0;
21043
21084
  __Pyx_RefNannySetupContext("feature_names", 1);
21044
21085
 
21045
- /* "mettagrid/objects.pxd":98
21086
+ /* "mettagrid/objects.pxd":106
21046
21087
  * @staticmethod
21047
21088
  * inline vector[string] feature_names():
21048
21089
  * return [ # <<<<<<<<<<<<<<
21049
21090
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21050
21091
  * "agent:shield"
21051
21092
  */
21052
- __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)
21053
21094
  __Pyx_GOTREF(__pyx_t_1);
21054
21095
  __Pyx_INCREF(__pyx_n_u_agent);
21055
21096
  __Pyx_GIVEREF(__pyx_n_u_agent);
21056
- 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);
21057
21098
  __Pyx_INCREF(__pyx_kp_u_agent_hp);
21058
21099
  __Pyx_GIVEREF(__pyx_kp_u_agent_hp);
21059
- 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);
21060
21101
  __Pyx_INCREF(__pyx_kp_u_agent_frozen);
21061
21102
  __Pyx_GIVEREF(__pyx_kp_u_agent_frozen);
21062
- 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);
21063
21104
  __Pyx_INCREF(__pyx_kp_u_agent_energy);
21064
21105
  __Pyx_GIVEREF(__pyx_kp_u_agent_energy);
21065
- 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);
21066
21107
  __Pyx_INCREF(__pyx_kp_u_agent_orientation);
21067
21108
  __Pyx_GIVEREF(__pyx_kp_u_agent_orientation);
21068
- 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);
21069
21110
  __Pyx_INCREF(__pyx_kp_u_agent_shield);
21070
21111
  __Pyx_GIVEREF(__pyx_kp_u_agent_shield);
21071
- 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);
21072
21113
  { /* enter inner scope */
21073
21114
 
21074
- /* "mettagrid/objects.pxd":101
21115
+ /* "mettagrid/objects.pxd":109
21075
21116
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21076
21117
  * "agent:shield"
21077
21118
  * ] + [ # <<<<<<<<<<<<<<
21078
21119
  * "agent:inv:" + n for n in InventoryItemNames]
21079
21120
  *
21080
21121
  */
21081
- __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)
21082
21123
  __Pyx_GOTREF(__pyx_t_2);
21083
21124
 
21084
- /* "mettagrid/objects.pxd":102
21125
+ /* "mettagrid/objects.pxd":110
21085
21126
  * "agent:shield"
21086
21127
  * ] + [
21087
21128
  * "agent:inv:" + n for n in InventoryItemNames] # <<<<<<<<<<<<<<
@@ -21094,33 +21135,33 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21094
21135
  __pyx_t_4 = *__pyx_t_3;
21095
21136
  ++__pyx_t_3;
21096
21137
  __pyx_7genexpr__pyx_v_n = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);
21097
- __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)
21098
21139
  __Pyx_GOTREF(__pyx_t_5);
21099
- __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)
21100
21141
  __Pyx_GOTREF(__pyx_t_6);
21101
21142
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21102
- 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)
21103
21144
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21104
21145
  }
21105
21146
  } /* exit inner scope */
21106
21147
 
21107
- /* "mettagrid/objects.pxd":101
21148
+ /* "mettagrid/objects.pxd":109
21108
21149
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21109
21150
  * "agent:shield"
21110
21151
  * ] + [ # <<<<<<<<<<<<<<
21111
21152
  * "agent:inv:" + n for n in InventoryItemNames]
21112
21153
  *
21113
21154
  */
21114
- __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)
21115
21156
  __Pyx_GOTREF(__pyx_t_6);
21116
21157
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21117
21158
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21118
- __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)
21119
21160
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21120
21161
  __pyx_r = __pyx_t_7;
21121
21162
  goto __pyx_L0;
21122
21163
 
21123
- /* "mettagrid/objects.pxd":97
21164
+ /* "mettagrid/objects.pxd":105
21124
21165
  *
21125
21166
  * @staticmethod
21126
21167
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21141,7 +21182,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21141
21182
  return __pyx_r;
21142
21183
  }
21143
21184
 
21144
- /* "mettagrid/objects.pxd":105
21185
+ /* "mettagrid/objects.pxd":113
21145
21186
  *
21146
21187
  * cdef cppclass Wall(MettaObject):
21147
21188
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21154,7 +21195,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21154
21195
  const char *__pyx_filename = NULL;
21155
21196
  int __pyx_clineno = 0;
21156
21197
 
21157
- /* "mettagrid/objects.pxd":106
21198
+ /* "mettagrid/objects.pxd":114
21158
21199
  * cdef cppclass Wall(MettaObject):
21159
21200
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg):
21160
21201
  * GridObject.init(ObjectType.WallT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21163,16 +21204,16 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21163
21204
  */
21164
21205
  GridObject::init(__pyx_e_9mettagrid_7objects_WallT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21165
21206
 
21166
- /* "mettagrid/objects.pxd":107
21207
+ /* "mettagrid/objects.pxd":115
21167
21208
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg):
21168
21209
  * GridObject.init(ObjectType.WallT, GridLocation(r, c, GridLayer.Object_Layer))
21169
21210
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21170
21211
  *
21171
21212
  * inline void obs(ObsType[:] obs):
21172
21213
  */
21173
- __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)
21174
21215
 
21175
- /* "mettagrid/objects.pxd":105
21216
+ /* "mettagrid/objects.pxd":113
21176
21217
  *
21177
21218
  * cdef cppclass Wall(MettaObject):
21178
21219
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21187,7 +21228,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21187
21228
  __pyx_L0:;
21188
21229
  }
21189
21230
 
21190
- /* "mettagrid/objects.pxd":109
21231
+ /* "mettagrid/objects.pxd":117
21191
21232
  * MettaObject.init_mo(cfg)
21192
21233
  *
21193
21234
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21198,7 +21239,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21198
21239
  void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21199
21240
  Py_ssize_t __pyx_t_1;
21200
21241
 
21201
- /* "mettagrid/objects.pxd":110
21242
+ /* "mettagrid/objects.pxd":118
21202
21243
  *
21203
21244
  * inline void obs(ObsType[:] obs):
21204
21245
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21208,7 +21249,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21208
21249
  __pyx_t_1 = 0;
21209
21250
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21210
21251
 
21211
- /* "mettagrid/objects.pxd":111
21252
+ /* "mettagrid/objects.pxd":119
21212
21253
  * inline void obs(ObsType[:] obs):
21213
21254
  * obs[0] = 1
21214
21255
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -21218,7 +21259,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21218
21259
  __pyx_t_1 = 1;
21219
21260
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
21220
21261
 
21221
- /* "mettagrid/objects.pxd":109
21262
+ /* "mettagrid/objects.pxd":117
21222
21263
  * MettaObject.init_mo(cfg)
21223
21264
  *
21224
21265
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21229,7 +21270,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21229
21270
  /* function exit code */
21230
21271
  }
21231
21272
 
21232
- /* "mettagrid/objects.pxd":114
21273
+ /* "mettagrid/objects.pxd":122
21233
21274
  *
21234
21275
  * @staticmethod
21235
21276
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21247,27 +21288,27 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Wall::feature_names(void)
21247
21288
  int __pyx_clineno = 0;
21248
21289
  __Pyx_RefNannySetupContext("feature_names", 1);
21249
21290
 
21250
- /* "mettagrid/objects.pxd":115
21291
+ /* "mettagrid/objects.pxd":123
21251
21292
  * @staticmethod
21252
21293
  * inline vector[string] feature_names():
21253
21294
  * return ["wall", "wall:hp"] # <<<<<<<<<<<<<<
21254
21295
  *
21255
21296
  * cdef cppclass Generator(Usable):
21256
21297
  */
21257
- __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)
21258
21299
  __Pyx_GOTREF(__pyx_t_1);
21259
21300
  __Pyx_INCREF(__pyx_n_u_wall);
21260
21301
  __Pyx_GIVEREF(__pyx_n_u_wall);
21261
- 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);
21262
21303
  __Pyx_INCREF(__pyx_kp_u_wall_hp);
21263
21304
  __Pyx_GIVEREF(__pyx_kp_u_wall_hp);
21264
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_wall_hp)) __PYX_ERR(3, 115, __pyx_L1_error);
21265
- __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)
21266
21307
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21267
21308
  __pyx_r = __pyx_t_2;
21268
21309
  goto __pyx_L0;
21269
21310
 
21270
- /* "mettagrid/objects.pxd":114
21311
+ /* "mettagrid/objects.pxd":122
21271
21312
  *
21272
21313
  * @staticmethod
21273
21314
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21285,7 +21326,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Wall::feature_names(void)
21285
21326
  return __pyx_r;
21286
21327
  }
21287
21328
 
21288
- /* "mettagrid/objects.pxd":120
21329
+ /* "mettagrid/objects.pxd":128
21289
21330
  * unsigned int r1
21290
21331
  *
21291
21332
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21298,7 +21339,7 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21298
21339
  const char *__pyx_filename = NULL;
21299
21340
  int __pyx_clineno = 0;
21300
21341
 
21301
- /* "mettagrid/objects.pxd":121
21342
+ /* "mettagrid/objects.pxd":129
21302
21343
  *
21303
21344
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg):
21304
21345
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21307,34 +21348,34 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21307
21348
  */
21308
21349
  GridObject::init(__pyx_e_9mettagrid_7objects_GeneratorT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21309
21350
 
21310
- /* "mettagrid/objects.pxd":122
21351
+ /* "mettagrid/objects.pxd":130
21311
21352
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg):
21312
21353
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer))
21313
21354
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21314
21355
  * Usable.init_usable(cfg)
21315
21356
  * this.r1 = cfg[b"initial_resources"]
21316
21357
  */
21317
- __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)
21318
21359
 
21319
- /* "mettagrid/objects.pxd":123
21360
+ /* "mettagrid/objects.pxd":131
21320
21361
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer))
21321
21362
  * MettaObject.init_mo(cfg)
21322
21363
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
21323
21364
  * this.r1 = cfg[b"initial_resources"]
21324
21365
  *
21325
21366
  */
21326
- __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)
21327
21368
 
21328
- /* "mettagrid/objects.pxd":124
21369
+ /* "mettagrid/objects.pxd":132
21329
21370
  * MettaObject.init_mo(cfg)
21330
21371
  * Usable.init_usable(cfg)
21331
21372
  * this.r1 = cfg[b"initial_resources"] # <<<<<<<<<<<<<<
21332
21373
  *
21333
- * inline char usable(const Agent *actor):
21374
+ * inline bint usable(const Agent *actor):
21334
21375
  */
21335
21376
  this->r1 = (__pyx_v_cfg[__pyx_k_initial_resources]);
21336
21377
 
21337
- /* "mettagrid/objects.pxd":120
21378
+ /* "mettagrid/objects.pxd":128
21338
21379
  * unsigned int r1
21339
21380
  *
21340
21381
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21349,46 +21390,45 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21349
21390
  __pyx_L0:;
21350
21391
  }
21351
21392
 
21352
- /* "mettagrid/objects.pxd":126
21393
+ /* "mettagrid/objects.pxd":134
21353
21394
  * this.r1 = cfg[b"initial_resources"]
21354
21395
  *
21355
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21396
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21356
21397
  * return Usable.usable(actor) and this.r1 > 0
21357
21398
  *
21358
21399
  */
21359
21400
 
21360
- char __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21361
- char __pyx_r;
21362
- char __pyx_t_1;
21363
- char __pyx_t_2;
21364
- 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;
21365
21405
  int __pyx_lineno = 0;
21366
21406
  const char *__pyx_filename = NULL;
21367
21407
  int __pyx_clineno = 0;
21368
21408
 
21369
- /* "mettagrid/objects.pxd":127
21409
+ /* "mettagrid/objects.pxd":135
21370
21410
  *
21371
- * inline char usable(const Agent *actor):
21411
+ * inline bint usable(const Agent *actor):
21372
21412
  * return Usable.usable(actor) and this.r1 > 0 # <<<<<<<<<<<<<<
21373
21413
  *
21374
21414
  * inline void obs(ObsType[:] obs):
21375
21415
  */
21376
- __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)
21377
21417
  if (__pyx_t_2) {
21378
21418
  } else {
21379
21419
  __pyx_t_1 = __pyx_t_2;
21380
21420
  goto __pyx_L3_bool_binop_done;
21381
21421
  }
21382
- __pyx_t_3 = (this->r1 > 0);
21383
- __pyx_t_1 = __pyx_t_3;
21422
+ __pyx_t_2 = (this->r1 > 0);
21423
+ __pyx_t_1 = __pyx_t_2;
21384
21424
  __pyx_L3_bool_binop_done:;
21385
21425
  __pyx_r = __pyx_t_1;
21386
21426
  goto __pyx_L0;
21387
21427
 
21388
- /* "mettagrid/objects.pxd":126
21428
+ /* "mettagrid/objects.pxd":134
21389
21429
  * this.r1 = cfg[b"initial_resources"]
21390
21430
  *
21391
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21431
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21392
21432
  * return Usable.usable(actor) and this.r1 > 0
21393
21433
  *
21394
21434
  */
@@ -21401,7 +21441,7 @@ char __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_A
21401
21441
  return __pyx_r;
21402
21442
  }
21403
21443
 
21404
- /* "mettagrid/objects.pxd":129
21444
+ /* "mettagrid/objects.pxd":137
21405
21445
  * return Usable.usable(actor) and this.r1 > 0
21406
21446
  *
21407
21447
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21414,7 +21454,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21414
21454
  unsigned int __pyx_t_2;
21415
21455
  unsigned char __pyx_t_3;
21416
21456
 
21417
- /* "mettagrid/objects.pxd":130
21457
+ /* "mettagrid/objects.pxd":138
21418
21458
  *
21419
21459
  * inline void obs(ObsType[:] obs):
21420
21460
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21424,7 +21464,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21424
21464
  __pyx_t_1 = 0;
21425
21465
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21426
21466
 
21427
- /* "mettagrid/objects.pxd":131
21467
+ /* "mettagrid/objects.pxd":139
21428
21468
  * inline void obs(ObsType[:] obs):
21429
21469
  * obs[0] = 1
21430
21470
  * obs[1] = this.hp # <<<<<<<<<<<<<<
@@ -21435,7 +21475,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21435
21475
  __pyx_t_1 = 1;
21436
21476
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21437
21477
 
21438
- /* "mettagrid/objects.pxd":132
21478
+ /* "mettagrid/objects.pxd":140
21439
21479
  * obs[0] = 1
21440
21480
  * obs[1] = this.hp
21441
21481
  * obs[2] = this.r1 # <<<<<<<<<<<<<<
@@ -21446,7 +21486,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21446
21486
  __pyx_t_1 = 2;
21447
21487
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21448
21488
 
21449
- /* "mettagrid/objects.pxd":133
21489
+ /* "mettagrid/objects.pxd":141
21450
21490
  * obs[1] = this.hp
21451
21491
  * obs[2] = this.r1
21452
21492
  * obs[3] = this.ready # <<<<<<<<<<<<<<
@@ -21457,7 +21497,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21457
21497
  __pyx_t_1 = 3;
21458
21498
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
21459
21499
 
21460
- /* "mettagrid/objects.pxd":129
21500
+ /* "mettagrid/objects.pxd":137
21461
21501
  * return Usable.usable(actor) and this.r1 > 0
21462
21502
  *
21463
21503
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21468,7 +21508,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21468
21508
  /* function exit code */
21469
21509
  }
21470
21510
 
21471
- /* "mettagrid/objects.pxd":137
21511
+ /* "mettagrid/objects.pxd":145
21472
21512
  *
21473
21513
  * @staticmethod
21474
21514
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21486,33 +21526,33 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Generator::feature_names(v
21486
21526
  int __pyx_clineno = 0;
21487
21527
  __Pyx_RefNannySetupContext("feature_names", 1);
21488
21528
 
21489
- /* "mettagrid/objects.pxd":138
21529
+ /* "mettagrid/objects.pxd":146
21490
21530
  * @staticmethod
21491
21531
  * inline vector[string] feature_names():
21492
21532
  * return ["generator", "generator:hp", "generator:r1", "generator:ready"] # <<<<<<<<<<<<<<
21493
21533
  *
21494
21534
  * cdef cppclass Converter(Usable):
21495
21535
  */
21496
- __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)
21497
21537
  __Pyx_GOTREF(__pyx_t_1);
21498
21538
  __Pyx_INCREF(__pyx_n_u_generator);
21499
21539
  __Pyx_GIVEREF(__pyx_n_u_generator);
21500
- 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);
21501
21541
  __Pyx_INCREF(__pyx_kp_u_generator_hp);
21502
21542
  __Pyx_GIVEREF(__pyx_kp_u_generator_hp);
21503
- 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);
21504
21544
  __Pyx_INCREF(__pyx_kp_u_generator_r1);
21505
21545
  __Pyx_GIVEREF(__pyx_kp_u_generator_r1);
21506
- 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);
21507
21547
  __Pyx_INCREF(__pyx_kp_u_generator_ready);
21508
21548
  __Pyx_GIVEREF(__pyx_kp_u_generator_ready);
21509
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_generator_ready)) __PYX_ERR(3, 138, __pyx_L1_error);
21510
- __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)
21511
21551
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21512
21552
  __pyx_r = __pyx_t_2;
21513
21553
  goto __pyx_L0;
21514
21554
 
21515
- /* "mettagrid/objects.pxd":137
21555
+ /* "mettagrid/objects.pxd":145
21516
21556
  *
21517
21557
  * @staticmethod
21518
21558
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21530,7 +21570,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Generator::feature_names(v
21530
21570
  return __pyx_r;
21531
21571
  }
21532
21572
 
21533
- /* "mettagrid/objects.pxd":145
21573
+ /* "mettagrid/objects.pxd":153
21534
21574
  * short output_energy
21535
21575
  *
21536
21576
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21543,7 +21583,7 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21543
21583
  const char *__pyx_filename = NULL;
21544
21584
  int __pyx_clineno = 0;
21545
21585
 
21546
- /* "mettagrid/objects.pxd":146
21586
+ /* "mettagrid/objects.pxd":154
21547
21587
  *
21548
21588
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg):
21549
21589
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21552,25 +21592,25 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21552
21592
  */
21553
21593
  GridObject::init(__pyx_e_9mettagrid_7objects_ConverterT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21554
21594
 
21555
- /* "mettagrid/objects.pxd":147
21595
+ /* "mettagrid/objects.pxd":155
21556
21596
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg):
21557
21597
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer))
21558
21598
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21559
21599
  * Usable.init_usable(cfg)
21560
21600
  * this.input_resource = InventoryItem.r1
21561
21601
  */
21562
- __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)
21563
21603
 
21564
- /* "mettagrid/objects.pxd":148
21604
+ /* "mettagrid/objects.pxd":156
21565
21605
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer))
21566
21606
  * MettaObject.init_mo(cfg)
21567
21607
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
21568
21608
  * this.input_resource = InventoryItem.r1
21569
21609
  * this.output_resource = InventoryItem.r2
21570
21610
  */
21571
- __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)
21572
21612
 
21573
- /* "mettagrid/objects.pxd":149
21613
+ /* "mettagrid/objects.pxd":157
21574
21614
  * MettaObject.init_mo(cfg)
21575
21615
  * Usable.init_usable(cfg)
21576
21616
  * this.input_resource = InventoryItem.r1 # <<<<<<<<<<<<<<
@@ -21579,7 +21619,7 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21579
21619
  */
21580
21620
  this->input_resource = __pyx_e_9mettagrid_7objects_r1;
21581
21621
 
21582
- /* "mettagrid/objects.pxd":150
21622
+ /* "mettagrid/objects.pxd":158
21583
21623
  * Usable.init_usable(cfg)
21584
21624
  * this.input_resource = InventoryItem.r1
21585
21625
  * this.output_resource = InventoryItem.r2 # <<<<<<<<<<<<<<
@@ -21588,16 +21628,16 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21588
21628
  */
21589
21629
  this->output_resource = __pyx_e_9mettagrid_7objects_r2;
21590
21630
 
21591
- /* "mettagrid/objects.pxd":151
21631
+ /* "mettagrid/objects.pxd":159
21592
21632
  * this.input_resource = InventoryItem.r1
21593
21633
  * this.output_resource = InventoryItem.r2
21594
21634
  * this.output_energy = cfg[b"energy_output.r1"] # <<<<<<<<<<<<<<
21595
21635
  *
21596
- * inline char usable(const Agent *actor):
21636
+ * inline bint usable(const Agent *actor):
21597
21637
  */
21598
21638
  this->output_energy = (__pyx_v_cfg[__pyx_k_energy_output_r1]);
21599
21639
 
21600
- /* "mettagrid/objects.pxd":145
21640
+ /* "mettagrid/objects.pxd":153
21601
21641
  * short output_energy
21602
21642
  *
21603
21643
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21612,46 +21652,45 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21612
21652
  __pyx_L0:;
21613
21653
  }
21614
21654
 
21615
- /* "mettagrid/objects.pxd":153
21655
+ /* "mettagrid/objects.pxd":161
21616
21656
  * this.output_energy = cfg[b"energy_output.r1"]
21617
21657
  *
21618
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21658
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21619
21659
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21620
21660
  *
21621
21661
  */
21622
21662
 
21623
- char __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21624
- char __pyx_r;
21625
- char __pyx_t_1;
21626
- char __pyx_t_2;
21627
- 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;
21628
21667
  int __pyx_lineno = 0;
21629
21668
  const char *__pyx_filename = NULL;
21630
21669
  int __pyx_clineno = 0;
21631
21670
 
21632
- /* "mettagrid/objects.pxd":154
21671
+ /* "mettagrid/objects.pxd":162
21633
21672
  *
21634
- * inline char usable(const Agent *actor):
21673
+ * inline bint usable(const Agent *actor):
21635
21674
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0 # <<<<<<<<<<<<<<
21636
21675
  *
21637
21676
  * inline obs(ObsType[:] obs):
21638
21677
  */
21639
- __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)
21640
21679
  if (__pyx_t_2) {
21641
21680
  } else {
21642
21681
  __pyx_t_1 = __pyx_t_2;
21643
21682
  goto __pyx_L3_bool_binop_done;
21644
21683
  }
21645
- __pyx_t_3 = ((__pyx_v_actor->inventory[this->input_resource]) > 0);
21646
- __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;
21647
21686
  __pyx_L3_bool_binop_done:;
21648
21687
  __pyx_r = __pyx_t_1;
21649
21688
  goto __pyx_L0;
21650
21689
 
21651
- /* "mettagrid/objects.pxd":153
21690
+ /* "mettagrid/objects.pxd":161
21652
21691
  * this.output_energy = cfg[b"energy_output.r1"]
21653
21692
  *
21654
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21693
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21655
21694
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21656
21695
  *
21657
21696
  */
@@ -21664,7 +21703,7 @@ char __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_A
21664
21703
  return __pyx_r;
21665
21704
  }
21666
21705
 
21667
- /* "mettagrid/objects.pxd":156
21706
+ /* "mettagrid/objects.pxd":164
21668
21707
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21669
21708
  *
21670
21709
  * inline obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21678,7 +21717,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21678
21717
  Py_ssize_t __pyx_t_1;
21679
21718
  __Pyx_RefNannySetupContext("obs", 1);
21680
21719
 
21681
- /* "mettagrid/objects.pxd":157
21720
+ /* "mettagrid/objects.pxd":165
21682
21721
  *
21683
21722
  * inline obs(ObsType[:] obs):
21684
21723
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21688,7 +21727,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21688
21727
  __pyx_t_1 = 0;
21689
21728
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21690
21729
 
21691
- /* "mettagrid/objects.pxd":158
21730
+ /* "mettagrid/objects.pxd":166
21692
21731
  * inline obs(ObsType[:] obs):
21693
21732
  * obs[0] = 1
21694
21733
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -21698,7 +21737,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21698
21737
  __pyx_t_1 = 1;
21699
21738
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
21700
21739
 
21701
- /* "mettagrid/objects.pxd":159
21740
+ /* "mettagrid/objects.pxd":167
21702
21741
  * obs[0] = 1
21703
21742
  * obs[1] = hp
21704
21743
  * obs[2] = input_resource # <<<<<<<<<<<<<<
@@ -21708,7 +21747,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21708
21747
  __pyx_t_1 = 2;
21709
21748
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = input_resource;
21710
21749
 
21711
- /* "mettagrid/objects.pxd":160
21750
+ /* "mettagrid/objects.pxd":168
21712
21751
  * obs[1] = hp
21713
21752
  * obs[2] = input_resource
21714
21753
  * obs[3] = output_resource # <<<<<<<<<<<<<<
@@ -21718,7 +21757,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21718
21757
  __pyx_t_1 = 3;
21719
21758
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = output_resource;
21720
21759
 
21721
- /* "mettagrid/objects.pxd":161
21760
+ /* "mettagrid/objects.pxd":169
21722
21761
  * obs[2] = input_resource
21723
21762
  * obs[3] = output_resource
21724
21763
  * obs[4] = output_energy # <<<<<<<<<<<<<<
@@ -21728,7 +21767,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21728
21767
  __pyx_t_1 = 4;
21729
21768
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = output_energy;
21730
21769
 
21731
- /* "mettagrid/objects.pxd":162
21770
+ /* "mettagrid/objects.pxd":170
21732
21771
  * obs[3] = output_resource
21733
21772
  * obs[4] = output_energy
21734
21773
  * obs[5] = ready # <<<<<<<<<<<<<<
@@ -21738,7 +21777,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21738
21777
  __pyx_t_1 = 5;
21739
21778
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = ready;
21740
21779
 
21741
- /* "mettagrid/objects.pxd":156
21780
+ /* "mettagrid/objects.pxd":164
21742
21781
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21743
21782
  *
21744
21783
  * inline obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21753,7 +21792,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21753
21792
  return __pyx_r;
21754
21793
  }
21755
21794
 
21756
- /* "mettagrid/objects.pxd":165
21795
+ /* "mettagrid/objects.pxd":173
21757
21796
  *
21758
21797
  * @staticmethod
21759
21798
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21771,39 +21810,39 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Converter::feature_names(v
21771
21810
  int __pyx_clineno = 0;
21772
21811
  __Pyx_RefNannySetupContext("feature_names", 1);
21773
21812
 
21774
- /* "mettagrid/objects.pxd":166
21813
+ /* "mettagrid/objects.pxd":174
21775
21814
  * @staticmethod
21776
21815
  * inline vector[string] feature_names():
21777
21816
  * return ["converter", "converter:hp", "converter:input_resource", "converter:output_resource", "converter:output_energy", "converter:ready"] # <<<<<<<<<<<<<<
21778
21817
  *
21779
21818
  * cdef cppclass Altar(Usable):
21780
21819
  */
21781
- __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)
21782
21821
  __Pyx_GOTREF(__pyx_t_1);
21783
21822
  __Pyx_INCREF(__pyx_n_u_converter);
21784
21823
  __Pyx_GIVEREF(__pyx_n_u_converter);
21785
- 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);
21786
21825
  __Pyx_INCREF(__pyx_kp_u_converter_hp);
21787
21826
  __Pyx_GIVEREF(__pyx_kp_u_converter_hp);
21788
- 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);
21789
21828
  __Pyx_INCREF(__pyx_kp_u_converter_input_resource);
21790
21829
  __Pyx_GIVEREF(__pyx_kp_u_converter_input_resource);
21791
- 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);
21792
21831
  __Pyx_INCREF(__pyx_kp_u_converter_output_resource);
21793
21832
  __Pyx_GIVEREF(__pyx_kp_u_converter_output_resource);
21794
- 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);
21795
21834
  __Pyx_INCREF(__pyx_kp_u_converter_output_energy);
21796
21835
  __Pyx_GIVEREF(__pyx_kp_u_converter_output_energy);
21797
- 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);
21798
21837
  __Pyx_INCREF(__pyx_kp_u_converter_ready);
21799
21838
  __Pyx_GIVEREF(__pyx_kp_u_converter_ready);
21800
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_converter_ready)) __PYX_ERR(3, 166, __pyx_L1_error);
21801
- __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)
21802
21841
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21803
21842
  __pyx_r = __pyx_t_2;
21804
21843
  goto __pyx_L0;
21805
21844
 
21806
- /* "mettagrid/objects.pxd":165
21845
+ /* "mettagrid/objects.pxd":173
21807
21846
  *
21808
21847
  * @staticmethod
21809
21848
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21821,7 +21860,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Converter::feature_names(v
21821
21860
  return __pyx_r;
21822
21861
  }
21823
21862
 
21824
- /* "mettagrid/objects.pxd":169
21863
+ /* "mettagrid/objects.pxd":177
21825
21864
  *
21826
21865
  * cdef cppclass Altar(Usable):
21827
21866
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21834,7 +21873,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21834
21873
  const char *__pyx_filename = NULL;
21835
21874
  int __pyx_clineno = 0;
21836
21875
 
21837
- /* "mettagrid/objects.pxd":170
21876
+ /* "mettagrid/objects.pxd":178
21838
21877
  * cdef cppclass Altar(Usable):
21839
21878
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg):
21840
21879
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21843,25 +21882,25 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21843
21882
  */
21844
21883
  GridObject::init(__pyx_e_9mettagrid_7objects_AltarT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21845
21884
 
21846
- /* "mettagrid/objects.pxd":171
21885
+ /* "mettagrid/objects.pxd":179
21847
21886
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg):
21848
21887
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer))
21849
21888
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21850
21889
  * Usable.init_usable(cfg)
21851
21890
  *
21852
21891
  */
21853
- __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)
21854
21893
 
21855
- /* "mettagrid/objects.pxd":172
21894
+ /* "mettagrid/objects.pxd":180
21856
21895
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer))
21857
21896
  * MettaObject.init_mo(cfg)
21858
21897
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
21859
21898
  *
21860
21899
  * inline void obs(ObsType[:] obs):
21861
21900
  */
21862
- __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)
21863
21902
 
21864
- /* "mettagrid/objects.pxd":169
21903
+ /* "mettagrid/objects.pxd":177
21865
21904
  *
21866
21905
  * cdef cppclass Altar(Usable):
21867
21906
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21876,7 +21915,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21876
21915
  __pyx_L0:;
21877
21916
  }
21878
21917
 
21879
- /* "mettagrid/objects.pxd":174
21918
+ /* "mettagrid/objects.pxd":182
21880
21919
  * Usable.init_usable(cfg)
21881
21920
  *
21882
21921
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21887,7 +21926,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21887
21926
  void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21888
21927
  Py_ssize_t __pyx_t_1;
21889
21928
 
21890
- /* "mettagrid/objects.pxd":175
21929
+ /* "mettagrid/objects.pxd":183
21891
21930
  *
21892
21931
  * inline void obs(ObsType[:] obs):
21893
21932
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21897,7 +21936,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21897
21936
  __pyx_t_1 = 0;
21898
21937
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21899
21938
 
21900
- /* "mettagrid/objects.pxd":176
21939
+ /* "mettagrid/objects.pxd":184
21901
21940
  * inline void obs(ObsType[:] obs):
21902
21941
  * obs[0] = 1
21903
21942
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -21907,7 +21946,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21907
21946
  __pyx_t_1 = 1;
21908
21947
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
21909
21948
 
21910
- /* "mettagrid/objects.pxd":177
21949
+ /* "mettagrid/objects.pxd":185
21911
21950
  * obs[0] = 1
21912
21951
  * obs[1] = hp
21913
21952
  * obs[2] = ready # <<<<<<<<<<<<<<
@@ -21917,7 +21956,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21917
21956
  __pyx_t_1 = 2;
21918
21957
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = ready;
21919
21958
 
21920
- /* "mettagrid/objects.pxd":174
21959
+ /* "mettagrid/objects.pxd":182
21921
21960
  * Usable.init_usable(cfg)
21922
21961
  *
21923
21962
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21928,7 +21967,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
21928
21967
  /* function exit code */
21929
21968
  }
21930
21969
 
21931
- /* "mettagrid/objects.pxd":180
21970
+ /* "mettagrid/objects.pxd":188
21932
21971
  *
21933
21972
  * @staticmethod
21934
21973
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21946,30 +21985,30 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Altar::feature_names(void)
21946
21985
  int __pyx_clineno = 0;
21947
21986
  __Pyx_RefNannySetupContext("feature_names", 1);
21948
21987
 
21949
- /* "mettagrid/objects.pxd":181
21988
+ /* "mettagrid/objects.pxd":189
21950
21989
  * @staticmethod
21951
21990
  * inline vector[string] feature_names():
21952
21991
  * return ["altar", "altar:hp", "altar:ready"] # <<<<<<<<<<<<<<
21953
21992
  *
21954
21993
  * cdef map[TypeId, GridLayer] ObjectLayers
21955
21994
  */
21956
- __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)
21957
21996
  __Pyx_GOTREF(__pyx_t_1);
21958
21997
  __Pyx_INCREF(__pyx_n_u_altar);
21959
21998
  __Pyx_GIVEREF(__pyx_n_u_altar);
21960
- 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);
21961
22000
  __Pyx_INCREF(__pyx_kp_u_altar_hp);
21962
22001
  __Pyx_GIVEREF(__pyx_kp_u_altar_hp);
21963
- 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);
21964
22003
  __Pyx_INCREF(__pyx_kp_u_altar_ready);
21965
22004
  __Pyx_GIVEREF(__pyx_kp_u_altar_ready);
21966
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_altar_ready)) __PYX_ERR(3, 181, __pyx_L1_error);
21967
- __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)
21968
22007
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21969
22008
  __pyx_r = __pyx_t_2;
21970
22009
  goto __pyx_L0;
21971
22010
 
21972
- /* "mettagrid/objects.pxd":180
22011
+ /* "mettagrid/objects.pxd":188
21973
22012
  *
21974
22013
  * @staticmethod
21975
22014
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21987,78 +22026,107 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Altar::feature_names(void)
21987
22026
  return __pyx_r;
21988
22027
  }
21989
22028
 
21990
- /* "mettagrid/objects.pxd":186
22029
+ /* "mettagrid/objects.pxd":194
21991
22030
  *
21992
22031
  * cdef class ResetHandler(EventHandler):
21993
22032
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg): # <<<<<<<<<<<<<<
21994
22033
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
21995
- * usable.ready = True
22034
+ * if usable is NULL:
21996
22035
  */
21997
22036
 
21998
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) {
21999
22038
  __pyx_t_9mettagrid_7objects_Usable *__pyx_v_usable;
22000
22039
  __Pyx_RefNannyDeclarations
22001
- PyObject *__pyx_t_1 = NULL;
22040
+ int __pyx_t_1;
22002
22041
  PyObject *__pyx_t_2 = NULL;
22003
- char const *__pyx_t_3;
22042
+ PyObject *__pyx_t_3 = NULL;
22043
+ char const *__pyx_t_4;
22004
22044
  int __pyx_lineno = 0;
22005
22045
  const char *__pyx_filename = NULL;
22006
22046
  int __pyx_clineno = 0;
22007
22047
  __Pyx_RefNannySetupContext("handle_event", 1);
22008
22048
 
22009
- /* "mettagrid/objects.pxd":187
22049
+ /* "mettagrid/objects.pxd":195
22010
22050
  * cdef class ResetHandler(EventHandler):
22011
22051
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
22012
22052
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id) # <<<<<<<<<<<<<<
22013
- * usable.ready = True
22014
- * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
22053
+ * if usable is NULL:
22054
+ * return
22015
22055
  */
22016
22056
  __pyx_v_usable = ((__pyx_t_9mettagrid_7objects_Usable *)__pyx_v_self->__pyx_base.env->_grid->object(__pyx_v_obj_id));
22017
22057
 
22018
- /* "mettagrid/objects.pxd":188
22058
+ /* "mettagrid/objects.pxd":196
22059
+ * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
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
22019
22078
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
22020
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
+ *
22021
22089
  * usable.ready = True # <<<<<<<<<<<<<<
22022
22090
  * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
22023
22091
  *
22024
22092
  */
22025
22093
  __pyx_v_usable->ready = 1;
22026
22094
 
22027
- /* "mettagrid/objects.pxd":189
22028
- * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22095
+ /* "mettagrid/objects.pxd":200
22096
+ *
22029
22097
  * usable.ready = True
22030
22098
  * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id]) # <<<<<<<<<<<<<<
22031
22099
  *
22032
22100
  * cdef enum Events:
22033
22101
  */
22034
- __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)
22035
- __Pyx_GOTREF(__pyx_t_1);
22036
- __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)
22037
22103
  __Pyx_GOTREF(__pyx_t_2);
22038
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22039
- __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(3, 189, __pyx_L1_error)
22040
- ((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);
22041
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;
22042
22110
 
22043
- /* "mettagrid/objects.pxd":186
22111
+ /* "mettagrid/objects.pxd":194
22044
22112
  *
22045
22113
  * cdef class ResetHandler(EventHandler):
22046
22114
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg): # <<<<<<<<<<<<<<
22047
22115
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22048
- * usable.ready = True
22116
+ * if usable is NULL:
22049
22117
  */
22050
22118
 
22051
22119
  /* function exit code */
22052
22120
  goto __pyx_L0;
22053
22121
  __pyx_L1_error:;
22054
- __Pyx_XDECREF(__pyx_t_1);
22055
22122
  __Pyx_XDECREF(__pyx_t_2);
22123
+ __Pyx_XDECREF(__pyx_t_3);
22056
22124
  __Pyx_AddTraceback("mettagrid.objects.ResetHandler.handle_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
22057
22125
  __pyx_L0:;
22058
22126
  __Pyx_RefNannyFinishContext();
22059
22127
  }
22060
22128
 
22061
- /* "mettagrid/actions/move.pyx":13
22129
+ /* "mettagrid/actions/move.pyx":12
22062
22130
  *
22063
22131
  * cdef class Move(MettaActionHandler):
22064
22132
  * def __init__(self, cfg: OmegaConf): # <<<<<<<<<<<<<<
@@ -22102,12 +22170,12 @@ static int __pyx_pw_9mettagrid_7actions_4move_4Move_1__init__(PyObject *__pyx_v_
22102
22170
  (void)__Pyx_Arg_NewRef_VARARGS(values[0]);
22103
22171
  kw_args--;
22104
22172
  }
22105
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 13, __pyx_L3_error)
22173
+ else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L3_error)
22106
22174
  else goto __pyx_L5_argtuple_error;
22107
22175
  }
22108
22176
  if (unlikely(kw_args > 0)) {
22109
22177
  const Py_ssize_t kwd_pos_args = __pyx_nargs;
22110
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 13, __pyx_L3_error)
22178
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(1, 12, __pyx_L3_error)
22111
22179
  }
22112
22180
  } else if (unlikely(__pyx_nargs != 1)) {
22113
22181
  goto __pyx_L5_argtuple_error;
@@ -22118,7 +22186,7 @@ static int __pyx_pw_9mettagrid_7actions_4move_4Move_1__init__(PyObject *__pyx_v_
22118
22186
  }
22119
22187
  goto __pyx_L6_skip;
22120
22188
  __pyx_L5_argtuple_error:;
22121
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 13, __pyx_L3_error)
22189
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 12, __pyx_L3_error)
22122
22190
  __pyx_L6_skip:;
22123
22191
  goto __pyx_L4_argument_unpacking_done;
22124
22192
  __pyx_L3_error:;
@@ -22157,14 +22225,14 @@ static int __pyx_pf_9mettagrid_7actions_4move_4Move___init__(struct __pyx_obj_9m
22157
22225
  int __pyx_clineno = 0;
22158
22226
  __Pyx_RefNannySetupContext("__init__", 1);
22159
22227
 
22160
- /* "mettagrid/actions/move.pyx":14
22228
+ /* "mettagrid/actions/move.pyx":13
22161
22229
  * cdef class Move(MettaActionHandler):
22162
22230
  * def __init__(self, cfg: OmegaConf):
22163
22231
  * MettaActionHandler.__init__(self, cfg, "move") # <<<<<<<<<<<<<<
22164
22232
  *
22165
- * cdef char _handle_action(
22233
+ * cdef unsigned char max_arg(self):
22166
22234
  */
22167
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
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, 13, __pyx_L1_error)
22168
22236
  __Pyx_GOTREF(__pyx_t_2);
22169
22237
  __pyx_t_3 = NULL;
22170
22238
  __pyx_t_4 = 0;
@@ -22184,13 +22252,13 @@ static int __pyx_pf_9mettagrid_7actions_4move_4Move___init__(struct __pyx_obj_9m
22184
22252
  PyObject *__pyx_callargs[4] = {__pyx_t_3, ((PyObject *)__pyx_v_self), __pyx_v_cfg, __pyx_n_u_move};
22185
22253
  __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 3+__pyx_t_4);
22186
22254
  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
22187
- if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
22255
+ if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
22188
22256
  __Pyx_GOTREF(__pyx_t_1);
22189
22257
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22190
22258
  }
22191
22259
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22192
22260
 
22193
- /* "mettagrid/actions/move.pyx":13
22261
+ /* "mettagrid/actions/move.pyx":12
22194
22262
  *
22195
22263
  * cdef class Move(MettaActionHandler):
22196
22264
  * def __init__(self, cfg: OmegaConf): # <<<<<<<<<<<<<<
@@ -22212,73 +22280,184 @@ static int __pyx_pf_9mettagrid_7actions_4move_4Move___init__(struct __pyx_obj_9m
22212
22280
  return __pyx_r;
22213
22281
  }
22214
22282
 
22215
- /* "mettagrid/actions/move.pyx":16
22283
+ /* "mettagrid/actions/move.pyx":15
22284
+ * MettaActionHandler.__init__(self, cfg, "move")
22285
+ *
22286
+ * cdef unsigned char max_arg(self): # <<<<<<<<<<<<<<
22287
+ * return 1
22288
+ *
22289
+ */
22290
+
22291
+ static unsigned char __pyx_f_9mettagrid_7actions_4move_4Move_max_arg(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_4move_Move *__pyx_v_self) {
22292
+ unsigned char __pyx_r;
22293
+
22294
+ /* "mettagrid/actions/move.pyx":16
22295
+ *
22296
+ * cdef unsigned char max_arg(self):
22297
+ * return 1 # <<<<<<<<<<<<<<
22298
+ *
22299
+ * cdef bint _handle_action(
22300
+ */
22301
+ __pyx_r = 1;
22302
+ goto __pyx_L0;
22303
+
22304
+ /* "mettagrid/actions/move.pyx":15
22216
22305
  * MettaActionHandler.__init__(self, cfg, "move")
22217
22306
  *
22218
- * cdef char _handle_action( # <<<<<<<<<<<<<<
22307
+ * cdef unsigned char max_arg(self): # <<<<<<<<<<<<<<
22308
+ * return 1
22309
+ *
22310
+ */
22311
+
22312
+ /* function exit code */
22313
+ __pyx_L0:;
22314
+ return __pyx_r;
22315
+ }
22316
+
22317
+ /* "mettagrid/actions/move.pyx":18
22318
+ * return 1
22319
+ *
22320
+ * cdef bint _handle_action( # <<<<<<<<<<<<<<
22219
22321
  * self,
22220
22322
  * unsigned int actor_id,
22221
22323
  */
22222
22324
 
22223
- static char __pyx_f_9mettagrid_7actions_4move_4Move__handle_action(struct __pyx_obj_9mettagrid_7actions_4move_Move *__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) {
22325
+ static int __pyx_f_9mettagrid_7actions_4move_4Move__handle_action(struct __pyx_obj_9mettagrid_7actions_4move_Move *__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) {
22224
22326
  unsigned short __pyx_v_direction;
22225
22327
  Orientation __pyx_v_orientation;
22226
22328
  GridLocation __pyx_v_old_loc;
22227
22329
  GridLocation __pyx_v_new_loc;
22228
- char __pyx_r;
22330
+ int __pyx_r;
22229
22331
  int __pyx_t_1;
22230
22332
  GridLocation __pyx_t_2;
22231
22333
 
22232
- /* "mettagrid/actions/move.pyx":22
22334
+ /* "mettagrid/actions/move.pyx":24
22233
22335
  * ActionArg arg):
22234
22336
  *
22235
22337
  * cdef unsigned short direction = arg # <<<<<<<<<<<<<<
22236
- * if direction >= 2:
22237
- * return False
22338
+ *
22339
+ * cdef Orientation orientation = <Orientation>(actor.orientation)
22238
22340
  */
22239
22341
  __pyx_v_direction = __pyx_v_arg;
22240
22342
 
22241
- /* "mettagrid/actions/move.pyx":23
22242
- *
22343
+ /* "mettagrid/actions/move.pyx":26
22243
22344
  * cdef unsigned short direction = arg
22244
- * if direction >= 2: # <<<<<<<<<<<<<<
22245
- * return False
22246
22345
  *
22346
+ * cdef Orientation orientation = <Orientation>(actor.orientation) # <<<<<<<<<<<<<<
22347
+ * if direction == 1:
22348
+ * if orientation == Orientation.Up:
22247
22349
  */
22248
- __pyx_t_1 = (__pyx_v_direction >= 2);
22249
- if (__pyx_t_1) {
22350
+ __pyx_v_orientation = ((Orientation)__pyx_v_actor->orientation);
22250
22351
 
22251
- /* "mettagrid/actions/move.pyx":24
22252
- * cdef unsigned short direction = arg
22253
- * if direction >= 2:
22254
- * return False # <<<<<<<<<<<<<<
22352
+ /* "mettagrid/actions/move.pyx":27
22255
22353
  *
22256
- * cdef Orientation orientation = <Orientation>((actor.orientation + 2*(direction)) % 4)
22354
+ * cdef Orientation orientation = <Orientation>(actor.orientation)
22355
+ * if direction == 1: # <<<<<<<<<<<<<<
22356
+ * if orientation == Orientation.Up:
22357
+ * orientation = Orientation.Down
22257
22358
  */
22258
- __pyx_r = 0;
22259
- goto __pyx_L0;
22359
+ __pyx_t_1 = (__pyx_v_direction == 1);
22360
+ if (__pyx_t_1) {
22260
22361
 
22261
- /* "mettagrid/actions/move.pyx":23
22362
+ /* "mettagrid/actions/move.pyx":28
22363
+ * cdef Orientation orientation = <Orientation>(actor.orientation)
22364
+ * if direction == 1:
22365
+ * if orientation == Orientation.Up: # <<<<<<<<<<<<<<
22366
+ * orientation = Orientation.Down
22367
+ * elif orientation == Orientation.Down:
22368
+ */
22369
+ switch (__pyx_v_orientation) {
22370
+ case Up:
22371
+
22372
+ /* "mettagrid/actions/move.pyx":29
22373
+ * if direction == 1:
22374
+ * if orientation == Orientation.Up:
22375
+ * orientation = Orientation.Down # <<<<<<<<<<<<<<
22376
+ * elif orientation == Orientation.Down:
22377
+ * orientation = Orientation.Up
22378
+ */
22379
+ __pyx_v_orientation = Down;
22380
+
22381
+ /* "mettagrid/actions/move.pyx":28
22382
+ * cdef Orientation orientation = <Orientation>(actor.orientation)
22383
+ * if direction == 1:
22384
+ * if orientation == Orientation.Up: # <<<<<<<<<<<<<<
22385
+ * orientation = Orientation.Down
22386
+ * elif orientation == Orientation.Down:
22387
+ */
22388
+ break;
22389
+ case Down:
22390
+
22391
+ /* "mettagrid/actions/move.pyx":31
22392
+ * orientation = Orientation.Down
22393
+ * elif orientation == Orientation.Down:
22394
+ * orientation = Orientation.Up # <<<<<<<<<<<<<<
22395
+ * elif orientation == Orientation.Left:
22396
+ * orientation = Orientation.Right
22397
+ */
22398
+ __pyx_v_orientation = Up;
22399
+
22400
+ /* "mettagrid/actions/move.pyx":30
22401
+ * if orientation == Orientation.Up:
22402
+ * orientation = Orientation.Down
22403
+ * elif orientation == Orientation.Down: # <<<<<<<<<<<<<<
22404
+ * orientation = Orientation.Up
22405
+ * elif orientation == Orientation.Left:
22406
+ */
22407
+ break;
22408
+ case Left:
22409
+
22410
+ /* "mettagrid/actions/move.pyx":33
22411
+ * orientation = Orientation.Up
22412
+ * elif orientation == Orientation.Left:
22413
+ * orientation = Orientation.Right # <<<<<<<<<<<<<<
22414
+ * elif orientation == Orientation.Right:
22415
+ * orientation = Orientation.Left
22416
+ */
22417
+ __pyx_v_orientation = Right;
22418
+
22419
+ /* "mettagrid/actions/move.pyx":32
22420
+ * elif orientation == Orientation.Down:
22421
+ * orientation = Orientation.Up
22422
+ * elif orientation == Orientation.Left: # <<<<<<<<<<<<<<
22423
+ * orientation = Orientation.Right
22424
+ * elif orientation == Orientation.Right:
22425
+ */
22426
+ break;
22427
+ case Right:
22428
+
22429
+ /* "mettagrid/actions/move.pyx":35
22430
+ * orientation = Orientation.Right
22431
+ * elif orientation == Orientation.Right:
22432
+ * orientation = Orientation.Left # <<<<<<<<<<<<<<
22262
22433
  *
22263
- * cdef unsigned short direction = arg
22264
- * if direction >= 2: # <<<<<<<<<<<<<<
22265
- * return False
22434
+ * cdef GridLocation old_loc = actor.location
22435
+ */
22436
+ __pyx_v_orientation = Left;
22437
+
22438
+ /* "mettagrid/actions/move.pyx":34
22439
+ * elif orientation == Orientation.Left:
22440
+ * orientation = Orientation.Right
22441
+ * elif orientation == Orientation.Right: # <<<<<<<<<<<<<<
22442
+ * orientation = Orientation.Left
22266
22443
  *
22267
22444
  */
22268
- }
22445
+ break;
22446
+ default: break;
22447
+ }
22269
22448
 
22270
- /* "mettagrid/actions/move.pyx":26
22271
- * return False
22449
+ /* "mettagrid/actions/move.pyx":27
22272
22450
  *
22273
- * cdef Orientation orientation = <Orientation>((actor.orientation + 2*(direction)) % 4) # <<<<<<<<<<<<<<
22274
- * cdef GridLocation old_loc = actor.location
22275
- * cdef GridLocation new_loc = self.env._grid.relative_location(old_loc, orientation)
22451
+ * cdef Orientation orientation = <Orientation>(actor.orientation)
22452
+ * if direction == 1: # <<<<<<<<<<<<<<
22453
+ * if orientation == Orientation.Up:
22454
+ * orientation = Orientation.Down
22276
22455
  */
22277
- __pyx_v_orientation = ((Orientation)__Pyx_mod_long((__pyx_v_actor->orientation + (2 * __pyx_v_direction)), 4));
22456
+ }
22278
22457
 
22279
- /* "mettagrid/actions/move.pyx":27
22458
+ /* "mettagrid/actions/move.pyx":37
22459
+ * orientation = Orientation.Left
22280
22460
  *
22281
- * cdef Orientation orientation = <Orientation>((actor.orientation + 2*(direction)) % 4)
22282
22461
  * cdef GridLocation old_loc = actor.location # <<<<<<<<<<<<<<
22283
22462
  * cdef GridLocation new_loc = self.env._grid.relative_location(old_loc, orientation)
22284
22463
  * if not self.env._grid.is_empty(new_loc.r, new_loc.c):
@@ -22286,55 +22465,55 @@ static char __pyx_f_9mettagrid_7actions_4move_4Move__handle_action(struct __pyx_
22286
22465
  __pyx_t_2 = __pyx_v_actor->location;
22287
22466
  __pyx_v_old_loc = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_2);
22288
22467
 
22289
- /* "mettagrid/actions/move.pyx":28
22290
- * cdef Orientation orientation = <Orientation>((actor.orientation + 2*(direction)) % 4)
22468
+ /* "mettagrid/actions/move.pyx":38
22469
+ *
22291
22470
  * cdef GridLocation old_loc = actor.location
22292
22471
  * cdef GridLocation new_loc = self.env._grid.relative_location(old_loc, orientation) # <<<<<<<<<<<<<<
22293
22472
  * if not self.env._grid.is_empty(new_loc.r, new_loc.c):
22294
- * return False
22473
+ * return 0
22295
22474
  */
22296
22475
  __pyx_v_new_loc = __pyx_v_self->__pyx_base.__pyx_base.env->_grid->relative_location(__pyx_v_old_loc, __pyx_v_orientation);
22297
22476
 
22298
- /* "mettagrid/actions/move.pyx":29
22477
+ /* "mettagrid/actions/move.pyx":39
22299
22478
  * cdef GridLocation old_loc = actor.location
22300
22479
  * cdef GridLocation new_loc = self.env._grid.relative_location(old_loc, orientation)
22301
22480
  * if not self.env._grid.is_empty(new_loc.r, new_loc.c): # <<<<<<<<<<<<<<
22302
- * return False
22481
+ * return 0
22303
22482
  * return self.env._grid.move_object(actor.id, new_loc)
22304
22483
  */
22305
22484
  __pyx_t_1 = (!(__pyx_v_self->__pyx_base.__pyx_base.env->_grid->is_empty(__pyx_v_new_loc.r, __pyx_v_new_loc.c) != 0));
22306
22485
  if (__pyx_t_1) {
22307
22486
 
22308
- /* "mettagrid/actions/move.pyx":30
22487
+ /* "mettagrid/actions/move.pyx":40
22309
22488
  * cdef GridLocation new_loc = self.env._grid.relative_location(old_loc, orientation)
22310
22489
  * if not self.env._grid.is_empty(new_loc.r, new_loc.c):
22311
- * return False # <<<<<<<<<<<<<<
22490
+ * return 0 # <<<<<<<<<<<<<<
22312
22491
  * return self.env._grid.move_object(actor.id, new_loc)
22313
22492
  */
22314
22493
  __pyx_r = 0;
22315
22494
  goto __pyx_L0;
22316
22495
 
22317
- /* "mettagrid/actions/move.pyx":29
22496
+ /* "mettagrid/actions/move.pyx":39
22318
22497
  * cdef GridLocation old_loc = actor.location
22319
22498
  * cdef GridLocation new_loc = self.env._grid.relative_location(old_loc, orientation)
22320
22499
  * if not self.env._grid.is_empty(new_loc.r, new_loc.c): # <<<<<<<<<<<<<<
22321
- * return False
22500
+ * return 0
22322
22501
  * return self.env._grid.move_object(actor.id, new_loc)
22323
22502
  */
22324
22503
  }
22325
22504
 
22326
- /* "mettagrid/actions/move.pyx":31
22505
+ /* "mettagrid/actions/move.pyx":41
22327
22506
  * if not self.env._grid.is_empty(new_loc.r, new_loc.c):
22328
- * return False
22507
+ * return 0
22329
22508
  * return self.env._grid.move_object(actor.id, new_loc) # <<<<<<<<<<<<<<
22330
22509
  */
22331
22510
  __pyx_r = __pyx_v_self->__pyx_base.__pyx_base.env->_grid->move_object(__pyx_v_actor->id, __pyx_v_new_loc);
22332
22511
  goto __pyx_L0;
22333
22512
 
22334
- /* "mettagrid/actions/move.pyx":16
22335
- * MettaActionHandler.__init__(self, cfg, "move")
22513
+ /* "mettagrid/actions/move.pyx":18
22514
+ * return 1
22336
22515
  *
22337
- * cdef char _handle_action( # <<<<<<<<<<<<<<
22516
+ * cdef bint _handle_action( # <<<<<<<<<<<<<<
22338
22517
  * self,
22339
22518
  * unsigned int actor_id,
22340
22519
  */
@@ -23880,7 +24059,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
23880
24059
  __Pyx_GOTREF(__pyx_tuple__8);
23881
24060
  __Pyx_GIVEREF(__pyx_tuple__8);
23882
24061
 
23883
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
24062
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
23884
24063
  * __pyx_import_array()
23885
24064
  * except Exception:
23886
24065
  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
@@ -23891,7 +24070,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
23891
24070
  __Pyx_GOTREF(__pyx_tuple__9);
23892
24071
  __Pyx_GIVEREF(__pyx_tuple__9);
23893
24072
 
23894
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
24073
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
23895
24074
  * _import_umath()
23896
24075
  * except Exception:
23897
24076
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -24026,14 +24205,14 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
24026
24205
  /* #### Code section: init_constants ### */
24027
24206
 
24028
24207
  static CYTHON_SMALL_CODE int __Pyx_InitConstants(void) {
24029
- if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 2, __pyx_L1_error);
24030
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 2, __pyx_L1_error)
24031
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 2, __pyx_L1_error)
24032
- __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(1, 2, __pyx_L1_error)
24033
- __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(1, 2, __pyx_L1_error)
24034
- __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(1, 2, __pyx_L1_error)
24035
- __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(1, 2, __pyx_L1_error)
24036
- __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 2, __pyx_L1_error)
24208
+ if (__Pyx_CreateStringTabAndInitStrings() < 0) __PYX_ERR(1, 1, __pyx_L1_error);
24209
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
24210
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24211
+ __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(1, 1, __pyx_L1_error)
24212
+ __pyx_int_112105877 = PyInt_FromLong(112105877L); if (unlikely(!__pyx_int_112105877)) __PYX_ERR(1, 1, __pyx_L1_error)
24213
+ __pyx_int_136983863 = PyInt_FromLong(136983863L); if (unlikely(!__pyx_int_136983863)) __PYX_ERR(1, 1, __pyx_L1_error)
24214
+ __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(1, 1, __pyx_L1_error)
24215
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24037
24216
  return 0;
24038
24217
  __pyx_L1_error:;
24039
24218
  return -1;
@@ -24044,7 +24223,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
24044
24223
  /* AssertionsEnabled.init */
24045
24224
  if (likely(__Pyx_init_assertions_enabled() == 0)); else
24046
24225
 
24047
- if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 2, __pyx_L1_error)
24226
+ if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L1_error)
24048
24227
 
24049
24228
  return 0;
24050
24229
  __pyx_L1_error:;
@@ -24099,20 +24278,21 @@ static int __Pyx_modinit_type_init_code(void) {
24099
24278
  int __pyx_clineno = 0;
24100
24279
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
24101
24280
  /*--- Type init code ---*/
24102
- __pyx_t_1 = PyImport_ImportModule("mettagrid.actions.actions"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
24281
+ __pyx_t_1 = PyImport_ImportModule("mettagrid.actions.actions"); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24103
24282
  __Pyx_GOTREF(__pyx_t_1);
24104
- __pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler = __Pyx_ImportType_3_0_11(__pyx_t_1, "mettagrid.actions.actions", "MettaActionHandler", sizeof(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler) __PYX_ERR(1, 2, __pyx_L1_error)
24105
- __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)
24283
+ __pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler = __Pyx_ImportType_3_0_11(__pyx_t_1, "mettagrid.actions.actions", "MettaActionHandler", sizeof(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler) __PYX_ERR(1, 1, __pyx_L1_error)
24284
+ __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, 1, __pyx_L1_error)
24106
24285
  __pyx_vtabptr_9mettagrid_7actions_4move_Move = &__pyx_vtable_9mettagrid_7actions_4move_Move;
24107
24286
  __pyx_vtable_9mettagrid_7actions_4move_Move.__pyx_base = *__pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler;
24108
- __pyx_vtable_9mettagrid_7actions_4move_Move.__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_4move_4Move__handle_action;
24287
+ __pyx_vtable_9mettagrid_7actions_4move_Move.__pyx_base.__pyx_base.max_arg = (unsigned char (*)(struct __pyx_obj_10puffergrid_6action_ActionHandler *))__pyx_f_9mettagrid_7actions_4move_4Move_max_arg;
24288
+ __pyx_vtable_9mettagrid_7actions_4move_Move.__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_4move_4Move__handle_action;
24109
24289
  #if CYTHON_USE_TYPE_SPECS
24110
- __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error)
24290
+ __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 11, __pyx_L1_error)
24111
24291
  __Pyx_GOTREF(__pyx_t_2);
24112
24292
  __pyx_ptype_9mettagrid_7actions_4move_Move = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9mettagrid_7actions_4move_Move_spec, __pyx_t_2);
24113
24293
  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
24114
- if (unlikely(!__pyx_ptype_9mettagrid_7actions_4move_Move)) __PYX_ERR(1, 12, __pyx_L1_error)
24115
- if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9mettagrid_7actions_4move_Move_spec, __pyx_ptype_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
24294
+ if (unlikely(!__pyx_ptype_9mettagrid_7actions_4move_Move)) __PYX_ERR(1, 11, __pyx_L1_error)
24295
+ if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9mettagrid_7actions_4move_Move_spec, __pyx_ptype_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
24116
24296
  #else
24117
24297
  __pyx_ptype_9mettagrid_7actions_4move_Move = &__pyx_type_9mettagrid_7actions_4move_Move;
24118
24298
  #endif
@@ -24121,7 +24301,7 @@ static int __Pyx_modinit_type_init_code(void) {
24121
24301
  __pyx_ptype_9mettagrid_7actions_4move_Move->tp_base = __pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler;
24122
24302
  #endif
24123
24303
  #if !CYTHON_USE_TYPE_SPECS
24124
- if (__Pyx_PyType_Ready(__pyx_ptype_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
24304
+ if (__Pyx_PyType_Ready(__pyx_ptype_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
24125
24305
  #endif
24126
24306
  #if PY_MAJOR_VERSION < 3
24127
24307
  __pyx_ptype_9mettagrid_7actions_4move_Move->tp_print = 0;
@@ -24131,13 +24311,13 @@ static int __Pyx_modinit_type_init_code(void) {
24131
24311
  __pyx_ptype_9mettagrid_7actions_4move_Move->tp_getattro = __Pyx_PyObject_GenericGetAttr;
24132
24312
  }
24133
24313
  #endif
24134
- if (__Pyx_SetVtable(__pyx_ptype_9mettagrid_7actions_4move_Move, __pyx_vtabptr_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
24314
+ if (__Pyx_SetVtable(__pyx_ptype_9mettagrid_7actions_4move_Move, __pyx_vtabptr_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
24135
24315
  #if !CYTHON_COMPILING_IN_LIMITED_API
24136
- if (__Pyx_MergeVtables(__pyx_ptype_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
24316
+ if (__Pyx_MergeVtables(__pyx_ptype_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
24137
24317
  #endif
24138
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Move, (PyObject *) __pyx_ptype_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
24318
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Move, (PyObject *) __pyx_ptype_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
24139
24319
  #if !CYTHON_COMPILING_IN_LIMITED_API
24140
- if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 12, __pyx_L1_error)
24320
+ if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_9mettagrid_7actions_4move_Move) < 0) __PYX_ERR(1, 11, __pyx_L1_error)
24141
24321
  #endif
24142
24322
  __pyx_vtabptr_array = &__pyx_vtable_array;
24143
24323
  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
@@ -24354,12 +24534,12 @@ static int __Pyx_modinit_type_import_code(void) {
24354
24534
  __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)
24355
24535
  __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)
24356
24536
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24357
- __pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 185, __pyx_L1_error)
24537
+ __pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 193, __pyx_L1_error)
24358
24538
  __Pyx_GOTREF(__pyx_t_1);
24359
- __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)
24360
- __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)
24361
- __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)
24362
- __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)
24539
+ __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)
24540
+ __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)
24541
+ __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)
24542
+ __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)
24363
24543
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24364
24544
  __Pyx_RefNannyFinishContext();
24365
24545
  return 0;
@@ -24377,11 +24557,11 @@ static int __Pyx_modinit_variable_import_code(void) {
24377
24557
  int __pyx_clineno = 0;
24378
24558
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
24379
24559
  /*--- Variable import code ---*/
24380
- __pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (!__pyx_t_1) __PYX_ERR(1, 2, __pyx_L1_error)
24560
+ __pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (!__pyx_t_1) __PYX_ERR(1, 1, __pyx_L1_error)
24381
24561
  __Pyx_GOTREF(__pyx_t_1);
24382
- if (__Pyx_ImportVoidPtr_3_0_11(__pyx_t_1, "ObjectTypeNames", (void **)&__pyx_vp_9mettagrid_7objects_ObjectTypeNames, "std::vector<std::string> ") < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24383
- if (__Pyx_ImportVoidPtr_3_0_11(__pyx_t_1, "InventoryItemNames", (void **)&__pyx_vp_9mettagrid_7objects_InventoryItemNames, "std::vector<std::string> ") < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24384
- if (__Pyx_ImportVoidPtr_3_0_11(__pyx_t_1, "ObjectLayers", (void **)&__pyx_vp_9mettagrid_7objects_ObjectLayers, "std::map<TypeId,enum __pyx_t_9mettagrid_7objects_GridLayer> ") < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24562
+ if (__Pyx_ImportVoidPtr_3_0_11(__pyx_t_1, "ObjectTypeNames", (void **)&__pyx_vp_9mettagrid_7objects_ObjectTypeNames, "std::vector<std::string> ") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24563
+ if (__Pyx_ImportVoidPtr_3_0_11(__pyx_t_1, "InventoryItemNames", (void **)&__pyx_vp_9mettagrid_7objects_InventoryItemNames, "std::vector<std::string> ") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24564
+ if (__Pyx_ImportVoidPtr_3_0_11(__pyx_t_1, "ObjectLayers", (void **)&__pyx_vp_9mettagrid_7objects_ObjectLayers, "std::map<TypeId,enum __pyx_t_9mettagrid_7objects_GridLayer> ") < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24385
24565
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24386
24566
  __Pyx_RefNannyFinishContext();
24387
24567
  return 0;
@@ -24588,26 +24768,26 @@ static CYTHON_SMALL_CODE int __pyx_pymod_exec_move(PyObject *__pyx_pyinit_module
24588
24768
  #else
24589
24769
  #if PY_MAJOR_VERSION < 3
24590
24770
  __pyx_m = Py_InitModule4("move", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
24591
- if (unlikely(!__pyx_m)) __PYX_ERR(1, 2, __pyx_L1_error)
24771
+ if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
24592
24772
  #elif CYTHON_USE_MODULE_STATE
24593
- __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
24773
+ __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
24594
24774
  {
24595
24775
  int add_module_result = PyState_AddModule(__pyx_t_1, &__pyx_moduledef);
24596
24776
  __pyx_t_1 = 0; /* transfer ownership from __pyx_t_1 to "move" pseudovariable */
24597
- if (unlikely((add_module_result < 0))) __PYX_ERR(1, 2, __pyx_L1_error)
24777
+ if (unlikely((add_module_result < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
24598
24778
  pystate_addmodule_run = 1;
24599
24779
  }
24600
24780
  #else
24601
24781
  __pyx_m = PyModule_Create(&__pyx_moduledef);
24602
- if (unlikely(!__pyx_m)) __PYX_ERR(1, 2, __pyx_L1_error)
24782
+ if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
24603
24783
  #endif
24604
24784
  #endif
24605
24785
  CYTHON_UNUSED_VAR(__pyx_t_1);
24606
- __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 2, __pyx_L1_error)
24786
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
24607
24787
  Py_INCREF(__pyx_d);
24608
- __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 2, __pyx_L1_error)
24609
- __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 2, __pyx_L1_error)
24610
- if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24788
+ __pyx_b = __Pyx_PyImport_AddModuleRef(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
24789
+ __pyx_cython_runtime = __Pyx_PyImport_AddModuleRef((const char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
24790
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24611
24791
  #if CYTHON_REFNANNY
24612
24792
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
24613
24793
  if (!__Pyx_RefNanny) {
@@ -24618,30 +24798,30 @@ if (!__Pyx_RefNanny) {
24618
24798
  }
24619
24799
  #endif
24620
24800
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_move(void)", 0);
24621
- if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24801
+ if (__Pyx_check_binary_version(__PYX_LIMITED_VERSION_HEX, __Pyx_get_runtime_version(), CYTHON_COMPILING_IN_LIMITED_API) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24622
24802
  #ifdef __Pxy_PyFrame_Initialize_Offsets
24623
24803
  __Pxy_PyFrame_Initialize_Offsets();
24624
24804
  #endif
24625
- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 2, __pyx_L1_error)
24626
- __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 2, __pyx_L1_error)
24627
- __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 2, __pyx_L1_error)
24805
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
24806
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
24807
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
24628
24808
  #ifdef __Pyx_CyFunction_USED
24629
- if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24809
+ if (__pyx_CyFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24630
24810
  #endif
24631
24811
  #ifdef __Pyx_FusedFunction_USED
24632
- if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24812
+ if (__pyx_FusedFunction_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24633
24813
  #endif
24634
24814
  #ifdef __Pyx_Coroutine_USED
24635
- if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24815
+ if (__pyx_Coroutine_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24636
24816
  #endif
24637
24817
  #ifdef __Pyx_Generator_USED
24638
- if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24818
+ if (__pyx_Generator_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24639
24819
  #endif
24640
24820
  #ifdef __Pyx_AsyncGen_USED
24641
- if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24821
+ if (__pyx_AsyncGen_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24642
24822
  #endif
24643
24823
  #ifdef __Pyx_StopAsyncIteration_USED
24644
- if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24824
+ if (__pyx_StopAsyncIteration_init(__pyx_m) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24645
24825
  #endif
24646
24826
  /*--- Library function declarations ---*/
24647
24827
  /*--- Threads initialization code ---*/
@@ -24649,38 +24829,38 @@ if (!__Pyx_RefNanny) {
24649
24829
  PyEval_InitThreads();
24650
24830
  #endif
24651
24831
  /*--- Initialize various global constants etc. ---*/
24652
- if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24832
+ if (__Pyx_InitConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24653
24833
  stringtab_initialized = 1;
24654
- if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24834
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24655
24835
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
24656
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24836
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24657
24837
  #endif
24658
24838
  if (__pyx_module_is_main_mettagrid__actions__move) {
24659
- if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24839
+ if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24660
24840
  }
24661
24841
  #if PY_MAJOR_VERSION >= 3
24662
24842
  {
24663
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 2, __pyx_L1_error)
24843
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
24664
24844
  if (!PyDict_GetItemString(modules, "mettagrid.actions.move")) {
24665
- if (unlikely((PyDict_SetItemString(modules, "mettagrid.actions.move", __pyx_m) < 0))) __PYX_ERR(1, 2, __pyx_L1_error)
24845
+ if (unlikely((PyDict_SetItemString(modules, "mettagrid.actions.move", __pyx_m) < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
24666
24846
  }
24667
24847
  }
24668
24848
  #endif
24669
24849
  /*--- Builtin init code ---*/
24670
- if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24850
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24671
24851
  /*--- Constants init code ---*/
24672
- if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24852
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24673
24853
  /*--- Global type/function init code ---*/
24674
24854
  (void)__Pyx_modinit_global_init_code();
24675
24855
  (void)__Pyx_modinit_variable_export_code();
24676
24856
  (void)__Pyx_modinit_function_export_code();
24677
- if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 2, __pyx_L1_error)
24678
- if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(1, 2, __pyx_L1_error)
24679
- if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(1, 2, __pyx_L1_error)
24857
+ if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
24858
+ if (unlikely((__Pyx_modinit_type_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
24859
+ if (unlikely((__Pyx_modinit_variable_import_code() < 0))) __PYX_ERR(1, 1, __pyx_L1_error)
24680
24860
  (void)__Pyx_modinit_function_import_code();
24681
24861
  /*--- Execution code ---*/
24682
24862
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
24683
- if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 2, __pyx_L1_error)
24863
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
24684
24864
  #endif
24685
24865
 
24686
24866
  /* "View.MemoryView":99
@@ -25196,24 +25376,24 @@ if (!__Pyx_RefNanny) {
25196
25376
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
25197
25377
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25198
25378
 
25199
- /* "mettagrid/actions/move.pyx":4
25379
+ /* "mettagrid/actions/move.pyx":3
25200
25380
  * from libc.stdio cimport printf
25201
25381
  *
25202
25382
  * from omegaconf import OmegaConf # <<<<<<<<<<<<<<
25203
25383
  *
25204
25384
  * from puffergrid.grid_object cimport GridLocation, GridObjectId, GridObject, Orientation
25205
25385
  */
25206
- __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4, __pyx_L1_error)
25386
+ __pyx_t_7 = PyList_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error)
25207
25387
  __Pyx_GOTREF(__pyx_t_7);
25208
25388
  __Pyx_INCREF(__pyx_n_s_OmegaConf);
25209
25389
  __Pyx_GIVEREF(__pyx_n_s_OmegaConf);
25210
- if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_OmegaConf)) __PYX_ERR(1, 4, __pyx_L1_error);
25211
- __pyx_t_4 = __Pyx_Import(__pyx_n_s_omegaconf, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 4, __pyx_L1_error)
25390
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_7, 0, __pyx_n_s_OmegaConf)) __PYX_ERR(1, 3, __pyx_L1_error);
25391
+ __pyx_t_4 = __Pyx_Import(__pyx_n_s_omegaconf, __pyx_t_7, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 3, __pyx_L1_error)
25212
25392
  __Pyx_GOTREF(__pyx_t_4);
25213
25393
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25214
- __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_OmegaConf); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 4, __pyx_L1_error)
25394
+ __pyx_t_7 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_OmegaConf); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 3, __pyx_L1_error)
25215
25395
  __Pyx_GOTREF(__pyx_t_7);
25216
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_OmegaConf, __pyx_t_7) < 0) __PYX_ERR(1, 4, __pyx_L1_error)
25396
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_OmegaConf, __pyx_t_7) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
25217
25397
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
25218
25398
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25219
25399
 
@@ -25238,15 +25418,14 @@ if (!__Pyx_RefNanny) {
25238
25418
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_4) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
25239
25419
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25240
25420
 
25241
- /* "mettagrid/actions/move.pyx":2
25242
- *
25421
+ /* "mettagrid/actions/move.pyx":1
25243
25422
  * from libc.stdio cimport printf # <<<<<<<<<<<<<<
25244
25423
  *
25245
25424
  * from omegaconf import OmegaConf
25246
25425
  */
25247
- __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 2, __pyx_L1_error)
25426
+ __pyx_t_4 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1, __pyx_L1_error)
25248
25427
  __Pyx_GOTREF(__pyx_t_4);
25249
- if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(1, 2, __pyx_L1_error)
25428
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
25250
25429
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
25251
25430
 
25252
25431
  /*--- Wrapped vars code ---*/
@@ -27777,13 +27956,6 @@ static void __Pyx_WriteUnraisable(const char *name, int clineno,
27777
27956
  #endif
27778
27957
  }
27779
27958
 
27780
- /* ModInt[long] */
27781
- static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
27782
- long r = a % b;
27783
- r += ((r != 0) & ((r ^ b) < 0)) * b;
27784
- return r;
27785
- }
27786
-
27787
27959
  /* CallNextTpTraverse */
27788
27960
  static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
27789
27961
  PyTypeObject* type = Py_TYPE(obj);
@@ -31029,77 +31201,6 @@ raise_neg_overflow:
31029
31201
  return (unsigned short) -1;
31030
31202
  }
31031
31203
 
31032
- /* CIntToPy */
31033
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
31034
- #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31035
- #pragma GCC diagnostic push
31036
- #pragma GCC diagnostic ignored "-Wconversion"
31037
- #endif
31038
- const char neg_one = (char) -1, const_zero = (char) 0;
31039
- #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
31040
- #pragma GCC diagnostic pop
31041
- #endif
31042
- const int is_unsigned = neg_one > const_zero;
31043
- if (is_unsigned) {
31044
- if (sizeof(char) < sizeof(long)) {
31045
- return PyInt_FromLong((long) value);
31046
- } else if (sizeof(char) <= sizeof(unsigned long)) {
31047
- return PyLong_FromUnsignedLong((unsigned long) value);
31048
- #ifdef HAVE_LONG_LONG
31049
- } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
31050
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
31051
- #endif
31052
- }
31053
- } else {
31054
- if (sizeof(char) <= sizeof(long)) {
31055
- return PyInt_FromLong((long) value);
31056
- #ifdef HAVE_LONG_LONG
31057
- } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
31058
- return PyLong_FromLongLong((PY_LONG_LONG) value);
31059
- #endif
31060
- }
31061
- }
31062
- {
31063
- unsigned char *bytes = (unsigned char *)&value;
31064
- #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
31065
- if (is_unsigned) {
31066
- return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
31067
- } else {
31068
- return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
31069
- }
31070
- #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
31071
- int one = 1; int little = (int)*(unsigned char *)&one;
31072
- return _PyLong_FromByteArray(bytes, sizeof(char),
31073
- little, !is_unsigned);
31074
- #else
31075
- int one = 1; int little = (int)*(unsigned char *)&one;
31076
- PyObject *from_bytes, *result = NULL;
31077
- PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
31078
- from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
31079
- if (!from_bytes) return NULL;
31080
- py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(char));
31081
- if (!py_bytes) goto limited_bad;
31082
- order_str = PyUnicode_FromString(little ? "little" : "big");
31083
- if (!order_str) goto limited_bad;
31084
- arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
31085
- if (!arg_tuple) goto limited_bad;
31086
- if (!is_unsigned) {
31087
- kwds = PyDict_New();
31088
- if (!kwds) goto limited_bad;
31089
- if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
31090
- }
31091
- result = PyObject_Call(from_bytes, arg_tuple, kwds);
31092
- limited_bad:
31093
- Py_XDECREF(kwds);
31094
- Py_XDECREF(arg_tuple);
31095
- Py_XDECREF(order_str);
31096
- Py_XDECREF(py_bytes);
31097
- Py_XDECREF(from_bytes);
31098
- return result;
31099
- #endif
31100
- }
31101
- }
31102
-
31103
31204
  /* CIntFromPy */
31104
31205
  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
31105
31206
  #ifdef __Pyx_HAS_GCC_DIAGNOSTIC