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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (66) hide show
  1. README.md +75 -2
  2. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/actions.cpython-311-darwin.so +0 -0
  3. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/attack.cpython-311-darwin.so +0 -0
  4. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/gift.cpython-311-darwin.so +0 -0
  5. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/move.cpython-311-darwin.so +0 -0
  6. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/noop.cpython-311-darwin.so +0 -0
  7. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/rotate.cpython-311-darwin.so +0 -0
  8. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/shield.cpython-311-darwin.so +0 -0
  9. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/use.cpython-311-darwin.so +0 -0
  10. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/mettagrid_c.cpython-311-darwin.so +0 -0
  11. build/lib.macosx-11.0-arm64-cpython-311/mettagrid/objects.cpython-311-darwin.so +0 -0
  12. build/mettagrid/actions/actions.cpp +706 -593
  13. build/mettagrid/actions/attack.cpp +1589 -1185
  14. build/mettagrid/actions/gift.cpp +550 -515
  15. build/mettagrid/actions/move.cpp +739 -638
  16. build/mettagrid/actions/noop.cpp +32376 -0
  17. build/mettagrid/actions/rotate.cpp +550 -545
  18. build/mettagrid/actions/shield.cpp +594 -531
  19. build/mettagrid/actions/use.cpp +654 -589
  20. build/mettagrid/mettagrid.cpp +4011 -1495
  21. build/mettagrid/objects.cpp +1449 -824
  22. mettagrid/actions/actions.cpython-311-darwin.so +0 -0
  23. mettagrid/actions/actions.pxd +2 -2
  24. mettagrid/actions/actions.pyx +19 -5
  25. mettagrid/actions/attack.cpython-311-darwin.so +0 -0
  26. mettagrid/actions/attack.pyx +12 -3
  27. mettagrid/actions/gift.cpython-311-darwin.so +0 -0
  28. mettagrid/actions/gift.pyx +4 -1
  29. mettagrid/actions/move.cpython-311-darwin.so +0 -0
  30. mettagrid/actions/move.pyx +16 -6
  31. mettagrid/actions/noop.cpython-311-darwin.so +0 -0
  32. mettagrid/actions/noop.pxd +4 -0
  33. mettagrid/actions/noop.pyx +25 -0
  34. mettagrid/actions/rotate.cpython-311-darwin.so +0 -0
  35. mettagrid/actions/rotate.pyx +5 -3
  36. mettagrid/actions/shield.cpython-311-darwin.so +0 -0
  37. mettagrid/actions/shield.pyx +10 -3
  38. mettagrid/actions/use.cpython-311-darwin.so +0 -0
  39. mettagrid/actions/use.pyx +9 -4
  40. mettagrid/mettagrid.pyx +35 -1
  41. mettagrid/mettagrid_c.cpython-311-darwin.so +0 -0
  42. mettagrid/mettagrid_env.py +44 -72
  43. mettagrid/objects.cpython-311-darwin.so +0 -0
  44. mettagrid/objects.pxd +25 -12
  45. mettagrid/objects.pyx +19 -21
  46. mettagrid/renderer/assets/agent.png +0 -0
  47. mettagrid/renderer/assets/altar.png +0 -0
  48. mettagrid/renderer/assets/arial.ttf +0 -0
  49. mettagrid/renderer/assets/converter.png +0 -0
  50. mettagrid/renderer/assets/generator.png +0 -0
  51. mettagrid/renderer/json_renderer.py +0 -0
  52. mettagrid/renderer/raylib_renderer.py +410 -0
  53. mettagrid/renderer/render_code_example.py +56 -0
  54. mettagrid-0.0.3.dist-info/METADATA +96 -0
  55. mettagrid-0.0.3.dist-info/RECORD +81 -0
  56. setup.py +1 -0
  57. test_perf.py +2 -2
  58. mettagrid/actions.cpython-311-darwin.so +0 -0
  59. mettagrid/renderer/raylib_client.py +0 -180
  60. mettagrid-0.0.2.dist-info/METADATA +0 -23
  61. mettagrid-0.0.2.dist-info/RECORD +0 -70
  62. /mettagrid/renderer/assets/{tiny_galaxy_items.png → items.png} +0 -0
  63. /mettagrid/renderer/assets/{tiny_galaxy_monsters.png → monsters.png} +0 -0
  64. /mettagrid/renderer/assets/{wall1-0.png → wall.png} +0 -0
  65. {mettagrid-0.0.2.dist-info → mettagrid-0.0.3.dist-info}/LICENSE +0 -0
  66. {mettagrid-0.0.2.dist-info → mettagrid-0.0.3.dist-info}/WHEEL +0 -0
@@ -10,12 +10,12 @@
10
10
  ]
11
11
  ],
12
12
  "depends": [
13
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid/event.hpp",
14
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid/grid.hpp",
15
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid/grid_object.hpp"
13
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid/event.hpp",
14
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid/grid.hpp",
15
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid/grid_object.hpp"
16
16
  ],
17
17
  "include_dirs": [
18
- "/Users/daveey/miniforge3/envs/metta-new/lib/python3.11/site-packages/puffergrid"
18
+ "/Users/daveey/code/metta/deps/puffergrid/puffergrid"
19
19
  ],
20
20
  "language": "c++",
21
21
  "name": "mettagrid.actions.actions",
@@ -1718,7 +1718,7 @@ typedef struct {
1718
1718
 
1719
1719
  /* #### Code section: numeric_typedefs ### */
1720
1720
 
1721
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":731
1721
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":731
1722
1722
  * # in Cython to enable them only on the right systems.
1723
1723
  *
1724
1724
  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
@@ -1727,7 +1727,7 @@ typedef struct {
1727
1727
  */
1728
1728
  typedef npy_int8 __pyx_t_5numpy_int8_t;
1729
1729
 
1730
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":732
1730
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":732
1731
1731
  *
1732
1732
  * ctypedef npy_int8 int8_t
1733
1733
  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
@@ -1736,7 +1736,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
1736
1736
  */
1737
1737
  typedef npy_int16 __pyx_t_5numpy_int16_t;
1738
1738
 
1739
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":733
1739
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":733
1740
1740
  * ctypedef npy_int8 int8_t
1741
1741
  * ctypedef npy_int16 int16_t
1742
1742
  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
@@ -1745,7 +1745,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
1745
1745
  */
1746
1746
  typedef npy_int32 __pyx_t_5numpy_int32_t;
1747
1747
 
1748
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":734
1748
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":734
1749
1749
  * ctypedef npy_int16 int16_t
1750
1750
  * ctypedef npy_int32 int32_t
1751
1751
  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
@@ -1754,7 +1754,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
1754
1754
  */
1755
1755
  typedef npy_int64 __pyx_t_5numpy_int64_t;
1756
1756
 
1757
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":738
1757
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":738
1758
1758
  * #ctypedef npy_int128 int128_t
1759
1759
  *
1760
1760
  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
@@ -1763,7 +1763,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
1763
1763
  */
1764
1764
  typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1765
1765
 
1766
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":739
1766
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":739
1767
1767
  *
1768
1768
  * ctypedef npy_uint8 uint8_t
1769
1769
  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
@@ -1772,7 +1772,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
1772
1772
  */
1773
1773
  typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1774
1774
 
1775
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":740
1775
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":740
1776
1776
  * ctypedef npy_uint8 uint8_t
1777
1777
  * ctypedef npy_uint16 uint16_t
1778
1778
  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
@@ -1781,7 +1781,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
1781
1781
  */
1782
1782
  typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1783
1783
 
1784
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":741
1784
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":741
1785
1785
  * ctypedef npy_uint16 uint16_t
1786
1786
  * ctypedef npy_uint32 uint32_t
1787
1787
  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
@@ -1790,7 +1790,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
1790
1790
  */
1791
1791
  typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1792
1792
 
1793
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":745
1793
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":745
1794
1794
  * #ctypedef npy_uint128 uint128_t
1795
1795
  *
1796
1796
  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
@@ -1799,7 +1799,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
1799
1799
  */
1800
1800
  typedef npy_float32 __pyx_t_5numpy_float32_t;
1801
1801
 
1802
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":746
1802
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":746
1803
1803
  *
1804
1804
  * ctypedef npy_float32 float32_t
1805
1805
  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
@@ -1808,7 +1808,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
1808
1808
  */
1809
1809
  typedef npy_float64 __pyx_t_5numpy_float64_t;
1810
1810
 
1811
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":755
1811
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":755
1812
1812
  * # The int types are mapped a bit surprising --
1813
1813
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1814
1814
  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
@@ -1817,7 +1817,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
1817
1817
  */
1818
1818
  typedef npy_long __pyx_t_5numpy_int_t;
1819
1819
 
1820
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":756
1820
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":756
1821
1821
  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1822
1822
  * ctypedef npy_long int_t
1823
1823
  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
@@ -1826,7 +1826,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
1826
1826
  */
1827
1827
  typedef npy_longlong __pyx_t_5numpy_long_t;
1828
1828
 
1829
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":757
1829
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":757
1830
1830
  * ctypedef npy_long int_t
1831
1831
  * ctypedef npy_longlong long_t
1832
1832
  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
@@ -1835,7 +1835,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
1835
1835
  */
1836
1836
  typedef npy_longlong __pyx_t_5numpy_longlong_t;
1837
1837
 
1838
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":759
1838
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":759
1839
1839
  * ctypedef npy_longlong longlong_t
1840
1840
  *
1841
1841
  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
@@ -1844,7 +1844,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
1844
1844
  */
1845
1845
  typedef npy_ulong __pyx_t_5numpy_uint_t;
1846
1846
 
1847
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":760
1847
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":760
1848
1848
  *
1849
1849
  * ctypedef npy_ulong uint_t
1850
1850
  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
@@ -1853,7 +1853,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
1853
1853
  */
1854
1854
  typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1855
1855
 
1856
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":761
1856
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":761
1857
1857
  * ctypedef npy_ulong uint_t
1858
1858
  * ctypedef npy_ulonglong ulong_t
1859
1859
  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
@@ -1862,7 +1862,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1862
1862
  */
1863
1863
  typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1864
1864
 
1865
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":763
1865
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":763
1866
1866
  * ctypedef npy_ulonglong ulonglong_t
1867
1867
  *
1868
1868
  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
@@ -1871,7 +1871,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1871
1871
  */
1872
1872
  typedef npy_intp __pyx_t_5numpy_intp_t;
1873
1873
 
1874
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":764
1874
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":764
1875
1875
  *
1876
1876
  * ctypedef npy_intp intp_t
1877
1877
  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
@@ -1880,7 +1880,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
1880
1880
  */
1881
1881
  typedef npy_uintp __pyx_t_5numpy_uintp_t;
1882
1882
 
1883
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":766
1883
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":766
1884
1884
  * ctypedef npy_uintp uintp_t
1885
1885
  *
1886
1886
  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
@@ -1889,7 +1889,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
1889
1889
  */
1890
1890
  typedef npy_double __pyx_t_5numpy_float_t;
1891
1891
 
1892
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":767
1892
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":767
1893
1893
  *
1894
1894
  * ctypedef npy_double float_t
1895
1895
  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
@@ -1898,7 +1898,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
1898
1898
  */
1899
1899
  typedef npy_double __pyx_t_5numpy_double_t;
1900
1900
 
1901
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":768
1901
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":768
1902
1902
  * ctypedef npy_double float_t
1903
1903
  * ctypedef npy_double double_t
1904
1904
  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
@@ -1975,7 +1975,7 @@ struct __pyx_MemviewEnum_obj;
1975
1975
  struct __pyx_memoryview_obj;
1976
1976
  struct __pyx_memoryviewslice_obj;
1977
1977
 
1978
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":770
1978
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":770
1979
1979
  * ctypedef npy_longdouble longdouble_t
1980
1980
  *
1981
1981
  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
@@ -1984,7 +1984,7 @@ struct __pyx_memoryviewslice_obj;
1984
1984
  */
1985
1985
  typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1986
1986
 
1987
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":771
1987
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":771
1988
1988
  *
1989
1989
  * ctypedef npy_cfloat cfloat_t
1990
1990
  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
@@ -1993,7 +1993,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1993
1993
  */
1994
1994
  typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1995
1995
 
1996
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":772
1996
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":772
1997
1997
  * ctypedef npy_cfloat cfloat_t
1998
1998
  * ctypedef npy_cdouble cdouble_t
1999
1999
  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
@@ -2002,7 +2002,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
2002
2002
  */
2003
2003
  typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
2004
2004
 
2005
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":774
2005
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":774
2006
2006
  * ctypedef npy_clongdouble clongdouble_t
2007
2007
  *
2008
2008
  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
@@ -2018,7 +2018,7 @@ struct __pyx_t_9mettagrid_7objects_Generator;
2018
2018
  struct __pyx_t_9mettagrid_7objects_Converter;
2019
2019
  struct __pyx_t_9mettagrid_7objects_Altar;
2020
2020
 
2021
- /* "mettagrid/objects.pxd":15
2021
+ /* "mettagrid/objects.pxd":16
2022
2022
  * from puffergrid.event cimport EventHandler, EventArg
2023
2023
  *
2024
2024
  * cdef enum GridLayer: # <<<<<<<<<<<<<<
@@ -2030,7 +2030,7 @@ enum __pyx_t_9mettagrid_7objects_GridLayer {
2030
2030
  __pyx_e_9mettagrid_7objects_Object_Layer = 1
2031
2031
  };
2032
2032
 
2033
- /* "mettagrid/objects.pxd":46
2033
+ /* "mettagrid/objects.pxd":44
2034
2034
  * return this.ready and this.use_cost <= actor.energy
2035
2035
  *
2036
2036
  * cdef enum ObjectType: # <<<<<<<<<<<<<<
@@ -2046,7 +2046,7 @@ enum __pyx_t_9mettagrid_7objects_ObjectType {
2046
2046
  __pyx_e_9mettagrid_7objects_Count = 5
2047
2047
  };
2048
2048
 
2049
- /* "mettagrid/objects.pxd":56
2049
+ /* "mettagrid/objects.pxd":54
2050
2050
  * cdef vector[string] ObjectTypeNames # defined in objects.pyx
2051
2051
  *
2052
2052
  * cdef enum InventoryItem: # <<<<<<<<<<<<<<
@@ -2060,7 +2060,7 @@ enum __pyx_t_9mettagrid_7objects_InventoryItem {
2060
2060
  __pyx_e_9mettagrid_7objects_InventoryCount = 3
2061
2061
  };
2062
2062
 
2063
- /* "mettagrid/objects.pxd":191
2063
+ /* "mettagrid/objects.pxd":202
2064
2064
  * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
2065
2065
  *
2066
2066
  * cdef enum Events: # <<<<<<<<<<<<<<
@@ -2071,7 +2071,7 @@ enum __pyx_t_9mettagrid_7objects_Events {
2071
2071
  __pyx_e_9mettagrid_7objects_Reset = 0
2072
2072
  };
2073
2073
 
2074
- /* "mettagrid/objects.pxd":19
2074
+ /* "mettagrid/objects.pxd":20
2075
2075
  * Object_Layer = 1
2076
2076
  *
2077
2077
  * ctypedef map[string, int] ObjectConfig # <<<<<<<<<<<<<<
@@ -2081,7 +2081,7 @@ enum __pyx_t_9mettagrid_7objects_Events {
2081
2081
  typedef std::map<std::string,int> __pyx_t_9mettagrid_7objects_ObjectConfig;
2082
2082
  struct __pyx_t_9mettagrid_7objects_MettaObject : public GridObject {
2083
2083
 
2084
- /* "mettagrid/objects.pxd":21
2084
+ /* "mettagrid/objects.pxd":22
2085
2085
  * ctypedef map[string, int] ObjectConfig
2086
2086
  *
2087
2087
  * cdef cppclass MettaObject(GridObject): # <<<<<<<<<<<<<<
@@ -2090,14 +2090,13 @@ struct __pyx_t_9mettagrid_7objects_MettaObject : public GridObject {
2090
2090
  */
2091
2091
  unsigned int hp;
2092
2092
  virtual void init_mo(__pyx_t_9mettagrid_7objects_ObjectConfig);
2093
- virtual char usable(__pyx_t_9mettagrid_7objects_Agent const *);
2094
- virtual char attackable(void);
2093
+ virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
2095
2094
  virtual ~__pyx_t_9mettagrid_7objects_MettaObject() {
2096
2095
  }
2097
2096
  };
2098
2097
  struct __pyx_t_9mettagrid_7objects_Usable : public __pyx_t_9mettagrid_7objects_MettaObject {
2099
2098
 
2100
- /* "mettagrid/objects.pxd":33
2099
+ /* "mettagrid/objects.pxd":31
2101
2100
  * return False
2102
2101
  *
2103
2102
  * cdef cppclass Usable(MettaObject): # <<<<<<<<<<<<<<
@@ -2108,24 +2107,28 @@ struct __pyx_t_9mettagrid_7objects_Usable : public __pyx_t_9mettagrid_7objects_M
2108
2107
  unsigned int cooldown;
2109
2108
  unsigned char ready;
2110
2109
  virtual void init_usable(__pyx_t_9mettagrid_7objects_ObjectConfig);
2111
- virtual char usable(__pyx_t_9mettagrid_7objects_Agent const *);
2110
+ virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
2112
2111
  virtual ~__pyx_t_9mettagrid_7objects_Usable() {
2113
2112
  }
2114
2113
  };
2115
2114
  struct __pyx_t_9mettagrid_7objects_Agent : public __pyx_t_9mettagrid_7objects_MettaObject {
2116
2115
 
2117
- /* "mettagrid/objects.pxd":65
2116
+ /* "mettagrid/objects.pxd":63
2118
2117
  *
2119
2118
  *
2120
2119
  * cdef cppclass Agent(MettaObject): # <<<<<<<<<<<<<<
2121
- * char frozen
2122
- * unsigned int energy
2120
+ * unsigned int frozen
2121
+ * unsigned int freeze_duration
2123
2122
  */
2124
- char frozen;
2125
- unsigned int energy;
2123
+ unsigned int frozen;
2124
+ unsigned int freeze_duration;
2125
+ unsigned char energy;
2126
2126
  unsigned int orientation;
2127
- char shield;
2128
- std::vector<unsigned short> inventory;
2127
+ unsigned char shield;
2128
+ unsigned char shield_upkeep;
2129
+ std::vector<unsigned char> inventory;
2130
+ unsigned char max_items;
2131
+ unsigned char max_energy;
2129
2132
  void __pyx_f___init__Agent(GridCoord, GridCoord, __pyx_t_9mettagrid_7objects_ObjectConfig &);
2130
2133
  virtual void update_inventory(enum __pyx_t_9mettagrid_7objects_InventoryItem, short);
2131
2134
  virtual void obs(__Pyx_memviewslice);
@@ -2138,7 +2141,7 @@ struct __pyx_t_9mettagrid_7objects_Agent : public __pyx_t_9mettagrid_7objects_Me
2138
2141
  };
2139
2142
  struct __pyx_t_9mettagrid_7objects_Wall : public __pyx_t_9mettagrid_7objects_MettaObject {
2140
2143
 
2141
- /* "mettagrid/objects.pxd":104
2144
+ /* "mettagrid/objects.pxd":112
2142
2145
  * "agent:inv:" + n for n in InventoryItemNames]
2143
2146
  *
2144
2147
  * cdef cppclass Wall(MettaObject): # <<<<<<<<<<<<<<
@@ -2156,7 +2159,7 @@ struct __pyx_t_9mettagrid_7objects_Wall : public __pyx_t_9mettagrid_7objects_Met
2156
2159
  };
2157
2160
  struct __pyx_t_9mettagrid_7objects_Generator : public __pyx_t_9mettagrid_7objects_Usable {
2158
2161
 
2159
- /* "mettagrid/objects.pxd":117
2162
+ /* "mettagrid/objects.pxd":125
2160
2163
  * return ["wall", "wall:hp"]
2161
2164
  *
2162
2165
  * cdef cppclass Generator(Usable): # <<<<<<<<<<<<<<
@@ -2165,7 +2168,7 @@ struct __pyx_t_9mettagrid_7objects_Generator : public __pyx_t_9mettagrid_7object
2165
2168
  */
2166
2169
  unsigned int r1;
2167
2170
  void __pyx_f___init__Generator(GridCoord, GridCoord, __pyx_t_9mettagrid_7objects_ObjectConfig &);
2168
- virtual char usable(__pyx_t_9mettagrid_7objects_Agent const *);
2171
+ virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
2169
2172
  virtual void obs(__Pyx_memviewslice);
2170
2173
  static std::vector<std::string> feature_names(void);
2171
2174
  __pyx_t_9mettagrid_7objects_Generator(GridCoord __pyx_v_r, GridCoord __pyx_v_c, __pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
@@ -2176,7 +2179,7 @@ struct __pyx_t_9mettagrid_7objects_Generator : public __pyx_t_9mettagrid_7object
2176
2179
  };
2177
2180
  struct __pyx_t_9mettagrid_7objects_Converter : public __pyx_t_9mettagrid_7objects_Usable {
2178
2181
 
2179
- /* "mettagrid/objects.pxd":140
2182
+ /* "mettagrid/objects.pxd":148
2180
2183
  * return ["generator", "generator:hp", "generator:r1", "generator:ready"]
2181
2184
  *
2182
2185
  * cdef cppclass Converter(Usable): # <<<<<<<<<<<<<<
@@ -2187,7 +2190,7 @@ struct __pyx_t_9mettagrid_7objects_Converter : public __pyx_t_9mettagrid_7object
2187
2190
  enum __pyx_t_9mettagrid_7objects_InventoryItem output_resource;
2188
2191
  short output_energy;
2189
2192
  void __pyx_f___init__Converter(GridCoord, GridCoord, __pyx_t_9mettagrid_7objects_ObjectConfig &);
2190
- virtual char usable(__pyx_t_9mettagrid_7objects_Agent const *);
2193
+ virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
2191
2194
  virtual PyObject *obs(__Pyx_memviewslice);
2192
2195
  static std::vector<std::string> feature_names(void);
2193
2196
  __pyx_t_9mettagrid_7objects_Converter(GridCoord __pyx_v_r, GridCoord __pyx_v_c, __pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
@@ -2198,7 +2201,7 @@ struct __pyx_t_9mettagrid_7objects_Converter : public __pyx_t_9mettagrid_7object
2198
2201
  };
2199
2202
  struct __pyx_t_9mettagrid_7objects_Altar : public __pyx_t_9mettagrid_7objects_Usable {
2200
2203
 
2201
- /* "mettagrid/objects.pxd":168
2204
+ /* "mettagrid/objects.pxd":176
2202
2205
  * return ["converter", "converter:hp", "converter:input_resource", "converter:output_resource", "converter:output_energy", "converter:ready"]
2203
2206
  *
2204
2207
  * cdef cppclass Altar(Usable): # <<<<<<<<<<<<<<
@@ -2305,6 +2308,8 @@ struct __pyx_obj_10puffergrid_8grid_env_GridEnv {
2305
2308
  unsigned int _current_timestep;
2306
2309
  unsigned int _max_timestep;
2307
2310
  PyObject *_action_handlers;
2311
+ std::vector<unsigned char> _max_action_args;
2312
+ unsigned char _max_action_arg;
2308
2313
  struct __pyx_obj_10puffergrid_19observation_encoder_ObservationEncoder *_obs_encoder;
2309
2314
  unsigned short _obs_width;
2310
2315
  unsigned short _obs_height;
@@ -2338,7 +2343,7 @@ struct __pyx_obj_10puffergrid_6action_ActionHandler {
2338
2343
  };
2339
2344
 
2340
2345
 
2341
- /* "mettagrid/objects.pxd":185
2346
+ /* "mettagrid/objects.pxd":193
2342
2347
  * cdef map[TypeId, GridLayer] ObjectLayers
2343
2348
  *
2344
2349
  * cdef class ResetHandler(EventHandler): # <<<<<<<<<<<<<<
@@ -2350,17 +2355,18 @@ struct __pyx_obj_9mettagrid_7objects_ResetHandler {
2350
2355
  };
2351
2356
 
2352
2357
 
2353
- /* "mettagrid/objects.pxd":194
2358
+ /* "mettagrid/objects.pxd":205
2354
2359
  * Reset = 0
2355
2360
  *
2356
2361
  * cdef class MettaObservationEncoder(ObservationEncoder): # <<<<<<<<<<<<<<
2362
+ * cdef _encode(self, GridObject *obj, ObsType[:] obs, unsigned int offset)
2357
2363
  * cdef vector[short] _offsets
2358
- * cdef vector[string] _feature_names
2359
2364
  */
2360
2365
  struct __pyx_obj_9mettagrid_7objects_MettaObservationEncoder {
2361
2366
  struct __pyx_obj_10puffergrid_19observation_encoder_ObservationEncoder __pyx_base;
2362
2367
  std::vector<short> _offsets;
2363
2368
  std::vector<std::string> _feature_names;
2369
+ std::vector<std::vector<std::string> > _type_feature_names;
2364
2370
  };
2365
2371
 
2366
2372
 
@@ -2550,7 +2556,7 @@ struct __pyx_vtabstruct_10puffergrid_8grid_env_GridEnv {
2550
2556
  PyObject *(*get_episode_rewards)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, int __pyx_skip_dispatch);
2551
2557
  PyObject *(*get_buffers)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, int __pyx_skip_dispatch);
2552
2558
  PyArrayObject *(*render_ascii)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, PyObject *, int __pyx_skip_dispatch);
2553
- PyArrayObject *(*grid_objects)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, int __pyx_skip_dispatch);
2559
+ PyArrayObject *(*grid_objects_types)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, int __pyx_skip_dispatch);
2554
2560
  };
2555
2561
  static struct __pyx_vtabstruct_10puffergrid_8grid_env_GridEnv *__pyx_vtabptr_10puffergrid_8grid_env_GridEnv;
2556
2562
 
@@ -2565,12 +2571,13 @@ static struct __pyx_vtabstruct_10puffergrid_8grid_env_GridEnv *__pyx_vtabptr_10p
2565
2571
 
2566
2572
  struct __pyx_vtabstruct_10puffergrid_6action_ActionHandler {
2567
2573
  void (*init)(struct __pyx_obj_10puffergrid_6action_ActionHandler *, struct __pyx_obj_10puffergrid_8grid_env_GridEnv *);
2568
- char (*handle_action)(struct __pyx_obj_10puffergrid_6action_ActionHandler *, unsigned int, GridObjectId, __pyx_t_10puffergrid_6action_ActionArg);
2574
+ int (*handle_action)(struct __pyx_obj_10puffergrid_6action_ActionHandler *, unsigned int, GridObjectId, __pyx_t_10puffergrid_6action_ActionArg);
2575
+ unsigned char (*max_arg)(struct __pyx_obj_10puffergrid_6action_ActionHandler *);
2569
2576
  };
2570
2577
  static struct __pyx_vtabstruct_10puffergrid_6action_ActionHandler *__pyx_vtabptr_10puffergrid_6action_ActionHandler;
2571
2578
 
2572
2579
 
2573
- /* "mettagrid/objects.pxd":185
2580
+ /* "mettagrid/objects.pxd":193
2574
2581
  * cdef map[TypeId, GridLayer] ObjectLayers
2575
2582
  *
2576
2583
  * cdef class ResetHandler(EventHandler): # <<<<<<<<<<<<<<
@@ -2584,16 +2591,17 @@ struct __pyx_vtabstruct_9mettagrid_7objects_ResetHandler {
2584
2591
  static struct __pyx_vtabstruct_9mettagrid_7objects_ResetHandler *__pyx_vtabptr_9mettagrid_7objects_ResetHandler;
2585
2592
 
2586
2593
 
2587
- /* "mettagrid/objects.pxd":194
2594
+ /* "mettagrid/objects.pxd":205
2588
2595
  * Reset = 0
2589
2596
  *
2590
2597
  * cdef class MettaObservationEncoder(ObservationEncoder): # <<<<<<<<<<<<<<
2598
+ * cdef _encode(self, GridObject *obj, ObsType[:] obs, unsigned int offset)
2591
2599
  * cdef vector[short] _offsets
2592
- * cdef vector[string] _feature_names
2593
2600
  */
2594
2601
 
2595
2602
  struct __pyx_vtabstruct_9mettagrid_7objects_MettaObservationEncoder {
2596
2603
  struct __pyx_vtabstruct_10puffergrid_19observation_encoder_ObservationEncoder __pyx_base;
2604
+ PyObject *(*_encode)(struct __pyx_obj_9mettagrid_7objects_MettaObservationEncoder *, GridObject *, __Pyx_memviewslice, unsigned int);
2597
2605
  };
2598
2606
  static struct __pyx_vtabstruct_9mettagrid_7objects_MettaObservationEncoder *__pyx_vtabptr_9mettagrid_7objects_MettaObservationEncoder;
2599
2607
 
@@ -2602,13 +2610,13 @@ static struct __pyx_vtabstruct_9mettagrid_7objects_MettaObservationEncoder *__py
2602
2610
  * string to_string(int val)
2603
2611
  *
2604
2612
  * cdef class MettaActionHandler(ActionHandler): # <<<<<<<<<<<<<<
2605
- * def __init__(self, cfg: OmegaConf, action_name, action_cost=0):
2613
+ * def __init__(self, cfg: OmegaConf, action_name):
2606
2614
  * self.action_name = action_name
2607
2615
  */
2608
2616
 
2609
2617
  struct __pyx_vtabstruct_9mettagrid_7actions_7actions_MettaActionHandler {
2610
2618
  struct __pyx_vtabstruct_10puffergrid_6action_ActionHandler __pyx_base;
2611
- char (*_handle_action)(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *, unsigned int, __pyx_t_9mettagrid_7objects_Agent *, __pyx_t_10puffergrid_6action_ActionArg);
2619
+ int (*_handle_action)(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *, unsigned int, __pyx_t_9mettagrid_7objects_Agent *, __pyx_t_10puffergrid_6action_ActionArg);
2612
2620
  };
2613
2621
  static struct __pyx_vtabstruct_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler;
2614
2622
 
@@ -3732,9 +3740,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_9mettagrid_7object
3732
3740
  /* CIntFromPy.proto */
3733
3741
  static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *);
3734
3742
 
3735
- /* CIntToPy.proto */
3736
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);
3737
-
3738
3743
  /* MemviewSliceInit.proto */
3739
3744
  #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
3740
3745
  #define __Pyx_MEMVIEW_DIRECT 1
@@ -3816,8 +3821,8 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
3816
3821
  static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
3817
3822
  static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
3818
3823
  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*/
3819
- static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_action(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, unsigned int __pyx_v_actor_id, GridObjectId __pyx_v_actor_object_id, __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg); /* proto*/
3820
- static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler__handle_action(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, CYTHON_UNUSED unsigned int __pyx_v_actor_id, CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, CYTHON_UNUSED __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg); /* proto*/
3824
+ static int __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_action(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, unsigned int __pyx_v_actor_id, GridObjectId __pyx_v_actor_object_id, __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg); /* proto*/
3825
+ static int __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler__handle_action(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, CYTHON_UNUSED unsigned int __pyx_v_actor_id, CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, CYTHON_UNUSED __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg); /* proto*/
3821
3826
 
3822
3827
  /* Module declarations from "libc.string" */
3823
3828
 
@@ -4030,12 +4035,12 @@ static const char __pyx_k_pyx_state[] = "__pyx_state";
4030
4035
  static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
4031
4036
  static const char __pyx_k_IndexError[] = "IndexError";
4032
4037
  static const char __pyx_k_ValueError[] = "ValueError";
4038
+ static const char __pyx_k_max_energy[] = "max_energy";
4033
4039
  static const char __pyx_k_pyx_result[] = "__pyx_result";
4034
4040
  static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
4035
4041
  static const char __pyx_k_ImportError[] = "ImportError";
4036
4042
  static const char __pyx_k_MemoryError[] = "MemoryError";
4037
4043
  static const char __pyx_k_PickleError[] = "PickleError";
4038
- static const char __pyx_k_action_cost[] = "action_cost";
4039
4044
  static const char __pyx_k_action_name[] = "action_name";
4040
4045
  static const char __pyx_k_altar_ready[] = "altar:ready";
4041
4046
  static const char __pyx_k_collections[] = "collections";
@@ -4051,7 +4056,9 @@ static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
4051
4056
  static const char __pyx_k_stringsource[] = "<stringsource>";
4052
4057
  static const char __pyx_k_version_info[] = "version_info";
4053
4058
  static const char __pyx_k_class_getitem[] = "__class_getitem__";
4059
+ static const char __pyx_k_max_inventory[] = "max_inventory";
4054
4060
  static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
4061
+ static const char __pyx_k_upkeep_shield[] = "upkeep.shield";
4055
4062
  static const char __pyx_k_AssertionError[] = "AssertionError";
4056
4063
  static const char __pyx_k_initial_energy[] = "initial_energy";
4057
4064
  static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
@@ -4059,6 +4066,7 @@ static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
4059
4066
  static const char __pyx_k_collections_abc[] = "collections.abc";
4060
4067
  static const char __pyx_k_converter_ready[] = "converter:ready";
4061
4068
  static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
4069
+ static const char __pyx_k_freeze_duration[] = "freeze_duration";
4062
4070
  static const char __pyx_k_generator_ready[] = "generator:ready";
4063
4071
  static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
4064
4072
  static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
@@ -4149,7 +4157,7 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl
4149
4157
  static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
4150
4158
  static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4151
4159
  static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
4152
- static int __pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler___init__(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, PyObject *__pyx_v_cfg, PyObject *__pyx_v_action_name, CYTHON_UNUSED PyObject *__pyx_v_action_cost); /* proto */
4160
+ static int __pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler___init__(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, PyObject *__pyx_v_cfg, PyObject *__pyx_v_action_name); /* proto */
4153
4161
  static PyObject *__pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler_2__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self); /* proto */
4154
4162
  static PyObject *__pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler_4__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
4155
4163
  static PyObject *__pyx_tp_new_9mettagrid_7actions_7actions_MettaActionHandler(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
@@ -4314,7 +4322,6 @@ typedef struct {
4314
4322
  PyObject *__pyx_kp_u__7;
4315
4323
  PyObject *__pyx_n_s_abc;
4316
4324
  PyObject *__pyx_kp_u_action;
4317
- PyObject *__pyx_n_s_action_cost;
4318
4325
  PyObject *__pyx_n_s_action_name;
4319
4326
  PyObject *__pyx_n_u_agent;
4320
4327
  PyObject *__pyx_kp_u_agent_energy;
@@ -4574,7 +4581,6 @@ static int __pyx_m_clear(PyObject *m) {
4574
4581
  Py_CLEAR(clear_module_state->__pyx_kp_u__7);
4575
4582
  Py_CLEAR(clear_module_state->__pyx_n_s_abc);
4576
4583
  Py_CLEAR(clear_module_state->__pyx_kp_u_action);
4577
- Py_CLEAR(clear_module_state->__pyx_n_s_action_cost);
4578
4584
  Py_CLEAR(clear_module_state->__pyx_n_s_action_name);
4579
4585
  Py_CLEAR(clear_module_state->__pyx_n_u_agent);
4580
4586
  Py_CLEAR(clear_module_state->__pyx_kp_u_agent_energy);
@@ -4812,7 +4818,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
4812
4818
  Py_VISIT(traverse_module_state->__pyx_kp_u__7);
4813
4819
  Py_VISIT(traverse_module_state->__pyx_n_s_abc);
4814
4820
  Py_VISIT(traverse_module_state->__pyx_kp_u_action);
4815
- Py_VISIT(traverse_module_state->__pyx_n_s_action_cost);
4816
4821
  Py_VISIT(traverse_module_state->__pyx_n_s_action_name);
4817
4822
  Py_VISIT(traverse_module_state->__pyx_n_u_agent);
4818
4823
  Py_VISIT(traverse_module_state->__pyx_kp_u_agent_energy);
@@ -5110,7 +5115,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
5110
5115
  #define __pyx_kp_u__7 __pyx_mstate_global->__pyx_kp_u__7
5111
5116
  #define __pyx_n_s_abc __pyx_mstate_global->__pyx_n_s_abc
5112
5117
  #define __pyx_kp_u_action __pyx_mstate_global->__pyx_kp_u_action
5113
- #define __pyx_n_s_action_cost __pyx_mstate_global->__pyx_n_s_action_cost
5114
5118
  #define __pyx_n_s_action_name __pyx_mstate_global->__pyx_n_s_action_name
5115
5119
  #define __pyx_n_u_agent __pyx_mstate_global->__pyx_n_u_agent
5116
5120
  #define __pyx_kp_u_agent_energy __pyx_mstate_global->__pyx_kp_u_agent_energy
@@ -19487,7 +19491,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
19487
19491
  return __pyx_r;
19488
19492
  }
19489
19493
 
19490
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19494
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19491
19495
  *
19492
19496
  * @property
19493
19497
  * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<<
@@ -19498,7 +19502,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
19498
19502
  static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
19499
19503
  PyObject *__pyx_r;
19500
19504
 
19501
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248
19505
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248
19502
19506
  * """Returns a borrowed reference to the object owning the data/memory.
19503
19507
  * """
19504
19508
  * return PyArray_BASE(self) # <<<<<<<<<<<<<<
@@ -19508,7 +19512,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject
19508
19512
  __pyx_r = PyArray_BASE(__pyx_v_self);
19509
19513
  goto __pyx_L0;
19510
19514
 
19511
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19515
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
19512
19516
  *
19513
19517
  * @property
19514
19518
  * cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<<
@@ -19521,7 +19525,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject
19521
19525
  return __pyx_r;
19522
19526
  }
19523
19527
 
19524
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19528
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19525
19529
  *
19526
19530
  * @property
19527
19531
  * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
@@ -19535,7 +19539,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19535
19539
  PyArray_Descr *__pyx_t_1;
19536
19540
  __Pyx_RefNannySetupContext("descr", 1);
19537
19541
 
19538
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254
19542
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254
19539
19543
  * """Returns an owned reference to the dtype of the array.
19540
19544
  * """
19541
19545
  * return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
@@ -19548,7 +19552,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19548
19552
  __pyx_r = ((PyArray_Descr *)__pyx_t_1);
19549
19553
  goto __pyx_L0;
19550
19554
 
19551
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19555
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
19552
19556
  *
19553
19557
  * @property
19554
19558
  * cdef inline dtype descr(self): # <<<<<<<<<<<<<<
@@ -19563,7 +19567,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19563
19567
  return __pyx_r;
19564
19568
  }
19565
19569
 
19566
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19570
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19567
19571
  *
19568
19572
  * @property
19569
19573
  * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<<
@@ -19574,7 +19578,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
19574
19578
  static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
19575
19579
  int __pyx_r;
19576
19580
 
19577
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260
19581
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260
19578
19582
  * """Returns the number of dimensions in the array.
19579
19583
  * """
19580
19584
  * return PyArray_NDIM(self) # <<<<<<<<<<<<<<
@@ -19584,7 +19588,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19584
19588
  __pyx_r = PyArray_NDIM(__pyx_v_self);
19585
19589
  goto __pyx_L0;
19586
19590
 
19587
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19591
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
19588
19592
  *
19589
19593
  * @property
19590
19594
  * cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<<
@@ -19597,7 +19601,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19597
19601
  return __pyx_r;
19598
19602
  }
19599
19603
 
19600
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19604
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19601
19605
  *
19602
19606
  * @property
19603
19607
  * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<<
@@ -19608,7 +19612,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
19608
19612
  static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
19609
19613
  npy_intp *__pyx_r;
19610
19614
 
19611
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268
19615
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268
19612
19616
  * Can return NULL for 0-dimensional arrays.
19613
19617
  * """
19614
19618
  * return PyArray_DIMS(self) # <<<<<<<<<<<<<<
@@ -19618,7 +19622,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19618
19622
  __pyx_r = PyArray_DIMS(__pyx_v_self);
19619
19623
  goto __pyx_L0;
19620
19624
 
19621
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19625
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
19622
19626
  *
19623
19627
  * @property
19624
19628
  * cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<<
@@ -19631,7 +19635,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19631
19635
  return __pyx_r;
19632
19636
  }
19633
19637
 
19634
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19638
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19635
19639
  *
19636
19640
  * @property
19637
19641
  * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<<
@@ -19642,7 +19646,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
19642
19646
  static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
19643
19647
  npy_intp *__pyx_r;
19644
19648
 
19645
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275
19649
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275
19646
19650
  * The number of elements matches the number of dimensions of the array (ndim).
19647
19651
  * """
19648
19652
  * return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
@@ -19652,7 +19656,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19652
19656
  __pyx_r = PyArray_STRIDES(__pyx_v_self);
19653
19657
  goto __pyx_L0;
19654
19658
 
19655
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19659
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
19656
19660
  *
19657
19661
  * @property
19658
19662
  * cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<<
@@ -19665,7 +19669,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19665
19669
  return __pyx_r;
19666
19670
  }
19667
19671
 
19668
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19672
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19669
19673
  *
19670
19674
  * @property
19671
19675
  * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<<
@@ -19676,7 +19680,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
19676
19680
  static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
19677
19681
  npy_intp __pyx_r;
19678
19682
 
19679
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281
19683
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281
19680
19684
  * """Returns the total size (in number of elements) of the array.
19681
19685
  * """
19682
19686
  * return PyArray_SIZE(self) # <<<<<<<<<<<<<<
@@ -19686,7 +19690,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19686
19690
  __pyx_r = PyArray_SIZE(__pyx_v_self);
19687
19691
  goto __pyx_L0;
19688
19692
 
19689
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19693
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
19690
19694
  *
19691
19695
  * @property
19692
19696
  * cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<<
@@ -19699,7 +19703,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19699
19703
  return __pyx_r;
19700
19704
  }
19701
19705
 
19702
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19706
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19703
19707
  *
19704
19708
  * @property
19705
19709
  * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<<
@@ -19710,7 +19714,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
19710
19714
  static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
19711
19715
  char *__pyx_r;
19712
19716
 
19713
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290
19717
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290
19714
19718
  * of `PyArray_DATA()` instead, which returns a 'void*'.
19715
19719
  * """
19716
19720
  * return PyArray_BYTES(self) # <<<<<<<<<<<<<<
@@ -19720,7 +19724,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p
19720
19724
  __pyx_r = PyArray_BYTES(__pyx_v_self);
19721
19725
  goto __pyx_L0;
19722
19726
 
19723
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19727
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
19724
19728
  *
19725
19729
  * @property
19726
19730
  * cdef inline char* data(self) nogil: # <<<<<<<<<<<<<<
@@ -19733,7 +19737,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p
19733
19737
  return __pyx_r;
19734
19738
  }
19735
19739
 
19736
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19740
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19737
19741
  * ctypedef npy_cdouble complex_t
19738
19742
  *
19739
19743
  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -19750,7 +19754,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19750
19754
  int __pyx_clineno = 0;
19751
19755
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
19752
19756
 
19753
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777
19757
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777
19754
19758
  *
19755
19759
  * cdef inline object PyArray_MultiIterNew1(a):
19756
19760
  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
@@ -19764,7 +19768,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19764
19768
  __pyx_t_1 = 0;
19765
19769
  goto __pyx_L0;
19766
19770
 
19767
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19771
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
19768
19772
  * ctypedef npy_cdouble complex_t
19769
19773
  *
19770
19774
  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
@@ -19783,7 +19787,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
19783
19787
  return __pyx_r;
19784
19788
  }
19785
19789
 
19786
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19790
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19787
19791
  * return PyArray_MultiIterNew(1, <void*>a)
19788
19792
  *
19789
19793
  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -19800,7 +19804,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19800
19804
  int __pyx_clineno = 0;
19801
19805
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
19802
19806
 
19803
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780
19807
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780
19804
19808
  *
19805
19809
  * cdef inline object PyArray_MultiIterNew2(a, b):
19806
19810
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
@@ -19814,7 +19818,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19814
19818
  __pyx_t_1 = 0;
19815
19819
  goto __pyx_L0;
19816
19820
 
19817
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19821
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
19818
19822
  * return PyArray_MultiIterNew(1, <void*>a)
19819
19823
  *
19820
19824
  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
@@ -19833,7 +19837,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
19833
19837
  return __pyx_r;
19834
19838
  }
19835
19839
 
19836
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19840
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19837
19841
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19838
19842
  *
19839
19843
  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -19850,7 +19854,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19850
19854
  int __pyx_clineno = 0;
19851
19855
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
19852
19856
 
19853
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783
19857
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783
19854
19858
  *
19855
19859
  * cdef inline object PyArray_MultiIterNew3(a, b, c):
19856
19860
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
@@ -19864,7 +19868,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19864
19868
  __pyx_t_1 = 0;
19865
19869
  goto __pyx_L0;
19866
19870
 
19867
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19871
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
19868
19872
  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
19869
19873
  *
19870
19874
  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
@@ -19883,7 +19887,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
19883
19887
  return __pyx_r;
19884
19888
  }
19885
19889
 
19886
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19890
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19887
19891
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19888
19892
  *
19889
19893
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -19900,7 +19904,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19900
19904
  int __pyx_clineno = 0;
19901
19905
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
19902
19906
 
19903
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786
19907
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786
19904
19908
  *
19905
19909
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
19906
19910
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
@@ -19914,7 +19918,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19914
19918
  __pyx_t_1 = 0;
19915
19919
  goto __pyx_L0;
19916
19920
 
19917
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19921
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
19918
19922
  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
19919
19923
  *
19920
19924
  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
@@ -19933,7 +19937,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
19933
19937
  return __pyx_r;
19934
19938
  }
19935
19939
 
19936
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19940
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19937
19941
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19938
19942
  *
19939
19943
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -19950,7 +19954,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19950
19954
  int __pyx_clineno = 0;
19951
19955
  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
19952
19956
 
19953
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789
19957
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789
19954
19958
  *
19955
19959
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
19956
19960
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
@@ -19964,7 +19968,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19964
19968
  __pyx_t_1 = 0;
19965
19969
  goto __pyx_L0;
19966
19970
 
19967
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19971
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
19968
19972
  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
19969
19973
  *
19970
19974
  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
@@ -19983,7 +19987,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
19983
19987
  return __pyx_r;
19984
19988
  }
19985
19989
 
19986
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
19990
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
19987
19991
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
19988
19992
  *
19989
19993
  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
@@ -19997,7 +20001,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
19997
20001
  int __pyx_t_1;
19998
20002
  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
19999
20003
 
20000
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
20004
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
20001
20005
  *
20002
20006
  * cdef inline tuple PyDataType_SHAPE(dtype d):
20003
20007
  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
@@ -20007,7 +20011,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
20007
20011
  __pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
20008
20012
  if (__pyx_t_1) {
20009
20013
 
20010
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":793
20014
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":793
20011
20015
  * cdef inline tuple PyDataType_SHAPE(dtype d):
20012
20016
  * if PyDataType_HASSUBARRAY(d):
20013
20017
  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
@@ -20019,7 +20023,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
20019
20023
  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
20020
20024
  goto __pyx_L0;
20021
20025
 
20022
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
20026
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
20023
20027
  *
20024
20028
  * cdef inline tuple PyDataType_SHAPE(dtype d):
20025
20029
  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
@@ -20028,7 +20032,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
20028
20032
  */
20029
20033
  }
20030
20034
 
20031
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":795
20035
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":795
20032
20036
  * return <tuple>d.subarray.shape
20033
20037
  * else:
20034
20038
  * return () # <<<<<<<<<<<<<<
@@ -20042,7 +20046,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
20042
20046
  goto __pyx_L0;
20043
20047
  }
20044
20048
 
20045
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
20049
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
20046
20050
  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
20047
20051
  *
20048
20052
  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
@@ -20057,7 +20061,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
20057
20061
  return __pyx_r;
20058
20062
  }
20059
20063
 
20060
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
20064
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
20061
20065
  * int _import_umath() except -1
20062
20066
  *
20063
20067
  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -20067,7 +20071,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
20067
20071
 
20068
20072
  static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
20069
20073
 
20070
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971
20074
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971
20071
20075
  *
20072
20076
  * cdef inline void set_array_base(ndarray arr, object base):
20073
20077
  * Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
@@ -20076,7 +20080,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
20076
20080
  */
20077
20081
  Py_INCREF(__pyx_v_base);
20078
20082
 
20079
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972
20083
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972
20080
20084
  * cdef inline void set_array_base(ndarray arr, object base):
20081
20085
  * Py_INCREF(base) # important to do this before stealing the reference below!
20082
20086
  * PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
@@ -20085,7 +20089,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
20085
20089
  */
20086
20090
  (void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
20087
20091
 
20088
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
20092
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
20089
20093
  * int _import_umath() except -1
20090
20094
  *
20091
20095
  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
@@ -20096,7 +20100,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
20096
20100
  /* function exit code */
20097
20101
  }
20098
20102
 
20099
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
20103
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
20100
20104
  * PyArray_SetBaseObject(arr, base)
20101
20105
  *
20102
20106
  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -20111,7 +20115,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20111
20115
  int __pyx_t_1;
20112
20116
  __Pyx_RefNannySetupContext("get_array_base", 1);
20113
20117
 
20114
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975
20118
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975
20115
20119
  *
20116
20120
  * cdef inline object get_array_base(ndarray arr):
20117
20121
  * base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
@@ -20120,7 +20124,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20120
20124
  */
20121
20125
  __pyx_v_base = PyArray_BASE(__pyx_v_arr);
20122
20126
 
20123
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
20127
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
20124
20128
  * cdef inline object get_array_base(ndarray arr):
20125
20129
  * base = PyArray_BASE(arr)
20126
20130
  * if base is NULL: # <<<<<<<<<<<<<<
@@ -20130,7 +20134,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20130
20134
  __pyx_t_1 = (__pyx_v_base == NULL);
20131
20135
  if (__pyx_t_1) {
20132
20136
 
20133
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":977
20137
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":977
20134
20138
  * base = PyArray_BASE(arr)
20135
20139
  * if base is NULL:
20136
20140
  * return None # <<<<<<<<<<<<<<
@@ -20141,7 +20145,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20141
20145
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20142
20146
  goto __pyx_L0;
20143
20147
 
20144
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
20148
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
20145
20149
  * cdef inline object get_array_base(ndarray arr):
20146
20150
  * base = PyArray_BASE(arr)
20147
20151
  * if base is NULL: # <<<<<<<<<<<<<<
@@ -20150,7 +20154,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20150
20154
  */
20151
20155
  }
20152
20156
 
20153
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":978
20157
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":978
20154
20158
  * if base is NULL:
20155
20159
  * return None
20156
20160
  * return <object>base # <<<<<<<<<<<<<<
@@ -20162,7 +20166,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20162
20166
  __pyx_r = ((PyObject *)__pyx_v_base);
20163
20167
  goto __pyx_L0;
20164
20168
 
20165
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
20169
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
20166
20170
  * PyArray_SetBaseObject(arr, base)
20167
20171
  *
20168
20172
  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
@@ -20177,7 +20181,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
20177
20181
  return __pyx_r;
20178
20182
  }
20179
20183
 
20180
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20184
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20181
20185
  * # Versions of the import_* functions which are more suitable for
20182
20186
  * # Cython code.
20183
20187
  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
@@ -20201,7 +20205,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20201
20205
  int __pyx_clineno = 0;
20202
20206
  __Pyx_RefNannySetupContext("import_array", 1);
20203
20207
 
20204
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20208
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20205
20209
  * # Cython code.
20206
20210
  * cdef inline int import_array() except -1:
20207
20211
  * try: # <<<<<<<<<<<<<<
@@ -20217,7 +20221,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20217
20221
  __Pyx_XGOTREF(__pyx_t_3);
20218
20222
  /*try:*/ {
20219
20223
 
20220
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984
20224
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984
20221
20225
  * cdef inline int import_array() except -1:
20222
20226
  * try:
20223
20227
  * __pyx_import_array() # <<<<<<<<<<<<<<
@@ -20226,7 +20230,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20226
20230
  */
20227
20231
  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 984, __pyx_L3_error)
20228
20232
 
20229
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20233
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20230
20234
  * # Cython code.
20231
20235
  * cdef inline int import_array() except -1:
20232
20236
  * try: # <<<<<<<<<<<<<<
@@ -20240,7 +20244,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20240
20244
  goto __pyx_L8_try_end;
20241
20245
  __pyx_L3_error:;
20242
20246
 
20243
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985
20247
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985
20244
20248
  * try:
20245
20249
  * __pyx_import_array()
20246
20250
  * except Exception: # <<<<<<<<<<<<<<
@@ -20255,7 +20259,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20255
20259
  __Pyx_XGOTREF(__pyx_t_6);
20256
20260
  __Pyx_XGOTREF(__pyx_t_7);
20257
20261
 
20258
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
20262
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
20259
20263
  * __pyx_import_array()
20260
20264
  * except Exception:
20261
20265
  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
@@ -20270,7 +20274,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20270
20274
  }
20271
20275
  goto __pyx_L5_except_error;
20272
20276
 
20273
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20277
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
20274
20278
  * # Cython code.
20275
20279
  * cdef inline int import_array() except -1:
20276
20280
  * try: # <<<<<<<<<<<<<<
@@ -20286,7 +20290,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20286
20290
  __pyx_L8_try_end:;
20287
20291
  }
20288
20292
 
20289
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20293
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
20290
20294
  * # Versions of the import_* functions which are more suitable for
20291
20295
  * # Cython code.
20292
20296
  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
@@ -20309,7 +20313,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
20309
20313
  return __pyx_r;
20310
20314
  }
20311
20315
 
20312
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20316
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20313
20317
  * raise ImportError("numpy.core.multiarray failed to import")
20314
20318
  *
20315
20319
  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
@@ -20333,7 +20337,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20333
20337
  int __pyx_clineno = 0;
20334
20338
  __Pyx_RefNannySetupContext("import_umath", 1);
20335
20339
 
20336
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20340
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20337
20341
  *
20338
20342
  * cdef inline int import_umath() except -1:
20339
20343
  * try: # <<<<<<<<<<<<<<
@@ -20349,7 +20353,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20349
20353
  __Pyx_XGOTREF(__pyx_t_3);
20350
20354
  /*try:*/ {
20351
20355
 
20352
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990
20356
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990
20353
20357
  * cdef inline int import_umath() except -1:
20354
20358
  * try:
20355
20359
  * _import_umath() # <<<<<<<<<<<<<<
@@ -20358,7 +20362,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20358
20362
  */
20359
20363
  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 990, __pyx_L3_error)
20360
20364
 
20361
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20365
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20362
20366
  *
20363
20367
  * cdef inline int import_umath() except -1:
20364
20368
  * try: # <<<<<<<<<<<<<<
@@ -20372,7 +20376,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20372
20376
  goto __pyx_L8_try_end;
20373
20377
  __pyx_L3_error:;
20374
20378
 
20375
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991
20379
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991
20376
20380
  * try:
20377
20381
  * _import_umath()
20378
20382
  * except Exception: # <<<<<<<<<<<<<<
@@ -20387,7 +20391,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20387
20391
  __Pyx_XGOTREF(__pyx_t_6);
20388
20392
  __Pyx_XGOTREF(__pyx_t_7);
20389
20393
 
20390
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
20394
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
20391
20395
  * _import_umath()
20392
20396
  * except Exception:
20393
20397
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -20402,7 +20406,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20402
20406
  }
20403
20407
  goto __pyx_L5_except_error;
20404
20408
 
20405
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20409
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
20406
20410
  *
20407
20411
  * cdef inline int import_umath() except -1:
20408
20412
  * try: # <<<<<<<<<<<<<<
@@ -20418,7 +20422,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20418
20422
  __pyx_L8_try_end:;
20419
20423
  }
20420
20424
 
20421
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20425
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
20422
20426
  * raise ImportError("numpy.core.multiarray failed to import")
20423
20427
  *
20424
20428
  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
@@ -20441,7 +20445,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
20441
20445
  return __pyx_r;
20442
20446
  }
20443
20447
 
20444
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20448
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20445
20449
  * raise ImportError("numpy.core.umath failed to import")
20446
20450
  *
20447
20451
  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
@@ -20465,7 +20469,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20465
20469
  int __pyx_clineno = 0;
20466
20470
  __Pyx_RefNannySetupContext("import_ufunc", 1);
20467
20471
 
20468
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20472
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20469
20473
  *
20470
20474
  * cdef inline int import_ufunc() except -1:
20471
20475
  * try: # <<<<<<<<<<<<<<
@@ -20481,7 +20485,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20481
20485
  __Pyx_XGOTREF(__pyx_t_3);
20482
20486
  /*try:*/ {
20483
20487
 
20484
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996
20488
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996
20485
20489
  * cdef inline int import_ufunc() except -1:
20486
20490
  * try:
20487
20491
  * _import_umath() # <<<<<<<<<<<<<<
@@ -20490,7 +20494,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20490
20494
  */
20491
20495
  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 996, __pyx_L3_error)
20492
20496
 
20493
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20497
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20494
20498
  *
20495
20499
  * cdef inline int import_ufunc() except -1:
20496
20500
  * try: # <<<<<<<<<<<<<<
@@ -20504,7 +20508,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20504
20508
  goto __pyx_L8_try_end;
20505
20509
  __pyx_L3_error:;
20506
20510
 
20507
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":997
20511
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":997
20508
20512
  * try:
20509
20513
  * _import_umath()
20510
20514
  * except Exception: # <<<<<<<<<<<<<<
@@ -20519,7 +20523,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20519
20523
  __Pyx_XGOTREF(__pyx_t_6);
20520
20524
  __Pyx_XGOTREF(__pyx_t_7);
20521
20525
 
20522
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998
20526
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998
20523
20527
  * _import_umath()
20524
20528
  * except Exception:
20525
20529
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -20534,7 +20538,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20534
20538
  }
20535
20539
  goto __pyx_L5_except_error;
20536
20540
 
20537
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20541
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
20538
20542
  *
20539
20543
  * cdef inline int import_ufunc() except -1:
20540
20544
  * try: # <<<<<<<<<<<<<<
@@ -20550,7 +20554,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20550
20554
  __pyx_L8_try_end:;
20551
20555
  }
20552
20556
 
20553
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20557
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
20554
20558
  * raise ImportError("numpy.core.umath failed to import")
20555
20559
  *
20556
20560
  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
@@ -20573,7 +20577,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20573
20577
  return __pyx_r;
20574
20578
  }
20575
20579
 
20576
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20580
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20577
20581
  *
20578
20582
  *
20579
20583
  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
@@ -20584,7 +20588,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
20584
20588
  static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
20585
20589
  int __pyx_r;
20586
20590
 
20587
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013
20591
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013
20588
20592
  * bool
20589
20593
  * """
20590
20594
  * return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
@@ -20594,7 +20598,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20594
20598
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
20595
20599
  goto __pyx_L0;
20596
20600
 
20597
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20601
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
20598
20602
  *
20599
20603
  *
20600
20604
  * cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
@@ -20607,7 +20611,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20607
20611
  return __pyx_r;
20608
20612
  }
20609
20613
 
20610
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20614
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20611
20615
  *
20612
20616
  *
20613
20617
  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
@@ -20618,7 +20622,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
20618
20622
  static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
20619
20623
  int __pyx_r;
20620
20624
 
20621
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028
20625
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028
20622
20626
  * bool
20623
20627
  * """
20624
20628
  * return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
@@ -20628,7 +20632,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20628
20632
  __pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
20629
20633
  goto __pyx_L0;
20630
20634
 
20631
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20635
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
20632
20636
  *
20633
20637
  *
20634
20638
  * cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
@@ -20641,7 +20645,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20641
20645
  return __pyx_r;
20642
20646
  }
20643
20647
 
20644
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20648
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20645
20649
  *
20646
20650
  *
20647
20651
  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20652,7 +20656,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
20652
20656
  static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
20653
20657
  npy_datetime __pyx_r;
20654
20658
 
20655
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038
20659
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038
20656
20660
  * also needed. That can be found using `get_datetime64_unit`.
20657
20661
  * """
20658
20662
  * return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
@@ -20662,7 +20666,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20662
20666
  __pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
20663
20667
  goto __pyx_L0;
20664
20668
 
20665
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20669
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
20666
20670
  *
20667
20671
  *
20668
20672
  * cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20675,7 +20679,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20675
20679
  return __pyx_r;
20676
20680
  }
20677
20681
 
20678
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20682
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20679
20683
  *
20680
20684
  *
20681
20685
  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20686,7 +20690,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
20686
20690
  static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
20687
20691
  npy_timedelta __pyx_r;
20688
20692
 
20689
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045
20693
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045
20690
20694
  * returns the int64 value underlying scalar numpy timedelta64 object
20691
20695
  * """
20692
20696
  * return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
@@ -20696,7 +20700,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20696
20700
  __pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
20697
20701
  goto __pyx_L0;
20698
20702
 
20699
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20703
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
20700
20704
  *
20701
20705
  *
20702
20706
  * cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20709,7 +20713,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20709
20713
  return __pyx_r;
20710
20714
  }
20711
20715
 
20712
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20716
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20713
20717
  *
20714
20718
  *
20715
20719
  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20720,7 +20724,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
20720
20724
  static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
20721
20725
  NPY_DATETIMEUNIT __pyx_r;
20722
20726
 
20723
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1052
20727
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1052
20724
20728
  * returns the unit part of the dtype for a numpy datetime64 object.
20725
20729
  * """
20726
20730
  * return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
@@ -20728,7 +20732,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20728
20732
  __pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
20729
20733
  goto __pyx_L0;
20730
20734
 
20731
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20735
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
20732
20736
  *
20733
20737
  *
20734
20738
  * cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
@@ -20741,7 +20745,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20741
20745
  return __pyx_r;
20742
20746
  }
20743
20747
 
20744
- /* "mettagrid/objects.pxd":24
20748
+ /* "mettagrid/objects.pxd":25
20745
20749
  * unsigned int hp
20746
20750
  *
20747
20751
  * inline void init_mo(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20751,16 +20755,16 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
20751
20755
 
20752
20756
  void __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
20753
20757
 
20754
- /* "mettagrid/objects.pxd":25
20758
+ /* "mettagrid/objects.pxd":26
20755
20759
  *
20756
20760
  * inline void init_mo(ObjectConfig cfg):
20757
20761
  * this.hp = cfg[b"hp"] # <<<<<<<<<<<<<<
20758
20762
  *
20759
- * inline char usable(const Agent *actor):
20763
+ * inline bint usable(const Agent *actor):
20760
20764
  */
20761
20765
  this->hp = (__pyx_v_cfg[__pyx_k_hp]);
20762
20766
 
20763
- /* "mettagrid/objects.pxd":24
20767
+ /* "mettagrid/objects.pxd":25
20764
20768
  * unsigned int hp
20765
20769
  *
20766
20770
  * inline void init_mo(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20771,54 +20775,20 @@ void __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_t_9mettagrid_7object
20771
20775
  /* function exit code */
20772
20776
  }
20773
20777
 
20774
- /* "mettagrid/objects.pxd":27
20778
+ /* "mettagrid/objects.pxd":28
20775
20779
  * this.hp = cfg[b"hp"]
20776
20780
  *
20777
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20781
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20778
20782
  * return False
20779
20783
  *
20780
20784
  */
20781
20785
 
20782
- char __pyx_t_9mettagrid_7objects_MettaObject::usable(CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20783
- char __pyx_r;
20784
-
20785
- /* "mettagrid/objects.pxd":28
20786
- *
20787
- * inline char usable(const Agent *actor):
20788
- * return False # <<<<<<<<<<<<<<
20789
- *
20790
- * inline char attackable():
20791
- */
20792
- __pyx_r = 0;
20793
- goto __pyx_L0;
20794
-
20795
- /* "mettagrid/objects.pxd":27
20796
- * this.hp = cfg[b"hp"]
20797
- *
20798
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20799
- * return False
20800
- *
20801
- */
20802
-
20803
- /* function exit code */
20804
- __pyx_L0:;
20805
- return __pyx_r;
20806
- }
20807
-
20808
- /* "mettagrid/objects.pxd":30
20809
- * return False
20810
- *
20811
- * inline char attackable(): # <<<<<<<<<<<<<<
20812
- * return False
20813
- *
20814
- */
20815
-
20816
- char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20817
- char __pyx_r;
20786
+ int __pyx_t_9mettagrid_7objects_MettaObject::usable(CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20787
+ int __pyx_r;
20818
20788
 
20819
- /* "mettagrid/objects.pxd":31
20789
+ /* "mettagrid/objects.pxd":29
20820
20790
  *
20821
- * inline char attackable():
20791
+ * inline bint usable(const Agent *actor):
20822
20792
  * return False # <<<<<<<<<<<<<<
20823
20793
  *
20824
20794
  * cdef cppclass Usable(MettaObject):
@@ -20826,10 +20796,10 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20826
20796
  __pyx_r = 0;
20827
20797
  goto __pyx_L0;
20828
20798
 
20829
- /* "mettagrid/objects.pxd":30
20830
- * return False
20799
+ /* "mettagrid/objects.pxd":28
20800
+ * this.hp = cfg[b"hp"]
20831
20801
  *
20832
- * inline char attackable(): # <<<<<<<<<<<<<<
20802
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20833
20803
  * return False
20834
20804
  *
20835
20805
  */
@@ -20839,7 +20809,7 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20839
20809
  return __pyx_r;
20840
20810
  }
20841
20811
 
20842
- /* "mettagrid/objects.pxd":38
20812
+ /* "mettagrid/objects.pxd":36
20843
20813
  * unsigned char ready
20844
20814
  *
20845
20815
  * inline void init_usable(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20849,7 +20819,7 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
20849
20819
 
20850
20820
  void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
20851
20821
 
20852
- /* "mettagrid/objects.pxd":39
20822
+ /* "mettagrid/objects.pxd":37
20853
20823
  *
20854
20824
  * inline void init_usable(ObjectConfig cfg):
20855
20825
  * this.use_cost = cfg[b"use_cost"] # <<<<<<<<<<<<<<
@@ -20858,7 +20828,7 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20858
20828
  */
20859
20829
  this->use_cost = (__pyx_v_cfg[__pyx_k_use_cost]);
20860
20830
 
20861
- /* "mettagrid/objects.pxd":40
20831
+ /* "mettagrid/objects.pxd":38
20862
20832
  * inline void init_usable(ObjectConfig cfg):
20863
20833
  * this.use_cost = cfg[b"use_cost"]
20864
20834
  * this.cooldown = cfg[b"cooldown"] # <<<<<<<<<<<<<<
@@ -20867,16 +20837,16 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20867
20837
  */
20868
20838
  this->cooldown = (__pyx_v_cfg[__pyx_k_cooldown]);
20869
20839
 
20870
- /* "mettagrid/objects.pxd":41
20840
+ /* "mettagrid/objects.pxd":39
20871
20841
  * this.use_cost = cfg[b"use_cost"]
20872
20842
  * this.cooldown = cfg[b"cooldown"]
20873
20843
  * this.ready = 1 # <<<<<<<<<<<<<<
20874
20844
  *
20875
- * inline char usable(const Agent *actor):
20845
+ * inline bint usable(const Agent *actor):
20876
20846
  */
20877
20847
  this->ready = 1;
20878
20848
 
20879
- /* "mettagrid/objects.pxd":38
20849
+ /* "mettagrid/objects.pxd":36
20880
20850
  * unsigned char ready
20881
20851
  *
20882
20852
  * inline void init_usable(ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -20887,29 +20857,30 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
20887
20857
  /* function exit code */
20888
20858
  }
20889
20859
 
20890
- /* "mettagrid/objects.pxd":43
20860
+ /* "mettagrid/objects.pxd":41
20891
20861
  * this.ready = 1
20892
20862
  *
20893
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20863
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20894
20864
  * return this.ready and this.use_cost <= actor.energy
20895
20865
  *
20896
20866
  */
20897
20867
 
20898
- char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20899
- char __pyx_r;
20900
- char __pyx_t_1;
20868
+ int __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
20869
+ int __pyx_r;
20870
+ int __pyx_t_1;
20901
20871
  int __pyx_t_2;
20902
20872
 
20903
- /* "mettagrid/objects.pxd":44
20873
+ /* "mettagrid/objects.pxd":42
20904
20874
  *
20905
- * inline char usable(const Agent *actor):
20875
+ * inline bint usable(const Agent *actor):
20906
20876
  * return this.ready and this.use_cost <= actor.energy # <<<<<<<<<<<<<<
20907
20877
  *
20908
20878
  * cdef enum ObjectType:
20909
20879
  */
20910
- if (this->ready) {
20880
+ __pyx_t_2 = (this->ready != 0);
20881
+ if (__pyx_t_2) {
20911
20882
  } else {
20912
- __pyx_t_1 = this->ready;
20883
+ __pyx_t_1 = __pyx_t_2;
20913
20884
  goto __pyx_L3_bool_binop_done;
20914
20885
  }
20915
20886
  __pyx_t_2 = (this->use_cost <= __pyx_v_actor->energy);
@@ -20918,10 +20889,10 @@ char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agen
20918
20889
  __pyx_r = __pyx_t_1;
20919
20890
  goto __pyx_L0;
20920
20891
 
20921
- /* "mettagrid/objects.pxd":43
20892
+ /* "mettagrid/objects.pxd":41
20922
20893
  * this.ready = 1
20923
20894
  *
20924
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
20895
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
20925
20896
  * return this.ready and this.use_cost <= actor.energy
20926
20897
  *
20927
20898
  */
@@ -20931,8 +20902,8 @@ char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agen
20931
20902
  return __pyx_r;
20932
20903
  }
20933
20904
 
20934
- /* "mettagrid/objects.pxd":72
20935
- * vector[unsigned short] inventory
20905
+ /* "mettagrid/objects.pxd":74
20906
+ * unsigned char max_energy
20936
20907
  *
20937
20908
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
20938
20909
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
@@ -20944,67 +20915,103 @@ void __pyx_t_9mettagrid_7objects_Agent::__pyx_f___init__Agent(GridCoord __pyx_v_
20944
20915
  const char *__pyx_filename = NULL;
20945
20916
  int __pyx_clineno = 0;
20946
20917
 
20947
- /* "mettagrid/objects.pxd":73
20918
+ /* "mettagrid/objects.pxd":75
20948
20919
  *
20949
20920
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg):
20950
20921
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer)) # <<<<<<<<<<<<<<
20951
20922
  * MettaObject.init_mo(cfg)
20952
- * this.frozen = False
20923
+ * this.frozen = 0
20953
20924
  */
20954
20925
  GridObject::init(__pyx_e_9mettagrid_7objects_AgentT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Agent_Layer));
20955
20926
 
20956
- /* "mettagrid/objects.pxd":74
20927
+ /* "mettagrid/objects.pxd":76
20957
20928
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg):
20958
20929
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
20959
20930
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
20960
- * this.frozen = False
20961
- * this.energy = cfg[b"initial_energy"]
20931
+ * this.frozen = 0
20932
+ * this.freeze_duration = cfg[b"freeze_duration"]
20962
20933
  */
20963
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 74, __pyx_L1_error)
20934
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 76, __pyx_L1_error)
20964
20935
 
20965
- /* "mettagrid/objects.pxd":75
20936
+ /* "mettagrid/objects.pxd":77
20966
20937
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
20967
20938
  * MettaObject.init_mo(cfg)
20968
- * this.frozen = False # <<<<<<<<<<<<<<
20939
+ * this.frozen = 0 # <<<<<<<<<<<<<<
20940
+ * this.freeze_duration = cfg[b"freeze_duration"]
20969
20941
  * this.energy = cfg[b"initial_energy"]
20970
- * this.orientation = 0
20971
20942
  */
20972
20943
  this->frozen = 0;
20973
20944
 
20974
- /* "mettagrid/objects.pxd":76
20945
+ /* "mettagrid/objects.pxd":78
20975
20946
  * MettaObject.init_mo(cfg)
20976
- * this.frozen = False
20947
+ * this.frozen = 0
20948
+ * this.freeze_duration = cfg[b"freeze_duration"] # <<<<<<<<<<<<<<
20949
+ * this.energy = cfg[b"initial_energy"]
20950
+ * this.max_energy = cfg[b"max_energy"]
20951
+ */
20952
+ this->freeze_duration = (__pyx_v_cfg[__pyx_k_freeze_duration]);
20953
+
20954
+ /* "mettagrid/objects.pxd":79
20955
+ * this.frozen = 0
20956
+ * this.freeze_duration = cfg[b"freeze_duration"]
20977
20957
  * this.energy = cfg[b"initial_energy"] # <<<<<<<<<<<<<<
20978
- * this.orientation = 0
20979
- * this.inventory.resize(InventoryItem.InventoryCount)
20958
+ * this.max_energy = cfg[b"max_energy"]
20959
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20980
20960
  */
20981
20961
  this->energy = (__pyx_v_cfg[__pyx_k_initial_energy]);
20982
20962
 
20983
- /* "mettagrid/objects.pxd":77
20984
- * this.frozen = False
20963
+ /* "mettagrid/objects.pxd":80
20964
+ * this.freeze_duration = cfg[b"freeze_duration"]
20985
20965
  * this.energy = cfg[b"initial_energy"]
20966
+ * this.max_energy = cfg[b"max_energy"] # <<<<<<<<<<<<<<
20967
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20968
+ * this.orientation = 0
20969
+ */
20970
+ this->max_energy = (__pyx_v_cfg[__pyx_k_max_energy]);
20971
+
20972
+ /* "mettagrid/objects.pxd":81
20973
+ * this.energy = cfg[b"initial_energy"]
20974
+ * this.max_energy = cfg[b"max_energy"]
20975
+ * this.shield_upkeep = cfg[b"upkeep.shield"] # <<<<<<<<<<<<<<
20976
+ * this.orientation = 0
20977
+ * this.inventory.resize(InventoryItem.InventoryCount)
20978
+ */
20979
+ this->shield_upkeep = (__pyx_v_cfg[__pyx_k_upkeep_shield]);
20980
+
20981
+ /* "mettagrid/objects.pxd":82
20982
+ * this.max_energy = cfg[b"max_energy"]
20983
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20986
20984
  * this.orientation = 0 # <<<<<<<<<<<<<<
20987
20985
  * this.inventory.resize(InventoryItem.InventoryCount)
20988
- *
20986
+ * this.max_items = cfg[b"max_inventory"]
20989
20987
  */
20990
20988
  this->orientation = 0;
20991
20989
 
20992
- /* "mettagrid/objects.pxd":78
20993
- * this.energy = cfg[b"initial_energy"]
20990
+ /* "mettagrid/objects.pxd":83
20991
+ * this.shield_upkeep = cfg[b"upkeep.shield"]
20994
20992
  * this.orientation = 0
20995
20993
  * this.inventory.resize(InventoryItem.InventoryCount) # <<<<<<<<<<<<<<
20994
+ * this.max_items = cfg[b"max_inventory"]
20996
20995
  *
20997
- * inline void update_inventory(InventoryItem item, short amount):
20998
20996
  */
20999
20997
  try {
21000
20998
  this->inventory.resize(__pyx_e_9mettagrid_7objects_InventoryCount);
21001
20999
  } catch(...) {
21002
21000
  __Pyx_CppExn2PyErr();
21003
- __PYX_ERR(3, 78, __pyx_L1_error)
21001
+ __PYX_ERR(3, 83, __pyx_L1_error)
21004
21002
  }
21005
21003
 
21006
- /* "mettagrid/objects.pxd":72
21007
- * vector[unsigned short] inventory
21004
+ /* "mettagrid/objects.pxd":84
21005
+ * this.orientation = 0
21006
+ * this.inventory.resize(InventoryItem.InventoryCount)
21007
+ * this.max_items = cfg[b"max_inventory"] # <<<<<<<<<<<<<<
21008
+ *
21009
+ * inline void update_inventory(InventoryItem item, short amount):
21010
+ */
21011
+ this->max_items = (__pyx_v_cfg[__pyx_k_max_inventory]);
21012
+
21013
+ /* "mettagrid/objects.pxd":74
21014
+ * unsigned char max_energy
21008
21015
  *
21009
21016
  * inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
21010
21017
  * GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
@@ -21018,40 +21025,71 @@ void __pyx_t_9mettagrid_7objects_Agent::__pyx_f___init__Agent(GridCoord __pyx_v_
21018
21025
  __pyx_L0:;
21019
21026
  }
21020
21027
 
21021
- /* "mettagrid/objects.pxd":80
21022
- * this.inventory.resize(InventoryItem.InventoryCount)
21028
+ /* "mettagrid/objects.pxd":86
21029
+ * this.max_items = cfg[b"max_inventory"]
21023
21030
  *
21024
21031
  * inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
21025
21032
  * this.inventory[<InventoryItem>item] += amount
21026
- *
21033
+ * if this.inventory[<InventoryItem>item] > this.max_items:
21027
21034
  */
21028
21035
 
21029
21036
  void __pyx_t_9mettagrid_7objects_Agent::update_inventory(enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_v_item, short __pyx_v_amount) {
21030
21037
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_1;
21038
+ int __pyx_t_2;
21039
+ unsigned char __pyx_t_3;
21031
21040
 
21032
- /* "mettagrid/objects.pxd":81
21041
+ /* "mettagrid/objects.pxd":87
21033
21042
  *
21034
21043
  * inline void update_inventory(InventoryItem item, short amount):
21035
21044
  * this.inventory[<InventoryItem>item] += amount # <<<<<<<<<<<<<<
21036
- *
21037
- * inline void obs(ObsType[:] obs):
21045
+ * if this.inventory[<InventoryItem>item] > this.max_items:
21046
+ * this.inventory[<InventoryItem>item] = this.max_items
21038
21047
  */
21039
21048
  __pyx_t_1 = ((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item);
21040
21049
  (this->inventory[__pyx_t_1]) = ((this->inventory[__pyx_t_1]) + __pyx_v_amount);
21041
21050
 
21042
- /* "mettagrid/objects.pxd":80
21043
- * this.inventory.resize(InventoryItem.InventoryCount)
21051
+ /* "mettagrid/objects.pxd":88
21052
+ * inline void update_inventory(InventoryItem item, short amount):
21053
+ * this.inventory[<InventoryItem>item] += amount
21054
+ * if this.inventory[<InventoryItem>item] > this.max_items: # <<<<<<<<<<<<<<
21055
+ * this.inventory[<InventoryItem>item] = this.max_items
21044
21056
  *
21045
- * inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
21057
+ */
21058
+ __pyx_t_2 = ((this->inventory[((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item)]) > this->max_items);
21059
+ if (__pyx_t_2) {
21060
+
21061
+ /* "mettagrid/objects.pxd":89
21062
+ * this.inventory[<InventoryItem>item] += amount
21063
+ * if this.inventory[<InventoryItem>item] > this.max_items:
21064
+ * this.inventory[<InventoryItem>item] = this.max_items # <<<<<<<<<<<<<<
21065
+ *
21066
+ * inline void obs(ObsType[:] obs):
21067
+ */
21068
+ __pyx_t_3 = this->max_items;
21069
+ (this->inventory[((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item)]) = __pyx_t_3;
21070
+
21071
+ /* "mettagrid/objects.pxd":88
21072
+ * inline void update_inventory(InventoryItem item, short amount):
21046
21073
  * this.inventory[<InventoryItem>item] += amount
21074
+ * if this.inventory[<InventoryItem>item] > this.max_items: # <<<<<<<<<<<<<<
21075
+ * this.inventory[<InventoryItem>item] = this.max_items
21047
21076
  *
21077
+ */
21078
+ }
21079
+
21080
+ /* "mettagrid/objects.pxd":86
21081
+ * this.max_items = cfg[b"max_inventory"]
21082
+ *
21083
+ * inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
21084
+ * this.inventory[<InventoryItem>item] += amount
21085
+ * if this.inventory[<InventoryItem>item] > this.max_items:
21048
21086
  */
21049
21087
 
21050
21088
  /* function exit code */
21051
21089
  }
21052
21090
 
21053
- /* "mettagrid/objects.pxd":83
21054
- * this.inventory[<InventoryItem>item] += amount
21091
+ /* "mettagrid/objects.pxd":91
21092
+ * this.inventory[<InventoryItem>item] = this.max_items
21055
21093
  *
21056
21094
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
21057
21095
  * obs[0] = 1
@@ -21063,12 +21101,12 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21063
21101
  unsigned short __pyx_v_i;
21064
21102
  Py_ssize_t __pyx_t_1;
21065
21103
  unsigned int __pyx_t_2;
21066
- char __pyx_t_3;
21104
+ unsigned char __pyx_t_3;
21067
21105
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_4;
21068
21106
  enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_5;
21069
21107
  unsigned short __pyx_t_6;
21070
21108
 
21071
- /* "mettagrid/objects.pxd":84
21109
+ /* "mettagrid/objects.pxd":92
21072
21110
  *
21073
21111
  * inline void obs(ObsType[:] obs):
21074
21112
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21078,7 +21116,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21078
21116
  __pyx_t_1 = 0;
21079
21117
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21080
21118
 
21081
- /* "mettagrid/objects.pxd":85
21119
+ /* "mettagrid/objects.pxd":93
21082
21120
  * inline void obs(ObsType[:] obs):
21083
21121
  * obs[0] = 1
21084
21122
  * obs[1] = this.hp # <<<<<<<<<<<<<<
@@ -21089,29 +21127,29 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21089
21127
  __pyx_t_1 = 1;
21090
21128
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21091
21129
 
21092
- /* "mettagrid/objects.pxd":86
21130
+ /* "mettagrid/objects.pxd":94
21093
21131
  * obs[0] = 1
21094
21132
  * obs[1] = this.hp
21095
21133
  * obs[2] = this.frozen # <<<<<<<<<<<<<<
21096
21134
  * obs[3] = this.energy
21097
21135
  * obs[4] = this.orientation
21098
21136
  */
21099
- __pyx_t_3 = this->frozen;
21137
+ __pyx_t_2 = this->frozen;
21100
21138
  __pyx_t_1 = 2;
21101
- *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
21139
+ *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21102
21140
 
21103
- /* "mettagrid/objects.pxd":87
21141
+ /* "mettagrid/objects.pxd":95
21104
21142
  * obs[1] = this.hp
21105
21143
  * obs[2] = this.frozen
21106
21144
  * obs[3] = this.energy # <<<<<<<<<<<<<<
21107
21145
  * obs[4] = this.orientation
21108
21146
  * obs[5] = this.shield
21109
21147
  */
21110
- __pyx_t_2 = this->energy;
21148
+ __pyx_t_3 = this->energy;
21111
21149
  __pyx_t_1 = 3;
21112
- *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21150
+ *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
21113
21151
 
21114
- /* "mettagrid/objects.pxd":88
21152
+ /* "mettagrid/objects.pxd":96
21115
21153
  * obs[2] = this.frozen
21116
21154
  * obs[3] = this.energy
21117
21155
  * obs[4] = this.orientation # <<<<<<<<<<<<<<
@@ -21122,7 +21160,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21122
21160
  __pyx_t_1 = 4;
21123
21161
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21124
21162
 
21125
- /* "mettagrid/objects.pxd":89
21163
+ /* "mettagrid/objects.pxd":97
21126
21164
  * obs[3] = this.energy
21127
21165
  * obs[4] = this.orientation
21128
21166
  * obs[5] = this.shield # <<<<<<<<<<<<<<
@@ -21133,7 +21171,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21133
21171
  __pyx_t_1 = 5;
21134
21172
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
21135
21173
 
21136
- /* "mettagrid/objects.pxd":91
21174
+ /* "mettagrid/objects.pxd":99
21137
21175
  * obs[5] = this.shield
21138
21176
  *
21139
21177
  * cdef unsigned short idx = 6 # <<<<<<<<<<<<<<
@@ -21142,7 +21180,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21142
21180
  */
21143
21181
  __pyx_v_idx = 6;
21144
21182
 
21145
- /* "mettagrid/objects.pxd":93
21183
+ /* "mettagrid/objects.pxd":101
21146
21184
  * cdef unsigned short idx = 6
21147
21185
  * cdef unsigned short i
21148
21186
  * for i in range(InventoryItem.InventoryCount): # <<<<<<<<<<<<<<
@@ -21154,7 +21192,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21154
21192
  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
21155
21193
  __pyx_v_i = __pyx_t_6;
21156
21194
 
21157
- /* "mettagrid/objects.pxd":94
21195
+ /* "mettagrid/objects.pxd":102
21158
21196
  * cdef unsigned short i
21159
21197
  * for i in range(InventoryItem.InventoryCount):
21160
21198
  * obs[idx + i] = this.inventory[i] # <<<<<<<<<<<<<<
@@ -21165,8 +21203,8 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21165
21203
  *((__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]);
21166
21204
  }
21167
21205
 
21168
- /* "mettagrid/objects.pxd":83
21169
- * this.inventory[<InventoryItem>item] += amount
21206
+ /* "mettagrid/objects.pxd":91
21207
+ * this.inventory[<InventoryItem>item] = this.max_items
21170
21208
  *
21171
21209
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
21172
21210
  * obs[0] = 1
@@ -21176,7 +21214,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
21176
21214
  /* function exit code */
21177
21215
  }
21178
21216
 
21179
- /* "mettagrid/objects.pxd":97
21217
+ /* "mettagrid/objects.pxd":105
21180
21218
  *
21181
21219
  * @staticmethod
21182
21220
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21200,46 +21238,46 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21200
21238
  int __pyx_clineno = 0;
21201
21239
  __Pyx_RefNannySetupContext("feature_names", 1);
21202
21240
 
21203
- /* "mettagrid/objects.pxd":98
21241
+ /* "mettagrid/objects.pxd":106
21204
21242
  * @staticmethod
21205
21243
  * inline vector[string] feature_names():
21206
21244
  * return [ # <<<<<<<<<<<<<<
21207
21245
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21208
21246
  * "agent:shield"
21209
21247
  */
21210
- __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 98, __pyx_L1_error)
21248
+ __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 106, __pyx_L1_error)
21211
21249
  __Pyx_GOTREF(__pyx_t_1);
21212
21250
  __Pyx_INCREF(__pyx_n_u_agent);
21213
21251
  __Pyx_GIVEREF(__pyx_n_u_agent);
21214
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_agent)) __PYX_ERR(3, 98, __pyx_L1_error);
21252
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_agent)) __PYX_ERR(3, 106, __pyx_L1_error);
21215
21253
  __Pyx_INCREF(__pyx_kp_u_agent_hp);
21216
21254
  __Pyx_GIVEREF(__pyx_kp_u_agent_hp);
21217
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_agent_hp)) __PYX_ERR(3, 98, __pyx_L1_error);
21255
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_agent_hp)) __PYX_ERR(3, 106, __pyx_L1_error);
21218
21256
  __Pyx_INCREF(__pyx_kp_u_agent_frozen);
21219
21257
  __Pyx_GIVEREF(__pyx_kp_u_agent_frozen);
21220
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_agent_frozen)) __PYX_ERR(3, 98, __pyx_L1_error);
21258
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_agent_frozen)) __PYX_ERR(3, 106, __pyx_L1_error);
21221
21259
  __Pyx_INCREF(__pyx_kp_u_agent_energy);
21222
21260
  __Pyx_GIVEREF(__pyx_kp_u_agent_energy);
21223
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_agent_energy)) __PYX_ERR(3, 98, __pyx_L1_error);
21261
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_agent_energy)) __PYX_ERR(3, 106, __pyx_L1_error);
21224
21262
  __Pyx_INCREF(__pyx_kp_u_agent_orientation);
21225
21263
  __Pyx_GIVEREF(__pyx_kp_u_agent_orientation);
21226
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_agent_orientation)) __PYX_ERR(3, 98, __pyx_L1_error);
21264
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_agent_orientation)) __PYX_ERR(3, 106, __pyx_L1_error);
21227
21265
  __Pyx_INCREF(__pyx_kp_u_agent_shield);
21228
21266
  __Pyx_GIVEREF(__pyx_kp_u_agent_shield);
21229
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_agent_shield)) __PYX_ERR(3, 98, __pyx_L1_error);
21267
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_agent_shield)) __PYX_ERR(3, 106, __pyx_L1_error);
21230
21268
  { /* enter inner scope */
21231
21269
 
21232
- /* "mettagrid/objects.pxd":101
21270
+ /* "mettagrid/objects.pxd":109
21233
21271
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21234
21272
  * "agent:shield"
21235
21273
  * ] + [ # <<<<<<<<<<<<<<
21236
21274
  * "agent:inv:" + n for n in InventoryItemNames]
21237
21275
  *
21238
21276
  */
21239
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 101, __pyx_L1_error)
21277
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 109, __pyx_L1_error)
21240
21278
  __Pyx_GOTREF(__pyx_t_2);
21241
21279
 
21242
- /* "mettagrid/objects.pxd":102
21280
+ /* "mettagrid/objects.pxd":110
21243
21281
  * "agent:shield"
21244
21282
  * ] + [
21245
21283
  * "agent:inv:" + n for n in InventoryItemNames] # <<<<<<<<<<<<<<
@@ -21252,33 +21290,33 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21252
21290
  __pyx_t_4 = *__pyx_t_3;
21253
21291
  ++__pyx_t_3;
21254
21292
  __pyx_7genexpr__pyx_v_n = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);
21255
- __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)
21293
+ __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)
21256
21294
  __Pyx_GOTREF(__pyx_t_5);
21257
- __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)
21295
+ __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)
21258
21296
  __Pyx_GOTREF(__pyx_t_6);
21259
21297
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
21260
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 101, __pyx_L1_error)
21298
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 109, __pyx_L1_error)
21261
21299
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21262
21300
  }
21263
21301
  } /* exit inner scope */
21264
21302
 
21265
- /* "mettagrid/objects.pxd":101
21303
+ /* "mettagrid/objects.pxd":109
21266
21304
  * "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
21267
21305
  * "agent:shield"
21268
21306
  * ] + [ # <<<<<<<<<<<<<<
21269
21307
  * "agent:inv:" + n for n in InventoryItemNames]
21270
21308
  *
21271
21309
  */
21272
- __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 101, __pyx_L1_error)
21310
+ __pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 109, __pyx_L1_error)
21273
21311
  __Pyx_GOTREF(__pyx_t_6);
21274
21312
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21275
21313
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
21276
- __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)
21314
+ __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)
21277
21315
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
21278
21316
  __pyx_r = __pyx_t_7;
21279
21317
  goto __pyx_L0;
21280
21318
 
21281
- /* "mettagrid/objects.pxd":97
21319
+ /* "mettagrid/objects.pxd":105
21282
21320
  *
21283
21321
  * @staticmethod
21284
21322
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21299,7 +21337,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
21299
21337
  return __pyx_r;
21300
21338
  }
21301
21339
 
21302
- /* "mettagrid/objects.pxd":105
21340
+ /* "mettagrid/objects.pxd":113
21303
21341
  *
21304
21342
  * cdef cppclass Wall(MettaObject):
21305
21343
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21312,7 +21350,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21312
21350
  const char *__pyx_filename = NULL;
21313
21351
  int __pyx_clineno = 0;
21314
21352
 
21315
- /* "mettagrid/objects.pxd":106
21353
+ /* "mettagrid/objects.pxd":114
21316
21354
  * cdef cppclass Wall(MettaObject):
21317
21355
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg):
21318
21356
  * GridObject.init(ObjectType.WallT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21321,16 +21359,16 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21321
21359
  */
21322
21360
  GridObject::init(__pyx_e_9mettagrid_7objects_WallT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21323
21361
 
21324
- /* "mettagrid/objects.pxd":107
21362
+ /* "mettagrid/objects.pxd":115
21325
21363
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg):
21326
21364
  * GridObject.init(ObjectType.WallT, GridLocation(r, c, GridLayer.Object_Layer))
21327
21365
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21328
21366
  *
21329
21367
  * inline void obs(ObsType[:] obs):
21330
21368
  */
21331
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 107, __pyx_L1_error)
21369
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 115, __pyx_L1_error)
21332
21370
 
21333
- /* "mettagrid/objects.pxd":105
21371
+ /* "mettagrid/objects.pxd":113
21334
21372
  *
21335
21373
  * cdef cppclass Wall(MettaObject):
21336
21374
  * inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21345,7 +21383,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21345
21383
  __pyx_L0:;
21346
21384
  }
21347
21385
 
21348
- /* "mettagrid/objects.pxd":109
21386
+ /* "mettagrid/objects.pxd":117
21349
21387
  * MettaObject.init_mo(cfg)
21350
21388
  *
21351
21389
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21356,7 +21394,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
21356
21394
  void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21357
21395
  Py_ssize_t __pyx_t_1;
21358
21396
 
21359
- /* "mettagrid/objects.pxd":110
21397
+ /* "mettagrid/objects.pxd":118
21360
21398
  *
21361
21399
  * inline void obs(ObsType[:] obs):
21362
21400
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21366,7 +21404,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21366
21404
  __pyx_t_1 = 0;
21367
21405
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21368
21406
 
21369
- /* "mettagrid/objects.pxd":111
21407
+ /* "mettagrid/objects.pxd":119
21370
21408
  * inline void obs(ObsType[:] obs):
21371
21409
  * obs[0] = 1
21372
21410
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -21376,7 +21414,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21376
21414
  __pyx_t_1 = 1;
21377
21415
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
21378
21416
 
21379
- /* "mettagrid/objects.pxd":109
21417
+ /* "mettagrid/objects.pxd":117
21380
21418
  * MettaObject.init_mo(cfg)
21381
21419
  *
21382
21420
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21387,7 +21425,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
21387
21425
  /* function exit code */
21388
21426
  }
21389
21427
 
21390
- /* "mettagrid/objects.pxd":114
21428
+ /* "mettagrid/objects.pxd":122
21391
21429
  *
21392
21430
  * @staticmethod
21393
21431
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21405,27 +21443,27 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Wall::feature_names(void)
21405
21443
  int __pyx_clineno = 0;
21406
21444
  __Pyx_RefNannySetupContext("feature_names", 1);
21407
21445
 
21408
- /* "mettagrid/objects.pxd":115
21446
+ /* "mettagrid/objects.pxd":123
21409
21447
  * @staticmethod
21410
21448
  * inline vector[string] feature_names():
21411
21449
  * return ["wall", "wall:hp"] # <<<<<<<<<<<<<<
21412
21450
  *
21413
21451
  * cdef cppclass Generator(Usable):
21414
21452
  */
21415
- __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 115, __pyx_L1_error)
21453
+ __pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 123, __pyx_L1_error)
21416
21454
  __Pyx_GOTREF(__pyx_t_1);
21417
21455
  __Pyx_INCREF(__pyx_n_u_wall);
21418
21456
  __Pyx_GIVEREF(__pyx_n_u_wall);
21419
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_wall)) __PYX_ERR(3, 115, __pyx_L1_error);
21457
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_wall)) __PYX_ERR(3, 123, __pyx_L1_error);
21420
21458
  __Pyx_INCREF(__pyx_kp_u_wall_hp);
21421
21459
  __Pyx_GIVEREF(__pyx_kp_u_wall_hp);
21422
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_wall_hp)) __PYX_ERR(3, 115, __pyx_L1_error);
21423
- __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)
21460
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_wall_hp)) __PYX_ERR(3, 123, __pyx_L1_error);
21461
+ __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)
21424
21462
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21425
21463
  __pyx_r = __pyx_t_2;
21426
21464
  goto __pyx_L0;
21427
21465
 
21428
- /* "mettagrid/objects.pxd":114
21466
+ /* "mettagrid/objects.pxd":122
21429
21467
  *
21430
21468
  * @staticmethod
21431
21469
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21443,7 +21481,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Wall::feature_names(void)
21443
21481
  return __pyx_r;
21444
21482
  }
21445
21483
 
21446
- /* "mettagrid/objects.pxd":120
21484
+ /* "mettagrid/objects.pxd":128
21447
21485
  * unsigned int r1
21448
21486
  *
21449
21487
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21456,7 +21494,7 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21456
21494
  const char *__pyx_filename = NULL;
21457
21495
  int __pyx_clineno = 0;
21458
21496
 
21459
- /* "mettagrid/objects.pxd":121
21497
+ /* "mettagrid/objects.pxd":129
21460
21498
  *
21461
21499
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg):
21462
21500
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21465,34 +21503,34 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21465
21503
  */
21466
21504
  GridObject::init(__pyx_e_9mettagrid_7objects_GeneratorT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21467
21505
 
21468
- /* "mettagrid/objects.pxd":122
21506
+ /* "mettagrid/objects.pxd":130
21469
21507
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg):
21470
21508
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer))
21471
21509
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21472
21510
  * Usable.init_usable(cfg)
21473
21511
  * this.r1 = cfg[b"initial_resources"]
21474
21512
  */
21475
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 122, __pyx_L1_error)
21513
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 130, __pyx_L1_error)
21476
21514
 
21477
- /* "mettagrid/objects.pxd":123
21515
+ /* "mettagrid/objects.pxd":131
21478
21516
  * GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer))
21479
21517
  * MettaObject.init_mo(cfg)
21480
21518
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
21481
21519
  * this.r1 = cfg[b"initial_resources"]
21482
21520
  *
21483
21521
  */
21484
- __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 123, __pyx_L1_error)
21522
+ __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 131, __pyx_L1_error)
21485
21523
 
21486
- /* "mettagrid/objects.pxd":124
21524
+ /* "mettagrid/objects.pxd":132
21487
21525
  * MettaObject.init_mo(cfg)
21488
21526
  * Usable.init_usable(cfg)
21489
21527
  * this.r1 = cfg[b"initial_resources"] # <<<<<<<<<<<<<<
21490
21528
  *
21491
- * inline char usable(const Agent *actor):
21529
+ * inline bint usable(const Agent *actor):
21492
21530
  */
21493
21531
  this->r1 = (__pyx_v_cfg[__pyx_k_initial_resources]);
21494
21532
 
21495
- /* "mettagrid/objects.pxd":120
21533
+ /* "mettagrid/objects.pxd":128
21496
21534
  * unsigned int r1
21497
21535
  *
21498
21536
  * inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21507,46 +21545,45 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
21507
21545
  __pyx_L0:;
21508
21546
  }
21509
21547
 
21510
- /* "mettagrid/objects.pxd":126
21548
+ /* "mettagrid/objects.pxd":134
21511
21549
  * this.r1 = cfg[b"initial_resources"]
21512
21550
  *
21513
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21551
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21514
21552
  * return Usable.usable(actor) and this.r1 > 0
21515
21553
  *
21516
21554
  */
21517
21555
 
21518
- char __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21519
- char __pyx_r;
21520
- char __pyx_t_1;
21521
- char __pyx_t_2;
21522
- int __pyx_t_3;
21556
+ int __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21557
+ int __pyx_r;
21558
+ int __pyx_t_1;
21559
+ int __pyx_t_2;
21523
21560
  int __pyx_lineno = 0;
21524
21561
  const char *__pyx_filename = NULL;
21525
21562
  int __pyx_clineno = 0;
21526
21563
 
21527
- /* "mettagrid/objects.pxd":127
21564
+ /* "mettagrid/objects.pxd":135
21528
21565
  *
21529
- * inline char usable(const Agent *actor):
21566
+ * inline bint usable(const Agent *actor):
21530
21567
  * return Usable.usable(actor) and this.r1 > 0 # <<<<<<<<<<<<<<
21531
21568
  *
21532
21569
  * inline void obs(ObsType[:] obs):
21533
21570
  */
21534
- __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)
21571
+ __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)
21535
21572
  if (__pyx_t_2) {
21536
21573
  } else {
21537
21574
  __pyx_t_1 = __pyx_t_2;
21538
21575
  goto __pyx_L3_bool_binop_done;
21539
21576
  }
21540
- __pyx_t_3 = (this->r1 > 0);
21541
- __pyx_t_1 = __pyx_t_3;
21577
+ __pyx_t_2 = (this->r1 > 0);
21578
+ __pyx_t_1 = __pyx_t_2;
21542
21579
  __pyx_L3_bool_binop_done:;
21543
21580
  __pyx_r = __pyx_t_1;
21544
21581
  goto __pyx_L0;
21545
21582
 
21546
- /* "mettagrid/objects.pxd":126
21583
+ /* "mettagrid/objects.pxd":134
21547
21584
  * this.r1 = cfg[b"initial_resources"]
21548
21585
  *
21549
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21586
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21550
21587
  * return Usable.usable(actor) and this.r1 > 0
21551
21588
  *
21552
21589
  */
@@ -21559,7 +21596,7 @@ char __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_A
21559
21596
  return __pyx_r;
21560
21597
  }
21561
21598
 
21562
- /* "mettagrid/objects.pxd":129
21599
+ /* "mettagrid/objects.pxd":137
21563
21600
  * return Usable.usable(actor) and this.r1 > 0
21564
21601
  *
21565
21602
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21572,7 +21609,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21572
21609
  unsigned int __pyx_t_2;
21573
21610
  unsigned char __pyx_t_3;
21574
21611
 
21575
- /* "mettagrid/objects.pxd":130
21612
+ /* "mettagrid/objects.pxd":138
21576
21613
  *
21577
21614
  * inline void obs(ObsType[:] obs):
21578
21615
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21582,7 +21619,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21582
21619
  __pyx_t_1 = 0;
21583
21620
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21584
21621
 
21585
- /* "mettagrid/objects.pxd":131
21622
+ /* "mettagrid/objects.pxd":139
21586
21623
  * inline void obs(ObsType[:] obs):
21587
21624
  * obs[0] = 1
21588
21625
  * obs[1] = this.hp # <<<<<<<<<<<<<<
@@ -21593,7 +21630,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21593
21630
  __pyx_t_1 = 1;
21594
21631
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21595
21632
 
21596
- /* "mettagrid/objects.pxd":132
21633
+ /* "mettagrid/objects.pxd":140
21597
21634
  * obs[0] = 1
21598
21635
  * obs[1] = this.hp
21599
21636
  * obs[2] = this.r1 # <<<<<<<<<<<<<<
@@ -21604,7 +21641,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21604
21641
  __pyx_t_1 = 2;
21605
21642
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
21606
21643
 
21607
- /* "mettagrid/objects.pxd":133
21644
+ /* "mettagrid/objects.pxd":141
21608
21645
  * obs[1] = this.hp
21609
21646
  * obs[2] = this.r1
21610
21647
  * obs[3] = this.ready # <<<<<<<<<<<<<<
@@ -21615,7 +21652,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21615
21652
  __pyx_t_1 = 3;
21616
21653
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
21617
21654
 
21618
- /* "mettagrid/objects.pxd":129
21655
+ /* "mettagrid/objects.pxd":137
21619
21656
  * return Usable.usable(actor) and this.r1 > 0
21620
21657
  *
21621
21658
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21626,7 +21663,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
21626
21663
  /* function exit code */
21627
21664
  }
21628
21665
 
21629
- /* "mettagrid/objects.pxd":137
21666
+ /* "mettagrid/objects.pxd":145
21630
21667
  *
21631
21668
  * @staticmethod
21632
21669
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21644,33 +21681,33 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Generator::feature_names(v
21644
21681
  int __pyx_clineno = 0;
21645
21682
  __Pyx_RefNannySetupContext("feature_names", 1);
21646
21683
 
21647
- /* "mettagrid/objects.pxd":138
21684
+ /* "mettagrid/objects.pxd":146
21648
21685
  * @staticmethod
21649
21686
  * inline vector[string] feature_names():
21650
21687
  * return ["generator", "generator:hp", "generator:r1", "generator:ready"] # <<<<<<<<<<<<<<
21651
21688
  *
21652
21689
  * cdef cppclass Converter(Usable):
21653
21690
  */
21654
- __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 138, __pyx_L1_error)
21691
+ __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 146, __pyx_L1_error)
21655
21692
  __Pyx_GOTREF(__pyx_t_1);
21656
21693
  __Pyx_INCREF(__pyx_n_u_generator);
21657
21694
  __Pyx_GIVEREF(__pyx_n_u_generator);
21658
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_generator)) __PYX_ERR(3, 138, __pyx_L1_error);
21695
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_generator)) __PYX_ERR(3, 146, __pyx_L1_error);
21659
21696
  __Pyx_INCREF(__pyx_kp_u_generator_hp);
21660
21697
  __Pyx_GIVEREF(__pyx_kp_u_generator_hp);
21661
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_generator_hp)) __PYX_ERR(3, 138, __pyx_L1_error);
21698
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_generator_hp)) __PYX_ERR(3, 146, __pyx_L1_error);
21662
21699
  __Pyx_INCREF(__pyx_kp_u_generator_r1);
21663
21700
  __Pyx_GIVEREF(__pyx_kp_u_generator_r1);
21664
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_generator_r1)) __PYX_ERR(3, 138, __pyx_L1_error);
21701
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_generator_r1)) __PYX_ERR(3, 146, __pyx_L1_error);
21665
21702
  __Pyx_INCREF(__pyx_kp_u_generator_ready);
21666
21703
  __Pyx_GIVEREF(__pyx_kp_u_generator_ready);
21667
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_generator_ready)) __PYX_ERR(3, 138, __pyx_L1_error);
21668
- __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)
21704
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_generator_ready)) __PYX_ERR(3, 146, __pyx_L1_error);
21705
+ __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)
21669
21706
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21670
21707
  __pyx_r = __pyx_t_2;
21671
21708
  goto __pyx_L0;
21672
21709
 
21673
- /* "mettagrid/objects.pxd":137
21710
+ /* "mettagrid/objects.pxd":145
21674
21711
  *
21675
21712
  * @staticmethod
21676
21713
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21688,7 +21725,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Generator::feature_names(v
21688
21725
  return __pyx_r;
21689
21726
  }
21690
21727
 
21691
- /* "mettagrid/objects.pxd":145
21728
+ /* "mettagrid/objects.pxd":153
21692
21729
  * short output_energy
21693
21730
  *
21694
21731
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21701,7 +21738,7 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21701
21738
  const char *__pyx_filename = NULL;
21702
21739
  int __pyx_clineno = 0;
21703
21740
 
21704
- /* "mettagrid/objects.pxd":146
21741
+ /* "mettagrid/objects.pxd":154
21705
21742
  *
21706
21743
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg):
21707
21744
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -21710,25 +21747,25 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21710
21747
  */
21711
21748
  GridObject::init(__pyx_e_9mettagrid_7objects_ConverterT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
21712
21749
 
21713
- /* "mettagrid/objects.pxd":147
21750
+ /* "mettagrid/objects.pxd":155
21714
21751
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg):
21715
21752
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer))
21716
21753
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
21717
21754
  * Usable.init_usable(cfg)
21718
21755
  * this.input_resource = InventoryItem.r1
21719
21756
  */
21720
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 147, __pyx_L1_error)
21757
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 155, __pyx_L1_error)
21721
21758
 
21722
- /* "mettagrid/objects.pxd":148
21759
+ /* "mettagrid/objects.pxd":156
21723
21760
  * GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer))
21724
21761
  * MettaObject.init_mo(cfg)
21725
21762
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
21726
21763
  * this.input_resource = InventoryItem.r1
21727
21764
  * this.output_resource = InventoryItem.r2
21728
21765
  */
21729
- __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 148, __pyx_L1_error)
21766
+ __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 156, __pyx_L1_error)
21730
21767
 
21731
- /* "mettagrid/objects.pxd":149
21768
+ /* "mettagrid/objects.pxd":157
21732
21769
  * MettaObject.init_mo(cfg)
21733
21770
  * Usable.init_usable(cfg)
21734
21771
  * this.input_resource = InventoryItem.r1 # <<<<<<<<<<<<<<
@@ -21737,7 +21774,7 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21737
21774
  */
21738
21775
  this->input_resource = __pyx_e_9mettagrid_7objects_r1;
21739
21776
 
21740
- /* "mettagrid/objects.pxd":150
21777
+ /* "mettagrid/objects.pxd":158
21741
21778
  * Usable.init_usable(cfg)
21742
21779
  * this.input_resource = InventoryItem.r1
21743
21780
  * this.output_resource = InventoryItem.r2 # <<<<<<<<<<<<<<
@@ -21746,16 +21783,16 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21746
21783
  */
21747
21784
  this->output_resource = __pyx_e_9mettagrid_7objects_r2;
21748
21785
 
21749
- /* "mettagrid/objects.pxd":151
21786
+ /* "mettagrid/objects.pxd":159
21750
21787
  * this.input_resource = InventoryItem.r1
21751
21788
  * this.output_resource = InventoryItem.r2
21752
21789
  * this.output_energy = cfg[b"energy_output.r1"] # <<<<<<<<<<<<<<
21753
21790
  *
21754
- * inline char usable(const Agent *actor):
21791
+ * inline bint usable(const Agent *actor):
21755
21792
  */
21756
21793
  this->output_energy = (__pyx_v_cfg[__pyx_k_energy_output_r1]);
21757
21794
 
21758
- /* "mettagrid/objects.pxd":145
21795
+ /* "mettagrid/objects.pxd":153
21759
21796
  * short output_energy
21760
21797
  *
21761
21798
  * inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21770,46 +21807,45 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
21770
21807
  __pyx_L0:;
21771
21808
  }
21772
21809
 
21773
- /* "mettagrid/objects.pxd":153
21810
+ /* "mettagrid/objects.pxd":161
21774
21811
  * this.output_energy = cfg[b"energy_output.r1"]
21775
21812
  *
21776
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21813
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21777
21814
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21778
21815
  *
21779
21816
  */
21780
21817
 
21781
- char __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21782
- char __pyx_r;
21783
- char __pyx_t_1;
21784
- char __pyx_t_2;
21785
- int __pyx_t_3;
21818
+ int __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
21819
+ int __pyx_r;
21820
+ int __pyx_t_1;
21821
+ int __pyx_t_2;
21786
21822
  int __pyx_lineno = 0;
21787
21823
  const char *__pyx_filename = NULL;
21788
21824
  int __pyx_clineno = 0;
21789
21825
 
21790
- /* "mettagrid/objects.pxd":154
21826
+ /* "mettagrid/objects.pxd":162
21791
21827
  *
21792
- * inline char usable(const Agent *actor):
21828
+ * inline bint usable(const Agent *actor):
21793
21829
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0 # <<<<<<<<<<<<<<
21794
21830
  *
21795
21831
  * inline obs(ObsType[:] obs):
21796
21832
  */
21797
- __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)
21833
+ __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)
21798
21834
  if (__pyx_t_2) {
21799
21835
  } else {
21800
21836
  __pyx_t_1 = __pyx_t_2;
21801
21837
  goto __pyx_L3_bool_binop_done;
21802
21838
  }
21803
- __pyx_t_3 = ((__pyx_v_actor->inventory[this->input_resource]) > 0);
21804
- __pyx_t_1 = __pyx_t_3;
21839
+ __pyx_t_2 = ((__pyx_v_actor->inventory[this->input_resource]) > 0);
21840
+ __pyx_t_1 = __pyx_t_2;
21805
21841
  __pyx_L3_bool_binop_done:;
21806
21842
  __pyx_r = __pyx_t_1;
21807
21843
  goto __pyx_L0;
21808
21844
 
21809
- /* "mettagrid/objects.pxd":153
21845
+ /* "mettagrid/objects.pxd":161
21810
21846
  * this.output_energy = cfg[b"energy_output.r1"]
21811
21847
  *
21812
- * inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
21848
+ * inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
21813
21849
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21814
21850
  *
21815
21851
  */
@@ -21822,7 +21858,7 @@ char __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_A
21822
21858
  return __pyx_r;
21823
21859
  }
21824
21860
 
21825
- /* "mettagrid/objects.pxd":156
21861
+ /* "mettagrid/objects.pxd":164
21826
21862
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21827
21863
  *
21828
21864
  * inline obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21836,7 +21872,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21836
21872
  Py_ssize_t __pyx_t_1;
21837
21873
  __Pyx_RefNannySetupContext("obs", 1);
21838
21874
 
21839
- /* "mettagrid/objects.pxd":157
21875
+ /* "mettagrid/objects.pxd":165
21840
21876
  *
21841
21877
  * inline obs(ObsType[:] obs):
21842
21878
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -21846,7 +21882,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21846
21882
  __pyx_t_1 = 0;
21847
21883
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
21848
21884
 
21849
- /* "mettagrid/objects.pxd":158
21885
+ /* "mettagrid/objects.pxd":166
21850
21886
  * inline obs(ObsType[:] obs):
21851
21887
  * obs[0] = 1
21852
21888
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -21856,7 +21892,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21856
21892
  __pyx_t_1 = 1;
21857
21893
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
21858
21894
 
21859
- /* "mettagrid/objects.pxd":159
21895
+ /* "mettagrid/objects.pxd":167
21860
21896
  * obs[0] = 1
21861
21897
  * obs[1] = hp
21862
21898
  * obs[2] = input_resource # <<<<<<<<<<<<<<
@@ -21866,7 +21902,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21866
21902
  __pyx_t_1 = 2;
21867
21903
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = input_resource;
21868
21904
 
21869
- /* "mettagrid/objects.pxd":160
21905
+ /* "mettagrid/objects.pxd":168
21870
21906
  * obs[1] = hp
21871
21907
  * obs[2] = input_resource
21872
21908
  * obs[3] = output_resource # <<<<<<<<<<<<<<
@@ -21876,7 +21912,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21876
21912
  __pyx_t_1 = 3;
21877
21913
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = output_resource;
21878
21914
 
21879
- /* "mettagrid/objects.pxd":161
21915
+ /* "mettagrid/objects.pxd":169
21880
21916
  * obs[2] = input_resource
21881
21917
  * obs[3] = output_resource
21882
21918
  * obs[4] = output_energy # <<<<<<<<<<<<<<
@@ -21886,7 +21922,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21886
21922
  __pyx_t_1 = 4;
21887
21923
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = output_energy;
21888
21924
 
21889
- /* "mettagrid/objects.pxd":162
21925
+ /* "mettagrid/objects.pxd":170
21890
21926
  * obs[3] = output_resource
21891
21927
  * obs[4] = output_energy
21892
21928
  * obs[5] = ready # <<<<<<<<<<<<<<
@@ -21896,7 +21932,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21896
21932
  __pyx_t_1 = 5;
21897
21933
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = ready;
21898
21934
 
21899
- /* "mettagrid/objects.pxd":156
21935
+ /* "mettagrid/objects.pxd":164
21900
21936
  * return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
21901
21937
  *
21902
21938
  * inline obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -21911,7 +21947,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
21911
21947
  return __pyx_r;
21912
21948
  }
21913
21949
 
21914
- /* "mettagrid/objects.pxd":165
21950
+ /* "mettagrid/objects.pxd":173
21915
21951
  *
21916
21952
  * @staticmethod
21917
21953
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21929,39 +21965,39 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Converter::feature_names(v
21929
21965
  int __pyx_clineno = 0;
21930
21966
  __Pyx_RefNannySetupContext("feature_names", 1);
21931
21967
 
21932
- /* "mettagrid/objects.pxd":166
21968
+ /* "mettagrid/objects.pxd":174
21933
21969
  * @staticmethod
21934
21970
  * inline vector[string] feature_names():
21935
21971
  * return ["converter", "converter:hp", "converter:input_resource", "converter:output_resource", "converter:output_energy", "converter:ready"] # <<<<<<<<<<<<<<
21936
21972
  *
21937
21973
  * cdef cppclass Altar(Usable):
21938
21974
  */
21939
- __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 166, __pyx_L1_error)
21975
+ __pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 174, __pyx_L1_error)
21940
21976
  __Pyx_GOTREF(__pyx_t_1);
21941
21977
  __Pyx_INCREF(__pyx_n_u_converter);
21942
21978
  __Pyx_GIVEREF(__pyx_n_u_converter);
21943
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_converter)) __PYX_ERR(3, 166, __pyx_L1_error);
21979
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_converter)) __PYX_ERR(3, 174, __pyx_L1_error);
21944
21980
  __Pyx_INCREF(__pyx_kp_u_converter_hp);
21945
21981
  __Pyx_GIVEREF(__pyx_kp_u_converter_hp);
21946
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_converter_hp)) __PYX_ERR(3, 166, __pyx_L1_error);
21982
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_converter_hp)) __PYX_ERR(3, 174, __pyx_L1_error);
21947
21983
  __Pyx_INCREF(__pyx_kp_u_converter_input_resource);
21948
21984
  __Pyx_GIVEREF(__pyx_kp_u_converter_input_resource);
21949
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_converter_input_resource)) __PYX_ERR(3, 166, __pyx_L1_error);
21985
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_converter_input_resource)) __PYX_ERR(3, 174, __pyx_L1_error);
21950
21986
  __Pyx_INCREF(__pyx_kp_u_converter_output_resource);
21951
21987
  __Pyx_GIVEREF(__pyx_kp_u_converter_output_resource);
21952
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_converter_output_resource)) __PYX_ERR(3, 166, __pyx_L1_error);
21988
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_converter_output_resource)) __PYX_ERR(3, 174, __pyx_L1_error);
21953
21989
  __Pyx_INCREF(__pyx_kp_u_converter_output_energy);
21954
21990
  __Pyx_GIVEREF(__pyx_kp_u_converter_output_energy);
21955
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_converter_output_energy)) __PYX_ERR(3, 166, __pyx_L1_error);
21991
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_converter_output_energy)) __PYX_ERR(3, 174, __pyx_L1_error);
21956
21992
  __Pyx_INCREF(__pyx_kp_u_converter_ready);
21957
21993
  __Pyx_GIVEREF(__pyx_kp_u_converter_ready);
21958
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_converter_ready)) __PYX_ERR(3, 166, __pyx_L1_error);
21959
- __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)
21994
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_converter_ready)) __PYX_ERR(3, 174, __pyx_L1_error);
21995
+ __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)
21960
21996
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21961
21997
  __pyx_r = __pyx_t_2;
21962
21998
  goto __pyx_L0;
21963
21999
 
21964
- /* "mettagrid/objects.pxd":165
22000
+ /* "mettagrid/objects.pxd":173
21965
22001
  *
21966
22002
  * @staticmethod
21967
22003
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -21979,7 +22015,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Converter::feature_names(v
21979
22015
  return __pyx_r;
21980
22016
  }
21981
22017
 
21982
- /* "mettagrid/objects.pxd":169
22018
+ /* "mettagrid/objects.pxd":177
21983
22019
  *
21984
22020
  * cdef cppclass Altar(Usable):
21985
22021
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -21992,7 +22028,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
21992
22028
  const char *__pyx_filename = NULL;
21993
22029
  int __pyx_clineno = 0;
21994
22030
 
21995
- /* "mettagrid/objects.pxd":170
22031
+ /* "mettagrid/objects.pxd":178
21996
22032
  * cdef cppclass Altar(Usable):
21997
22033
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg):
21998
22034
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
@@ -22001,25 +22037,25 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
22001
22037
  */
22002
22038
  GridObject::init(__pyx_e_9mettagrid_7objects_AltarT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
22003
22039
 
22004
- /* "mettagrid/objects.pxd":171
22040
+ /* "mettagrid/objects.pxd":179
22005
22041
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg):
22006
22042
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer))
22007
22043
  * MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
22008
22044
  * Usable.init_usable(cfg)
22009
22045
  *
22010
22046
  */
22011
- __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 171, __pyx_L1_error)
22047
+ __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 179, __pyx_L1_error)
22012
22048
 
22013
- /* "mettagrid/objects.pxd":172
22049
+ /* "mettagrid/objects.pxd":180
22014
22050
  * GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer))
22015
22051
  * MettaObject.init_mo(cfg)
22016
22052
  * Usable.init_usable(cfg) # <<<<<<<<<<<<<<
22017
22053
  *
22018
22054
  * inline void obs(ObsType[:] obs):
22019
22055
  */
22020
- __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 172, __pyx_L1_error)
22056
+ __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 180, __pyx_L1_error)
22021
22057
 
22022
- /* "mettagrid/objects.pxd":169
22058
+ /* "mettagrid/objects.pxd":177
22023
22059
  *
22024
22060
  * cdef cppclass Altar(Usable):
22025
22061
  * inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
@@ -22034,7 +22070,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
22034
22070
  __pyx_L0:;
22035
22071
  }
22036
22072
 
22037
- /* "mettagrid/objects.pxd":174
22073
+ /* "mettagrid/objects.pxd":182
22038
22074
  * Usable.init_usable(cfg)
22039
22075
  *
22040
22076
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -22045,7 +22081,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
22045
22081
  void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
22046
22082
  Py_ssize_t __pyx_t_1;
22047
22083
 
22048
- /* "mettagrid/objects.pxd":175
22084
+ /* "mettagrid/objects.pxd":183
22049
22085
  *
22050
22086
  * inline void obs(ObsType[:] obs):
22051
22087
  * obs[0] = 1 # <<<<<<<<<<<<<<
@@ -22055,7 +22091,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
22055
22091
  __pyx_t_1 = 0;
22056
22092
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
22057
22093
 
22058
- /* "mettagrid/objects.pxd":176
22094
+ /* "mettagrid/objects.pxd":184
22059
22095
  * inline void obs(ObsType[:] obs):
22060
22096
  * obs[0] = 1
22061
22097
  * obs[1] = hp # <<<<<<<<<<<<<<
@@ -22065,7 +22101,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
22065
22101
  __pyx_t_1 = 1;
22066
22102
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
22067
22103
 
22068
- /* "mettagrid/objects.pxd":177
22104
+ /* "mettagrid/objects.pxd":185
22069
22105
  * obs[0] = 1
22070
22106
  * obs[1] = hp
22071
22107
  * obs[2] = ready # <<<<<<<<<<<<<<
@@ -22075,7 +22111,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
22075
22111
  __pyx_t_1 = 2;
22076
22112
  *((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = ready;
22077
22113
 
22078
- /* "mettagrid/objects.pxd":174
22114
+ /* "mettagrid/objects.pxd":182
22079
22115
  * Usable.init_usable(cfg)
22080
22116
  *
22081
22117
  * inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
@@ -22086,7 +22122,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
22086
22122
  /* function exit code */
22087
22123
  }
22088
22124
 
22089
- /* "mettagrid/objects.pxd":180
22125
+ /* "mettagrid/objects.pxd":188
22090
22126
  *
22091
22127
  * @staticmethod
22092
22128
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -22104,30 +22140,30 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Altar::feature_names(void)
22104
22140
  int __pyx_clineno = 0;
22105
22141
  __Pyx_RefNannySetupContext("feature_names", 1);
22106
22142
 
22107
- /* "mettagrid/objects.pxd":181
22143
+ /* "mettagrid/objects.pxd":189
22108
22144
  * @staticmethod
22109
22145
  * inline vector[string] feature_names():
22110
22146
  * return ["altar", "altar:hp", "altar:ready"] # <<<<<<<<<<<<<<
22111
22147
  *
22112
22148
  * cdef map[TypeId, GridLayer] ObjectLayers
22113
22149
  */
22114
- __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 181, __pyx_L1_error)
22150
+ __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 189, __pyx_L1_error)
22115
22151
  __Pyx_GOTREF(__pyx_t_1);
22116
22152
  __Pyx_INCREF(__pyx_n_u_altar);
22117
22153
  __Pyx_GIVEREF(__pyx_n_u_altar);
22118
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_altar)) __PYX_ERR(3, 181, __pyx_L1_error);
22154
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_altar)) __PYX_ERR(3, 189, __pyx_L1_error);
22119
22155
  __Pyx_INCREF(__pyx_kp_u_altar_hp);
22120
22156
  __Pyx_GIVEREF(__pyx_kp_u_altar_hp);
22121
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_altar_hp)) __PYX_ERR(3, 181, __pyx_L1_error);
22157
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_altar_hp)) __PYX_ERR(3, 189, __pyx_L1_error);
22122
22158
  __Pyx_INCREF(__pyx_kp_u_altar_ready);
22123
22159
  __Pyx_GIVEREF(__pyx_kp_u_altar_ready);
22124
- if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_altar_ready)) __PYX_ERR(3, 181, __pyx_L1_error);
22125
- __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)
22160
+ if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_altar_ready)) __PYX_ERR(3, 189, __pyx_L1_error);
22161
+ __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)
22126
22162
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22127
22163
  __pyx_r = __pyx_t_2;
22128
22164
  goto __pyx_L0;
22129
22165
 
22130
- /* "mettagrid/objects.pxd":180
22166
+ /* "mettagrid/objects.pxd":188
22131
22167
  *
22132
22168
  * @staticmethod
22133
22169
  * inline vector[string] feature_names(): # <<<<<<<<<<<<<<
@@ -22145,72 +22181,101 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Altar::feature_names(void)
22145
22181
  return __pyx_r;
22146
22182
  }
22147
22183
 
22148
- /* "mettagrid/objects.pxd":186
22184
+ /* "mettagrid/objects.pxd":194
22149
22185
  *
22150
22186
  * cdef class ResetHandler(EventHandler):
22151
22187
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg): # <<<<<<<<<<<<<<
22152
22188
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22153
- * usable.ready = True
22189
+ * if usable is NULL:
22154
22190
  */
22155
22191
 
22156
22192
  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) {
22157
22193
  __pyx_t_9mettagrid_7objects_Usable *__pyx_v_usable;
22158
22194
  __Pyx_RefNannyDeclarations
22159
- PyObject *__pyx_t_1 = NULL;
22195
+ int __pyx_t_1;
22160
22196
  PyObject *__pyx_t_2 = NULL;
22161
- char const *__pyx_t_3;
22197
+ PyObject *__pyx_t_3 = NULL;
22198
+ char const *__pyx_t_4;
22162
22199
  int __pyx_lineno = 0;
22163
22200
  const char *__pyx_filename = NULL;
22164
22201
  int __pyx_clineno = 0;
22165
22202
  __Pyx_RefNannySetupContext("handle_event", 1);
22166
22203
 
22167
- /* "mettagrid/objects.pxd":187
22204
+ /* "mettagrid/objects.pxd":195
22168
22205
  * cdef class ResetHandler(EventHandler):
22169
22206
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
22170
22207
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id) # <<<<<<<<<<<<<<
22171
- * usable.ready = True
22172
- * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
22208
+ * if usable is NULL:
22209
+ * return
22173
22210
  */
22174
22211
  __pyx_v_usable = ((__pyx_t_9mettagrid_7objects_Usable *)__pyx_v_self->__pyx_base.env->_grid->object(__pyx_v_obj_id));
22175
22212
 
22176
- /* "mettagrid/objects.pxd":188
22213
+ /* "mettagrid/objects.pxd":196
22214
+ * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
22215
+ * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22216
+ * if usable is NULL: # <<<<<<<<<<<<<<
22217
+ * return
22218
+ *
22219
+ */
22220
+ __pyx_t_1 = (__pyx_v_usable == NULL);
22221
+ if (__pyx_t_1) {
22222
+
22223
+ /* "mettagrid/objects.pxd":197
22224
+ * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22225
+ * if usable is NULL:
22226
+ * return # <<<<<<<<<<<<<<
22227
+ *
22228
+ * usable.ready = True
22229
+ */
22230
+ goto __pyx_L0;
22231
+
22232
+ /* "mettagrid/objects.pxd":196
22177
22233
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
22178
22234
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22235
+ * if usable is NULL: # <<<<<<<<<<<<<<
22236
+ * return
22237
+ *
22238
+ */
22239
+ }
22240
+
22241
+ /* "mettagrid/objects.pxd":199
22242
+ * return
22243
+ *
22179
22244
  * usable.ready = True # <<<<<<<<<<<<<<
22180
22245
  * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
22181
22246
  *
22182
22247
  */
22183
22248
  __pyx_v_usable->ready = 1;
22184
22249
 
22185
- /* "mettagrid/objects.pxd":189
22186
- * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22250
+ /* "mettagrid/objects.pxd":200
22251
+ *
22187
22252
  * usable.ready = True
22188
22253
  * self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id]) # <<<<<<<<<<<<<<
22189
22254
  *
22190
22255
  * cdef enum Events:
22191
22256
  */
22192
- __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)
22193
- __Pyx_GOTREF(__pyx_t_1);
22194
- __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)
22257
+ __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)
22195
22258
  __Pyx_GOTREF(__pyx_t_2);
22196
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22197
- __pyx_t_3 = __Pyx_PyObject_AsString(__pyx_t_2); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) __PYX_ERR(3, 189, __pyx_L1_error)
22198
- ((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)
22259
+ __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)
22260
+ __Pyx_GOTREF(__pyx_t_3);
22199
22261
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22262
+ __pyx_t_4 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(3, 200, __pyx_L1_error)
22263
+ ((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)
22264
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
22200
22265
 
22201
- /* "mettagrid/objects.pxd":186
22266
+ /* "mettagrid/objects.pxd":194
22202
22267
  *
22203
22268
  * cdef class ResetHandler(EventHandler):
22204
22269
  * cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg): # <<<<<<<<<<<<<<
22205
22270
  * cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
22206
- * usable.ready = True
22271
+ * if usable is NULL:
22207
22272
  */
22208
22273
 
22209
22274
  /* function exit code */
22210
22275
  goto __pyx_L0;
22211
22276
  __pyx_L1_error:;
22212
- __Pyx_XDECREF(__pyx_t_1);
22213
22277
  __Pyx_XDECREF(__pyx_t_2);
22278
+ __Pyx_XDECREF(__pyx_t_3);
22214
22279
  __Pyx_AddTraceback("mettagrid.objects.ResetHandler.handle_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
22215
22280
  __pyx_L0:;
22216
22281
  __Pyx_RefNannyFinishContext();
@@ -22219,7 +22284,7 @@ static void __pyx_f_9mettagrid_7objects_12ResetHandler_handle_event(struct __pyx
22219
22284
  /* "mettagrid/actions/actions.pyx":14
22220
22285
  *
22221
22286
  * cdef class MettaActionHandler(ActionHandler):
22222
- * def __init__(self, cfg: OmegaConf, action_name, action_cost=0): # <<<<<<<<<<<<<<
22287
+ * def __init__(self, cfg: OmegaConf, action_name): # <<<<<<<<<<<<<<
22223
22288
  * self.action_name = action_name
22224
22289
  *
22225
22290
  */
@@ -22229,10 +22294,9 @@ static int __pyx_pw_9mettagrid_7actions_7actions_18MettaActionHandler_1__init__(
22229
22294
  static int __pyx_pw_9mettagrid_7actions_7actions_18MettaActionHandler_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
22230
22295
  PyObject *__pyx_v_cfg = 0;
22231
22296
  PyObject *__pyx_v_action_name = 0;
22232
- CYTHON_UNUSED PyObject *__pyx_v_action_cost = 0;
22233
22297
  CYTHON_UNUSED Py_ssize_t __pyx_nargs;
22234
22298
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues;
22235
- PyObject* values[3] = {0,0,0};
22299
+ PyObject* values[2] = {0,0};
22236
22300
  int __pyx_lineno = 0;
22237
22301
  const char *__pyx_filename = NULL;
22238
22302
  int __pyx_clineno = 0;
@@ -22246,13 +22310,10 @@ static int __pyx_pw_9mettagrid_7actions_7actions_18MettaActionHandler_1__init__(
22246
22310
  #endif
22247
22311
  __pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
22248
22312
  {
22249
- PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cfg,&__pyx_n_s_action_name,&__pyx_n_s_action_cost,0};
22250
- values[2] = __Pyx_Arg_NewRef_VARARGS(((PyObject *)__pyx_int_0));
22313
+ PyObject **__pyx_pyargnames[] = {&__pyx_n_s_cfg,&__pyx_n_s_action_name,0};
22251
22314
  if (__pyx_kwds) {
22252
22315
  Py_ssize_t kw_args;
22253
22316
  switch (__pyx_nargs) {
22254
- case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
22255
- CYTHON_FALLTHROUGH;
22256
22317
  case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
22257
22318
  CYTHON_FALLTHROUGH;
22258
22319
  case 1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
@@ -22277,37 +22338,25 @@ static int __pyx_pw_9mettagrid_7actions_7actions_18MettaActionHandler_1__init__(
22277
22338
  }
22278
22339
  else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error)
22279
22340
  else {
22280
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 14, __pyx_L3_error)
22281
- }
22282
- CYTHON_FALLTHROUGH;
22283
- case 2:
22284
- if (kw_args > 0) {
22285
- PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_action_cost);
22286
- if (value) { values[2] = __Pyx_Arg_NewRef_VARARGS(value); kw_args--; }
22287
- else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 14, __pyx_L3_error)
22341
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 14, __pyx_L3_error)
22288
22342
  }
22289
22343
  }
22290
22344
  if (unlikely(kw_args > 0)) {
22291
22345
  const Py_ssize_t kwd_pos_args = __pyx_nargs;
22292
22346
  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 14, __pyx_L3_error)
22293
22347
  }
22348
+ } else if (unlikely(__pyx_nargs != 2)) {
22349
+ goto __pyx_L5_argtuple_error;
22294
22350
  } else {
22295
- switch (__pyx_nargs) {
22296
- case 3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
22297
- CYTHON_FALLTHROUGH;
22298
- case 2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
22299
- values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
22300
- break;
22301
- default: goto __pyx_L5_argtuple_error;
22302
- }
22351
+ values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
22352
+ values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
22303
22353
  }
22304
22354
  __pyx_v_cfg = values[0];
22305
22355
  __pyx_v_action_name = values[1];
22306
- __pyx_v_action_cost = values[2];
22307
22356
  }
22308
22357
  goto __pyx_L6_skip;
22309
22358
  __pyx_L5_argtuple_error:;
22310
- __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 14, __pyx_L3_error)
22359
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 14, __pyx_L3_error)
22311
22360
  __pyx_L6_skip:;
22312
22361
  goto __pyx_L4_argument_unpacking_done;
22313
22362
  __pyx_L3_error:;
@@ -22321,7 +22370,7 @@ static int __pyx_pw_9mettagrid_7actions_7actions_18MettaActionHandler_1__init__(
22321
22370
  __Pyx_RefNannyFinishContext();
22322
22371
  return -1;
22323
22372
  __pyx_L4_argument_unpacking_done:;
22324
- __pyx_r = __pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler___init__(((struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *)__pyx_v_self), __pyx_v_cfg, __pyx_v_action_name, __pyx_v_action_cost);
22373
+ __pyx_r = __pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler___init__(((struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *)__pyx_v_self), __pyx_v_cfg, __pyx_v_action_name);
22325
22374
 
22326
22375
  /* function exit code */
22327
22376
  {
@@ -22334,7 +22383,7 @@ static int __pyx_pw_9mettagrid_7actions_7actions_18MettaActionHandler_1__init__(
22334
22383
  return __pyx_r;
22335
22384
  }
22336
22385
 
22337
- static int __pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler___init__(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, PyObject *__pyx_v_cfg, PyObject *__pyx_v_action_name, CYTHON_UNUSED PyObject *__pyx_v_action_cost) {
22386
+ static int __pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler___init__(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, PyObject *__pyx_v_cfg, PyObject *__pyx_v_action_name) {
22338
22387
  PyObject *__pyx_v_t = NULL;
22339
22388
  PyObject *__pyx_v_n = NULL;
22340
22389
  int __pyx_r;
@@ -22355,7 +22404,7 @@ static int __pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler___init__(s
22355
22404
 
22356
22405
  /* "mettagrid/actions/actions.pyx":15
22357
22406
  * cdef class MettaActionHandler(ActionHandler):
22358
- * def __init__(self, cfg: OmegaConf, action_name, action_cost=0):
22407
+ * def __init__(self, cfg: OmegaConf, action_name):
22359
22408
  * self.action_name = action_name # <<<<<<<<<<<<<<
22360
22409
  *
22361
22410
  * self._stats.action = "action." + action_name
@@ -22522,7 +22571,7 @@ static int __pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler___init__(s
22522
22571
  *
22523
22572
  * self.action_cost = cfg.cost # <<<<<<<<<<<<<<
22524
22573
  *
22525
- * cdef char handle_action(
22574
+ * cdef bint handle_action(
22526
22575
  */
22527
22576
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_cfg, __pyx_n_s_cost); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 24, __pyx_L1_error)
22528
22577
  __Pyx_GOTREF(__pyx_t_3);
@@ -22533,7 +22582,7 @@ static int __pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler___init__(s
22533
22582
  /* "mettagrid/actions/actions.pyx":14
22534
22583
  *
22535
22584
  * cdef class MettaActionHandler(ActionHandler):
22536
- * def __init__(self, cfg: OmegaConf, action_name, action_cost=0): # <<<<<<<<<<<<<<
22585
+ * def __init__(self, cfg: OmegaConf, action_name): # <<<<<<<<<<<<<<
22537
22586
  * self.action_name = action_name
22538
22587
  *
22539
22588
  */
@@ -22558,17 +22607,16 @@ static int __pyx_pf_9mettagrid_7actions_7actions_18MettaActionHandler___init__(s
22558
22607
  /* "mettagrid/actions/actions.pyx":26
22559
22608
  * self.action_cost = cfg.cost
22560
22609
  *
22561
- * cdef char handle_action( # <<<<<<<<<<<<<<
22610
+ * cdef bint handle_action( # <<<<<<<<<<<<<<
22562
22611
  * self,
22563
22612
  * unsigned int actor_id,
22564
22613
  */
22565
22614
 
22566
- static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_action(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, unsigned int __pyx_v_actor_id, GridObjectId __pyx_v_actor_object_id, __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg) {
22615
+ static int __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_action(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, unsigned int __pyx_v_actor_id, GridObjectId __pyx_v_actor_object_id, __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg) {
22567
22616
  __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor;
22568
- char __pyx_v_result;
22569
- char __pyx_r;
22617
+ int __pyx_v_result;
22618
+ int __pyx_r;
22570
22619
  int __pyx_t_1;
22571
- char __pyx_t_2;
22572
22620
  int __pyx_lineno = 0;
22573
22621
  const char *__pyx_filename = NULL;
22574
22622
  int __pyx_clineno = 0;
@@ -22578,40 +22626,141 @@ static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_act
22578
22626
  *
22579
22627
  * cdef Agent *actor = <Agent*>self.env._grid.object(actor_object_id) # <<<<<<<<<<<<<<
22580
22628
  *
22581
- * if actor.frozen:
22629
+ * if actor.shield:
22582
22630
  */
22583
22631
  __pyx_v_actor = ((__pyx_t_9mettagrid_7objects_Agent *)__pyx_v_self->__pyx_base.env->_grid->object(__pyx_v_actor_object_id));
22584
22632
 
22585
22633
  /* "mettagrid/actions/actions.pyx":34
22586
22634
  * cdef Agent *actor = <Agent*>self.env._grid.object(actor_object_id)
22587
22635
  *
22588
- * if actor.frozen: # <<<<<<<<<<<<<<
22589
- * return False
22590
- *
22636
+ * if actor.shield: # <<<<<<<<<<<<<<
22637
+ * actor.energy -= actor.shield_upkeep
22638
+ * self.env._stats.agent_add(actor_id, "shield_upkeep", actor.shield_upkeep)
22591
22639
  */
22592
- __pyx_t_1 = (__pyx_v_actor->frozen != 0);
22640
+ __pyx_t_1 = (__pyx_v_actor->shield != 0);
22593
22641
  if (__pyx_t_1) {
22594
22642
 
22595
22643
  /* "mettagrid/actions/actions.pyx":35
22596
22644
  *
22597
- * if actor.frozen:
22598
- * return False # <<<<<<<<<<<<<<
22645
+ * if actor.shield:
22646
+ * actor.energy -= actor.shield_upkeep # <<<<<<<<<<<<<<
22647
+ * self.env._stats.agent_add(actor_id, "shield_upkeep", actor.shield_upkeep)
22648
+ * self.env._stats.agent_incr(actor_id, "status.shield.ticks")
22649
+ */
22650
+ __pyx_v_actor->energy = (__pyx_v_actor->energy - __pyx_v_actor->shield_upkeep);
22651
+
22652
+ /* "mettagrid/actions/actions.pyx":36
22653
+ * if actor.shield:
22654
+ * actor.energy -= actor.shield_upkeep
22655
+ * self.env._stats.agent_add(actor_id, "shield_upkeep", actor.shield_upkeep) # <<<<<<<<<<<<<<
22656
+ * self.env._stats.agent_incr(actor_id, "status.shield.ticks")
22657
+ * if actor.energy <= 0:
22658
+ */
22659
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->agent_add(__pyx_v_self->__pyx_base.env->_stats, __pyx_v_actor_id, ((char const *)"shield_upkeep"), __pyx_v_actor->shield_upkeep); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 36, __pyx_L1_error)
22660
+
22661
+ /* "mettagrid/actions/actions.pyx":37
22662
+ * actor.energy -= actor.shield_upkeep
22663
+ * self.env._stats.agent_add(actor_id, "shield_upkeep", actor.shield_upkeep)
22664
+ * self.env._stats.agent_incr(actor_id, "status.shield.ticks") # <<<<<<<<<<<<<<
22665
+ * if actor.energy <= 0:
22666
+ * actor.shield = False
22667
+ */
22668
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.env->_stats, __pyx_v_actor_id, ((char const *)"status.shield.ticks")); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 37, __pyx_L1_error)
22669
+
22670
+ /* "mettagrid/actions/actions.pyx":38
22671
+ * self.env._stats.agent_add(actor_id, "shield_upkeep", actor.shield_upkeep)
22672
+ * self.env._stats.agent_incr(actor_id, "status.shield.ticks")
22673
+ * if actor.energy <= 0: # <<<<<<<<<<<<<<
22674
+ * actor.shield = False
22675
+ * actor.energy = 0
22676
+ */
22677
+ __pyx_t_1 = (__pyx_v_actor->energy <= 0);
22678
+ if (__pyx_t_1) {
22679
+
22680
+ /* "mettagrid/actions/actions.pyx":39
22681
+ * self.env._stats.agent_incr(actor_id, "status.shield.ticks")
22682
+ * if actor.energy <= 0:
22683
+ * actor.shield = False # <<<<<<<<<<<<<<
22684
+ * actor.energy = 0
22599
22685
  *
22600
- * if actor.energy < self.action_cost:
22601
22686
  */
22602
- __pyx_r = 0;
22603
- goto __pyx_L0;
22687
+ __pyx_v_actor->shield = 0;
22688
+
22689
+ /* "mettagrid/actions/actions.pyx":40
22690
+ * if actor.energy <= 0:
22691
+ * actor.shield = False
22692
+ * actor.energy = 0 # <<<<<<<<<<<<<<
22693
+ *
22694
+ * if actor.frozen > 0:
22695
+ */
22696
+ __pyx_v_actor->energy = 0;
22697
+
22698
+ /* "mettagrid/actions/actions.pyx":38
22699
+ * self.env._stats.agent_add(actor_id, "shield_upkeep", actor.shield_upkeep)
22700
+ * self.env._stats.agent_incr(actor_id, "status.shield.ticks")
22701
+ * if actor.energy <= 0: # <<<<<<<<<<<<<<
22702
+ * actor.shield = False
22703
+ * actor.energy = 0
22704
+ */
22705
+ }
22604
22706
 
22605
22707
  /* "mettagrid/actions/actions.pyx":34
22606
22708
  * cdef Agent *actor = <Agent*>self.env._grid.object(actor_object_id)
22607
22709
  *
22608
- * if actor.frozen: # <<<<<<<<<<<<<<
22710
+ * if actor.shield: # <<<<<<<<<<<<<<
22711
+ * actor.energy -= actor.shield_upkeep
22712
+ * self.env._stats.agent_add(actor_id, "shield_upkeep", actor.shield_upkeep)
22713
+ */
22714
+ }
22715
+
22716
+ /* "mettagrid/actions/actions.pyx":42
22717
+ * actor.energy = 0
22718
+ *
22719
+ * if actor.frozen > 0: # <<<<<<<<<<<<<<
22720
+ * self.env._stats.agent_incr(actor_id, "status.frozen.ticks")
22721
+ * actor.frozen -= 1
22722
+ */
22723
+ __pyx_t_1 = (__pyx_v_actor->frozen > 0);
22724
+ if (__pyx_t_1) {
22725
+
22726
+ /* "mettagrid/actions/actions.pyx":43
22727
+ *
22728
+ * if actor.frozen > 0:
22729
+ * self.env._stats.agent_incr(actor_id, "status.frozen.ticks") # <<<<<<<<<<<<<<
22730
+ * actor.frozen -= 1
22731
+ * return False
22732
+ */
22733
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.env->_stats, __pyx_v_actor_id, ((char const *)"status.frozen.ticks")); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L1_error)
22734
+
22735
+ /* "mettagrid/actions/actions.pyx":44
22736
+ * if actor.frozen > 0:
22737
+ * self.env._stats.agent_incr(actor_id, "status.frozen.ticks")
22738
+ * actor.frozen -= 1 # <<<<<<<<<<<<<<
22609
22739
  * return False
22610
22740
  *
22741
+ */
22742
+ __pyx_v_actor->frozen = (__pyx_v_actor->frozen - 1);
22743
+
22744
+ /* "mettagrid/actions/actions.pyx":45
22745
+ * self.env._stats.agent_incr(actor_id, "status.frozen.ticks")
22746
+ * actor.frozen -= 1
22747
+ * return False # <<<<<<<<<<<<<<
22748
+ *
22749
+ * if actor.energy < self.action_cost:
22750
+ */
22751
+ __pyx_r = 0;
22752
+ goto __pyx_L0;
22753
+
22754
+ /* "mettagrid/actions/actions.pyx":42
22755
+ * actor.energy = 0
22756
+ *
22757
+ * if actor.frozen > 0: # <<<<<<<<<<<<<<
22758
+ * self.env._stats.agent_incr(actor_id, "status.frozen.ticks")
22759
+ * actor.frozen -= 1
22611
22760
  */
22612
22761
  }
22613
22762
 
22614
- /* "mettagrid/actions/actions.pyx":37
22763
+ /* "mettagrid/actions/actions.pyx":47
22615
22764
  * return False
22616
22765
  *
22617
22766
  * if actor.energy < self.action_cost: # <<<<<<<<<<<<<<
@@ -22621,7 +22770,7 @@ static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_act
22621
22770
  __pyx_t_1 = (__pyx_v_actor->energy < __pyx_v_self->action_cost);
22622
22771
  if (__pyx_t_1) {
22623
22772
 
22624
- /* "mettagrid/actions/actions.pyx":38
22773
+ /* "mettagrid/actions/actions.pyx":48
22625
22774
  *
22626
22775
  * if actor.energy < self.action_cost:
22627
22776
  * return False # <<<<<<<<<<<<<<
@@ -22631,7 +22780,7 @@ static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_act
22631
22780
  __pyx_r = 0;
22632
22781
  goto __pyx_L0;
22633
22782
 
22634
- /* "mettagrid/actions/actions.pyx":37
22783
+ /* "mettagrid/actions/actions.pyx":47
22635
22784
  * return False
22636
22785
  *
22637
22786
  * if actor.energy < self.action_cost: # <<<<<<<<<<<<<<
@@ -22640,7 +22789,7 @@ static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_act
22640
22789
  */
22641
22790
  }
22642
22791
 
22643
- /* "mettagrid/actions/actions.pyx":40
22792
+ /* "mettagrid/actions/actions.pyx":50
22644
22793
  * return False
22645
22794
  *
22646
22795
  * actor.energy -= self.action_cost # <<<<<<<<<<<<<<
@@ -22649,46 +22798,45 @@ static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_act
22649
22798
  */
22650
22799
  __pyx_v_actor->energy = (__pyx_v_actor->energy - __pyx_v_self->action_cost);
22651
22800
 
22652
- /* "mettagrid/actions/actions.pyx":41
22801
+ /* "mettagrid/actions/actions.pyx":51
22653
22802
  *
22654
22803
  * actor.energy -= self.action_cost
22655
22804
  * self.env._stats.agent_add(actor_id, self._stats.action_energy.c_str(), self.action_cost) # <<<<<<<<<<<<<<
22656
22805
  *
22657
- * cdef char result = self._handle_action(actor_id, actor, arg)
22806
+ * cdef bint result = self._handle_action(actor_id, actor, arg)
22658
22807
  */
22659
- ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->agent_add(__pyx_v_self->__pyx_base.env->_stats, __pyx_v_actor_id, __pyx_v_self->_stats.action_energy.c_str(), __pyx_v_self->action_cost); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 41, __pyx_L1_error)
22808
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->agent_add(__pyx_v_self->__pyx_base.env->_stats, __pyx_v_actor_id, __pyx_v_self->_stats.action_energy.c_str(), __pyx_v_self->action_cost); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 51, __pyx_L1_error)
22660
22809
 
22661
- /* "mettagrid/actions/actions.pyx":43
22810
+ /* "mettagrid/actions/actions.pyx":53
22662
22811
  * self.env._stats.agent_add(actor_id, self._stats.action_energy.c_str(), self.action_cost)
22663
22812
  *
22664
- * cdef char result = self._handle_action(actor_id, actor, arg) # <<<<<<<<<<<<<<
22813
+ * cdef bint result = self._handle_action(actor_id, actor, arg) # <<<<<<<<<<<<<<
22665
22814
  *
22666
22815
  * if result:
22667
22816
  */
22668
- __pyx_t_2 = ((struct __pyx_vtabstruct_9mettagrid_7actions_7actions_MettaActionHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->_handle_action(__pyx_v_self, __pyx_v_actor_id, __pyx_v_actor, __pyx_v_arg); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 43, __pyx_L1_error)
22669
- __pyx_v_result = __pyx_t_2;
22817
+ __pyx_t_1 = ((struct __pyx_vtabstruct_9mettagrid_7actions_7actions_MettaActionHandler *)__pyx_v_self->__pyx_base.__pyx_vtab)->_handle_action(__pyx_v_self, __pyx_v_actor_id, __pyx_v_actor, __pyx_v_arg); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error)
22818
+ __pyx_v_result = __pyx_t_1;
22670
22819
 
22671
- /* "mettagrid/actions/actions.pyx":45
22672
- * cdef char result = self._handle_action(actor_id, actor, arg)
22820
+ /* "mettagrid/actions/actions.pyx":55
22821
+ * cdef bint result = self._handle_action(actor_id, actor, arg)
22673
22822
  *
22674
22823
  * if result: # <<<<<<<<<<<<<<
22675
22824
  * self.env._stats.agent_incr(actor_id, self._stats.action.c_str())
22676
22825
  *
22677
22826
  */
22678
- __pyx_t_1 = (__pyx_v_result != 0);
22679
- if (__pyx_t_1) {
22827
+ if (__pyx_v_result) {
22680
22828
 
22681
- /* "mettagrid/actions/actions.pyx":46
22829
+ /* "mettagrid/actions/actions.pyx":56
22682
22830
  *
22683
22831
  * if result:
22684
22832
  * self.env._stats.agent_incr(actor_id, self._stats.action.c_str()) # <<<<<<<<<<<<<<
22685
22833
  *
22686
- * return result
22834
+ * if actor.energy < 0:
22687
22835
  */
22688
- ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.env->_stats, __pyx_v_actor_id, __pyx_v_self->_stats.action.c_str()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 46, __pyx_L1_error)
22836
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.env->_stats, __pyx_v_actor_id, __pyx_v_self->_stats.action.c_str()); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 56, __pyx_L1_error)
22689
22837
 
22690
- /* "mettagrid/actions/actions.pyx":45
22691
- * cdef char result = self._handle_action(actor_id, actor, arg)
22838
+ /* "mettagrid/actions/actions.pyx":55
22839
+ * cdef bint result = self._handle_action(actor_id, actor, arg)
22692
22840
  *
22693
22841
  * if result: # <<<<<<<<<<<<<<
22694
22842
  * self.env._stats.agent_incr(actor_id, self._stats.action.c_str())
@@ -22696,12 +22844,49 @@ static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_act
22696
22844
  */
22697
22845
  }
22698
22846
 
22699
- /* "mettagrid/actions/actions.pyx":48
22847
+ /* "mettagrid/actions/actions.pyx":58
22700
22848
  * self.env._stats.agent_incr(actor_id, self._stats.action.c_str())
22701
22849
  *
22850
+ * if actor.energy < 0: # <<<<<<<<<<<<<<
22851
+ * actor.energy = 0
22852
+ * self.env._stats.agent_incr(actor_id, "error.negative_energy")
22853
+ */
22854
+ __pyx_t_1 = (__pyx_v_actor->energy < 0);
22855
+ if (__pyx_t_1) {
22856
+
22857
+ /* "mettagrid/actions/actions.pyx":59
22858
+ *
22859
+ * if actor.energy < 0:
22860
+ * actor.energy = 0 # <<<<<<<<<<<<<<
22861
+ * self.env._stats.agent_incr(actor_id, "error.negative_energy")
22862
+ *
22863
+ */
22864
+ __pyx_v_actor->energy = 0;
22865
+
22866
+ /* "mettagrid/actions/actions.pyx":60
22867
+ * if actor.energy < 0:
22868
+ * actor.energy = 0
22869
+ * self.env._stats.agent_incr(actor_id, "error.negative_energy") # <<<<<<<<<<<<<<
22870
+ *
22871
+ * return result
22872
+ */
22873
+ ((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->agent_incr(__pyx_v_self->__pyx_base.env->_stats, __pyx_v_actor_id, ((char const *)"error.negative_energy")); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
22874
+
22875
+ /* "mettagrid/actions/actions.pyx":58
22876
+ * self.env._stats.agent_incr(actor_id, self._stats.action.c_str())
22877
+ *
22878
+ * if actor.energy < 0: # <<<<<<<<<<<<<<
22879
+ * actor.energy = 0
22880
+ * self.env._stats.agent_incr(actor_id, "error.negative_energy")
22881
+ */
22882
+ }
22883
+
22884
+ /* "mettagrid/actions/actions.pyx":62
22885
+ * self.env._stats.agent_incr(actor_id, "error.negative_energy")
22886
+ *
22702
22887
  * return result # <<<<<<<<<<<<<<
22703
22888
  *
22704
- * cdef char _handle_action(
22889
+ * cdef bint _handle_action(
22705
22890
  */
22706
22891
  __pyx_r = __pyx_v_result;
22707
22892
  goto __pyx_L0;
@@ -22709,7 +22894,7 @@ static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_act
22709
22894
  /* "mettagrid/actions/actions.pyx":26
22710
22895
  * self.action_cost = cfg.cost
22711
22896
  *
22712
- * cdef char handle_action( # <<<<<<<<<<<<<<
22897
+ * cdef bint handle_action( # <<<<<<<<<<<<<<
22713
22898
  * self,
22714
22899
  * unsigned int actor_id,
22715
22900
  */
@@ -22722,18 +22907,18 @@ static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_act
22722
22907
  return __pyx_r;
22723
22908
  }
22724
22909
 
22725
- /* "mettagrid/actions/actions.pyx":50
22910
+ /* "mettagrid/actions/actions.pyx":64
22726
22911
  * return result
22727
22912
  *
22728
- * cdef char _handle_action( # <<<<<<<<<<<<<<
22913
+ * cdef bint _handle_action( # <<<<<<<<<<<<<<
22729
22914
  * self,
22730
22915
  * unsigned int actor_id,
22731
22916
  */
22732
22917
 
22733
- static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler__handle_action(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, CYTHON_UNUSED unsigned int __pyx_v_actor_id, CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, CYTHON_UNUSED __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg) {
22734
- char __pyx_r;
22918
+ static int __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler__handle_action(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_v_self, CYTHON_UNUSED unsigned int __pyx_v_actor_id, CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, CYTHON_UNUSED __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg) {
22919
+ int __pyx_r;
22735
22920
 
22736
- /* "mettagrid/actions/actions.pyx":55
22921
+ /* "mettagrid/actions/actions.pyx":69
22737
22922
  * Agent * actor,
22738
22923
  * ActionArg arg):
22739
22924
  * return False # <<<<<<<<<<<<<<
@@ -22743,10 +22928,10 @@ static char __pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler__handle_ac
22743
22928
  __pyx_r = 0;
22744
22929
  goto __pyx_L0;
22745
22930
 
22746
- /* "mettagrid/actions/actions.pyx":50
22931
+ /* "mettagrid/actions/actions.pyx":64
22747
22932
  * return result
22748
22933
  *
22749
- * cdef char _handle_action( # <<<<<<<<<<<<<<
22934
+ * cdef bint _handle_action( # <<<<<<<<<<<<<<
22750
22935
  * self,
22751
22936
  * unsigned int actor_id,
22752
22937
  */
@@ -24142,7 +24327,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
24142
24327
  {&__pyx_kp_u__7, __pyx_k__7, sizeof(__pyx_k__7), 0, 1, 0, 0},
24143
24328
  {&__pyx_n_s_abc, __pyx_k_abc, sizeof(__pyx_k_abc), 0, 0, 1, 1},
24144
24329
  {&__pyx_kp_u_action, __pyx_k_action, sizeof(__pyx_k_action), 0, 1, 0, 0},
24145
- {&__pyx_n_s_action_cost, __pyx_k_action_cost, sizeof(__pyx_k_action_cost), 0, 0, 1, 1},
24146
24330
  {&__pyx_n_s_action_name, __pyx_k_action_name, sizeof(__pyx_k_action_name), 0, 0, 1, 1},
24147
24331
  {&__pyx_n_u_agent, __pyx_k_agent, sizeof(__pyx_k_agent), 0, 1, 0, 1},
24148
24332
  {&__pyx_kp_u_agent_energy, __pyx_k_agent_energy, sizeof(__pyx_k_agent_energy), 0, 1, 0, 0},
@@ -24318,7 +24502,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
24318
24502
  __Pyx_GOTREF(__pyx_tuple__8);
24319
24503
  __Pyx_GIVEREF(__pyx_tuple__8);
24320
24504
 
24321
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
24505
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
24322
24506
  * __pyx_import_array()
24323
24507
  * except Exception:
24324
24508
  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
@@ -24329,7 +24513,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
24329
24513
  __Pyx_GOTREF(__pyx_tuple__9);
24330
24514
  __Pyx_GIVEREF(__pyx_tuple__9);
24331
24515
 
24332
- /* "../../miniforge3/envs/metta-new/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
24516
+ /* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
24333
24517
  * _import_umath()
24334
24518
  * except Exception:
24335
24519
  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
@@ -24543,8 +24727,8 @@ static int __Pyx_modinit_type_init_code(void) {
24543
24727
  __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(0, 2, __pyx_L1_error)
24544
24728
  __pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler = &__pyx_vtable_9mettagrid_7actions_7actions_MettaActionHandler;
24545
24729
  __pyx_vtable_9mettagrid_7actions_7actions_MettaActionHandler.__pyx_base = *__pyx_vtabptr_10puffergrid_6action_ActionHandler;
24546
- __pyx_vtable_9mettagrid_7actions_7actions_MettaActionHandler.__pyx_base.handle_action = (char (*)(struct __pyx_obj_10puffergrid_6action_ActionHandler *, unsigned int, GridObjectId, __pyx_t_10puffergrid_6action_ActionArg))__pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_action;
24547
- __pyx_vtable_9mettagrid_7actions_7actions_MettaActionHandler._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_7actions_18MettaActionHandler__handle_action;
24730
+ __pyx_vtable_9mettagrid_7actions_7actions_MettaActionHandler.__pyx_base.handle_action = (int (*)(struct __pyx_obj_10puffergrid_6action_ActionHandler *, unsigned int, GridObjectId, __pyx_t_10puffergrid_6action_ActionArg))__pyx_f_9mettagrid_7actions_7actions_18MettaActionHandler_handle_action;
24731
+ __pyx_vtable_9mettagrid_7actions_7actions_MettaActionHandler._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_7actions_18MettaActionHandler__handle_action;
24548
24732
  #if CYTHON_USE_TYPE_SPECS
24549
24733
  __pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_10puffergrid_6action_ActionHandler); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
24550
24734
  __Pyx_GOTREF(__pyx_t_2);
@@ -24787,12 +24971,12 @@ static int __Pyx_modinit_type_import_code(void) {
24787
24971
  __pyx_ptype_10puffergrid_8grid_env_GridEnv = __Pyx_ImportType_3_0_11(__pyx_t_1, "puffergrid.grid_env", "GridEnv", sizeof(struct __pyx_obj_10puffergrid_8grid_env_GridEnv), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_10puffergrid_8grid_env_GridEnv),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_10puffergrid_8grid_env_GridEnv) __PYX_ERR(8, 18, __pyx_L1_error)
24788
24972
  __pyx_vtabptr_10puffergrid_8grid_env_GridEnv = (struct __pyx_vtabstruct_10puffergrid_8grid_env_GridEnv*)__Pyx_GetVtable(__pyx_ptype_10puffergrid_8grid_env_GridEnv); if (unlikely(!__pyx_vtabptr_10puffergrid_8grid_env_GridEnv)) __PYX_ERR(8, 18, __pyx_L1_error)
24789
24973
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24790
- __pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 185, __pyx_L1_error)
24974
+ __pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 193, __pyx_L1_error)
24791
24975
  __Pyx_GOTREF(__pyx_t_1);
24792
- __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)
24793
- __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)
24794
- __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)
24795
- __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)
24976
+ __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)
24977
+ __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)
24978
+ __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)
24979
+ __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)
24796
24980
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
24797
24981
  __Pyx_RefNannyFinishContext();
24798
24982
  return 0;
@@ -32063,77 +32247,6 @@ raise_neg_overflow:
32063
32247
  return (unsigned short) -1;
32064
32248
  }
32065
32249
 
32066
- /* CIntToPy */
32067
- static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
32068
- #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32069
- #pragma GCC diagnostic push
32070
- #pragma GCC diagnostic ignored "-Wconversion"
32071
- #endif
32072
- const char neg_one = (char) -1, const_zero = (char) 0;
32073
- #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
32074
- #pragma GCC diagnostic pop
32075
- #endif
32076
- const int is_unsigned = neg_one > const_zero;
32077
- if (is_unsigned) {
32078
- if (sizeof(char) < sizeof(long)) {
32079
- return PyInt_FromLong((long) value);
32080
- } else if (sizeof(char) <= sizeof(unsigned long)) {
32081
- return PyLong_FromUnsignedLong((unsigned long) value);
32082
- #ifdef HAVE_LONG_LONG
32083
- } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
32084
- return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
32085
- #endif
32086
- }
32087
- } else {
32088
- if (sizeof(char) <= sizeof(long)) {
32089
- return PyInt_FromLong((long) value);
32090
- #ifdef HAVE_LONG_LONG
32091
- } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
32092
- return PyLong_FromLongLong((PY_LONG_LONG) value);
32093
- #endif
32094
- }
32095
- }
32096
- {
32097
- unsigned char *bytes = (unsigned char *)&value;
32098
- #if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
32099
- if (is_unsigned) {
32100
- return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
32101
- } else {
32102
- return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
32103
- }
32104
- #elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
32105
- int one = 1; int little = (int)*(unsigned char *)&one;
32106
- return _PyLong_FromByteArray(bytes, sizeof(char),
32107
- little, !is_unsigned);
32108
- #else
32109
- int one = 1; int little = (int)*(unsigned char *)&one;
32110
- PyObject *from_bytes, *result = NULL;
32111
- PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
32112
- from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
32113
- if (!from_bytes) return NULL;
32114
- py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(char));
32115
- if (!py_bytes) goto limited_bad;
32116
- order_str = PyUnicode_FromString(little ? "little" : "big");
32117
- if (!order_str) goto limited_bad;
32118
- arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
32119
- if (!arg_tuple) goto limited_bad;
32120
- if (!is_unsigned) {
32121
- kwds = PyDict_New();
32122
- if (!kwds) goto limited_bad;
32123
- if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
32124
- }
32125
- result = PyObject_Call(from_bytes, arg_tuple, kwds);
32126
- limited_bad:
32127
- Py_XDECREF(kwds);
32128
- Py_XDECREF(arg_tuple);
32129
- Py_XDECREF(order_str);
32130
- Py_XDECREF(py_bytes);
32131
- Py_XDECREF(from_bytes);
32132
- return result;
32133
- #endif
32134
- }
32135
- }
32136
-
32137
32250
  /* MemviewSliceInit */
32138
32251
  static int
32139
32252
  __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,