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.
- README.md +75 -2
- build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/actions.cpython-311-darwin.so +0 -0
- build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/attack.cpython-311-darwin.so +0 -0
- build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/gift.cpython-311-darwin.so +0 -0
- build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/move.cpython-311-darwin.so +0 -0
- build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/noop.cpython-311-darwin.so +0 -0
- build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/rotate.cpython-311-darwin.so +0 -0
- build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/shield.cpython-311-darwin.so +0 -0
- build/lib.macosx-11.0-arm64-cpython-311/mettagrid/actions/use.cpython-311-darwin.so +0 -0
- build/lib.macosx-11.0-arm64-cpython-311/mettagrid/mettagrid_c.cpython-311-darwin.so +0 -0
- build/lib.macosx-11.0-arm64-cpython-311/mettagrid/objects.cpython-311-darwin.so +0 -0
- build/mettagrid/actions/actions.cpp +706 -593
- build/mettagrid/actions/attack.cpp +1589 -1185
- build/mettagrid/actions/gift.cpp +550 -515
- build/mettagrid/actions/move.cpp +739 -638
- build/mettagrid/actions/noop.cpp +32376 -0
- build/mettagrid/actions/rotate.cpp +550 -545
- build/mettagrid/actions/shield.cpp +594 -531
- build/mettagrid/actions/use.cpp +654 -589
- build/mettagrid/mettagrid.cpp +4011 -1495
- build/mettagrid/objects.cpp +1449 -824
- mettagrid/actions/actions.cpython-311-darwin.so +0 -0
- mettagrid/actions/actions.pxd +2 -2
- mettagrid/actions/actions.pyx +19 -5
- mettagrid/actions/attack.cpython-311-darwin.so +0 -0
- mettagrid/actions/attack.pyx +12 -3
- mettagrid/actions/gift.cpython-311-darwin.so +0 -0
- mettagrid/actions/gift.pyx +4 -1
- mettagrid/actions/move.cpython-311-darwin.so +0 -0
- mettagrid/actions/move.pyx +16 -6
- mettagrid/actions/noop.cpython-311-darwin.so +0 -0
- mettagrid/actions/noop.pxd +4 -0
- mettagrid/actions/noop.pyx +25 -0
- mettagrid/actions/rotate.cpython-311-darwin.so +0 -0
- mettagrid/actions/rotate.pyx +5 -3
- mettagrid/actions/shield.cpython-311-darwin.so +0 -0
- mettagrid/actions/shield.pyx +10 -3
- mettagrid/actions/use.cpython-311-darwin.so +0 -0
- mettagrid/actions/use.pyx +9 -4
- mettagrid/mettagrid.pyx +35 -1
- mettagrid/mettagrid_c.cpython-311-darwin.so +0 -0
- mettagrid/mettagrid_env.py +44 -72
- mettagrid/objects.cpython-311-darwin.so +0 -0
- mettagrid/objects.pxd +25 -12
- mettagrid/objects.pyx +19 -21
- mettagrid/renderer/assets/agent.png +0 -0
- mettagrid/renderer/assets/altar.png +0 -0
- mettagrid/renderer/assets/arial.ttf +0 -0
- mettagrid/renderer/assets/converter.png +0 -0
- mettagrid/renderer/assets/generator.png +0 -0
- mettagrid/renderer/json_renderer.py +0 -0
- mettagrid/renderer/raylib_renderer.py +410 -0
- mettagrid/renderer/render_code_example.py +56 -0
- mettagrid-0.0.3.dist-info/METADATA +96 -0
- mettagrid-0.0.3.dist-info/RECORD +81 -0
- setup.py +1 -0
- test_perf.py +2 -2
- mettagrid/actions.cpython-311-darwin.so +0 -0
- mettagrid/renderer/raylib_client.py +0 -180
- mettagrid-0.0.2.dist-info/METADATA +0 -23
- mettagrid-0.0.2.dist-info/RECORD +0 -70
- /mettagrid/renderer/assets/{tiny_galaxy_items.png → items.png} +0 -0
- /mettagrid/renderer/assets/{tiny_galaxy_monsters.png → monsters.png} +0 -0
- /mettagrid/renderer/assets/{wall1-0.png → wall.png} +0 -0
- {mettagrid-0.0.2.dist-info → mettagrid-0.0.3.dist-info}/LICENSE +0 -0
- {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/
|
|
14
|
-
"/Users/daveey/
|
|
15
|
-
"/Users/daveey/
|
|
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/
|
|
18
|
+
"/Users/daveey/code/metta/deps/puffergrid/puffergrid"
|
|
19
19
|
],
|
|
20
20
|
"language": "c++",
|
|
21
21
|
"name": "mettagrid.actions.shield",
|
|
@@ -1719,7 +1719,7 @@ typedef struct {
|
|
|
1719
1719
|
|
|
1720
1720
|
/* #### Code section: numeric_typedefs ### */
|
|
1721
1721
|
|
|
1722
|
-
/* "
|
|
1722
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":731
|
|
1723
1723
|
* # in Cython to enable them only on the right systems.
|
|
1724
1724
|
*
|
|
1725
1725
|
* ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
|
|
@@ -1728,7 +1728,7 @@ typedef struct {
|
|
|
1728
1728
|
*/
|
|
1729
1729
|
typedef npy_int8 __pyx_t_5numpy_int8_t;
|
|
1730
1730
|
|
|
1731
|
-
/* "
|
|
1731
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":732
|
|
1732
1732
|
*
|
|
1733
1733
|
* ctypedef npy_int8 int8_t
|
|
1734
1734
|
* ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
|
|
@@ -1737,7 +1737,7 @@ typedef npy_int8 __pyx_t_5numpy_int8_t;
|
|
|
1737
1737
|
*/
|
|
1738
1738
|
typedef npy_int16 __pyx_t_5numpy_int16_t;
|
|
1739
1739
|
|
|
1740
|
-
/* "
|
|
1740
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":733
|
|
1741
1741
|
* ctypedef npy_int8 int8_t
|
|
1742
1742
|
* ctypedef npy_int16 int16_t
|
|
1743
1743
|
* ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
|
|
@@ -1746,7 +1746,7 @@ typedef npy_int16 __pyx_t_5numpy_int16_t;
|
|
|
1746
1746
|
*/
|
|
1747
1747
|
typedef npy_int32 __pyx_t_5numpy_int32_t;
|
|
1748
1748
|
|
|
1749
|
-
/* "
|
|
1749
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":734
|
|
1750
1750
|
* ctypedef npy_int16 int16_t
|
|
1751
1751
|
* ctypedef npy_int32 int32_t
|
|
1752
1752
|
* ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
|
|
@@ -1755,7 +1755,7 @@ typedef npy_int32 __pyx_t_5numpy_int32_t;
|
|
|
1755
1755
|
*/
|
|
1756
1756
|
typedef npy_int64 __pyx_t_5numpy_int64_t;
|
|
1757
1757
|
|
|
1758
|
-
/* "
|
|
1758
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":738
|
|
1759
1759
|
* #ctypedef npy_int128 int128_t
|
|
1760
1760
|
*
|
|
1761
1761
|
* ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
|
|
@@ -1764,7 +1764,7 @@ typedef npy_int64 __pyx_t_5numpy_int64_t;
|
|
|
1764
1764
|
*/
|
|
1765
1765
|
typedef npy_uint8 __pyx_t_5numpy_uint8_t;
|
|
1766
1766
|
|
|
1767
|
-
/* "
|
|
1767
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":739
|
|
1768
1768
|
*
|
|
1769
1769
|
* ctypedef npy_uint8 uint8_t
|
|
1770
1770
|
* ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
|
|
@@ -1773,7 +1773,7 @@ typedef npy_uint8 __pyx_t_5numpy_uint8_t;
|
|
|
1773
1773
|
*/
|
|
1774
1774
|
typedef npy_uint16 __pyx_t_5numpy_uint16_t;
|
|
1775
1775
|
|
|
1776
|
-
/* "
|
|
1776
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":740
|
|
1777
1777
|
* ctypedef npy_uint8 uint8_t
|
|
1778
1778
|
* ctypedef npy_uint16 uint16_t
|
|
1779
1779
|
* ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
|
|
@@ -1782,7 +1782,7 @@ typedef npy_uint16 __pyx_t_5numpy_uint16_t;
|
|
|
1782
1782
|
*/
|
|
1783
1783
|
typedef npy_uint32 __pyx_t_5numpy_uint32_t;
|
|
1784
1784
|
|
|
1785
|
-
/* "
|
|
1785
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":741
|
|
1786
1786
|
* ctypedef npy_uint16 uint16_t
|
|
1787
1787
|
* ctypedef npy_uint32 uint32_t
|
|
1788
1788
|
* ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
|
|
@@ -1791,7 +1791,7 @@ typedef npy_uint32 __pyx_t_5numpy_uint32_t;
|
|
|
1791
1791
|
*/
|
|
1792
1792
|
typedef npy_uint64 __pyx_t_5numpy_uint64_t;
|
|
1793
1793
|
|
|
1794
|
-
/* "
|
|
1794
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":745
|
|
1795
1795
|
* #ctypedef npy_uint128 uint128_t
|
|
1796
1796
|
*
|
|
1797
1797
|
* ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
|
|
@@ -1800,7 +1800,7 @@ typedef npy_uint64 __pyx_t_5numpy_uint64_t;
|
|
|
1800
1800
|
*/
|
|
1801
1801
|
typedef npy_float32 __pyx_t_5numpy_float32_t;
|
|
1802
1802
|
|
|
1803
|
-
/* "
|
|
1803
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":746
|
|
1804
1804
|
*
|
|
1805
1805
|
* ctypedef npy_float32 float32_t
|
|
1806
1806
|
* ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
|
|
@@ -1809,7 +1809,7 @@ typedef npy_float32 __pyx_t_5numpy_float32_t;
|
|
|
1809
1809
|
*/
|
|
1810
1810
|
typedef npy_float64 __pyx_t_5numpy_float64_t;
|
|
1811
1811
|
|
|
1812
|
-
/* "
|
|
1812
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":755
|
|
1813
1813
|
* # The int types are mapped a bit surprising --
|
|
1814
1814
|
* # numpy.int corresponds to 'l' and numpy.long to 'q'
|
|
1815
1815
|
* ctypedef npy_long int_t # <<<<<<<<<<<<<<
|
|
@@ -1818,7 +1818,7 @@ typedef npy_float64 __pyx_t_5numpy_float64_t;
|
|
|
1818
1818
|
*/
|
|
1819
1819
|
typedef npy_long __pyx_t_5numpy_int_t;
|
|
1820
1820
|
|
|
1821
|
-
/* "
|
|
1821
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":756
|
|
1822
1822
|
* # numpy.int corresponds to 'l' and numpy.long to 'q'
|
|
1823
1823
|
* ctypedef npy_long int_t
|
|
1824
1824
|
* ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
|
|
@@ -1827,7 +1827,7 @@ typedef npy_long __pyx_t_5numpy_int_t;
|
|
|
1827
1827
|
*/
|
|
1828
1828
|
typedef npy_longlong __pyx_t_5numpy_long_t;
|
|
1829
1829
|
|
|
1830
|
-
/* "
|
|
1830
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":757
|
|
1831
1831
|
* ctypedef npy_long int_t
|
|
1832
1832
|
* ctypedef npy_longlong long_t
|
|
1833
1833
|
* ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
|
|
@@ -1836,7 +1836,7 @@ typedef npy_longlong __pyx_t_5numpy_long_t;
|
|
|
1836
1836
|
*/
|
|
1837
1837
|
typedef npy_longlong __pyx_t_5numpy_longlong_t;
|
|
1838
1838
|
|
|
1839
|
-
/* "
|
|
1839
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":759
|
|
1840
1840
|
* ctypedef npy_longlong longlong_t
|
|
1841
1841
|
*
|
|
1842
1842
|
* ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
|
|
@@ -1845,7 +1845,7 @@ typedef npy_longlong __pyx_t_5numpy_longlong_t;
|
|
|
1845
1845
|
*/
|
|
1846
1846
|
typedef npy_ulong __pyx_t_5numpy_uint_t;
|
|
1847
1847
|
|
|
1848
|
-
/* "
|
|
1848
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":760
|
|
1849
1849
|
*
|
|
1850
1850
|
* ctypedef npy_ulong uint_t
|
|
1851
1851
|
* ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
|
|
@@ -1854,7 +1854,7 @@ typedef npy_ulong __pyx_t_5numpy_uint_t;
|
|
|
1854
1854
|
*/
|
|
1855
1855
|
typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
|
|
1856
1856
|
|
|
1857
|
-
/* "
|
|
1857
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":761
|
|
1858
1858
|
* ctypedef npy_ulong uint_t
|
|
1859
1859
|
* ctypedef npy_ulonglong ulong_t
|
|
1860
1860
|
* ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
|
|
@@ -1863,7 +1863,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
|
|
|
1863
1863
|
*/
|
|
1864
1864
|
typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
|
|
1865
1865
|
|
|
1866
|
-
/* "
|
|
1866
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":763
|
|
1867
1867
|
* ctypedef npy_ulonglong ulonglong_t
|
|
1868
1868
|
*
|
|
1869
1869
|
* ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
|
|
@@ -1872,7 +1872,7 @@ typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
|
|
|
1872
1872
|
*/
|
|
1873
1873
|
typedef npy_intp __pyx_t_5numpy_intp_t;
|
|
1874
1874
|
|
|
1875
|
-
/* "
|
|
1875
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":764
|
|
1876
1876
|
*
|
|
1877
1877
|
* ctypedef npy_intp intp_t
|
|
1878
1878
|
* ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
|
|
@@ -1881,7 +1881,7 @@ typedef npy_intp __pyx_t_5numpy_intp_t;
|
|
|
1881
1881
|
*/
|
|
1882
1882
|
typedef npy_uintp __pyx_t_5numpy_uintp_t;
|
|
1883
1883
|
|
|
1884
|
-
/* "
|
|
1884
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":766
|
|
1885
1885
|
* ctypedef npy_uintp uintp_t
|
|
1886
1886
|
*
|
|
1887
1887
|
* ctypedef npy_double float_t # <<<<<<<<<<<<<<
|
|
@@ -1890,7 +1890,7 @@ typedef npy_uintp __pyx_t_5numpy_uintp_t;
|
|
|
1890
1890
|
*/
|
|
1891
1891
|
typedef npy_double __pyx_t_5numpy_float_t;
|
|
1892
1892
|
|
|
1893
|
-
/* "
|
|
1893
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":767
|
|
1894
1894
|
*
|
|
1895
1895
|
* ctypedef npy_double float_t
|
|
1896
1896
|
* ctypedef npy_double double_t # <<<<<<<<<<<<<<
|
|
@@ -1899,7 +1899,7 @@ typedef npy_double __pyx_t_5numpy_float_t;
|
|
|
1899
1899
|
*/
|
|
1900
1900
|
typedef npy_double __pyx_t_5numpy_double_t;
|
|
1901
1901
|
|
|
1902
|
-
/* "
|
|
1902
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":768
|
|
1903
1903
|
* ctypedef npy_double float_t
|
|
1904
1904
|
* ctypedef npy_double double_t
|
|
1905
1905
|
* ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
|
|
@@ -1977,7 +1977,7 @@ struct __pyx_MemviewEnum_obj;
|
|
|
1977
1977
|
struct __pyx_memoryview_obj;
|
|
1978
1978
|
struct __pyx_memoryviewslice_obj;
|
|
1979
1979
|
|
|
1980
|
-
/* "
|
|
1980
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":770
|
|
1981
1981
|
* ctypedef npy_longdouble longdouble_t
|
|
1982
1982
|
*
|
|
1983
1983
|
* ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
|
|
@@ -1986,7 +1986,7 @@ struct __pyx_memoryviewslice_obj;
|
|
|
1986
1986
|
*/
|
|
1987
1987
|
typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
|
|
1988
1988
|
|
|
1989
|
-
/* "
|
|
1989
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":771
|
|
1990
1990
|
*
|
|
1991
1991
|
* ctypedef npy_cfloat cfloat_t
|
|
1992
1992
|
* ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
|
|
@@ -1995,7 +1995,7 @@ typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
|
|
|
1995
1995
|
*/
|
|
1996
1996
|
typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
|
|
1997
1997
|
|
|
1998
|
-
/* "
|
|
1998
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":772
|
|
1999
1999
|
* ctypedef npy_cfloat cfloat_t
|
|
2000
2000
|
* ctypedef npy_cdouble cdouble_t
|
|
2001
2001
|
* ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
|
|
@@ -2004,7 +2004,7 @@ typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
|
|
|
2004
2004
|
*/
|
|
2005
2005
|
typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
|
|
2006
2006
|
|
|
2007
|
-
/* "
|
|
2007
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":774
|
|
2008
2008
|
* ctypedef npy_clongdouble clongdouble_t
|
|
2009
2009
|
*
|
|
2010
2010
|
* ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
|
|
@@ -2020,7 +2020,7 @@ struct __pyx_t_9mettagrid_7objects_Generator;
|
|
|
2020
2020
|
struct __pyx_t_9mettagrid_7objects_Converter;
|
|
2021
2021
|
struct __pyx_t_9mettagrid_7objects_Altar;
|
|
2022
2022
|
|
|
2023
|
-
/* "mettagrid/objects.pxd":
|
|
2023
|
+
/* "mettagrid/objects.pxd":16
|
|
2024
2024
|
* from puffergrid.event cimport EventHandler, EventArg
|
|
2025
2025
|
*
|
|
2026
2026
|
* cdef enum GridLayer: # <<<<<<<<<<<<<<
|
|
@@ -2032,7 +2032,7 @@ enum __pyx_t_9mettagrid_7objects_GridLayer {
|
|
|
2032
2032
|
__pyx_e_9mettagrid_7objects_Object_Layer = 1
|
|
2033
2033
|
};
|
|
2034
2034
|
|
|
2035
|
-
/* "mettagrid/objects.pxd":
|
|
2035
|
+
/* "mettagrid/objects.pxd":44
|
|
2036
2036
|
* return this.ready and this.use_cost <= actor.energy
|
|
2037
2037
|
*
|
|
2038
2038
|
* cdef enum ObjectType: # <<<<<<<<<<<<<<
|
|
@@ -2048,7 +2048,7 @@ enum __pyx_t_9mettagrid_7objects_ObjectType {
|
|
|
2048
2048
|
__pyx_e_9mettagrid_7objects_Count = 5
|
|
2049
2049
|
};
|
|
2050
2050
|
|
|
2051
|
-
/* "mettagrid/objects.pxd":
|
|
2051
|
+
/* "mettagrid/objects.pxd":54
|
|
2052
2052
|
* cdef vector[string] ObjectTypeNames # defined in objects.pyx
|
|
2053
2053
|
*
|
|
2054
2054
|
* cdef enum InventoryItem: # <<<<<<<<<<<<<<
|
|
@@ -2062,7 +2062,7 @@ enum __pyx_t_9mettagrid_7objects_InventoryItem {
|
|
|
2062
2062
|
__pyx_e_9mettagrid_7objects_InventoryCount = 3
|
|
2063
2063
|
};
|
|
2064
2064
|
|
|
2065
|
-
/* "mettagrid/objects.pxd":
|
|
2065
|
+
/* "mettagrid/objects.pxd":202
|
|
2066
2066
|
* self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
|
|
2067
2067
|
*
|
|
2068
2068
|
* cdef enum Events: # <<<<<<<<<<<<<<
|
|
@@ -2073,7 +2073,7 @@ enum __pyx_t_9mettagrid_7objects_Events {
|
|
|
2073
2073
|
__pyx_e_9mettagrid_7objects_Reset = 0
|
|
2074
2074
|
};
|
|
2075
2075
|
|
|
2076
|
-
/* "mettagrid/objects.pxd":
|
|
2076
|
+
/* "mettagrid/objects.pxd":20
|
|
2077
2077
|
* Object_Layer = 1
|
|
2078
2078
|
*
|
|
2079
2079
|
* ctypedef map[string, int] ObjectConfig # <<<<<<<<<<<<<<
|
|
@@ -2083,7 +2083,7 @@ enum __pyx_t_9mettagrid_7objects_Events {
|
|
|
2083
2083
|
typedef std::map<std::string,int> __pyx_t_9mettagrid_7objects_ObjectConfig;
|
|
2084
2084
|
struct __pyx_t_9mettagrid_7objects_MettaObject : public GridObject {
|
|
2085
2085
|
|
|
2086
|
-
/* "mettagrid/objects.pxd":
|
|
2086
|
+
/* "mettagrid/objects.pxd":22
|
|
2087
2087
|
* ctypedef map[string, int] ObjectConfig
|
|
2088
2088
|
*
|
|
2089
2089
|
* cdef cppclass MettaObject(GridObject): # <<<<<<<<<<<<<<
|
|
@@ -2092,14 +2092,13 @@ struct __pyx_t_9mettagrid_7objects_MettaObject : public GridObject {
|
|
|
2092
2092
|
*/
|
|
2093
2093
|
unsigned int hp;
|
|
2094
2094
|
virtual void init_mo(__pyx_t_9mettagrid_7objects_ObjectConfig);
|
|
2095
|
-
virtual
|
|
2096
|
-
virtual char attackable(void);
|
|
2095
|
+
virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
|
|
2097
2096
|
virtual ~__pyx_t_9mettagrid_7objects_MettaObject() {
|
|
2098
2097
|
}
|
|
2099
2098
|
};
|
|
2100
2099
|
struct __pyx_t_9mettagrid_7objects_Usable : public __pyx_t_9mettagrid_7objects_MettaObject {
|
|
2101
2100
|
|
|
2102
|
-
/* "mettagrid/objects.pxd":
|
|
2101
|
+
/* "mettagrid/objects.pxd":31
|
|
2103
2102
|
* return False
|
|
2104
2103
|
*
|
|
2105
2104
|
* cdef cppclass Usable(MettaObject): # <<<<<<<<<<<<<<
|
|
@@ -2110,24 +2109,28 @@ struct __pyx_t_9mettagrid_7objects_Usable : public __pyx_t_9mettagrid_7objects_M
|
|
|
2110
2109
|
unsigned int cooldown;
|
|
2111
2110
|
unsigned char ready;
|
|
2112
2111
|
virtual void init_usable(__pyx_t_9mettagrid_7objects_ObjectConfig);
|
|
2113
|
-
virtual
|
|
2112
|
+
virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
|
|
2114
2113
|
virtual ~__pyx_t_9mettagrid_7objects_Usable() {
|
|
2115
2114
|
}
|
|
2116
2115
|
};
|
|
2117
2116
|
struct __pyx_t_9mettagrid_7objects_Agent : public __pyx_t_9mettagrid_7objects_MettaObject {
|
|
2118
2117
|
|
|
2119
|
-
/* "mettagrid/objects.pxd":
|
|
2118
|
+
/* "mettagrid/objects.pxd":63
|
|
2120
2119
|
*
|
|
2121
2120
|
*
|
|
2122
2121
|
* cdef cppclass Agent(MettaObject): # <<<<<<<<<<<<<<
|
|
2123
|
-
*
|
|
2124
|
-
* unsigned int
|
|
2122
|
+
* unsigned int frozen
|
|
2123
|
+
* unsigned int freeze_duration
|
|
2125
2124
|
*/
|
|
2126
|
-
|
|
2127
|
-
unsigned int
|
|
2125
|
+
unsigned int frozen;
|
|
2126
|
+
unsigned int freeze_duration;
|
|
2127
|
+
unsigned char energy;
|
|
2128
2128
|
unsigned int orientation;
|
|
2129
|
-
char shield;
|
|
2130
|
-
|
|
2129
|
+
unsigned char shield;
|
|
2130
|
+
unsigned char shield_upkeep;
|
|
2131
|
+
std::vector<unsigned char> inventory;
|
|
2132
|
+
unsigned char max_items;
|
|
2133
|
+
unsigned char max_energy;
|
|
2131
2134
|
void __pyx_f___init__Agent(GridCoord, GridCoord, __pyx_t_9mettagrid_7objects_ObjectConfig &);
|
|
2132
2135
|
virtual void update_inventory(enum __pyx_t_9mettagrid_7objects_InventoryItem, short);
|
|
2133
2136
|
virtual void obs(__Pyx_memviewslice);
|
|
@@ -2140,7 +2143,7 @@ struct __pyx_t_9mettagrid_7objects_Agent : public __pyx_t_9mettagrid_7objects_Me
|
|
|
2140
2143
|
};
|
|
2141
2144
|
struct __pyx_t_9mettagrid_7objects_Wall : public __pyx_t_9mettagrid_7objects_MettaObject {
|
|
2142
2145
|
|
|
2143
|
-
/* "mettagrid/objects.pxd":
|
|
2146
|
+
/* "mettagrid/objects.pxd":112
|
|
2144
2147
|
* "agent:inv:" + n for n in InventoryItemNames]
|
|
2145
2148
|
*
|
|
2146
2149
|
* cdef cppclass Wall(MettaObject): # <<<<<<<<<<<<<<
|
|
@@ -2158,7 +2161,7 @@ struct __pyx_t_9mettagrid_7objects_Wall : public __pyx_t_9mettagrid_7objects_Met
|
|
|
2158
2161
|
};
|
|
2159
2162
|
struct __pyx_t_9mettagrid_7objects_Generator : public __pyx_t_9mettagrid_7objects_Usable {
|
|
2160
2163
|
|
|
2161
|
-
/* "mettagrid/objects.pxd":
|
|
2164
|
+
/* "mettagrid/objects.pxd":125
|
|
2162
2165
|
* return ["wall", "wall:hp"]
|
|
2163
2166
|
*
|
|
2164
2167
|
* cdef cppclass Generator(Usable): # <<<<<<<<<<<<<<
|
|
@@ -2167,7 +2170,7 @@ struct __pyx_t_9mettagrid_7objects_Generator : public __pyx_t_9mettagrid_7object
|
|
|
2167
2170
|
*/
|
|
2168
2171
|
unsigned int r1;
|
|
2169
2172
|
void __pyx_f___init__Generator(GridCoord, GridCoord, __pyx_t_9mettagrid_7objects_ObjectConfig &);
|
|
2170
|
-
virtual
|
|
2173
|
+
virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
|
|
2171
2174
|
virtual void obs(__Pyx_memviewslice);
|
|
2172
2175
|
static std::vector<std::string> feature_names(void);
|
|
2173
2176
|
__pyx_t_9mettagrid_7objects_Generator(GridCoord __pyx_v_r, GridCoord __pyx_v_c, __pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
|
|
@@ -2178,7 +2181,7 @@ struct __pyx_t_9mettagrid_7objects_Generator : public __pyx_t_9mettagrid_7object
|
|
|
2178
2181
|
};
|
|
2179
2182
|
struct __pyx_t_9mettagrid_7objects_Converter : public __pyx_t_9mettagrid_7objects_Usable {
|
|
2180
2183
|
|
|
2181
|
-
/* "mettagrid/objects.pxd":
|
|
2184
|
+
/* "mettagrid/objects.pxd":148
|
|
2182
2185
|
* return ["generator", "generator:hp", "generator:r1", "generator:ready"]
|
|
2183
2186
|
*
|
|
2184
2187
|
* cdef cppclass Converter(Usable): # <<<<<<<<<<<<<<
|
|
@@ -2189,7 +2192,7 @@ struct __pyx_t_9mettagrid_7objects_Converter : public __pyx_t_9mettagrid_7object
|
|
|
2189
2192
|
enum __pyx_t_9mettagrid_7objects_InventoryItem output_resource;
|
|
2190
2193
|
short output_energy;
|
|
2191
2194
|
void __pyx_f___init__Converter(GridCoord, GridCoord, __pyx_t_9mettagrid_7objects_ObjectConfig &);
|
|
2192
|
-
virtual
|
|
2195
|
+
virtual int usable(__pyx_t_9mettagrid_7objects_Agent const *);
|
|
2193
2196
|
virtual PyObject *obs(__Pyx_memviewslice);
|
|
2194
2197
|
static std::vector<std::string> feature_names(void);
|
|
2195
2198
|
__pyx_t_9mettagrid_7objects_Converter(GridCoord __pyx_v_r, GridCoord __pyx_v_c, __pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
|
|
@@ -2200,7 +2203,7 @@ struct __pyx_t_9mettagrid_7objects_Converter : public __pyx_t_9mettagrid_7object
|
|
|
2200
2203
|
};
|
|
2201
2204
|
struct __pyx_t_9mettagrid_7objects_Altar : public __pyx_t_9mettagrid_7objects_Usable {
|
|
2202
2205
|
|
|
2203
|
-
/* "mettagrid/objects.pxd":
|
|
2206
|
+
/* "mettagrid/objects.pxd":176
|
|
2204
2207
|
* return ["converter", "converter:hp", "converter:input_resource", "converter:output_resource", "converter:output_energy", "converter:ready"]
|
|
2205
2208
|
*
|
|
2206
2209
|
* cdef cppclass Altar(Usable): # <<<<<<<<<<<<<<
|
|
@@ -2307,6 +2310,8 @@ struct __pyx_obj_10puffergrid_8grid_env_GridEnv {
|
|
|
2307
2310
|
unsigned int _current_timestep;
|
|
2308
2311
|
unsigned int _max_timestep;
|
|
2309
2312
|
PyObject *_action_handlers;
|
|
2313
|
+
std::vector<unsigned char> _max_action_args;
|
|
2314
|
+
unsigned char _max_action_arg;
|
|
2310
2315
|
struct __pyx_obj_10puffergrid_19observation_encoder_ObservationEncoder *_obs_encoder;
|
|
2311
2316
|
unsigned short _obs_width;
|
|
2312
2317
|
unsigned short _obs_height;
|
|
@@ -2340,7 +2345,7 @@ struct __pyx_obj_10puffergrid_6action_ActionHandler {
|
|
|
2340
2345
|
};
|
|
2341
2346
|
|
|
2342
2347
|
|
|
2343
|
-
/* "mettagrid/objects.pxd":
|
|
2348
|
+
/* "mettagrid/objects.pxd":193
|
|
2344
2349
|
* cdef map[TypeId, GridLayer] ObjectLayers
|
|
2345
2350
|
*
|
|
2346
2351
|
* cdef class ResetHandler(EventHandler): # <<<<<<<<<<<<<<
|
|
@@ -2352,17 +2357,18 @@ struct __pyx_obj_9mettagrid_7objects_ResetHandler {
|
|
|
2352
2357
|
};
|
|
2353
2358
|
|
|
2354
2359
|
|
|
2355
|
-
/* "mettagrid/objects.pxd":
|
|
2360
|
+
/* "mettagrid/objects.pxd":205
|
|
2356
2361
|
* Reset = 0
|
|
2357
2362
|
*
|
|
2358
2363
|
* cdef class MettaObservationEncoder(ObservationEncoder): # <<<<<<<<<<<<<<
|
|
2364
|
+
* cdef _encode(self, GridObject *obj, ObsType[:] obs, unsigned int offset)
|
|
2359
2365
|
* cdef vector[short] _offsets
|
|
2360
|
-
* cdef vector[string] _feature_names
|
|
2361
2366
|
*/
|
|
2362
2367
|
struct __pyx_obj_9mettagrid_7objects_MettaObservationEncoder {
|
|
2363
2368
|
struct __pyx_obj_10puffergrid_19observation_encoder_ObservationEncoder __pyx_base;
|
|
2364
2369
|
std::vector<short> _offsets;
|
|
2365
2370
|
std::vector<std::string> _feature_names;
|
|
2371
|
+
std::vector<std::vector<std::string> > _type_feature_names;
|
|
2366
2372
|
};
|
|
2367
2373
|
|
|
2368
2374
|
|
|
@@ -2563,7 +2569,7 @@ struct __pyx_vtabstruct_10puffergrid_8grid_env_GridEnv {
|
|
|
2563
2569
|
PyObject *(*get_episode_rewards)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, int __pyx_skip_dispatch);
|
|
2564
2570
|
PyObject *(*get_buffers)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, int __pyx_skip_dispatch);
|
|
2565
2571
|
PyArrayObject *(*render_ascii)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, PyObject *, int __pyx_skip_dispatch);
|
|
2566
|
-
PyArrayObject *(*
|
|
2572
|
+
PyArrayObject *(*grid_objects_types)(struct __pyx_obj_10puffergrid_8grid_env_GridEnv *, int __pyx_skip_dispatch);
|
|
2567
2573
|
};
|
|
2568
2574
|
static struct __pyx_vtabstruct_10puffergrid_8grid_env_GridEnv *__pyx_vtabptr_10puffergrid_8grid_env_GridEnv;
|
|
2569
2575
|
|
|
@@ -2578,12 +2584,13 @@ static struct __pyx_vtabstruct_10puffergrid_8grid_env_GridEnv *__pyx_vtabptr_10p
|
|
|
2578
2584
|
|
|
2579
2585
|
struct __pyx_vtabstruct_10puffergrid_6action_ActionHandler {
|
|
2580
2586
|
void (*init)(struct __pyx_obj_10puffergrid_6action_ActionHandler *, struct __pyx_obj_10puffergrid_8grid_env_GridEnv *);
|
|
2581
|
-
|
|
2587
|
+
int (*handle_action)(struct __pyx_obj_10puffergrid_6action_ActionHandler *, unsigned int, GridObjectId, __pyx_t_10puffergrid_6action_ActionArg);
|
|
2588
|
+
unsigned char (*max_arg)(struct __pyx_obj_10puffergrid_6action_ActionHandler *);
|
|
2582
2589
|
};
|
|
2583
2590
|
static struct __pyx_vtabstruct_10puffergrid_6action_ActionHandler *__pyx_vtabptr_10puffergrid_6action_ActionHandler;
|
|
2584
2591
|
|
|
2585
2592
|
|
|
2586
|
-
/* "mettagrid/objects.pxd":
|
|
2593
|
+
/* "mettagrid/objects.pxd":193
|
|
2587
2594
|
* cdef map[TypeId, GridLayer] ObjectLayers
|
|
2588
2595
|
*
|
|
2589
2596
|
* cdef class ResetHandler(EventHandler): # <<<<<<<<<<<<<<
|
|
@@ -2597,16 +2604,17 @@ struct __pyx_vtabstruct_9mettagrid_7objects_ResetHandler {
|
|
|
2597
2604
|
static struct __pyx_vtabstruct_9mettagrid_7objects_ResetHandler *__pyx_vtabptr_9mettagrid_7objects_ResetHandler;
|
|
2598
2605
|
|
|
2599
2606
|
|
|
2600
|
-
/* "mettagrid/objects.pxd":
|
|
2607
|
+
/* "mettagrid/objects.pxd":205
|
|
2601
2608
|
* Reset = 0
|
|
2602
2609
|
*
|
|
2603
2610
|
* cdef class MettaObservationEncoder(ObservationEncoder): # <<<<<<<<<<<<<<
|
|
2611
|
+
* cdef _encode(self, GridObject *obj, ObsType[:] obs, unsigned int offset)
|
|
2604
2612
|
* cdef vector[short] _offsets
|
|
2605
|
-
* cdef vector[string] _feature_names
|
|
2606
2613
|
*/
|
|
2607
2614
|
|
|
2608
2615
|
struct __pyx_vtabstruct_9mettagrid_7objects_MettaObservationEncoder {
|
|
2609
2616
|
struct __pyx_vtabstruct_10puffergrid_19observation_encoder_ObservationEncoder __pyx_base;
|
|
2617
|
+
PyObject *(*_encode)(struct __pyx_obj_9mettagrid_7objects_MettaObservationEncoder *, GridObject *, __Pyx_memviewslice, unsigned int);
|
|
2610
2618
|
};
|
|
2611
2619
|
static struct __pyx_vtabstruct_9mettagrid_7objects_MettaObservationEncoder *__pyx_vtabptr_9mettagrid_7objects_MettaObservationEncoder;
|
|
2612
2620
|
|
|
@@ -2621,7 +2629,7 @@ static struct __pyx_vtabstruct_9mettagrid_7objects_MettaObservationEncoder *__py
|
|
|
2621
2629
|
|
|
2622
2630
|
struct __pyx_vtabstruct_9mettagrid_7actions_7actions_MettaActionHandler {
|
|
2623
2631
|
struct __pyx_vtabstruct_10puffergrid_6action_ActionHandler __pyx_base;
|
|
2624
|
-
|
|
2632
|
+
int (*_handle_action)(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *, unsigned int, __pyx_t_9mettagrid_7objects_Agent *, __pyx_t_10puffergrid_6action_ActionArg);
|
|
2625
2633
|
};
|
|
2626
2634
|
static struct __pyx_vtabstruct_9mettagrid_7actions_7actions_MettaActionHandler *__pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler;
|
|
2627
2635
|
|
|
@@ -3749,9 +3757,6 @@ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum____pyx_t_9mettagrid_7object
|
|
|
3749
3757
|
/* CIntFromPy.proto */
|
|
3750
3758
|
static CYTHON_INLINE unsigned short __Pyx_PyInt_As_unsigned_short(PyObject *);
|
|
3751
3759
|
|
|
3752
|
-
/* CIntToPy.proto */
|
|
3753
|
-
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value);
|
|
3754
|
-
|
|
3755
3760
|
/* CIntFromPy.proto */
|
|
3756
3761
|
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
|
|
3757
3762
|
|
|
@@ -3811,7 +3816,8 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
|
|
|
3811
3816
|
static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self); /* proto*/
|
|
3812
3817
|
static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self); /* proto*/
|
|
3813
3818
|
static void __pyx_f_9mettagrid_7objects_12ResetHandler_handle_event(struct __pyx_obj_9mettagrid_7objects_ResetHandler *__pyx_v_self, GridObjectId __pyx_v_obj_id, CYTHON_UNUSED EventArg __pyx_v_arg); /* proto*/
|
|
3814
|
-
static char
|
|
3819
|
+
static unsigned char __pyx_f_9mettagrid_7actions_6shield_6Shield_max_arg(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_6shield_Shield *__pyx_v_self); /* proto*/
|
|
3820
|
+
static int __pyx_f_9mettagrid_7actions_6shield_6Shield__handle_action(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_6shield_Shield *__pyx_v_self, CYTHON_UNUSED unsigned int __pyx_v_actor_id, __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, CYTHON_UNUSED __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg); /* proto*/
|
|
3815
3821
|
|
|
3816
3822
|
/* Module declarations from "libc.string" */
|
|
3817
3823
|
|
|
@@ -4025,6 +4031,7 @@ static const char __pyx_k_pyx_state[] = "__pyx_state";
|
|
|
4025
4031
|
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
|
|
4026
4032
|
static const char __pyx_k_IndexError[] = "IndexError";
|
|
4027
4033
|
static const char __pyx_k_ValueError[] = "ValueError";
|
|
4034
|
+
static const char __pyx_k_max_energy[] = "max_energy";
|
|
4028
4035
|
static const char __pyx_k_pyx_result[] = "__pyx_result";
|
|
4029
4036
|
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
|
|
4030
4037
|
static const char __pyx_k_ImportError[] = "ImportError";
|
|
@@ -4044,7 +4051,9 @@ static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
|
|
|
4044
4051
|
static const char __pyx_k_stringsource[] = "<stringsource>";
|
|
4045
4052
|
static const char __pyx_k_version_info[] = "version_info";
|
|
4046
4053
|
static const char __pyx_k_class_getitem[] = "__class_getitem__";
|
|
4054
|
+
static const char __pyx_k_max_inventory[] = "max_inventory";
|
|
4047
4055
|
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
|
|
4056
|
+
static const char __pyx_k_upkeep_shield[] = "upkeep.shield";
|
|
4048
4057
|
static const char __pyx_k_AssertionError[] = "AssertionError";
|
|
4049
4058
|
static const char __pyx_k_initial_energy[] = "initial_energy";
|
|
4050
4059
|
static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
|
|
@@ -4052,6 +4061,7 @@ static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
|
|
|
4052
4061
|
static const char __pyx_k_collections_abc[] = "collections.abc";
|
|
4053
4062
|
static const char __pyx_k_converter_ready[] = "converter:ready";
|
|
4054
4063
|
static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
|
|
4064
|
+
static const char __pyx_k_freeze_duration[] = "freeze_duration";
|
|
4055
4065
|
static const char __pyx_k_generator_ready[] = "generator:ready";
|
|
4056
4066
|
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
|
|
4057
4067
|
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
|
|
@@ -19326,7 +19336,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
|
|
|
19326
19336
|
return __pyx_r;
|
|
19327
19337
|
}
|
|
19328
19338
|
|
|
19329
|
-
/* "
|
|
19339
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
|
|
19330
19340
|
*
|
|
19331
19341
|
* @property
|
|
19332
19342
|
* cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19337,7 +19347,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__
|
|
|
19337
19347
|
static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject *__pyx_v_self) {
|
|
19338
19348
|
PyObject *__pyx_r;
|
|
19339
19349
|
|
|
19340
|
-
/* "
|
|
19350
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":248
|
|
19341
19351
|
* """Returns a borrowed reference to the object owning the data/memory.
|
|
19342
19352
|
* """
|
|
19343
19353
|
* return PyArray_BASE(self) # <<<<<<<<<<<<<<
|
|
@@ -19347,7 +19357,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject
|
|
|
19347
19357
|
__pyx_r = PyArray_BASE(__pyx_v_self);
|
|
19348
19358
|
goto __pyx_L0;
|
|
19349
19359
|
|
|
19350
|
-
/* "
|
|
19360
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":245
|
|
19351
19361
|
*
|
|
19352
19362
|
* @property
|
|
19353
19363
|
* cdef inline PyObject* base(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19360,7 +19370,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_7ndarray_4base_base(PyArrayObject
|
|
|
19360
19370
|
return __pyx_r;
|
|
19361
19371
|
}
|
|
19362
19372
|
|
|
19363
|
-
/* "
|
|
19373
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
|
|
19364
19374
|
*
|
|
19365
19375
|
* @property
|
|
19366
19376
|
* cdef inline dtype descr(self): # <<<<<<<<<<<<<<
|
|
@@ -19374,7 +19384,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
|
|
|
19374
19384
|
PyArray_Descr *__pyx_t_1;
|
|
19375
19385
|
__Pyx_RefNannySetupContext("descr", 1);
|
|
19376
19386
|
|
|
19377
|
-
/* "
|
|
19387
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":254
|
|
19378
19388
|
* """Returns an owned reference to the dtype of the array.
|
|
19379
19389
|
* """
|
|
19380
19390
|
* return <dtype>PyArray_DESCR(self) # <<<<<<<<<<<<<<
|
|
@@ -19387,7 +19397,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
|
|
|
19387
19397
|
__pyx_r = ((PyArray_Descr *)__pyx_t_1);
|
|
19388
19398
|
goto __pyx_L0;
|
|
19389
19399
|
|
|
19390
|
-
/* "
|
|
19400
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":251
|
|
19391
19401
|
*
|
|
19392
19402
|
* @property
|
|
19393
19403
|
* cdef inline dtype descr(self): # <<<<<<<<<<<<<<
|
|
@@ -19402,7 +19412,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
|
|
|
19402
19412
|
return __pyx_r;
|
|
19403
19413
|
}
|
|
19404
19414
|
|
|
19405
|
-
/* "
|
|
19415
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
|
|
19406
19416
|
*
|
|
19407
19417
|
* @property
|
|
19408
19418
|
* cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19413,7 +19423,7 @@ static CYTHON_INLINE PyArray_Descr *__pyx_f_5numpy_7ndarray_5descr_descr(PyArray
|
|
|
19413
19423
|
static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx_v_self) {
|
|
19414
19424
|
int __pyx_r;
|
|
19415
19425
|
|
|
19416
|
-
/* "
|
|
19426
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":260
|
|
19417
19427
|
* """Returns the number of dimensions in the array.
|
|
19418
19428
|
* """
|
|
19419
19429
|
* return PyArray_NDIM(self) # <<<<<<<<<<<<<<
|
|
@@ -19423,7 +19433,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
|
|
|
19423
19433
|
__pyx_r = PyArray_NDIM(__pyx_v_self);
|
|
19424
19434
|
goto __pyx_L0;
|
|
19425
19435
|
|
|
19426
|
-
/* "
|
|
19436
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":257
|
|
19427
19437
|
*
|
|
19428
19438
|
* @property
|
|
19429
19439
|
* cdef inline int ndim(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19436,7 +19446,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
|
|
|
19436
19446
|
return __pyx_r;
|
|
19437
19447
|
}
|
|
19438
19448
|
|
|
19439
|
-
/* "
|
|
19449
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
|
|
19440
19450
|
*
|
|
19441
19451
|
* @property
|
|
19442
19452
|
* cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19447,7 +19457,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_7ndarray_4ndim_ndim(PyArrayObject *__pyx
|
|
|
19447
19457
|
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObject *__pyx_v_self) {
|
|
19448
19458
|
npy_intp *__pyx_r;
|
|
19449
19459
|
|
|
19450
|
-
/* "
|
|
19460
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":268
|
|
19451
19461
|
* Can return NULL for 0-dimensional arrays.
|
|
19452
19462
|
* """
|
|
19453
19463
|
* return PyArray_DIMS(self) # <<<<<<<<<<<<<<
|
|
@@ -19457,7 +19467,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
|
|
|
19457
19467
|
__pyx_r = PyArray_DIMS(__pyx_v_self);
|
|
19458
19468
|
goto __pyx_L0;
|
|
19459
19469
|
|
|
19460
|
-
/* "
|
|
19470
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":263
|
|
19461
19471
|
*
|
|
19462
19472
|
* @property
|
|
19463
19473
|
* cdef inline npy_intp *shape(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19470,7 +19480,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
|
|
|
19470
19480
|
return __pyx_r;
|
|
19471
19481
|
}
|
|
19472
19482
|
|
|
19473
|
-
/* "
|
|
19483
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
|
|
19474
19484
|
*
|
|
19475
19485
|
* @property
|
|
19476
19486
|
* cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19481,7 +19491,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_5shape_shape(PyArrayObjec
|
|
|
19481
19491
|
static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayObject *__pyx_v_self) {
|
|
19482
19492
|
npy_intp *__pyx_r;
|
|
19483
19493
|
|
|
19484
|
-
/* "
|
|
19494
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":275
|
|
19485
19495
|
* The number of elements matches the number of dimensions of the array (ndim).
|
|
19486
19496
|
* """
|
|
19487
19497
|
* return PyArray_STRIDES(self) # <<<<<<<<<<<<<<
|
|
@@ -19491,7 +19501,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
|
|
|
19491
19501
|
__pyx_r = PyArray_STRIDES(__pyx_v_self);
|
|
19492
19502
|
goto __pyx_L0;
|
|
19493
19503
|
|
|
19494
|
-
/* "
|
|
19504
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":271
|
|
19495
19505
|
*
|
|
19496
19506
|
* @property
|
|
19497
19507
|
* cdef inline npy_intp *strides(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19504,7 +19514,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
|
|
|
19504
19514
|
return __pyx_r;
|
|
19505
19515
|
}
|
|
19506
19516
|
|
|
19507
|
-
/* "
|
|
19517
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
|
|
19508
19518
|
*
|
|
19509
19519
|
* @property
|
|
19510
19520
|
* cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19515,7 +19525,7 @@ static CYTHON_INLINE npy_intp *__pyx_f_5numpy_7ndarray_7strides_strides(PyArrayO
|
|
|
19515
19525
|
static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *__pyx_v_self) {
|
|
19516
19526
|
npy_intp __pyx_r;
|
|
19517
19527
|
|
|
19518
|
-
/* "
|
|
19528
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":281
|
|
19519
19529
|
* """Returns the total size (in number of elements) of the array.
|
|
19520
19530
|
* """
|
|
19521
19531
|
* return PyArray_SIZE(self) # <<<<<<<<<<<<<<
|
|
@@ -19525,7 +19535,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
|
|
|
19525
19535
|
__pyx_r = PyArray_SIZE(__pyx_v_self);
|
|
19526
19536
|
goto __pyx_L0;
|
|
19527
19537
|
|
|
19528
|
-
/* "
|
|
19538
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":278
|
|
19529
19539
|
*
|
|
19530
19540
|
* @property
|
|
19531
19541
|
* cdef inline npy_intp size(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19538,7 +19548,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
|
|
|
19538
19548
|
return __pyx_r;
|
|
19539
19549
|
}
|
|
19540
19550
|
|
|
19541
|
-
/* "
|
|
19551
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
|
|
19542
19552
|
*
|
|
19543
19553
|
* @property
|
|
19544
19554
|
* cdef inline char* data(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19549,7 +19559,7 @@ static CYTHON_INLINE npy_intp __pyx_f_5numpy_7ndarray_4size_size(PyArrayObject *
|
|
|
19549
19559
|
static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__pyx_v_self) {
|
|
19550
19560
|
char *__pyx_r;
|
|
19551
19561
|
|
|
19552
|
-
/* "
|
|
19562
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":290
|
|
19553
19563
|
* of `PyArray_DATA()` instead, which returns a 'void*'.
|
|
19554
19564
|
* """
|
|
19555
19565
|
* return PyArray_BYTES(self) # <<<<<<<<<<<<<<
|
|
@@ -19559,7 +19569,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p
|
|
|
19559
19569
|
__pyx_r = PyArray_BYTES(__pyx_v_self);
|
|
19560
19570
|
goto __pyx_L0;
|
|
19561
19571
|
|
|
19562
|
-
/* "
|
|
19572
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":284
|
|
19563
19573
|
*
|
|
19564
19574
|
* @property
|
|
19565
19575
|
* cdef inline char* data(self) nogil: # <<<<<<<<<<<<<<
|
|
@@ -19572,7 +19582,7 @@ static CYTHON_INLINE char *__pyx_f_5numpy_7ndarray_4data_data(PyArrayObject *__p
|
|
|
19572
19582
|
return __pyx_r;
|
|
19573
19583
|
}
|
|
19574
19584
|
|
|
19575
|
-
/* "
|
|
19585
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
|
|
19576
19586
|
* ctypedef npy_cdouble complex_t
|
|
19577
19587
|
*
|
|
19578
19588
|
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
|
|
@@ -19589,7 +19599,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
|
|
|
19589
19599
|
int __pyx_clineno = 0;
|
|
19590
19600
|
__Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 1);
|
|
19591
19601
|
|
|
19592
|
-
/* "
|
|
19602
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":777
|
|
19593
19603
|
*
|
|
19594
19604
|
* cdef inline object PyArray_MultiIterNew1(a):
|
|
19595
19605
|
* return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
|
|
@@ -19603,7 +19613,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
|
|
|
19603
19613
|
__pyx_t_1 = 0;
|
|
19604
19614
|
goto __pyx_L0;
|
|
19605
19615
|
|
|
19606
|
-
/* "
|
|
19616
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":776
|
|
19607
19617
|
* ctypedef npy_cdouble complex_t
|
|
19608
19618
|
*
|
|
19609
19619
|
* cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
|
|
@@ -19622,7 +19632,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__
|
|
|
19622
19632
|
return __pyx_r;
|
|
19623
19633
|
}
|
|
19624
19634
|
|
|
19625
|
-
/* "
|
|
19635
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
|
|
19626
19636
|
* return PyArray_MultiIterNew(1, <void*>a)
|
|
19627
19637
|
*
|
|
19628
19638
|
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
|
|
@@ -19639,7 +19649,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
|
|
|
19639
19649
|
int __pyx_clineno = 0;
|
|
19640
19650
|
__Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 1);
|
|
19641
19651
|
|
|
19642
|
-
/* "
|
|
19652
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":780
|
|
19643
19653
|
*
|
|
19644
19654
|
* cdef inline object PyArray_MultiIterNew2(a, b):
|
|
19645
19655
|
* return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
|
|
@@ -19653,7 +19663,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
|
|
|
19653
19663
|
__pyx_t_1 = 0;
|
|
19654
19664
|
goto __pyx_L0;
|
|
19655
19665
|
|
|
19656
|
-
/* "
|
|
19666
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":779
|
|
19657
19667
|
* return PyArray_MultiIterNew(1, <void*>a)
|
|
19658
19668
|
*
|
|
19659
19669
|
* cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
|
|
@@ -19672,7 +19682,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__
|
|
|
19672
19682
|
return __pyx_r;
|
|
19673
19683
|
}
|
|
19674
19684
|
|
|
19675
|
-
/* "
|
|
19685
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
|
|
19676
19686
|
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
|
19677
19687
|
*
|
|
19678
19688
|
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
|
|
@@ -19689,7 +19699,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
|
|
|
19689
19699
|
int __pyx_clineno = 0;
|
|
19690
19700
|
__Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 1);
|
|
19691
19701
|
|
|
19692
|
-
/* "
|
|
19702
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":783
|
|
19693
19703
|
*
|
|
19694
19704
|
* cdef inline object PyArray_MultiIterNew3(a, b, c):
|
|
19695
19705
|
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
|
|
@@ -19703,7 +19713,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
|
|
|
19703
19713
|
__pyx_t_1 = 0;
|
|
19704
19714
|
goto __pyx_L0;
|
|
19705
19715
|
|
|
19706
|
-
/* "
|
|
19716
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":782
|
|
19707
19717
|
* return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
|
19708
19718
|
*
|
|
19709
19719
|
* cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
|
|
@@ -19722,7 +19732,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__
|
|
|
19722
19732
|
return __pyx_r;
|
|
19723
19733
|
}
|
|
19724
19734
|
|
|
19725
|
-
/* "
|
|
19735
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
|
|
19726
19736
|
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
|
19727
19737
|
*
|
|
19728
19738
|
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
|
|
@@ -19739,7 +19749,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
|
|
|
19739
19749
|
int __pyx_clineno = 0;
|
|
19740
19750
|
__Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 1);
|
|
19741
19751
|
|
|
19742
|
-
/* "
|
|
19752
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":786
|
|
19743
19753
|
*
|
|
19744
19754
|
* cdef inline object PyArray_MultiIterNew4(a, b, c, d):
|
|
19745
19755
|
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
|
|
@@ -19753,7 +19763,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
|
|
|
19753
19763
|
__pyx_t_1 = 0;
|
|
19754
19764
|
goto __pyx_L0;
|
|
19755
19765
|
|
|
19756
|
-
/* "
|
|
19766
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":785
|
|
19757
19767
|
* return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
|
19758
19768
|
*
|
|
19759
19769
|
* cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
|
|
@@ -19772,7 +19782,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__
|
|
|
19772
19782
|
return __pyx_r;
|
|
19773
19783
|
}
|
|
19774
19784
|
|
|
19775
|
-
/* "
|
|
19785
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
|
|
19776
19786
|
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
|
19777
19787
|
*
|
|
19778
19788
|
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
|
|
@@ -19789,7 +19799,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
|
|
|
19789
19799
|
int __pyx_clineno = 0;
|
|
19790
19800
|
__Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 1);
|
|
19791
19801
|
|
|
19792
|
-
/* "
|
|
19802
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":789
|
|
19793
19803
|
*
|
|
19794
19804
|
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
|
|
19795
19805
|
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
|
|
@@ -19803,7 +19813,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
|
|
|
19803
19813
|
__pyx_t_1 = 0;
|
|
19804
19814
|
goto __pyx_L0;
|
|
19805
19815
|
|
|
19806
|
-
/* "
|
|
19816
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":788
|
|
19807
19817
|
* return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
|
19808
19818
|
*
|
|
19809
19819
|
* cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
|
|
@@ -19822,7 +19832,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__
|
|
|
19822
19832
|
return __pyx_r;
|
|
19823
19833
|
}
|
|
19824
19834
|
|
|
19825
|
-
/* "
|
|
19835
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
|
|
19826
19836
|
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
|
19827
19837
|
*
|
|
19828
19838
|
* cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
|
|
@@ -19836,7 +19846,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
|
|
|
19836
19846
|
int __pyx_t_1;
|
|
19837
19847
|
__Pyx_RefNannySetupContext("PyDataType_SHAPE", 1);
|
|
19838
19848
|
|
|
19839
|
-
/* "
|
|
19849
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
|
|
19840
19850
|
*
|
|
19841
19851
|
* cdef inline tuple PyDataType_SHAPE(dtype d):
|
|
19842
19852
|
* if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
|
|
@@ -19846,7 +19856,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
|
|
|
19846
19856
|
__pyx_t_1 = PyDataType_HASSUBARRAY(__pyx_v_d);
|
|
19847
19857
|
if (__pyx_t_1) {
|
|
19848
19858
|
|
|
19849
|
-
/* "
|
|
19859
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":793
|
|
19850
19860
|
* cdef inline tuple PyDataType_SHAPE(dtype d):
|
|
19851
19861
|
* if PyDataType_HASSUBARRAY(d):
|
|
19852
19862
|
* return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
|
|
@@ -19858,7 +19868,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
|
|
|
19858
19868
|
__pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
|
|
19859
19869
|
goto __pyx_L0;
|
|
19860
19870
|
|
|
19861
|
-
/* "
|
|
19871
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":792
|
|
19862
19872
|
*
|
|
19863
19873
|
* cdef inline tuple PyDataType_SHAPE(dtype d):
|
|
19864
19874
|
* if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
|
|
@@ -19867,7 +19877,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
|
|
|
19867
19877
|
*/
|
|
19868
19878
|
}
|
|
19869
19879
|
|
|
19870
|
-
/* "
|
|
19880
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":795
|
|
19871
19881
|
* return <tuple>d.subarray.shape
|
|
19872
19882
|
* else:
|
|
19873
19883
|
* return () # <<<<<<<<<<<<<<
|
|
@@ -19881,7 +19891,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
|
|
|
19881
19891
|
goto __pyx_L0;
|
|
19882
19892
|
}
|
|
19883
19893
|
|
|
19884
|
-
/* "
|
|
19894
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":791
|
|
19885
19895
|
* return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
|
19886
19896
|
*
|
|
19887
19897
|
* cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
|
|
@@ -19896,7 +19906,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
|
|
|
19896
19906
|
return __pyx_r;
|
|
19897
19907
|
}
|
|
19898
19908
|
|
|
19899
|
-
/* "
|
|
19909
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
|
|
19900
19910
|
* int _import_umath() except -1
|
|
19901
19911
|
*
|
|
19902
19912
|
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
|
|
@@ -19906,7 +19916,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__
|
|
|
19906
19916
|
|
|
19907
19917
|
static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
|
|
19908
19918
|
|
|
19909
|
-
/* "
|
|
19919
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":971
|
|
19910
19920
|
*
|
|
19911
19921
|
* cdef inline void set_array_base(ndarray arr, object base):
|
|
19912
19922
|
* Py_INCREF(base) # important to do this before stealing the reference below! # <<<<<<<<<<<<<<
|
|
@@ -19915,7 +19925,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
|
|
|
19915
19925
|
*/
|
|
19916
19926
|
Py_INCREF(__pyx_v_base);
|
|
19917
19927
|
|
|
19918
|
-
/* "
|
|
19928
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":972
|
|
19919
19929
|
* cdef inline void set_array_base(ndarray arr, object base):
|
|
19920
19930
|
* Py_INCREF(base) # important to do this before stealing the reference below!
|
|
19921
19931
|
* PyArray_SetBaseObject(arr, base) # <<<<<<<<<<<<<<
|
|
@@ -19924,7 +19934,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
|
|
|
19924
19934
|
*/
|
|
19925
19935
|
(void)(PyArray_SetBaseObject(__pyx_v_arr, __pyx_v_base));
|
|
19926
19936
|
|
|
19927
|
-
/* "
|
|
19937
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":970
|
|
19928
19938
|
* int _import_umath() except -1
|
|
19929
19939
|
*
|
|
19930
19940
|
* cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
|
|
@@ -19935,7 +19945,7 @@ static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_a
|
|
|
19935
19945
|
/* function exit code */
|
|
19936
19946
|
}
|
|
19937
19947
|
|
|
19938
|
-
/* "
|
|
19948
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
|
|
19939
19949
|
* PyArray_SetBaseObject(arr, base)
|
|
19940
19950
|
*
|
|
19941
19951
|
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
|
|
@@ -19950,7 +19960,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
|
|
|
19950
19960
|
int __pyx_t_1;
|
|
19951
19961
|
__Pyx_RefNannySetupContext("get_array_base", 1);
|
|
19952
19962
|
|
|
19953
|
-
/* "
|
|
19963
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":975
|
|
19954
19964
|
*
|
|
19955
19965
|
* cdef inline object get_array_base(ndarray arr):
|
|
19956
19966
|
* base = PyArray_BASE(arr) # <<<<<<<<<<<<<<
|
|
@@ -19959,7 +19969,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
|
|
|
19959
19969
|
*/
|
|
19960
19970
|
__pyx_v_base = PyArray_BASE(__pyx_v_arr);
|
|
19961
19971
|
|
|
19962
|
-
/* "
|
|
19972
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
|
|
19963
19973
|
* cdef inline object get_array_base(ndarray arr):
|
|
19964
19974
|
* base = PyArray_BASE(arr)
|
|
19965
19975
|
* if base is NULL: # <<<<<<<<<<<<<<
|
|
@@ -19969,7 +19979,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
|
|
|
19969
19979
|
__pyx_t_1 = (__pyx_v_base == NULL);
|
|
19970
19980
|
if (__pyx_t_1) {
|
|
19971
19981
|
|
|
19972
|
-
/* "
|
|
19982
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":977
|
|
19973
19983
|
* base = PyArray_BASE(arr)
|
|
19974
19984
|
* if base is NULL:
|
|
19975
19985
|
* return None # <<<<<<<<<<<<<<
|
|
@@ -19980,7 +19990,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
|
|
|
19980
19990
|
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
|
|
19981
19991
|
goto __pyx_L0;
|
|
19982
19992
|
|
|
19983
|
-
/* "
|
|
19993
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":976
|
|
19984
19994
|
* cdef inline object get_array_base(ndarray arr):
|
|
19985
19995
|
* base = PyArray_BASE(arr)
|
|
19986
19996
|
* if base is NULL: # <<<<<<<<<<<<<<
|
|
@@ -19989,7 +19999,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
|
|
|
19989
19999
|
*/
|
|
19990
20000
|
}
|
|
19991
20001
|
|
|
19992
|
-
/* "
|
|
20002
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":978
|
|
19993
20003
|
* if base is NULL:
|
|
19994
20004
|
* return None
|
|
19995
20005
|
* return <object>base # <<<<<<<<<<<<<<
|
|
@@ -20001,7 +20011,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
|
|
|
20001
20011
|
__pyx_r = ((PyObject *)__pyx_v_base);
|
|
20002
20012
|
goto __pyx_L0;
|
|
20003
20013
|
|
|
20004
|
-
/* "
|
|
20014
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":974
|
|
20005
20015
|
* PyArray_SetBaseObject(arr, base)
|
|
20006
20016
|
*
|
|
20007
20017
|
* cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
|
|
@@ -20016,7 +20026,7 @@ static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__py
|
|
|
20016
20026
|
return __pyx_r;
|
|
20017
20027
|
}
|
|
20018
20028
|
|
|
20019
|
-
/* "
|
|
20029
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
|
|
20020
20030
|
* # Versions of the import_* functions which are more suitable for
|
|
20021
20031
|
* # Cython code.
|
|
20022
20032
|
* cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
|
|
@@ -20040,7 +20050,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
|
|
|
20040
20050
|
int __pyx_clineno = 0;
|
|
20041
20051
|
__Pyx_RefNannySetupContext("import_array", 1);
|
|
20042
20052
|
|
|
20043
|
-
/* "
|
|
20053
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
|
|
20044
20054
|
* # Cython code.
|
|
20045
20055
|
* cdef inline int import_array() except -1:
|
|
20046
20056
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20056,7 +20066,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
|
|
|
20056
20066
|
__Pyx_XGOTREF(__pyx_t_3);
|
|
20057
20067
|
/*try:*/ {
|
|
20058
20068
|
|
|
20059
|
-
/* "
|
|
20069
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":984
|
|
20060
20070
|
* cdef inline int import_array() except -1:
|
|
20061
20071
|
* try:
|
|
20062
20072
|
* __pyx_import_array() # <<<<<<<<<<<<<<
|
|
@@ -20065,7 +20075,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
|
|
|
20065
20075
|
*/
|
|
20066
20076
|
__pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 984, __pyx_L3_error)
|
|
20067
20077
|
|
|
20068
|
-
/* "
|
|
20078
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
|
|
20069
20079
|
* # Cython code.
|
|
20070
20080
|
* cdef inline int import_array() except -1:
|
|
20071
20081
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20079,7 +20089,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
|
|
|
20079
20089
|
goto __pyx_L8_try_end;
|
|
20080
20090
|
__pyx_L3_error:;
|
|
20081
20091
|
|
|
20082
|
-
/* "
|
|
20092
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":985
|
|
20083
20093
|
* try:
|
|
20084
20094
|
* __pyx_import_array()
|
|
20085
20095
|
* except Exception: # <<<<<<<<<<<<<<
|
|
@@ -20094,7 +20104,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
|
|
|
20094
20104
|
__Pyx_XGOTREF(__pyx_t_6);
|
|
20095
20105
|
__Pyx_XGOTREF(__pyx_t_7);
|
|
20096
20106
|
|
|
20097
|
-
/* "
|
|
20107
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
|
|
20098
20108
|
* __pyx_import_array()
|
|
20099
20109
|
* except Exception:
|
|
20100
20110
|
* raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
|
|
@@ -20109,7 +20119,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
|
|
|
20109
20119
|
}
|
|
20110
20120
|
goto __pyx_L5_except_error;
|
|
20111
20121
|
|
|
20112
|
-
/* "
|
|
20122
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":983
|
|
20113
20123
|
* # Cython code.
|
|
20114
20124
|
* cdef inline int import_array() except -1:
|
|
20115
20125
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20125,7 +20135,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
|
|
|
20125
20135
|
__pyx_L8_try_end:;
|
|
20126
20136
|
}
|
|
20127
20137
|
|
|
20128
|
-
/* "
|
|
20138
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":982
|
|
20129
20139
|
* # Versions of the import_* functions which are more suitable for
|
|
20130
20140
|
* # Cython code.
|
|
20131
20141
|
* cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
|
|
@@ -20148,7 +20158,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
|
|
|
20148
20158
|
return __pyx_r;
|
|
20149
20159
|
}
|
|
20150
20160
|
|
|
20151
|
-
/* "
|
|
20161
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
|
|
20152
20162
|
* raise ImportError("numpy.core.multiarray failed to import")
|
|
20153
20163
|
*
|
|
20154
20164
|
* cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
|
|
@@ -20172,7 +20182,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
|
|
|
20172
20182
|
int __pyx_clineno = 0;
|
|
20173
20183
|
__Pyx_RefNannySetupContext("import_umath", 1);
|
|
20174
20184
|
|
|
20175
|
-
/* "
|
|
20185
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
|
|
20176
20186
|
*
|
|
20177
20187
|
* cdef inline int import_umath() except -1:
|
|
20178
20188
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20188,7 +20198,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
|
|
|
20188
20198
|
__Pyx_XGOTREF(__pyx_t_3);
|
|
20189
20199
|
/*try:*/ {
|
|
20190
20200
|
|
|
20191
|
-
/* "
|
|
20201
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":990
|
|
20192
20202
|
* cdef inline int import_umath() except -1:
|
|
20193
20203
|
* try:
|
|
20194
20204
|
* _import_umath() # <<<<<<<<<<<<<<
|
|
@@ -20197,7 +20207,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
|
|
|
20197
20207
|
*/
|
|
20198
20208
|
__pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 990, __pyx_L3_error)
|
|
20199
20209
|
|
|
20200
|
-
/* "
|
|
20210
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
|
|
20201
20211
|
*
|
|
20202
20212
|
* cdef inline int import_umath() except -1:
|
|
20203
20213
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20211,7 +20221,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
|
|
|
20211
20221
|
goto __pyx_L8_try_end;
|
|
20212
20222
|
__pyx_L3_error:;
|
|
20213
20223
|
|
|
20214
|
-
/* "
|
|
20224
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":991
|
|
20215
20225
|
* try:
|
|
20216
20226
|
* _import_umath()
|
|
20217
20227
|
* except Exception: # <<<<<<<<<<<<<<
|
|
@@ -20226,7 +20236,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
|
|
|
20226
20236
|
__Pyx_XGOTREF(__pyx_t_6);
|
|
20227
20237
|
__Pyx_XGOTREF(__pyx_t_7);
|
|
20228
20238
|
|
|
20229
|
-
/* "
|
|
20239
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
|
|
20230
20240
|
* _import_umath()
|
|
20231
20241
|
* except Exception:
|
|
20232
20242
|
* raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
|
|
@@ -20241,7 +20251,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
|
|
|
20241
20251
|
}
|
|
20242
20252
|
goto __pyx_L5_except_error;
|
|
20243
20253
|
|
|
20244
|
-
/* "
|
|
20254
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":989
|
|
20245
20255
|
*
|
|
20246
20256
|
* cdef inline int import_umath() except -1:
|
|
20247
20257
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20257,7 +20267,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
|
|
|
20257
20267
|
__pyx_L8_try_end:;
|
|
20258
20268
|
}
|
|
20259
20269
|
|
|
20260
|
-
/* "
|
|
20270
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":988
|
|
20261
20271
|
* raise ImportError("numpy.core.multiarray failed to import")
|
|
20262
20272
|
*
|
|
20263
20273
|
* cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
|
|
@@ -20280,7 +20290,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
|
|
|
20280
20290
|
return __pyx_r;
|
|
20281
20291
|
}
|
|
20282
20292
|
|
|
20283
|
-
/* "
|
|
20293
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
|
|
20284
20294
|
* raise ImportError("numpy.core.umath failed to import")
|
|
20285
20295
|
*
|
|
20286
20296
|
* cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
|
|
@@ -20304,7 +20314,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
|
|
|
20304
20314
|
int __pyx_clineno = 0;
|
|
20305
20315
|
__Pyx_RefNannySetupContext("import_ufunc", 1);
|
|
20306
20316
|
|
|
20307
|
-
/* "
|
|
20317
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
|
|
20308
20318
|
*
|
|
20309
20319
|
* cdef inline int import_ufunc() except -1:
|
|
20310
20320
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20320,7 +20330,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
|
|
|
20320
20330
|
__Pyx_XGOTREF(__pyx_t_3);
|
|
20321
20331
|
/*try:*/ {
|
|
20322
20332
|
|
|
20323
|
-
/* "
|
|
20333
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":996
|
|
20324
20334
|
* cdef inline int import_ufunc() except -1:
|
|
20325
20335
|
* try:
|
|
20326
20336
|
* _import_umath() # <<<<<<<<<<<<<<
|
|
@@ -20329,7 +20339,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
|
|
|
20329
20339
|
*/
|
|
20330
20340
|
__pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 996, __pyx_L3_error)
|
|
20331
20341
|
|
|
20332
|
-
/* "
|
|
20342
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
|
|
20333
20343
|
*
|
|
20334
20344
|
* cdef inline int import_ufunc() except -1:
|
|
20335
20345
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20343,7 +20353,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
|
|
|
20343
20353
|
goto __pyx_L8_try_end;
|
|
20344
20354
|
__pyx_L3_error:;
|
|
20345
20355
|
|
|
20346
|
-
/* "
|
|
20356
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":997
|
|
20347
20357
|
* try:
|
|
20348
20358
|
* _import_umath()
|
|
20349
20359
|
* except Exception: # <<<<<<<<<<<<<<
|
|
@@ -20358,7 +20368,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
|
|
|
20358
20368
|
__Pyx_XGOTREF(__pyx_t_6);
|
|
20359
20369
|
__Pyx_XGOTREF(__pyx_t_7);
|
|
20360
20370
|
|
|
20361
|
-
/* "
|
|
20371
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":998
|
|
20362
20372
|
* _import_umath()
|
|
20363
20373
|
* except Exception:
|
|
20364
20374
|
* raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
|
|
@@ -20373,7 +20383,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
|
|
|
20373
20383
|
}
|
|
20374
20384
|
goto __pyx_L5_except_error;
|
|
20375
20385
|
|
|
20376
|
-
/* "
|
|
20386
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":995
|
|
20377
20387
|
*
|
|
20378
20388
|
* cdef inline int import_ufunc() except -1:
|
|
20379
20389
|
* try: # <<<<<<<<<<<<<<
|
|
@@ -20389,7 +20399,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
|
|
|
20389
20399
|
__pyx_L8_try_end:;
|
|
20390
20400
|
}
|
|
20391
20401
|
|
|
20392
|
-
/* "
|
|
20402
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":994
|
|
20393
20403
|
* raise ImportError("numpy.core.umath failed to import")
|
|
20394
20404
|
*
|
|
20395
20405
|
* cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
|
|
@@ -20412,7 +20422,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
|
|
|
20412
20422
|
return __pyx_r;
|
|
20413
20423
|
}
|
|
20414
20424
|
|
|
20415
|
-
/* "
|
|
20425
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
|
|
20416
20426
|
*
|
|
20417
20427
|
*
|
|
20418
20428
|
* cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
|
|
@@ -20423,7 +20433,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
|
|
|
20423
20433
|
static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_obj) {
|
|
20424
20434
|
int __pyx_r;
|
|
20425
20435
|
|
|
20426
|
-
/* "
|
|
20436
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1013
|
|
20427
20437
|
* bool
|
|
20428
20438
|
* """
|
|
20429
20439
|
* return PyObject_TypeCheck(obj, &PyTimedeltaArrType_Type) # <<<<<<<<<<<<<<
|
|
@@ -20433,7 +20443,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
|
|
|
20433
20443
|
__pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyTimedeltaArrType_Type));
|
|
20434
20444
|
goto __pyx_L0;
|
|
20435
20445
|
|
|
20436
|
-
/* "
|
|
20446
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1001
|
|
20437
20447
|
*
|
|
20438
20448
|
*
|
|
20439
20449
|
* cdef inline bint is_timedelta64_object(object obj): # <<<<<<<<<<<<<<
|
|
@@ -20446,7 +20456,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
|
|
|
20446
20456
|
return __pyx_r;
|
|
20447
20457
|
}
|
|
20448
20458
|
|
|
20449
|
-
/* "
|
|
20459
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
|
|
20450
20460
|
*
|
|
20451
20461
|
*
|
|
20452
20462
|
* cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
|
|
@@ -20457,7 +20467,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_timedelta64_object(PyObject *__pyx_v_
|
|
|
20457
20467
|
static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_obj) {
|
|
20458
20468
|
int __pyx_r;
|
|
20459
20469
|
|
|
20460
|
-
/* "
|
|
20470
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1028
|
|
20461
20471
|
* bool
|
|
20462
20472
|
* """
|
|
20463
20473
|
* return PyObject_TypeCheck(obj, &PyDatetimeArrType_Type) # <<<<<<<<<<<<<<
|
|
@@ -20467,7 +20477,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
|
|
|
20467
20477
|
__pyx_r = PyObject_TypeCheck(__pyx_v_obj, (&PyDatetimeArrType_Type));
|
|
20468
20478
|
goto __pyx_L0;
|
|
20469
20479
|
|
|
20470
|
-
/* "
|
|
20480
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1016
|
|
20471
20481
|
*
|
|
20472
20482
|
*
|
|
20473
20483
|
* cdef inline bint is_datetime64_object(object obj): # <<<<<<<<<<<<<<
|
|
@@ -20480,7 +20490,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
|
|
|
20480
20490
|
return __pyx_r;
|
|
20481
20491
|
}
|
|
20482
20492
|
|
|
20483
|
-
/* "
|
|
20493
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
|
|
20484
20494
|
*
|
|
20485
20495
|
*
|
|
20486
20496
|
* cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
|
|
@@ -20491,7 +20501,7 @@ static CYTHON_INLINE int __pyx_f_5numpy_is_datetime64_object(PyObject *__pyx_v_o
|
|
|
20491
20501
|
static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *__pyx_v_obj) {
|
|
20492
20502
|
npy_datetime __pyx_r;
|
|
20493
20503
|
|
|
20494
|
-
/* "
|
|
20504
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1038
|
|
20495
20505
|
* also needed. That can be found using `get_datetime64_unit`.
|
|
20496
20506
|
* """
|
|
20497
20507
|
* return (<PyDatetimeScalarObject*>obj).obval # <<<<<<<<<<<<<<
|
|
@@ -20501,7 +20511,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
|
|
|
20501
20511
|
__pyx_r = ((PyDatetimeScalarObject *)__pyx_v_obj)->obval;
|
|
20502
20512
|
goto __pyx_L0;
|
|
20503
20513
|
|
|
20504
|
-
/* "
|
|
20514
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1031
|
|
20505
20515
|
*
|
|
20506
20516
|
*
|
|
20507
20517
|
* cdef inline npy_datetime get_datetime64_value(object obj) nogil: # <<<<<<<<<<<<<<
|
|
@@ -20514,7 +20524,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
|
|
|
20514
20524
|
return __pyx_r;
|
|
20515
20525
|
}
|
|
20516
20526
|
|
|
20517
|
-
/* "
|
|
20527
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
|
|
20518
20528
|
*
|
|
20519
20529
|
*
|
|
20520
20530
|
* cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
|
|
@@ -20525,7 +20535,7 @@ static CYTHON_INLINE npy_datetime __pyx_f_5numpy_get_datetime64_value(PyObject *
|
|
|
20525
20535
|
static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject *__pyx_v_obj) {
|
|
20526
20536
|
npy_timedelta __pyx_r;
|
|
20527
20537
|
|
|
20528
|
-
/* "
|
|
20538
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1045
|
|
20529
20539
|
* returns the int64 value underlying scalar numpy timedelta64 object
|
|
20530
20540
|
* """
|
|
20531
20541
|
* return (<PyTimedeltaScalarObject*>obj).obval # <<<<<<<<<<<<<<
|
|
@@ -20535,7 +20545,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
|
|
|
20535
20545
|
__pyx_r = ((PyTimedeltaScalarObject *)__pyx_v_obj)->obval;
|
|
20536
20546
|
goto __pyx_L0;
|
|
20537
20547
|
|
|
20538
|
-
/* "
|
|
20548
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1041
|
|
20539
20549
|
*
|
|
20540
20550
|
*
|
|
20541
20551
|
* cdef inline npy_timedelta get_timedelta64_value(object obj) nogil: # <<<<<<<<<<<<<<
|
|
@@ -20548,7 +20558,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
|
|
|
20548
20558
|
return __pyx_r;
|
|
20549
20559
|
}
|
|
20550
20560
|
|
|
20551
|
-
/* "
|
|
20561
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
|
|
20552
20562
|
*
|
|
20553
20563
|
*
|
|
20554
20564
|
* cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
|
|
@@ -20559,7 +20569,7 @@ static CYTHON_INLINE npy_timedelta __pyx_f_5numpy_get_timedelta64_value(PyObject
|
|
|
20559
20569
|
static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObject *__pyx_v_obj) {
|
|
20560
20570
|
NPY_DATETIMEUNIT __pyx_r;
|
|
20561
20571
|
|
|
20562
|
-
/* "
|
|
20572
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1052
|
|
20563
20573
|
* returns the unit part of the dtype for a numpy datetime64 object.
|
|
20564
20574
|
* """
|
|
20565
20575
|
* return <NPY_DATETIMEUNIT>(<PyDatetimeScalarObject*>obj).obmeta.base # <<<<<<<<<<<<<<
|
|
@@ -20567,7 +20577,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
|
|
|
20567
20577
|
__pyx_r = ((NPY_DATETIMEUNIT)((PyDatetimeScalarObject *)__pyx_v_obj)->obmeta.base);
|
|
20568
20578
|
goto __pyx_L0;
|
|
20569
20579
|
|
|
20570
|
-
/* "
|
|
20580
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":1048
|
|
20571
20581
|
*
|
|
20572
20582
|
*
|
|
20573
20583
|
* cdef inline NPY_DATETIMEUNIT get_datetime64_unit(object obj) nogil: # <<<<<<<<<<<<<<
|
|
@@ -20580,7 +20590,7 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
|
|
|
20580
20590
|
return __pyx_r;
|
|
20581
20591
|
}
|
|
20582
20592
|
|
|
20583
|
-
/* "mettagrid/objects.pxd":
|
|
20593
|
+
/* "mettagrid/objects.pxd":25
|
|
20584
20594
|
* unsigned int hp
|
|
20585
20595
|
*
|
|
20586
20596
|
* inline void init_mo(ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -20590,16 +20600,16 @@ static CYTHON_INLINE NPY_DATETIMEUNIT __pyx_f_5numpy_get_datetime64_unit(PyObjec
|
|
|
20590
20600
|
|
|
20591
20601
|
void __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
|
|
20592
20602
|
|
|
20593
|
-
/* "mettagrid/objects.pxd":
|
|
20603
|
+
/* "mettagrid/objects.pxd":26
|
|
20594
20604
|
*
|
|
20595
20605
|
* inline void init_mo(ObjectConfig cfg):
|
|
20596
20606
|
* this.hp = cfg[b"hp"] # <<<<<<<<<<<<<<
|
|
20597
20607
|
*
|
|
20598
|
-
* inline
|
|
20608
|
+
* inline bint usable(const Agent *actor):
|
|
20599
20609
|
*/
|
|
20600
20610
|
this->hp = (__pyx_v_cfg[__pyx_k_hp]);
|
|
20601
20611
|
|
|
20602
|
-
/* "mettagrid/objects.pxd":
|
|
20612
|
+
/* "mettagrid/objects.pxd":25
|
|
20603
20613
|
* unsigned int hp
|
|
20604
20614
|
*
|
|
20605
20615
|
* inline void init_mo(ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -20610,54 +20620,20 @@ void __pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_t_9mettagrid_7object
|
|
|
20610
20620
|
/* function exit code */
|
|
20611
20621
|
}
|
|
20612
20622
|
|
|
20613
|
-
/* "mettagrid/objects.pxd":
|
|
20623
|
+
/* "mettagrid/objects.pxd":28
|
|
20614
20624
|
* this.hp = cfg[b"hp"]
|
|
20615
20625
|
*
|
|
20616
|
-
* inline
|
|
20626
|
+
* inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
|
|
20617
20627
|
* return False
|
|
20618
20628
|
*
|
|
20619
20629
|
*/
|
|
20620
20630
|
|
|
20621
|
-
|
|
20622
|
-
|
|
20623
|
-
|
|
20624
|
-
/* "mettagrid/objects.pxd":28
|
|
20625
|
-
*
|
|
20626
|
-
* inline char usable(const Agent *actor):
|
|
20627
|
-
* return False # <<<<<<<<<<<<<<
|
|
20628
|
-
*
|
|
20629
|
-
* inline char attackable():
|
|
20630
|
-
*/
|
|
20631
|
-
__pyx_r = 0;
|
|
20632
|
-
goto __pyx_L0;
|
|
20633
|
-
|
|
20634
|
-
/* "mettagrid/objects.pxd":27
|
|
20635
|
-
* this.hp = cfg[b"hp"]
|
|
20636
|
-
*
|
|
20637
|
-
* inline char usable(const Agent *actor): # <<<<<<<<<<<<<<
|
|
20638
|
-
* return False
|
|
20639
|
-
*
|
|
20640
|
-
*/
|
|
20641
|
-
|
|
20642
|
-
/* function exit code */
|
|
20643
|
-
__pyx_L0:;
|
|
20644
|
-
return __pyx_r;
|
|
20645
|
-
}
|
|
20646
|
-
|
|
20647
|
-
/* "mettagrid/objects.pxd":30
|
|
20648
|
-
* return False
|
|
20649
|
-
*
|
|
20650
|
-
* inline char attackable(): # <<<<<<<<<<<<<<
|
|
20651
|
-
* return False
|
|
20652
|
-
*
|
|
20653
|
-
*/
|
|
20654
|
-
|
|
20655
|
-
char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
|
|
20656
|
-
char __pyx_r;
|
|
20631
|
+
int __pyx_t_9mettagrid_7objects_MettaObject::usable(CYTHON_UNUSED __pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
|
|
20632
|
+
int __pyx_r;
|
|
20657
20633
|
|
|
20658
|
-
/* "mettagrid/objects.pxd":
|
|
20634
|
+
/* "mettagrid/objects.pxd":29
|
|
20659
20635
|
*
|
|
20660
|
-
* inline
|
|
20636
|
+
* inline bint usable(const Agent *actor):
|
|
20661
20637
|
* return False # <<<<<<<<<<<<<<
|
|
20662
20638
|
*
|
|
20663
20639
|
* cdef cppclass Usable(MettaObject):
|
|
@@ -20665,10 +20641,10 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
|
|
|
20665
20641
|
__pyx_r = 0;
|
|
20666
20642
|
goto __pyx_L0;
|
|
20667
20643
|
|
|
20668
|
-
/* "mettagrid/objects.pxd":
|
|
20669
|
-
*
|
|
20644
|
+
/* "mettagrid/objects.pxd":28
|
|
20645
|
+
* this.hp = cfg[b"hp"]
|
|
20670
20646
|
*
|
|
20671
|
-
* inline
|
|
20647
|
+
* inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
|
|
20672
20648
|
* return False
|
|
20673
20649
|
*
|
|
20674
20650
|
*/
|
|
@@ -20678,7 +20654,7 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
|
|
|
20678
20654
|
return __pyx_r;
|
|
20679
20655
|
}
|
|
20680
20656
|
|
|
20681
|
-
/* "mettagrid/objects.pxd":
|
|
20657
|
+
/* "mettagrid/objects.pxd":36
|
|
20682
20658
|
* unsigned char ready
|
|
20683
20659
|
*
|
|
20684
20660
|
* inline void init_usable(ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -20688,7 +20664,7 @@ char __pyx_t_9mettagrid_7objects_MettaObject::attackable(void) {
|
|
|
20688
20664
|
|
|
20689
20665
|
void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects_ObjectConfig __pyx_v_cfg) {
|
|
20690
20666
|
|
|
20691
|
-
/* "mettagrid/objects.pxd":
|
|
20667
|
+
/* "mettagrid/objects.pxd":37
|
|
20692
20668
|
*
|
|
20693
20669
|
* inline void init_usable(ObjectConfig cfg):
|
|
20694
20670
|
* this.use_cost = cfg[b"use_cost"] # <<<<<<<<<<<<<<
|
|
@@ -20697,7 +20673,7 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
|
|
|
20697
20673
|
*/
|
|
20698
20674
|
this->use_cost = (__pyx_v_cfg[__pyx_k_use_cost]);
|
|
20699
20675
|
|
|
20700
|
-
/* "mettagrid/objects.pxd":
|
|
20676
|
+
/* "mettagrid/objects.pxd":38
|
|
20701
20677
|
* inline void init_usable(ObjectConfig cfg):
|
|
20702
20678
|
* this.use_cost = cfg[b"use_cost"]
|
|
20703
20679
|
* this.cooldown = cfg[b"cooldown"] # <<<<<<<<<<<<<<
|
|
@@ -20706,16 +20682,16 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
|
|
|
20706
20682
|
*/
|
|
20707
20683
|
this->cooldown = (__pyx_v_cfg[__pyx_k_cooldown]);
|
|
20708
20684
|
|
|
20709
|
-
/* "mettagrid/objects.pxd":
|
|
20685
|
+
/* "mettagrid/objects.pxd":39
|
|
20710
20686
|
* this.use_cost = cfg[b"use_cost"]
|
|
20711
20687
|
* this.cooldown = cfg[b"cooldown"]
|
|
20712
20688
|
* this.ready = 1 # <<<<<<<<<<<<<<
|
|
20713
20689
|
*
|
|
20714
|
-
* inline
|
|
20690
|
+
* inline bint usable(const Agent *actor):
|
|
20715
20691
|
*/
|
|
20716
20692
|
this->ready = 1;
|
|
20717
20693
|
|
|
20718
|
-
/* "mettagrid/objects.pxd":
|
|
20694
|
+
/* "mettagrid/objects.pxd":36
|
|
20719
20695
|
* unsigned char ready
|
|
20720
20696
|
*
|
|
20721
20697
|
* inline void init_usable(ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -20726,29 +20702,30 @@ void __pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_t_9mettagrid_7objects
|
|
|
20726
20702
|
/* function exit code */
|
|
20727
20703
|
}
|
|
20728
20704
|
|
|
20729
|
-
/* "mettagrid/objects.pxd":
|
|
20705
|
+
/* "mettagrid/objects.pxd":41
|
|
20730
20706
|
* this.ready = 1
|
|
20731
20707
|
*
|
|
20732
|
-
* inline
|
|
20708
|
+
* inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
|
|
20733
20709
|
* return this.ready and this.use_cost <= actor.energy
|
|
20734
20710
|
*
|
|
20735
20711
|
*/
|
|
20736
20712
|
|
|
20737
|
-
|
|
20738
|
-
|
|
20739
|
-
|
|
20713
|
+
int __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
|
|
20714
|
+
int __pyx_r;
|
|
20715
|
+
int __pyx_t_1;
|
|
20740
20716
|
int __pyx_t_2;
|
|
20741
20717
|
|
|
20742
|
-
/* "mettagrid/objects.pxd":
|
|
20718
|
+
/* "mettagrid/objects.pxd":42
|
|
20743
20719
|
*
|
|
20744
|
-
* inline
|
|
20720
|
+
* inline bint usable(const Agent *actor):
|
|
20745
20721
|
* return this.ready and this.use_cost <= actor.energy # <<<<<<<<<<<<<<
|
|
20746
20722
|
*
|
|
20747
20723
|
* cdef enum ObjectType:
|
|
20748
20724
|
*/
|
|
20749
|
-
|
|
20725
|
+
__pyx_t_2 = (this->ready != 0);
|
|
20726
|
+
if (__pyx_t_2) {
|
|
20750
20727
|
} else {
|
|
20751
|
-
__pyx_t_1 =
|
|
20728
|
+
__pyx_t_1 = __pyx_t_2;
|
|
20752
20729
|
goto __pyx_L3_bool_binop_done;
|
|
20753
20730
|
}
|
|
20754
20731
|
__pyx_t_2 = (this->use_cost <= __pyx_v_actor->energy);
|
|
@@ -20757,10 +20734,10 @@ char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agen
|
|
|
20757
20734
|
__pyx_r = __pyx_t_1;
|
|
20758
20735
|
goto __pyx_L0;
|
|
20759
20736
|
|
|
20760
|
-
/* "mettagrid/objects.pxd":
|
|
20737
|
+
/* "mettagrid/objects.pxd":41
|
|
20761
20738
|
* this.ready = 1
|
|
20762
20739
|
*
|
|
20763
|
-
* inline
|
|
20740
|
+
* inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
|
|
20764
20741
|
* return this.ready and this.use_cost <= actor.energy
|
|
20765
20742
|
*
|
|
20766
20743
|
*/
|
|
@@ -20770,8 +20747,8 @@ char __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_t_9mettagrid_7objects_Agen
|
|
|
20770
20747
|
return __pyx_r;
|
|
20771
20748
|
}
|
|
20772
20749
|
|
|
20773
|
-
/* "mettagrid/objects.pxd":
|
|
20774
|
-
*
|
|
20750
|
+
/* "mettagrid/objects.pxd":74
|
|
20751
|
+
* unsigned char max_energy
|
|
20775
20752
|
*
|
|
20776
20753
|
* inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
20777
20754
|
* GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
|
|
@@ -20783,67 +20760,103 @@ void __pyx_t_9mettagrid_7objects_Agent::__pyx_f___init__Agent(GridCoord __pyx_v_
|
|
|
20783
20760
|
const char *__pyx_filename = NULL;
|
|
20784
20761
|
int __pyx_clineno = 0;
|
|
20785
20762
|
|
|
20786
|
-
/* "mettagrid/objects.pxd":
|
|
20763
|
+
/* "mettagrid/objects.pxd":75
|
|
20787
20764
|
*
|
|
20788
20765
|
* inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg):
|
|
20789
20766
|
* GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer)) # <<<<<<<<<<<<<<
|
|
20790
20767
|
* MettaObject.init_mo(cfg)
|
|
20791
|
-
* this.frozen =
|
|
20768
|
+
* this.frozen = 0
|
|
20792
20769
|
*/
|
|
20793
20770
|
GridObject::init(__pyx_e_9mettagrid_7objects_AgentT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Agent_Layer));
|
|
20794
20771
|
|
|
20795
|
-
/* "mettagrid/objects.pxd":
|
|
20772
|
+
/* "mettagrid/objects.pxd":76
|
|
20796
20773
|
* inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg):
|
|
20797
20774
|
* GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
|
|
20798
20775
|
* MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
|
|
20799
|
-
* this.frozen =
|
|
20800
|
-
* this.
|
|
20776
|
+
* this.frozen = 0
|
|
20777
|
+
* this.freeze_duration = cfg[b"freeze_duration"]
|
|
20801
20778
|
*/
|
|
20802
|
-
__pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
20779
|
+
__pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 76, __pyx_L1_error)
|
|
20803
20780
|
|
|
20804
|
-
/* "mettagrid/objects.pxd":
|
|
20781
|
+
/* "mettagrid/objects.pxd":77
|
|
20805
20782
|
* GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
|
|
20806
20783
|
* MettaObject.init_mo(cfg)
|
|
20807
|
-
* this.frozen =
|
|
20784
|
+
* this.frozen = 0 # <<<<<<<<<<<<<<
|
|
20785
|
+
* this.freeze_duration = cfg[b"freeze_duration"]
|
|
20808
20786
|
* this.energy = cfg[b"initial_energy"]
|
|
20809
|
-
* this.orientation = 0
|
|
20810
20787
|
*/
|
|
20811
20788
|
this->frozen = 0;
|
|
20812
20789
|
|
|
20813
|
-
/* "mettagrid/objects.pxd":
|
|
20790
|
+
/* "mettagrid/objects.pxd":78
|
|
20814
20791
|
* MettaObject.init_mo(cfg)
|
|
20815
|
-
* this.frozen =
|
|
20792
|
+
* this.frozen = 0
|
|
20793
|
+
* this.freeze_duration = cfg[b"freeze_duration"] # <<<<<<<<<<<<<<
|
|
20794
|
+
* this.energy = cfg[b"initial_energy"]
|
|
20795
|
+
* this.max_energy = cfg[b"max_energy"]
|
|
20796
|
+
*/
|
|
20797
|
+
this->freeze_duration = (__pyx_v_cfg[__pyx_k_freeze_duration]);
|
|
20798
|
+
|
|
20799
|
+
/* "mettagrid/objects.pxd":79
|
|
20800
|
+
* this.frozen = 0
|
|
20801
|
+
* this.freeze_duration = cfg[b"freeze_duration"]
|
|
20816
20802
|
* this.energy = cfg[b"initial_energy"] # <<<<<<<<<<<<<<
|
|
20817
|
-
* this.
|
|
20818
|
-
* this.
|
|
20803
|
+
* this.max_energy = cfg[b"max_energy"]
|
|
20804
|
+
* this.shield_upkeep = cfg[b"upkeep.shield"]
|
|
20819
20805
|
*/
|
|
20820
20806
|
this->energy = (__pyx_v_cfg[__pyx_k_initial_energy]);
|
|
20821
20807
|
|
|
20822
|
-
/* "mettagrid/objects.pxd":
|
|
20823
|
-
* this.
|
|
20808
|
+
/* "mettagrid/objects.pxd":80
|
|
20809
|
+
* this.freeze_duration = cfg[b"freeze_duration"]
|
|
20810
|
+
* this.energy = cfg[b"initial_energy"]
|
|
20811
|
+
* this.max_energy = cfg[b"max_energy"] # <<<<<<<<<<<<<<
|
|
20812
|
+
* this.shield_upkeep = cfg[b"upkeep.shield"]
|
|
20813
|
+
* this.orientation = 0
|
|
20814
|
+
*/
|
|
20815
|
+
this->max_energy = (__pyx_v_cfg[__pyx_k_max_energy]);
|
|
20816
|
+
|
|
20817
|
+
/* "mettagrid/objects.pxd":81
|
|
20824
20818
|
* this.energy = cfg[b"initial_energy"]
|
|
20819
|
+
* this.max_energy = cfg[b"max_energy"]
|
|
20820
|
+
* this.shield_upkeep = cfg[b"upkeep.shield"] # <<<<<<<<<<<<<<
|
|
20821
|
+
* this.orientation = 0
|
|
20822
|
+
* this.inventory.resize(InventoryItem.InventoryCount)
|
|
20823
|
+
*/
|
|
20824
|
+
this->shield_upkeep = (__pyx_v_cfg[__pyx_k_upkeep_shield]);
|
|
20825
|
+
|
|
20826
|
+
/* "mettagrid/objects.pxd":82
|
|
20827
|
+
* this.max_energy = cfg[b"max_energy"]
|
|
20828
|
+
* this.shield_upkeep = cfg[b"upkeep.shield"]
|
|
20825
20829
|
* this.orientation = 0 # <<<<<<<<<<<<<<
|
|
20826
20830
|
* this.inventory.resize(InventoryItem.InventoryCount)
|
|
20827
|
-
*
|
|
20831
|
+
* this.max_items = cfg[b"max_inventory"]
|
|
20828
20832
|
*/
|
|
20829
20833
|
this->orientation = 0;
|
|
20830
20834
|
|
|
20831
|
-
/* "mettagrid/objects.pxd":
|
|
20832
|
-
* this.
|
|
20835
|
+
/* "mettagrid/objects.pxd":83
|
|
20836
|
+
* this.shield_upkeep = cfg[b"upkeep.shield"]
|
|
20833
20837
|
* this.orientation = 0
|
|
20834
20838
|
* this.inventory.resize(InventoryItem.InventoryCount) # <<<<<<<<<<<<<<
|
|
20839
|
+
* this.max_items = cfg[b"max_inventory"]
|
|
20835
20840
|
*
|
|
20836
|
-
* inline void update_inventory(InventoryItem item, short amount):
|
|
20837
20841
|
*/
|
|
20838
20842
|
try {
|
|
20839
20843
|
this->inventory.resize(__pyx_e_9mettagrid_7objects_InventoryCount);
|
|
20840
20844
|
} catch(...) {
|
|
20841
20845
|
__Pyx_CppExn2PyErr();
|
|
20842
|
-
__PYX_ERR(3,
|
|
20846
|
+
__PYX_ERR(3, 83, __pyx_L1_error)
|
|
20843
20847
|
}
|
|
20844
20848
|
|
|
20845
|
-
/* "mettagrid/objects.pxd":
|
|
20846
|
-
*
|
|
20849
|
+
/* "mettagrid/objects.pxd":84
|
|
20850
|
+
* this.orientation = 0
|
|
20851
|
+
* this.inventory.resize(InventoryItem.InventoryCount)
|
|
20852
|
+
* this.max_items = cfg[b"max_inventory"] # <<<<<<<<<<<<<<
|
|
20853
|
+
*
|
|
20854
|
+
* inline void update_inventory(InventoryItem item, short amount):
|
|
20855
|
+
*/
|
|
20856
|
+
this->max_items = (__pyx_v_cfg[__pyx_k_max_inventory]);
|
|
20857
|
+
|
|
20858
|
+
/* "mettagrid/objects.pxd":74
|
|
20859
|
+
* unsigned char max_energy
|
|
20847
20860
|
*
|
|
20848
20861
|
* inline Agent(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
20849
20862
|
* GridObject.init(ObjectType.AgentT, GridLocation(r, c, GridLayer.Agent_Layer))
|
|
@@ -20857,40 +20870,71 @@ void __pyx_t_9mettagrid_7objects_Agent::__pyx_f___init__Agent(GridCoord __pyx_v_
|
|
|
20857
20870
|
__pyx_L0:;
|
|
20858
20871
|
}
|
|
20859
20872
|
|
|
20860
|
-
/* "mettagrid/objects.pxd":
|
|
20861
|
-
* this.
|
|
20873
|
+
/* "mettagrid/objects.pxd":86
|
|
20874
|
+
* this.max_items = cfg[b"max_inventory"]
|
|
20862
20875
|
*
|
|
20863
20876
|
* inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
|
|
20864
20877
|
* this.inventory[<InventoryItem>item] += amount
|
|
20865
|
-
*
|
|
20878
|
+
* if this.inventory[<InventoryItem>item] > this.max_items:
|
|
20866
20879
|
*/
|
|
20867
20880
|
|
|
20868
20881
|
void __pyx_t_9mettagrid_7objects_Agent::update_inventory(enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_v_item, short __pyx_v_amount) {
|
|
20869
20882
|
enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_1;
|
|
20883
|
+
int __pyx_t_2;
|
|
20884
|
+
unsigned char __pyx_t_3;
|
|
20870
20885
|
|
|
20871
|
-
/* "mettagrid/objects.pxd":
|
|
20886
|
+
/* "mettagrid/objects.pxd":87
|
|
20872
20887
|
*
|
|
20873
20888
|
* inline void update_inventory(InventoryItem item, short amount):
|
|
20874
20889
|
* this.inventory[<InventoryItem>item] += amount # <<<<<<<<<<<<<<
|
|
20875
|
-
*
|
|
20876
|
-
*
|
|
20890
|
+
* if this.inventory[<InventoryItem>item] > this.max_items:
|
|
20891
|
+
* this.inventory[<InventoryItem>item] = this.max_items
|
|
20877
20892
|
*/
|
|
20878
20893
|
__pyx_t_1 = ((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item);
|
|
20879
20894
|
(this->inventory[__pyx_t_1]) = ((this->inventory[__pyx_t_1]) + __pyx_v_amount);
|
|
20880
20895
|
|
|
20881
|
-
/* "mettagrid/objects.pxd":
|
|
20882
|
-
*
|
|
20896
|
+
/* "mettagrid/objects.pxd":88
|
|
20897
|
+
* inline void update_inventory(InventoryItem item, short amount):
|
|
20898
|
+
* this.inventory[<InventoryItem>item] += amount
|
|
20899
|
+
* if this.inventory[<InventoryItem>item] > this.max_items: # <<<<<<<<<<<<<<
|
|
20900
|
+
* this.inventory[<InventoryItem>item] = this.max_items
|
|
20883
20901
|
*
|
|
20884
|
-
|
|
20902
|
+
*/
|
|
20903
|
+
__pyx_t_2 = ((this->inventory[((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item)]) > this->max_items);
|
|
20904
|
+
if (__pyx_t_2) {
|
|
20905
|
+
|
|
20906
|
+
/* "mettagrid/objects.pxd":89
|
|
20907
|
+
* this.inventory[<InventoryItem>item] += amount
|
|
20908
|
+
* if this.inventory[<InventoryItem>item] > this.max_items:
|
|
20909
|
+
* this.inventory[<InventoryItem>item] = this.max_items # <<<<<<<<<<<<<<
|
|
20910
|
+
*
|
|
20911
|
+
* inline void obs(ObsType[:] obs):
|
|
20912
|
+
*/
|
|
20913
|
+
__pyx_t_3 = this->max_items;
|
|
20914
|
+
(this->inventory[((enum __pyx_t_9mettagrid_7objects_InventoryItem)__pyx_v_item)]) = __pyx_t_3;
|
|
20915
|
+
|
|
20916
|
+
/* "mettagrid/objects.pxd":88
|
|
20917
|
+
* inline void update_inventory(InventoryItem item, short amount):
|
|
20885
20918
|
* this.inventory[<InventoryItem>item] += amount
|
|
20919
|
+
* if this.inventory[<InventoryItem>item] > this.max_items: # <<<<<<<<<<<<<<
|
|
20920
|
+
* this.inventory[<InventoryItem>item] = this.max_items
|
|
20886
20921
|
*
|
|
20922
|
+
*/
|
|
20923
|
+
}
|
|
20924
|
+
|
|
20925
|
+
/* "mettagrid/objects.pxd":86
|
|
20926
|
+
* this.max_items = cfg[b"max_inventory"]
|
|
20927
|
+
*
|
|
20928
|
+
* inline void update_inventory(InventoryItem item, short amount): # <<<<<<<<<<<<<<
|
|
20929
|
+
* this.inventory[<InventoryItem>item] += amount
|
|
20930
|
+
* if this.inventory[<InventoryItem>item] > this.max_items:
|
|
20887
20931
|
*/
|
|
20888
20932
|
|
|
20889
20933
|
/* function exit code */
|
|
20890
20934
|
}
|
|
20891
20935
|
|
|
20892
|
-
/* "mettagrid/objects.pxd":
|
|
20893
|
-
*
|
|
20936
|
+
/* "mettagrid/objects.pxd":91
|
|
20937
|
+
* this.inventory[<InventoryItem>item] = this.max_items
|
|
20894
20938
|
*
|
|
20895
20939
|
* inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
|
|
20896
20940
|
* obs[0] = 1
|
|
@@ -20902,12 +20946,12 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
20902
20946
|
unsigned short __pyx_v_i;
|
|
20903
20947
|
Py_ssize_t __pyx_t_1;
|
|
20904
20948
|
unsigned int __pyx_t_2;
|
|
20905
|
-
char __pyx_t_3;
|
|
20949
|
+
unsigned char __pyx_t_3;
|
|
20906
20950
|
enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_4;
|
|
20907
20951
|
enum __pyx_t_9mettagrid_7objects_InventoryItem __pyx_t_5;
|
|
20908
20952
|
unsigned short __pyx_t_6;
|
|
20909
20953
|
|
|
20910
|
-
/* "mettagrid/objects.pxd":
|
|
20954
|
+
/* "mettagrid/objects.pxd":92
|
|
20911
20955
|
*
|
|
20912
20956
|
* inline void obs(ObsType[:] obs):
|
|
20913
20957
|
* obs[0] = 1 # <<<<<<<<<<<<<<
|
|
@@ -20917,7 +20961,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
20917
20961
|
__pyx_t_1 = 0;
|
|
20918
20962
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
|
|
20919
20963
|
|
|
20920
|
-
/* "mettagrid/objects.pxd":
|
|
20964
|
+
/* "mettagrid/objects.pxd":93
|
|
20921
20965
|
* inline void obs(ObsType[:] obs):
|
|
20922
20966
|
* obs[0] = 1
|
|
20923
20967
|
* obs[1] = this.hp # <<<<<<<<<<<<<<
|
|
@@ -20928,29 +20972,29 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
20928
20972
|
__pyx_t_1 = 1;
|
|
20929
20973
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
|
|
20930
20974
|
|
|
20931
|
-
/* "mettagrid/objects.pxd":
|
|
20975
|
+
/* "mettagrid/objects.pxd":94
|
|
20932
20976
|
* obs[0] = 1
|
|
20933
20977
|
* obs[1] = this.hp
|
|
20934
20978
|
* obs[2] = this.frozen # <<<<<<<<<<<<<<
|
|
20935
20979
|
* obs[3] = this.energy
|
|
20936
20980
|
* obs[4] = this.orientation
|
|
20937
20981
|
*/
|
|
20938
|
-
|
|
20982
|
+
__pyx_t_2 = this->frozen;
|
|
20939
20983
|
__pyx_t_1 = 2;
|
|
20940
|
-
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) =
|
|
20984
|
+
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
|
|
20941
20985
|
|
|
20942
|
-
/* "mettagrid/objects.pxd":
|
|
20986
|
+
/* "mettagrid/objects.pxd":95
|
|
20943
20987
|
* obs[1] = this.hp
|
|
20944
20988
|
* obs[2] = this.frozen
|
|
20945
20989
|
* obs[3] = this.energy # <<<<<<<<<<<<<<
|
|
20946
20990
|
* obs[4] = this.orientation
|
|
20947
20991
|
* obs[5] = this.shield
|
|
20948
20992
|
*/
|
|
20949
|
-
|
|
20993
|
+
__pyx_t_3 = this->energy;
|
|
20950
20994
|
__pyx_t_1 = 3;
|
|
20951
|
-
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) =
|
|
20995
|
+
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
|
|
20952
20996
|
|
|
20953
|
-
/* "mettagrid/objects.pxd":
|
|
20997
|
+
/* "mettagrid/objects.pxd":96
|
|
20954
20998
|
* obs[2] = this.frozen
|
|
20955
20999
|
* obs[3] = this.energy
|
|
20956
21000
|
* obs[4] = this.orientation # <<<<<<<<<<<<<<
|
|
@@ -20961,7 +21005,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
20961
21005
|
__pyx_t_1 = 4;
|
|
20962
21006
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
|
|
20963
21007
|
|
|
20964
|
-
/* "mettagrid/objects.pxd":
|
|
21008
|
+
/* "mettagrid/objects.pxd":97
|
|
20965
21009
|
* obs[3] = this.energy
|
|
20966
21010
|
* obs[4] = this.orientation
|
|
20967
21011
|
* obs[5] = this.shield # <<<<<<<<<<<<<<
|
|
@@ -20972,7 +21016,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
20972
21016
|
__pyx_t_1 = 5;
|
|
20973
21017
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
|
|
20974
21018
|
|
|
20975
|
-
/* "mettagrid/objects.pxd":
|
|
21019
|
+
/* "mettagrid/objects.pxd":99
|
|
20976
21020
|
* obs[5] = this.shield
|
|
20977
21021
|
*
|
|
20978
21022
|
* cdef unsigned short idx = 6 # <<<<<<<<<<<<<<
|
|
@@ -20981,7 +21025,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
20981
21025
|
*/
|
|
20982
21026
|
__pyx_v_idx = 6;
|
|
20983
21027
|
|
|
20984
|
-
/* "mettagrid/objects.pxd":
|
|
21028
|
+
/* "mettagrid/objects.pxd":101
|
|
20985
21029
|
* cdef unsigned short idx = 6
|
|
20986
21030
|
* cdef unsigned short i
|
|
20987
21031
|
* for i in range(InventoryItem.InventoryCount): # <<<<<<<<<<<<<<
|
|
@@ -20993,7 +21037,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
20993
21037
|
for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
|
|
20994
21038
|
__pyx_v_i = __pyx_t_6;
|
|
20995
21039
|
|
|
20996
|
-
/* "mettagrid/objects.pxd":
|
|
21040
|
+
/* "mettagrid/objects.pxd":102
|
|
20997
21041
|
* cdef unsigned short i
|
|
20998
21042
|
* for i in range(InventoryItem.InventoryCount):
|
|
20999
21043
|
* obs[idx + i] = this.inventory[i] # <<<<<<<<<<<<<<
|
|
@@ -21004,8 +21048,8 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
21004
21048
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = (this->inventory[__pyx_v_i]);
|
|
21005
21049
|
}
|
|
21006
21050
|
|
|
21007
|
-
/* "mettagrid/objects.pxd":
|
|
21008
|
-
*
|
|
21051
|
+
/* "mettagrid/objects.pxd":91
|
|
21052
|
+
* this.inventory[<InventoryItem>item] = this.max_items
|
|
21009
21053
|
*
|
|
21010
21054
|
* inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
|
|
21011
21055
|
* obs[0] = 1
|
|
@@ -21015,7 +21059,7 @@ void __pyx_t_9mettagrid_7objects_Agent::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
21015
21059
|
/* function exit code */
|
|
21016
21060
|
}
|
|
21017
21061
|
|
|
21018
|
-
/* "mettagrid/objects.pxd":
|
|
21062
|
+
/* "mettagrid/objects.pxd":105
|
|
21019
21063
|
*
|
|
21020
21064
|
* @staticmethod
|
|
21021
21065
|
* inline vector[string] feature_names(): # <<<<<<<<<<<<<<
|
|
@@ -21039,46 +21083,46 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
|
|
|
21039
21083
|
int __pyx_clineno = 0;
|
|
21040
21084
|
__Pyx_RefNannySetupContext("feature_names", 1);
|
|
21041
21085
|
|
|
21042
|
-
/* "mettagrid/objects.pxd":
|
|
21086
|
+
/* "mettagrid/objects.pxd":106
|
|
21043
21087
|
* @staticmethod
|
|
21044
21088
|
* inline vector[string] feature_names():
|
|
21045
21089
|
* return [ # <<<<<<<<<<<<<<
|
|
21046
21090
|
* "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
|
|
21047
21091
|
* "agent:shield"
|
|
21048
21092
|
*/
|
|
21049
|
-
__pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3,
|
|
21093
|
+
__pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 106, __pyx_L1_error)
|
|
21050
21094
|
__Pyx_GOTREF(__pyx_t_1);
|
|
21051
21095
|
__Pyx_INCREF(__pyx_n_u_agent);
|
|
21052
21096
|
__Pyx_GIVEREF(__pyx_n_u_agent);
|
|
21053
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_agent)) __PYX_ERR(3,
|
|
21097
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_agent)) __PYX_ERR(3, 106, __pyx_L1_error);
|
|
21054
21098
|
__Pyx_INCREF(__pyx_kp_u_agent_hp);
|
|
21055
21099
|
__Pyx_GIVEREF(__pyx_kp_u_agent_hp);
|
|
21056
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_agent_hp)) __PYX_ERR(3,
|
|
21100
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_agent_hp)) __PYX_ERR(3, 106, __pyx_L1_error);
|
|
21057
21101
|
__Pyx_INCREF(__pyx_kp_u_agent_frozen);
|
|
21058
21102
|
__Pyx_GIVEREF(__pyx_kp_u_agent_frozen);
|
|
21059
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_agent_frozen)) __PYX_ERR(3,
|
|
21103
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_agent_frozen)) __PYX_ERR(3, 106, __pyx_L1_error);
|
|
21060
21104
|
__Pyx_INCREF(__pyx_kp_u_agent_energy);
|
|
21061
21105
|
__Pyx_GIVEREF(__pyx_kp_u_agent_energy);
|
|
21062
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_agent_energy)) __PYX_ERR(3,
|
|
21106
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_agent_energy)) __PYX_ERR(3, 106, __pyx_L1_error);
|
|
21063
21107
|
__Pyx_INCREF(__pyx_kp_u_agent_orientation);
|
|
21064
21108
|
__Pyx_GIVEREF(__pyx_kp_u_agent_orientation);
|
|
21065
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_agent_orientation)) __PYX_ERR(3,
|
|
21109
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_agent_orientation)) __PYX_ERR(3, 106, __pyx_L1_error);
|
|
21066
21110
|
__Pyx_INCREF(__pyx_kp_u_agent_shield);
|
|
21067
21111
|
__Pyx_GIVEREF(__pyx_kp_u_agent_shield);
|
|
21068
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_agent_shield)) __PYX_ERR(3,
|
|
21112
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_agent_shield)) __PYX_ERR(3, 106, __pyx_L1_error);
|
|
21069
21113
|
{ /* enter inner scope */
|
|
21070
21114
|
|
|
21071
|
-
/* "mettagrid/objects.pxd":
|
|
21115
|
+
/* "mettagrid/objects.pxd":109
|
|
21072
21116
|
* "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
|
|
21073
21117
|
* "agent:shield"
|
|
21074
21118
|
* ] + [ # <<<<<<<<<<<<<<
|
|
21075
21119
|
* "agent:inv:" + n for n in InventoryItemNames]
|
|
21076
21120
|
*
|
|
21077
21121
|
*/
|
|
21078
|
-
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3,
|
|
21122
|
+
__pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 109, __pyx_L1_error)
|
|
21079
21123
|
__Pyx_GOTREF(__pyx_t_2);
|
|
21080
21124
|
|
|
21081
|
-
/* "mettagrid/objects.pxd":
|
|
21125
|
+
/* "mettagrid/objects.pxd":110
|
|
21082
21126
|
* "agent:shield"
|
|
21083
21127
|
* ] + [
|
|
21084
21128
|
* "agent:inv:" + n for n in InventoryItemNames] # <<<<<<<<<<<<<<
|
|
@@ -21091,33 +21135,33 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
|
|
|
21091
21135
|
__pyx_t_4 = *__pyx_t_3;
|
|
21092
21136
|
++__pyx_t_3;
|
|
21093
21137
|
__pyx_7genexpr__pyx_v_n = __PYX_STD_MOVE_IF_SUPPORTED(__pyx_t_4);
|
|
21094
|
-
__pyx_t_5 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(__pyx_7genexpr__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(3,
|
|
21138
|
+
__pyx_t_5 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string(__pyx_7genexpr__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(3, 110, __pyx_L1_error)
|
|
21095
21139
|
__Pyx_GOTREF(__pyx_t_5);
|
|
21096
|
-
__pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_agent_inv, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3,
|
|
21140
|
+
__pyx_t_6 = __Pyx_PyUnicode_Concat(__pyx_kp_u_agent_inv, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 110, __pyx_L1_error)
|
|
21097
21141
|
__Pyx_GOTREF(__pyx_t_6);
|
|
21098
21142
|
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
|
21099
|
-
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3,
|
|
21143
|
+
if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(3, 109, __pyx_L1_error)
|
|
21100
21144
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
21101
21145
|
}
|
|
21102
21146
|
} /* exit inner scope */
|
|
21103
21147
|
|
|
21104
|
-
/* "mettagrid/objects.pxd":
|
|
21148
|
+
/* "mettagrid/objects.pxd":109
|
|
21105
21149
|
* "agent", "agent:hp", "agent:frozen", "agent:energy", "agent:orientation",
|
|
21106
21150
|
* "agent:shield"
|
|
21107
21151
|
* ] + [ # <<<<<<<<<<<<<<
|
|
21108
21152
|
* "agent:inv:" + n for n in InventoryItemNames]
|
|
21109
21153
|
*
|
|
21110
21154
|
*/
|
|
21111
|
-
__pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3,
|
|
21155
|
+
__pyx_t_6 = PyNumber_Add(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(3, 109, __pyx_L1_error)
|
|
21112
21156
|
__Pyx_GOTREF(__pyx_t_6);
|
|
21113
21157
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
21114
21158
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
21115
|
-
__pyx_t_7 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
21159
|
+
__pyx_t_7 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_6); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 109, __pyx_L1_error)
|
|
21116
21160
|
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
|
|
21117
21161
|
__pyx_r = __pyx_t_7;
|
|
21118
21162
|
goto __pyx_L0;
|
|
21119
21163
|
|
|
21120
|
-
/* "mettagrid/objects.pxd":
|
|
21164
|
+
/* "mettagrid/objects.pxd":105
|
|
21121
21165
|
*
|
|
21122
21166
|
* @staticmethod
|
|
21123
21167
|
* inline vector[string] feature_names(): # <<<<<<<<<<<<<<
|
|
@@ -21138,7 +21182,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Agent::feature_names(void)
|
|
|
21138
21182
|
return __pyx_r;
|
|
21139
21183
|
}
|
|
21140
21184
|
|
|
21141
|
-
/* "mettagrid/objects.pxd":
|
|
21185
|
+
/* "mettagrid/objects.pxd":113
|
|
21142
21186
|
*
|
|
21143
21187
|
* cdef cppclass Wall(MettaObject):
|
|
21144
21188
|
* inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -21151,7 +21195,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
|
|
|
21151
21195
|
const char *__pyx_filename = NULL;
|
|
21152
21196
|
int __pyx_clineno = 0;
|
|
21153
21197
|
|
|
21154
|
-
/* "mettagrid/objects.pxd":
|
|
21198
|
+
/* "mettagrid/objects.pxd":114
|
|
21155
21199
|
* cdef cppclass Wall(MettaObject):
|
|
21156
21200
|
* inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg):
|
|
21157
21201
|
* GridObject.init(ObjectType.WallT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
|
|
@@ -21160,16 +21204,16 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
|
|
|
21160
21204
|
*/
|
|
21161
21205
|
GridObject::init(__pyx_e_9mettagrid_7objects_WallT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
|
|
21162
21206
|
|
|
21163
|
-
/* "mettagrid/objects.pxd":
|
|
21207
|
+
/* "mettagrid/objects.pxd":115
|
|
21164
21208
|
* inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg):
|
|
21165
21209
|
* GridObject.init(ObjectType.WallT, GridLocation(r, c, GridLayer.Object_Layer))
|
|
21166
21210
|
* MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
|
|
21167
21211
|
*
|
|
21168
21212
|
* inline void obs(ObsType[:] obs):
|
|
21169
21213
|
*/
|
|
21170
|
-
__pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
21214
|
+
__pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 115, __pyx_L1_error)
|
|
21171
21215
|
|
|
21172
|
-
/* "mettagrid/objects.pxd":
|
|
21216
|
+
/* "mettagrid/objects.pxd":113
|
|
21173
21217
|
*
|
|
21174
21218
|
* cdef cppclass Wall(MettaObject):
|
|
21175
21219
|
* inline Wall(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -21184,7 +21228,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
|
|
|
21184
21228
|
__pyx_L0:;
|
|
21185
21229
|
}
|
|
21186
21230
|
|
|
21187
|
-
/* "mettagrid/objects.pxd":
|
|
21231
|
+
/* "mettagrid/objects.pxd":117
|
|
21188
21232
|
* MettaObject.init_mo(cfg)
|
|
21189
21233
|
*
|
|
21190
21234
|
* inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
|
|
@@ -21195,7 +21239,7 @@ void __pyx_t_9mettagrid_7objects_Wall::__pyx_f___init__Wall(GridCoord __pyx_v_r,
|
|
|
21195
21239
|
void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
21196
21240
|
Py_ssize_t __pyx_t_1;
|
|
21197
21241
|
|
|
21198
|
-
/* "mettagrid/objects.pxd":
|
|
21242
|
+
/* "mettagrid/objects.pxd":118
|
|
21199
21243
|
*
|
|
21200
21244
|
* inline void obs(ObsType[:] obs):
|
|
21201
21245
|
* obs[0] = 1 # <<<<<<<<<<<<<<
|
|
@@ -21205,7 +21249,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
21205
21249
|
__pyx_t_1 = 0;
|
|
21206
21250
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
|
|
21207
21251
|
|
|
21208
|
-
/* "mettagrid/objects.pxd":
|
|
21252
|
+
/* "mettagrid/objects.pxd":119
|
|
21209
21253
|
* inline void obs(ObsType[:] obs):
|
|
21210
21254
|
* obs[0] = 1
|
|
21211
21255
|
* obs[1] = hp # <<<<<<<<<<<<<<
|
|
@@ -21215,7 +21259,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
21215
21259
|
__pyx_t_1 = 1;
|
|
21216
21260
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
|
|
21217
21261
|
|
|
21218
|
-
/* "mettagrid/objects.pxd":
|
|
21262
|
+
/* "mettagrid/objects.pxd":117
|
|
21219
21263
|
* MettaObject.init_mo(cfg)
|
|
21220
21264
|
*
|
|
21221
21265
|
* inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
|
|
@@ -21226,7 +21270,7 @@ void __pyx_t_9mettagrid_7objects_Wall::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
21226
21270
|
/* function exit code */
|
|
21227
21271
|
}
|
|
21228
21272
|
|
|
21229
|
-
/* "mettagrid/objects.pxd":
|
|
21273
|
+
/* "mettagrid/objects.pxd":122
|
|
21230
21274
|
*
|
|
21231
21275
|
* @staticmethod
|
|
21232
21276
|
* inline vector[string] feature_names(): # <<<<<<<<<<<<<<
|
|
@@ -21244,27 +21288,27 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Wall::feature_names(void)
|
|
|
21244
21288
|
int __pyx_clineno = 0;
|
|
21245
21289
|
__Pyx_RefNannySetupContext("feature_names", 1);
|
|
21246
21290
|
|
|
21247
|
-
/* "mettagrid/objects.pxd":
|
|
21291
|
+
/* "mettagrid/objects.pxd":123
|
|
21248
21292
|
* @staticmethod
|
|
21249
21293
|
* inline vector[string] feature_names():
|
|
21250
21294
|
* return ["wall", "wall:hp"] # <<<<<<<<<<<<<<
|
|
21251
21295
|
*
|
|
21252
21296
|
* cdef cppclass Generator(Usable):
|
|
21253
21297
|
*/
|
|
21254
|
-
__pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3,
|
|
21298
|
+
__pyx_t_1 = PyList_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 123, __pyx_L1_error)
|
|
21255
21299
|
__Pyx_GOTREF(__pyx_t_1);
|
|
21256
21300
|
__Pyx_INCREF(__pyx_n_u_wall);
|
|
21257
21301
|
__Pyx_GIVEREF(__pyx_n_u_wall);
|
|
21258
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_wall)) __PYX_ERR(3,
|
|
21302
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_wall)) __PYX_ERR(3, 123, __pyx_L1_error);
|
|
21259
21303
|
__Pyx_INCREF(__pyx_kp_u_wall_hp);
|
|
21260
21304
|
__Pyx_GIVEREF(__pyx_kp_u_wall_hp);
|
|
21261
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_wall_hp)) __PYX_ERR(3,
|
|
21262
|
-
__pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
21305
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_wall_hp)) __PYX_ERR(3, 123, __pyx_L1_error);
|
|
21306
|
+
__pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 123, __pyx_L1_error)
|
|
21263
21307
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
21264
21308
|
__pyx_r = __pyx_t_2;
|
|
21265
21309
|
goto __pyx_L0;
|
|
21266
21310
|
|
|
21267
|
-
/* "mettagrid/objects.pxd":
|
|
21311
|
+
/* "mettagrid/objects.pxd":122
|
|
21268
21312
|
*
|
|
21269
21313
|
* @staticmethod
|
|
21270
21314
|
* inline vector[string] feature_names(): # <<<<<<<<<<<<<<
|
|
@@ -21282,7 +21326,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Wall::feature_names(void)
|
|
|
21282
21326
|
return __pyx_r;
|
|
21283
21327
|
}
|
|
21284
21328
|
|
|
21285
|
-
/* "mettagrid/objects.pxd":
|
|
21329
|
+
/* "mettagrid/objects.pxd":128
|
|
21286
21330
|
* unsigned int r1
|
|
21287
21331
|
*
|
|
21288
21332
|
* inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -21295,7 +21339,7 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
|
|
|
21295
21339
|
const char *__pyx_filename = NULL;
|
|
21296
21340
|
int __pyx_clineno = 0;
|
|
21297
21341
|
|
|
21298
|
-
/* "mettagrid/objects.pxd":
|
|
21342
|
+
/* "mettagrid/objects.pxd":129
|
|
21299
21343
|
*
|
|
21300
21344
|
* inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg):
|
|
21301
21345
|
* GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
|
|
@@ -21304,34 +21348,34 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
|
|
|
21304
21348
|
*/
|
|
21305
21349
|
GridObject::init(__pyx_e_9mettagrid_7objects_GeneratorT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
|
|
21306
21350
|
|
|
21307
|
-
/* "mettagrid/objects.pxd":
|
|
21351
|
+
/* "mettagrid/objects.pxd":130
|
|
21308
21352
|
* inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg):
|
|
21309
21353
|
* GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer))
|
|
21310
21354
|
* MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
|
|
21311
21355
|
* Usable.init_usable(cfg)
|
|
21312
21356
|
* this.r1 = cfg[b"initial_resources"]
|
|
21313
21357
|
*/
|
|
21314
|
-
__pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
21358
|
+
__pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 130, __pyx_L1_error)
|
|
21315
21359
|
|
|
21316
|
-
/* "mettagrid/objects.pxd":
|
|
21360
|
+
/* "mettagrid/objects.pxd":131
|
|
21317
21361
|
* GridObject.init(ObjectType.GeneratorT, GridLocation(r, c, GridLayer.Object_Layer))
|
|
21318
21362
|
* MettaObject.init_mo(cfg)
|
|
21319
21363
|
* Usable.init_usable(cfg) # <<<<<<<<<<<<<<
|
|
21320
21364
|
* this.r1 = cfg[b"initial_resources"]
|
|
21321
21365
|
*
|
|
21322
21366
|
*/
|
|
21323
|
-
__pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
21367
|
+
__pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 131, __pyx_L1_error)
|
|
21324
21368
|
|
|
21325
|
-
/* "mettagrid/objects.pxd":
|
|
21369
|
+
/* "mettagrid/objects.pxd":132
|
|
21326
21370
|
* MettaObject.init_mo(cfg)
|
|
21327
21371
|
* Usable.init_usable(cfg)
|
|
21328
21372
|
* this.r1 = cfg[b"initial_resources"] # <<<<<<<<<<<<<<
|
|
21329
21373
|
*
|
|
21330
|
-
* inline
|
|
21374
|
+
* inline bint usable(const Agent *actor):
|
|
21331
21375
|
*/
|
|
21332
21376
|
this->r1 = (__pyx_v_cfg[__pyx_k_initial_resources]);
|
|
21333
21377
|
|
|
21334
|
-
/* "mettagrid/objects.pxd":
|
|
21378
|
+
/* "mettagrid/objects.pxd":128
|
|
21335
21379
|
* unsigned int r1
|
|
21336
21380
|
*
|
|
21337
21381
|
* inline Generator(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -21346,46 +21390,45 @@ void __pyx_t_9mettagrid_7objects_Generator::__pyx_f___init__Generator(GridCoord
|
|
|
21346
21390
|
__pyx_L0:;
|
|
21347
21391
|
}
|
|
21348
21392
|
|
|
21349
|
-
/* "mettagrid/objects.pxd":
|
|
21393
|
+
/* "mettagrid/objects.pxd":134
|
|
21350
21394
|
* this.r1 = cfg[b"initial_resources"]
|
|
21351
21395
|
*
|
|
21352
|
-
* inline
|
|
21396
|
+
* inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
|
|
21353
21397
|
* return Usable.usable(actor) and this.r1 > 0
|
|
21354
21398
|
*
|
|
21355
21399
|
*/
|
|
21356
21400
|
|
|
21357
|
-
|
|
21358
|
-
|
|
21359
|
-
|
|
21360
|
-
|
|
21361
|
-
int __pyx_t_3;
|
|
21401
|
+
int __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
|
|
21402
|
+
int __pyx_r;
|
|
21403
|
+
int __pyx_t_1;
|
|
21404
|
+
int __pyx_t_2;
|
|
21362
21405
|
int __pyx_lineno = 0;
|
|
21363
21406
|
const char *__pyx_filename = NULL;
|
|
21364
21407
|
int __pyx_clineno = 0;
|
|
21365
21408
|
|
|
21366
|
-
/* "mettagrid/objects.pxd":
|
|
21409
|
+
/* "mettagrid/objects.pxd":135
|
|
21367
21410
|
*
|
|
21368
|
-
* inline
|
|
21411
|
+
* inline bint usable(const Agent *actor):
|
|
21369
21412
|
* return Usable.usable(actor) and this.r1 > 0 # <<<<<<<<<<<<<<
|
|
21370
21413
|
*
|
|
21371
21414
|
* inline void obs(ObsType[:] obs):
|
|
21372
21415
|
*/
|
|
21373
|
-
__pyx_t_2 = __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_v_actor); if (unlikely(__pyx_t_2 == ((
|
|
21416
|
+
__pyx_t_2 = __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_v_actor); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(3, 135, __pyx_L1_error)
|
|
21374
21417
|
if (__pyx_t_2) {
|
|
21375
21418
|
} else {
|
|
21376
21419
|
__pyx_t_1 = __pyx_t_2;
|
|
21377
21420
|
goto __pyx_L3_bool_binop_done;
|
|
21378
21421
|
}
|
|
21379
|
-
|
|
21380
|
-
__pyx_t_1 =
|
|
21422
|
+
__pyx_t_2 = (this->r1 > 0);
|
|
21423
|
+
__pyx_t_1 = __pyx_t_2;
|
|
21381
21424
|
__pyx_L3_bool_binop_done:;
|
|
21382
21425
|
__pyx_r = __pyx_t_1;
|
|
21383
21426
|
goto __pyx_L0;
|
|
21384
21427
|
|
|
21385
|
-
/* "mettagrid/objects.pxd":
|
|
21428
|
+
/* "mettagrid/objects.pxd":134
|
|
21386
21429
|
* this.r1 = cfg[b"initial_resources"]
|
|
21387
21430
|
*
|
|
21388
|
-
* inline
|
|
21431
|
+
* inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
|
|
21389
21432
|
* return Usable.usable(actor) and this.r1 > 0
|
|
21390
21433
|
*
|
|
21391
21434
|
*/
|
|
@@ -21398,7 +21441,7 @@ char __pyx_t_9mettagrid_7objects_Generator::usable(__pyx_t_9mettagrid_7objects_A
|
|
|
21398
21441
|
return __pyx_r;
|
|
21399
21442
|
}
|
|
21400
21443
|
|
|
21401
|
-
/* "mettagrid/objects.pxd":
|
|
21444
|
+
/* "mettagrid/objects.pxd":137
|
|
21402
21445
|
* return Usable.usable(actor) and this.r1 > 0
|
|
21403
21446
|
*
|
|
21404
21447
|
* inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
|
|
@@ -21411,7 +21454,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
|
|
|
21411
21454
|
unsigned int __pyx_t_2;
|
|
21412
21455
|
unsigned char __pyx_t_3;
|
|
21413
21456
|
|
|
21414
|
-
/* "mettagrid/objects.pxd":
|
|
21457
|
+
/* "mettagrid/objects.pxd":138
|
|
21415
21458
|
*
|
|
21416
21459
|
* inline void obs(ObsType[:] obs):
|
|
21417
21460
|
* obs[0] = 1 # <<<<<<<<<<<<<<
|
|
@@ -21421,7 +21464,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
|
|
|
21421
21464
|
__pyx_t_1 = 0;
|
|
21422
21465
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
|
|
21423
21466
|
|
|
21424
|
-
/* "mettagrid/objects.pxd":
|
|
21467
|
+
/* "mettagrid/objects.pxd":139
|
|
21425
21468
|
* inline void obs(ObsType[:] obs):
|
|
21426
21469
|
* obs[0] = 1
|
|
21427
21470
|
* obs[1] = this.hp # <<<<<<<<<<<<<<
|
|
@@ -21432,7 +21475,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
|
|
|
21432
21475
|
__pyx_t_1 = 1;
|
|
21433
21476
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
|
|
21434
21477
|
|
|
21435
|
-
/* "mettagrid/objects.pxd":
|
|
21478
|
+
/* "mettagrid/objects.pxd":140
|
|
21436
21479
|
* obs[0] = 1
|
|
21437
21480
|
* obs[1] = this.hp
|
|
21438
21481
|
* obs[2] = this.r1 # <<<<<<<<<<<<<<
|
|
@@ -21443,7 +21486,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
|
|
|
21443
21486
|
__pyx_t_1 = 2;
|
|
21444
21487
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_2;
|
|
21445
21488
|
|
|
21446
|
-
/* "mettagrid/objects.pxd":
|
|
21489
|
+
/* "mettagrid/objects.pxd":141
|
|
21447
21490
|
* obs[1] = this.hp
|
|
21448
21491
|
* obs[2] = this.r1
|
|
21449
21492
|
* obs[3] = this.ready # <<<<<<<<<<<<<<
|
|
@@ -21454,7 +21497,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
|
|
|
21454
21497
|
__pyx_t_1 = 3;
|
|
21455
21498
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = __pyx_t_3;
|
|
21456
21499
|
|
|
21457
|
-
/* "mettagrid/objects.pxd":
|
|
21500
|
+
/* "mettagrid/objects.pxd":137
|
|
21458
21501
|
* return Usable.usable(actor) and this.r1 > 0
|
|
21459
21502
|
*
|
|
21460
21503
|
* inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
|
|
@@ -21465,7 +21508,7 @@ void __pyx_t_9mettagrid_7objects_Generator::obs(__Pyx_memviewslice __pyx_v_obs)
|
|
|
21465
21508
|
/* function exit code */
|
|
21466
21509
|
}
|
|
21467
21510
|
|
|
21468
|
-
/* "mettagrid/objects.pxd":
|
|
21511
|
+
/* "mettagrid/objects.pxd":145
|
|
21469
21512
|
*
|
|
21470
21513
|
* @staticmethod
|
|
21471
21514
|
* inline vector[string] feature_names(): # <<<<<<<<<<<<<<
|
|
@@ -21483,33 +21526,33 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Generator::feature_names(v
|
|
|
21483
21526
|
int __pyx_clineno = 0;
|
|
21484
21527
|
__Pyx_RefNannySetupContext("feature_names", 1);
|
|
21485
21528
|
|
|
21486
|
-
/* "mettagrid/objects.pxd":
|
|
21529
|
+
/* "mettagrid/objects.pxd":146
|
|
21487
21530
|
* @staticmethod
|
|
21488
21531
|
* inline vector[string] feature_names():
|
|
21489
21532
|
* return ["generator", "generator:hp", "generator:r1", "generator:ready"] # <<<<<<<<<<<<<<
|
|
21490
21533
|
*
|
|
21491
21534
|
* cdef cppclass Converter(Usable):
|
|
21492
21535
|
*/
|
|
21493
|
-
__pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3,
|
|
21536
|
+
__pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 146, __pyx_L1_error)
|
|
21494
21537
|
__Pyx_GOTREF(__pyx_t_1);
|
|
21495
21538
|
__Pyx_INCREF(__pyx_n_u_generator);
|
|
21496
21539
|
__Pyx_GIVEREF(__pyx_n_u_generator);
|
|
21497
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_generator)) __PYX_ERR(3,
|
|
21540
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_generator)) __PYX_ERR(3, 146, __pyx_L1_error);
|
|
21498
21541
|
__Pyx_INCREF(__pyx_kp_u_generator_hp);
|
|
21499
21542
|
__Pyx_GIVEREF(__pyx_kp_u_generator_hp);
|
|
21500
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_generator_hp)) __PYX_ERR(3,
|
|
21543
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_generator_hp)) __PYX_ERR(3, 146, __pyx_L1_error);
|
|
21501
21544
|
__Pyx_INCREF(__pyx_kp_u_generator_r1);
|
|
21502
21545
|
__Pyx_GIVEREF(__pyx_kp_u_generator_r1);
|
|
21503
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_generator_r1)) __PYX_ERR(3,
|
|
21546
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_generator_r1)) __PYX_ERR(3, 146, __pyx_L1_error);
|
|
21504
21547
|
__Pyx_INCREF(__pyx_kp_u_generator_ready);
|
|
21505
21548
|
__Pyx_GIVEREF(__pyx_kp_u_generator_ready);
|
|
21506
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_generator_ready)) __PYX_ERR(3,
|
|
21507
|
-
__pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
21549
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_generator_ready)) __PYX_ERR(3, 146, __pyx_L1_error);
|
|
21550
|
+
__pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 146, __pyx_L1_error)
|
|
21508
21551
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
21509
21552
|
__pyx_r = __pyx_t_2;
|
|
21510
21553
|
goto __pyx_L0;
|
|
21511
21554
|
|
|
21512
|
-
/* "mettagrid/objects.pxd":
|
|
21555
|
+
/* "mettagrid/objects.pxd":145
|
|
21513
21556
|
*
|
|
21514
21557
|
* @staticmethod
|
|
21515
21558
|
* inline vector[string] feature_names(): # <<<<<<<<<<<<<<
|
|
@@ -21527,7 +21570,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Generator::feature_names(v
|
|
|
21527
21570
|
return __pyx_r;
|
|
21528
21571
|
}
|
|
21529
21572
|
|
|
21530
|
-
/* "mettagrid/objects.pxd":
|
|
21573
|
+
/* "mettagrid/objects.pxd":153
|
|
21531
21574
|
* short output_energy
|
|
21532
21575
|
*
|
|
21533
21576
|
* inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -21540,7 +21583,7 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
|
|
|
21540
21583
|
const char *__pyx_filename = NULL;
|
|
21541
21584
|
int __pyx_clineno = 0;
|
|
21542
21585
|
|
|
21543
|
-
/* "mettagrid/objects.pxd":
|
|
21586
|
+
/* "mettagrid/objects.pxd":154
|
|
21544
21587
|
*
|
|
21545
21588
|
* inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg):
|
|
21546
21589
|
* GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
|
|
@@ -21549,25 +21592,25 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
|
|
|
21549
21592
|
*/
|
|
21550
21593
|
GridObject::init(__pyx_e_9mettagrid_7objects_ConverterT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
|
|
21551
21594
|
|
|
21552
|
-
/* "mettagrid/objects.pxd":
|
|
21595
|
+
/* "mettagrid/objects.pxd":155
|
|
21553
21596
|
* inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg):
|
|
21554
21597
|
* GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer))
|
|
21555
21598
|
* MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
|
|
21556
21599
|
* Usable.init_usable(cfg)
|
|
21557
21600
|
* this.input_resource = InventoryItem.r1
|
|
21558
21601
|
*/
|
|
21559
|
-
__pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
21602
|
+
__pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 155, __pyx_L1_error)
|
|
21560
21603
|
|
|
21561
|
-
/* "mettagrid/objects.pxd":
|
|
21604
|
+
/* "mettagrid/objects.pxd":156
|
|
21562
21605
|
* GridObject.init(ObjectType.ConverterT, GridLocation(r, c, GridLayer.Object_Layer))
|
|
21563
21606
|
* MettaObject.init_mo(cfg)
|
|
21564
21607
|
* Usable.init_usable(cfg) # <<<<<<<<<<<<<<
|
|
21565
21608
|
* this.input_resource = InventoryItem.r1
|
|
21566
21609
|
* this.output_resource = InventoryItem.r2
|
|
21567
21610
|
*/
|
|
21568
|
-
__pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
21611
|
+
__pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 156, __pyx_L1_error)
|
|
21569
21612
|
|
|
21570
|
-
/* "mettagrid/objects.pxd":
|
|
21613
|
+
/* "mettagrid/objects.pxd":157
|
|
21571
21614
|
* MettaObject.init_mo(cfg)
|
|
21572
21615
|
* Usable.init_usable(cfg)
|
|
21573
21616
|
* this.input_resource = InventoryItem.r1 # <<<<<<<<<<<<<<
|
|
@@ -21576,7 +21619,7 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
|
|
|
21576
21619
|
*/
|
|
21577
21620
|
this->input_resource = __pyx_e_9mettagrid_7objects_r1;
|
|
21578
21621
|
|
|
21579
|
-
/* "mettagrid/objects.pxd":
|
|
21622
|
+
/* "mettagrid/objects.pxd":158
|
|
21580
21623
|
* Usable.init_usable(cfg)
|
|
21581
21624
|
* this.input_resource = InventoryItem.r1
|
|
21582
21625
|
* this.output_resource = InventoryItem.r2 # <<<<<<<<<<<<<<
|
|
@@ -21585,16 +21628,16 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
|
|
|
21585
21628
|
*/
|
|
21586
21629
|
this->output_resource = __pyx_e_9mettagrid_7objects_r2;
|
|
21587
21630
|
|
|
21588
|
-
/* "mettagrid/objects.pxd":
|
|
21631
|
+
/* "mettagrid/objects.pxd":159
|
|
21589
21632
|
* this.input_resource = InventoryItem.r1
|
|
21590
21633
|
* this.output_resource = InventoryItem.r2
|
|
21591
21634
|
* this.output_energy = cfg[b"energy_output.r1"] # <<<<<<<<<<<<<<
|
|
21592
21635
|
*
|
|
21593
|
-
* inline
|
|
21636
|
+
* inline bint usable(const Agent *actor):
|
|
21594
21637
|
*/
|
|
21595
21638
|
this->output_energy = (__pyx_v_cfg[__pyx_k_energy_output_r1]);
|
|
21596
21639
|
|
|
21597
|
-
/* "mettagrid/objects.pxd":
|
|
21640
|
+
/* "mettagrid/objects.pxd":153
|
|
21598
21641
|
* short output_energy
|
|
21599
21642
|
*
|
|
21600
21643
|
* inline Converter(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -21609,46 +21652,45 @@ void __pyx_t_9mettagrid_7objects_Converter::__pyx_f___init__Converter(GridCoord
|
|
|
21609
21652
|
__pyx_L0:;
|
|
21610
21653
|
}
|
|
21611
21654
|
|
|
21612
|
-
/* "mettagrid/objects.pxd":
|
|
21655
|
+
/* "mettagrid/objects.pxd":161
|
|
21613
21656
|
* this.output_energy = cfg[b"energy_output.r1"]
|
|
21614
21657
|
*
|
|
21615
|
-
* inline
|
|
21658
|
+
* inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
|
|
21616
21659
|
* return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
|
|
21617
21660
|
*
|
|
21618
21661
|
*/
|
|
21619
21662
|
|
|
21620
|
-
|
|
21621
|
-
|
|
21622
|
-
|
|
21623
|
-
|
|
21624
|
-
int __pyx_t_3;
|
|
21663
|
+
int __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_Agent const *__pyx_v_actor) {
|
|
21664
|
+
int __pyx_r;
|
|
21665
|
+
int __pyx_t_1;
|
|
21666
|
+
int __pyx_t_2;
|
|
21625
21667
|
int __pyx_lineno = 0;
|
|
21626
21668
|
const char *__pyx_filename = NULL;
|
|
21627
21669
|
int __pyx_clineno = 0;
|
|
21628
21670
|
|
|
21629
|
-
/* "mettagrid/objects.pxd":
|
|
21671
|
+
/* "mettagrid/objects.pxd":162
|
|
21630
21672
|
*
|
|
21631
|
-
* inline
|
|
21673
|
+
* inline bint usable(const Agent *actor):
|
|
21632
21674
|
* return Usable.usable(actor) and actor.inventory[this.input_resource] > 0 # <<<<<<<<<<<<<<
|
|
21633
21675
|
*
|
|
21634
21676
|
* inline obs(ObsType[:] obs):
|
|
21635
21677
|
*/
|
|
21636
|
-
__pyx_t_2 = __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_v_actor); if (unlikely(__pyx_t_2 == ((
|
|
21678
|
+
__pyx_t_2 = __pyx_t_9mettagrid_7objects_Usable::usable(__pyx_v_actor); if (unlikely(__pyx_t_2 == ((int)-1) && PyErr_Occurred())) __PYX_ERR(3, 162, __pyx_L1_error)
|
|
21637
21679
|
if (__pyx_t_2) {
|
|
21638
21680
|
} else {
|
|
21639
21681
|
__pyx_t_1 = __pyx_t_2;
|
|
21640
21682
|
goto __pyx_L3_bool_binop_done;
|
|
21641
21683
|
}
|
|
21642
|
-
|
|
21643
|
-
__pyx_t_1 =
|
|
21684
|
+
__pyx_t_2 = ((__pyx_v_actor->inventory[this->input_resource]) > 0);
|
|
21685
|
+
__pyx_t_1 = __pyx_t_2;
|
|
21644
21686
|
__pyx_L3_bool_binop_done:;
|
|
21645
21687
|
__pyx_r = __pyx_t_1;
|
|
21646
21688
|
goto __pyx_L0;
|
|
21647
21689
|
|
|
21648
|
-
/* "mettagrid/objects.pxd":
|
|
21690
|
+
/* "mettagrid/objects.pxd":161
|
|
21649
21691
|
* this.output_energy = cfg[b"energy_output.r1"]
|
|
21650
21692
|
*
|
|
21651
|
-
* inline
|
|
21693
|
+
* inline bint usable(const Agent *actor): # <<<<<<<<<<<<<<
|
|
21652
21694
|
* return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
|
|
21653
21695
|
*
|
|
21654
21696
|
*/
|
|
@@ -21661,7 +21703,7 @@ char __pyx_t_9mettagrid_7objects_Converter::usable(__pyx_t_9mettagrid_7objects_A
|
|
|
21661
21703
|
return __pyx_r;
|
|
21662
21704
|
}
|
|
21663
21705
|
|
|
21664
|
-
/* "mettagrid/objects.pxd":
|
|
21706
|
+
/* "mettagrid/objects.pxd":164
|
|
21665
21707
|
* return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
|
|
21666
21708
|
*
|
|
21667
21709
|
* inline obs(ObsType[:] obs): # <<<<<<<<<<<<<<
|
|
@@ -21675,7 +21717,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
|
|
|
21675
21717
|
Py_ssize_t __pyx_t_1;
|
|
21676
21718
|
__Pyx_RefNannySetupContext("obs", 1);
|
|
21677
21719
|
|
|
21678
|
-
/* "mettagrid/objects.pxd":
|
|
21720
|
+
/* "mettagrid/objects.pxd":165
|
|
21679
21721
|
*
|
|
21680
21722
|
* inline obs(ObsType[:] obs):
|
|
21681
21723
|
* obs[0] = 1 # <<<<<<<<<<<<<<
|
|
@@ -21685,7 +21727,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
|
|
|
21685
21727
|
__pyx_t_1 = 0;
|
|
21686
21728
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
|
|
21687
21729
|
|
|
21688
|
-
/* "mettagrid/objects.pxd":
|
|
21730
|
+
/* "mettagrid/objects.pxd":166
|
|
21689
21731
|
* inline obs(ObsType[:] obs):
|
|
21690
21732
|
* obs[0] = 1
|
|
21691
21733
|
* obs[1] = hp # <<<<<<<<<<<<<<
|
|
@@ -21695,7 +21737,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
|
|
|
21695
21737
|
__pyx_t_1 = 1;
|
|
21696
21738
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
|
|
21697
21739
|
|
|
21698
|
-
/* "mettagrid/objects.pxd":
|
|
21740
|
+
/* "mettagrid/objects.pxd":167
|
|
21699
21741
|
* obs[0] = 1
|
|
21700
21742
|
* obs[1] = hp
|
|
21701
21743
|
* obs[2] = input_resource # <<<<<<<<<<<<<<
|
|
@@ -21705,7 +21747,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
|
|
|
21705
21747
|
__pyx_t_1 = 2;
|
|
21706
21748
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = input_resource;
|
|
21707
21749
|
|
|
21708
|
-
/* "mettagrid/objects.pxd":
|
|
21750
|
+
/* "mettagrid/objects.pxd":168
|
|
21709
21751
|
* obs[1] = hp
|
|
21710
21752
|
* obs[2] = input_resource
|
|
21711
21753
|
* obs[3] = output_resource # <<<<<<<<<<<<<<
|
|
@@ -21715,7 +21757,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
|
|
|
21715
21757
|
__pyx_t_1 = 3;
|
|
21716
21758
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = output_resource;
|
|
21717
21759
|
|
|
21718
|
-
/* "mettagrid/objects.pxd":
|
|
21760
|
+
/* "mettagrid/objects.pxd":169
|
|
21719
21761
|
* obs[2] = input_resource
|
|
21720
21762
|
* obs[3] = output_resource
|
|
21721
21763
|
* obs[4] = output_energy # <<<<<<<<<<<<<<
|
|
@@ -21725,7 +21767,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
|
|
|
21725
21767
|
__pyx_t_1 = 4;
|
|
21726
21768
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = output_energy;
|
|
21727
21769
|
|
|
21728
|
-
/* "mettagrid/objects.pxd":
|
|
21770
|
+
/* "mettagrid/objects.pxd":170
|
|
21729
21771
|
* obs[3] = output_resource
|
|
21730
21772
|
* obs[4] = output_energy
|
|
21731
21773
|
* obs[5] = ready # <<<<<<<<<<<<<<
|
|
@@ -21735,7 +21777,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
|
|
|
21735
21777
|
__pyx_t_1 = 5;
|
|
21736
21778
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = ready;
|
|
21737
21779
|
|
|
21738
|
-
/* "mettagrid/objects.pxd":
|
|
21780
|
+
/* "mettagrid/objects.pxd":164
|
|
21739
21781
|
* return Usable.usable(actor) and actor.inventory[this.input_resource] > 0
|
|
21740
21782
|
*
|
|
21741
21783
|
* inline obs(ObsType[:] obs): # <<<<<<<<<<<<<<
|
|
@@ -21750,7 +21792,7 @@ PyObject *__pyx_t_9mettagrid_7objects_Converter::obs(__Pyx_memviewslice __pyx_v_
|
|
|
21750
21792
|
return __pyx_r;
|
|
21751
21793
|
}
|
|
21752
21794
|
|
|
21753
|
-
/* "mettagrid/objects.pxd":
|
|
21795
|
+
/* "mettagrid/objects.pxd":173
|
|
21754
21796
|
*
|
|
21755
21797
|
* @staticmethod
|
|
21756
21798
|
* inline vector[string] feature_names(): # <<<<<<<<<<<<<<
|
|
@@ -21768,39 +21810,39 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Converter::feature_names(v
|
|
|
21768
21810
|
int __pyx_clineno = 0;
|
|
21769
21811
|
__Pyx_RefNannySetupContext("feature_names", 1);
|
|
21770
21812
|
|
|
21771
|
-
/* "mettagrid/objects.pxd":
|
|
21813
|
+
/* "mettagrid/objects.pxd":174
|
|
21772
21814
|
* @staticmethod
|
|
21773
21815
|
* inline vector[string] feature_names():
|
|
21774
21816
|
* return ["converter", "converter:hp", "converter:input_resource", "converter:output_resource", "converter:output_energy", "converter:ready"] # <<<<<<<<<<<<<<
|
|
21775
21817
|
*
|
|
21776
21818
|
* cdef cppclass Altar(Usable):
|
|
21777
21819
|
*/
|
|
21778
|
-
__pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3,
|
|
21820
|
+
__pyx_t_1 = PyList_New(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 174, __pyx_L1_error)
|
|
21779
21821
|
__Pyx_GOTREF(__pyx_t_1);
|
|
21780
21822
|
__Pyx_INCREF(__pyx_n_u_converter);
|
|
21781
21823
|
__Pyx_GIVEREF(__pyx_n_u_converter);
|
|
21782
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_converter)) __PYX_ERR(3,
|
|
21824
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_converter)) __PYX_ERR(3, 174, __pyx_L1_error);
|
|
21783
21825
|
__Pyx_INCREF(__pyx_kp_u_converter_hp);
|
|
21784
21826
|
__Pyx_GIVEREF(__pyx_kp_u_converter_hp);
|
|
21785
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_converter_hp)) __PYX_ERR(3,
|
|
21827
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_converter_hp)) __PYX_ERR(3, 174, __pyx_L1_error);
|
|
21786
21828
|
__Pyx_INCREF(__pyx_kp_u_converter_input_resource);
|
|
21787
21829
|
__Pyx_GIVEREF(__pyx_kp_u_converter_input_resource);
|
|
21788
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_converter_input_resource)) __PYX_ERR(3,
|
|
21830
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_converter_input_resource)) __PYX_ERR(3, 174, __pyx_L1_error);
|
|
21789
21831
|
__Pyx_INCREF(__pyx_kp_u_converter_output_resource);
|
|
21790
21832
|
__Pyx_GIVEREF(__pyx_kp_u_converter_output_resource);
|
|
21791
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_converter_output_resource)) __PYX_ERR(3,
|
|
21833
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 3, __pyx_kp_u_converter_output_resource)) __PYX_ERR(3, 174, __pyx_L1_error);
|
|
21792
21834
|
__Pyx_INCREF(__pyx_kp_u_converter_output_energy);
|
|
21793
21835
|
__Pyx_GIVEREF(__pyx_kp_u_converter_output_energy);
|
|
21794
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_converter_output_energy)) __PYX_ERR(3,
|
|
21836
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 4, __pyx_kp_u_converter_output_energy)) __PYX_ERR(3, 174, __pyx_L1_error);
|
|
21795
21837
|
__Pyx_INCREF(__pyx_kp_u_converter_ready);
|
|
21796
21838
|
__Pyx_GIVEREF(__pyx_kp_u_converter_ready);
|
|
21797
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_converter_ready)) __PYX_ERR(3,
|
|
21798
|
-
__pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
21839
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 5, __pyx_kp_u_converter_ready)) __PYX_ERR(3, 174, __pyx_L1_error);
|
|
21840
|
+
__pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 174, __pyx_L1_error)
|
|
21799
21841
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
21800
21842
|
__pyx_r = __pyx_t_2;
|
|
21801
21843
|
goto __pyx_L0;
|
|
21802
21844
|
|
|
21803
|
-
/* "mettagrid/objects.pxd":
|
|
21845
|
+
/* "mettagrid/objects.pxd":173
|
|
21804
21846
|
*
|
|
21805
21847
|
* @staticmethod
|
|
21806
21848
|
* inline vector[string] feature_names(): # <<<<<<<<<<<<<<
|
|
@@ -21818,7 +21860,7 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Converter::feature_names(v
|
|
|
21818
21860
|
return __pyx_r;
|
|
21819
21861
|
}
|
|
21820
21862
|
|
|
21821
|
-
/* "mettagrid/objects.pxd":
|
|
21863
|
+
/* "mettagrid/objects.pxd":177
|
|
21822
21864
|
*
|
|
21823
21865
|
* cdef cppclass Altar(Usable):
|
|
21824
21866
|
* inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -21831,7 +21873,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
|
|
|
21831
21873
|
const char *__pyx_filename = NULL;
|
|
21832
21874
|
int __pyx_clineno = 0;
|
|
21833
21875
|
|
|
21834
|
-
/* "mettagrid/objects.pxd":
|
|
21876
|
+
/* "mettagrid/objects.pxd":178
|
|
21835
21877
|
* cdef cppclass Altar(Usable):
|
|
21836
21878
|
* inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg):
|
|
21837
21879
|
* GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer)) # <<<<<<<<<<<<<<
|
|
@@ -21840,25 +21882,25 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
|
|
|
21840
21882
|
*/
|
|
21841
21883
|
GridObject::init(__pyx_e_9mettagrid_7objects_AltarT, GridLocation(__pyx_v_r, __pyx_v_c, __pyx_e_9mettagrid_7objects_Object_Layer));
|
|
21842
21884
|
|
|
21843
|
-
/* "mettagrid/objects.pxd":
|
|
21885
|
+
/* "mettagrid/objects.pxd":179
|
|
21844
21886
|
* inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg):
|
|
21845
21887
|
* GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer))
|
|
21846
21888
|
* MettaObject.init_mo(cfg) # <<<<<<<<<<<<<<
|
|
21847
21889
|
* Usable.init_usable(cfg)
|
|
21848
21890
|
*
|
|
21849
21891
|
*/
|
|
21850
|
-
__pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
21892
|
+
__pyx_t_9mettagrid_7objects_MettaObject::init_mo(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 179, __pyx_L1_error)
|
|
21851
21893
|
|
|
21852
|
-
/* "mettagrid/objects.pxd":
|
|
21894
|
+
/* "mettagrid/objects.pxd":180
|
|
21853
21895
|
* GridObject.init(ObjectType.AltarT, GridLocation(r, c, GridLayer.Object_Layer))
|
|
21854
21896
|
* MettaObject.init_mo(cfg)
|
|
21855
21897
|
* Usable.init_usable(cfg) # <<<<<<<<<<<<<<
|
|
21856
21898
|
*
|
|
21857
21899
|
* inline void obs(ObsType[:] obs):
|
|
21858
21900
|
*/
|
|
21859
|
-
__pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
21901
|
+
__pyx_t_9mettagrid_7objects_Usable::init_usable(__pyx_v_cfg); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 180, __pyx_L1_error)
|
|
21860
21902
|
|
|
21861
|
-
/* "mettagrid/objects.pxd":
|
|
21903
|
+
/* "mettagrid/objects.pxd":177
|
|
21862
21904
|
*
|
|
21863
21905
|
* cdef cppclass Altar(Usable):
|
|
21864
21906
|
* inline Altar(GridCoord r, GridCoord c, ObjectConfig cfg): # <<<<<<<<<<<<<<
|
|
@@ -21873,7 +21915,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
|
|
|
21873
21915
|
__pyx_L0:;
|
|
21874
21916
|
}
|
|
21875
21917
|
|
|
21876
|
-
/* "mettagrid/objects.pxd":
|
|
21918
|
+
/* "mettagrid/objects.pxd":182
|
|
21877
21919
|
* Usable.init_usable(cfg)
|
|
21878
21920
|
*
|
|
21879
21921
|
* inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
|
|
@@ -21884,7 +21926,7 @@ void __pyx_t_9mettagrid_7objects_Altar::__pyx_f___init__Altar(GridCoord __pyx_v_
|
|
|
21884
21926
|
void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
21885
21927
|
Py_ssize_t __pyx_t_1;
|
|
21886
21928
|
|
|
21887
|
-
/* "mettagrid/objects.pxd":
|
|
21929
|
+
/* "mettagrid/objects.pxd":183
|
|
21888
21930
|
*
|
|
21889
21931
|
* inline void obs(ObsType[:] obs):
|
|
21890
21932
|
* obs[0] = 1 # <<<<<<<<<<<<<<
|
|
@@ -21894,7 +21936,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
21894
21936
|
__pyx_t_1 = 0;
|
|
21895
21937
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = 1;
|
|
21896
21938
|
|
|
21897
|
-
/* "mettagrid/objects.pxd":
|
|
21939
|
+
/* "mettagrid/objects.pxd":184
|
|
21898
21940
|
* inline void obs(ObsType[:] obs):
|
|
21899
21941
|
* obs[0] = 1
|
|
21900
21942
|
* obs[1] = hp # <<<<<<<<<<<<<<
|
|
@@ -21904,7 +21946,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
21904
21946
|
__pyx_t_1 = 1;
|
|
21905
21947
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = hp;
|
|
21906
21948
|
|
|
21907
|
-
/* "mettagrid/objects.pxd":
|
|
21949
|
+
/* "mettagrid/objects.pxd":185
|
|
21908
21950
|
* obs[0] = 1
|
|
21909
21951
|
* obs[1] = hp
|
|
21910
21952
|
* obs[2] = ready # <<<<<<<<<<<<<<
|
|
@@ -21914,7 +21956,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
21914
21956
|
__pyx_t_1 = 2;
|
|
21915
21957
|
*((__pyx_t_10puffergrid_19observation_encoder_ObsType *) ( /* dim=0 */ (__pyx_v_obs.data + __pyx_t_1 * __pyx_v_obs.strides[0]) )) = ready;
|
|
21916
21958
|
|
|
21917
|
-
/* "mettagrid/objects.pxd":
|
|
21959
|
+
/* "mettagrid/objects.pxd":182
|
|
21918
21960
|
* Usable.init_usable(cfg)
|
|
21919
21961
|
*
|
|
21920
21962
|
* inline void obs(ObsType[:] obs): # <<<<<<<<<<<<<<
|
|
@@ -21925,7 +21967,7 @@ void __pyx_t_9mettagrid_7objects_Altar::obs(__Pyx_memviewslice __pyx_v_obs) {
|
|
|
21925
21967
|
/* function exit code */
|
|
21926
21968
|
}
|
|
21927
21969
|
|
|
21928
|
-
/* "mettagrid/objects.pxd":
|
|
21970
|
+
/* "mettagrid/objects.pxd":188
|
|
21929
21971
|
*
|
|
21930
21972
|
* @staticmethod
|
|
21931
21973
|
* inline vector[string] feature_names(): # <<<<<<<<<<<<<<
|
|
@@ -21943,30 +21985,30 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Altar::feature_names(void)
|
|
|
21943
21985
|
int __pyx_clineno = 0;
|
|
21944
21986
|
__Pyx_RefNannySetupContext("feature_names", 1);
|
|
21945
21987
|
|
|
21946
|
-
/* "mettagrid/objects.pxd":
|
|
21988
|
+
/* "mettagrid/objects.pxd":189
|
|
21947
21989
|
* @staticmethod
|
|
21948
21990
|
* inline vector[string] feature_names():
|
|
21949
21991
|
* return ["altar", "altar:hp", "altar:ready"] # <<<<<<<<<<<<<<
|
|
21950
21992
|
*
|
|
21951
21993
|
* cdef map[TypeId, GridLayer] ObjectLayers
|
|
21952
21994
|
*/
|
|
21953
|
-
__pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3,
|
|
21995
|
+
__pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 189, __pyx_L1_error)
|
|
21954
21996
|
__Pyx_GOTREF(__pyx_t_1);
|
|
21955
21997
|
__Pyx_INCREF(__pyx_n_u_altar);
|
|
21956
21998
|
__Pyx_GIVEREF(__pyx_n_u_altar);
|
|
21957
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_altar)) __PYX_ERR(3,
|
|
21999
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_u_altar)) __PYX_ERR(3, 189, __pyx_L1_error);
|
|
21958
22000
|
__Pyx_INCREF(__pyx_kp_u_altar_hp);
|
|
21959
22001
|
__Pyx_GIVEREF(__pyx_kp_u_altar_hp);
|
|
21960
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_altar_hp)) __PYX_ERR(3,
|
|
22002
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 1, __pyx_kp_u_altar_hp)) __PYX_ERR(3, 189, __pyx_L1_error);
|
|
21961
22003
|
__Pyx_INCREF(__pyx_kp_u_altar_ready);
|
|
21962
22004
|
__Pyx_GIVEREF(__pyx_kp_u_altar_ready);
|
|
21963
|
-
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_altar_ready)) __PYX_ERR(3,
|
|
21964
|
-
__pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3,
|
|
22005
|
+
if (__Pyx_PyList_SET_ITEM(__pyx_t_1, 2, __pyx_kp_u_altar_ready)) __PYX_ERR(3, 189, __pyx_L1_error);
|
|
22006
|
+
__pyx_t_2 = __pyx_convert_vector_from_py_std_3a__3a_string(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 189, __pyx_L1_error)
|
|
21965
22007
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
21966
22008
|
__pyx_r = __pyx_t_2;
|
|
21967
22009
|
goto __pyx_L0;
|
|
21968
22010
|
|
|
21969
|
-
/* "mettagrid/objects.pxd":
|
|
22011
|
+
/* "mettagrid/objects.pxd":188
|
|
21970
22012
|
*
|
|
21971
22013
|
* @staticmethod
|
|
21972
22014
|
* inline vector[string] feature_names(): # <<<<<<<<<<<<<<
|
|
@@ -21984,72 +22026,101 @@ std::vector<std::string> __pyx_t_9mettagrid_7objects_Altar::feature_names(void)
|
|
|
21984
22026
|
return __pyx_r;
|
|
21985
22027
|
}
|
|
21986
22028
|
|
|
21987
|
-
/* "mettagrid/objects.pxd":
|
|
22029
|
+
/* "mettagrid/objects.pxd":194
|
|
21988
22030
|
*
|
|
21989
22031
|
* cdef class ResetHandler(EventHandler):
|
|
21990
22032
|
* cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg): # <<<<<<<<<<<<<<
|
|
21991
22033
|
* cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
|
|
21992
|
-
* usable
|
|
22034
|
+
* if usable is NULL:
|
|
21993
22035
|
*/
|
|
21994
22036
|
|
|
21995
22037
|
static void __pyx_f_9mettagrid_7objects_12ResetHandler_handle_event(struct __pyx_obj_9mettagrid_7objects_ResetHandler *__pyx_v_self, GridObjectId __pyx_v_obj_id, CYTHON_UNUSED EventArg __pyx_v_arg) {
|
|
21996
22038
|
__pyx_t_9mettagrid_7objects_Usable *__pyx_v_usable;
|
|
21997
22039
|
__Pyx_RefNannyDeclarations
|
|
21998
|
-
|
|
22040
|
+
int __pyx_t_1;
|
|
21999
22041
|
PyObject *__pyx_t_2 = NULL;
|
|
22000
|
-
|
|
22042
|
+
PyObject *__pyx_t_3 = NULL;
|
|
22043
|
+
char const *__pyx_t_4;
|
|
22001
22044
|
int __pyx_lineno = 0;
|
|
22002
22045
|
const char *__pyx_filename = NULL;
|
|
22003
22046
|
int __pyx_clineno = 0;
|
|
22004
22047
|
__Pyx_RefNannySetupContext("handle_event", 1);
|
|
22005
22048
|
|
|
22006
|
-
/* "mettagrid/objects.pxd":
|
|
22049
|
+
/* "mettagrid/objects.pxd":195
|
|
22007
22050
|
* cdef class ResetHandler(EventHandler):
|
|
22008
22051
|
* cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
|
|
22009
22052
|
* cdef Usable *usable = <Usable*>self.env._grid.object(obj_id) # <<<<<<<<<<<<<<
|
|
22010
|
-
* usable
|
|
22011
|
-
*
|
|
22053
|
+
* if usable is NULL:
|
|
22054
|
+
* return
|
|
22012
22055
|
*/
|
|
22013
22056
|
__pyx_v_usable = ((__pyx_t_9mettagrid_7objects_Usable *)__pyx_v_self->__pyx_base.env->_grid->object(__pyx_v_obj_id));
|
|
22014
22057
|
|
|
22015
|
-
/* "mettagrid/objects.pxd":
|
|
22058
|
+
/* "mettagrid/objects.pxd":196
|
|
22059
|
+
* cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
|
|
22060
|
+
* cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
|
|
22061
|
+
* if usable is NULL: # <<<<<<<<<<<<<<
|
|
22062
|
+
* return
|
|
22063
|
+
*
|
|
22064
|
+
*/
|
|
22065
|
+
__pyx_t_1 = (__pyx_v_usable == NULL);
|
|
22066
|
+
if (__pyx_t_1) {
|
|
22067
|
+
|
|
22068
|
+
/* "mettagrid/objects.pxd":197
|
|
22069
|
+
* cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
|
|
22070
|
+
* if usable is NULL:
|
|
22071
|
+
* return # <<<<<<<<<<<<<<
|
|
22072
|
+
*
|
|
22073
|
+
* usable.ready = True
|
|
22074
|
+
*/
|
|
22075
|
+
goto __pyx_L0;
|
|
22076
|
+
|
|
22077
|
+
/* "mettagrid/objects.pxd":196
|
|
22016
22078
|
* cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg):
|
|
22017
22079
|
* cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
|
|
22080
|
+
* if usable is NULL: # <<<<<<<<<<<<<<
|
|
22081
|
+
* return
|
|
22082
|
+
*
|
|
22083
|
+
*/
|
|
22084
|
+
}
|
|
22085
|
+
|
|
22086
|
+
/* "mettagrid/objects.pxd":199
|
|
22087
|
+
* return
|
|
22088
|
+
*
|
|
22018
22089
|
* usable.ready = True # <<<<<<<<<<<<<<
|
|
22019
22090
|
* self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id])
|
|
22020
22091
|
*
|
|
22021
22092
|
*/
|
|
22022
22093
|
__pyx_v_usable->ready = 1;
|
|
22023
22094
|
|
|
22024
|
-
/* "mettagrid/objects.pxd":
|
|
22025
|
-
*
|
|
22095
|
+
/* "mettagrid/objects.pxd":200
|
|
22096
|
+
*
|
|
22026
22097
|
* usable.ready = True
|
|
22027
22098
|
* self.env._stats.game_incr("resets." + ObjectTypeNames[usable._type_id]) # <<<<<<<<<<<<<<
|
|
22028
22099
|
*
|
|
22029
22100
|
* cdef enum Events:
|
|
22030
22101
|
*/
|
|
22031
|
-
|
|
22032
|
-
__Pyx_GOTREF(__pyx_t_1);
|
|
22033
|
-
__pyx_t_2 = __Pyx_PyUnicode_Concat(__pyx_kp_u_resets, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 189, __pyx_L1_error)
|
|
22102
|
+
__pyx_t_2 = __pyx_convert_PyStr_string_to_py_6libcpp_6string_std__in_string((__pyx_v_9mettagrid_7objects_ObjectTypeNames[__pyx_v_usable->_type_id])); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 200, __pyx_L1_error)
|
|
22034
22103
|
__Pyx_GOTREF(__pyx_t_2);
|
|
22035
|
-
|
|
22036
|
-
__pyx_t_3
|
|
22037
|
-
((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->game_incr(__pyx_v_self->__pyx_base.env->_stats, __pyx_t_3); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 189, __pyx_L1_error)
|
|
22104
|
+
__pyx_t_3 = __Pyx_PyUnicode_Concat(__pyx_kp_u_resets, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 200, __pyx_L1_error)
|
|
22105
|
+
__Pyx_GOTREF(__pyx_t_3);
|
|
22038
22106
|
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
|
22107
|
+
__pyx_t_4 = __Pyx_PyObject_AsString(__pyx_t_3); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) __PYX_ERR(3, 200, __pyx_L1_error)
|
|
22108
|
+
((struct __pyx_vtabstruct_10puffergrid_13stats_tracker_StatsTracker *)__pyx_v_self->__pyx_base.env->_stats->__pyx_vtab)->game_incr(__pyx_v_self->__pyx_base.env->_stats, __pyx_t_4); if (unlikely(PyErr_Occurred())) __PYX_ERR(3, 200, __pyx_L1_error)
|
|
22109
|
+
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
|
22039
22110
|
|
|
22040
|
-
/* "mettagrid/objects.pxd":
|
|
22111
|
+
/* "mettagrid/objects.pxd":194
|
|
22041
22112
|
*
|
|
22042
22113
|
* cdef class ResetHandler(EventHandler):
|
|
22043
22114
|
* cdef inline void handle_event(self, GridObjectId obj_id, EventArg arg): # <<<<<<<<<<<<<<
|
|
22044
22115
|
* cdef Usable *usable = <Usable*>self.env._grid.object(obj_id)
|
|
22045
|
-
* usable
|
|
22116
|
+
* if usable is NULL:
|
|
22046
22117
|
*/
|
|
22047
22118
|
|
|
22048
22119
|
/* function exit code */
|
|
22049
22120
|
goto __pyx_L0;
|
|
22050
22121
|
__pyx_L1_error:;
|
|
22051
|
-
__Pyx_XDECREF(__pyx_t_1);
|
|
22052
22122
|
__Pyx_XDECREF(__pyx_t_2);
|
|
22123
|
+
__Pyx_XDECREF(__pyx_t_3);
|
|
22053
22124
|
__Pyx_AddTraceback("mettagrid.objects.ResetHandler.handle_event", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
|
22054
22125
|
__pyx_L0:;
|
|
22055
22126
|
__Pyx_RefNannyFinishContext();
|
|
@@ -22159,7 +22230,7 @@ static int __pyx_pf_9mettagrid_7actions_6shield_6Shield___init__(struct __pyx_ob
|
|
|
22159
22230
|
* def __init__(self, cfg: OmegaConf):
|
|
22160
22231
|
* MettaActionHandler.__init__(self, cfg, "shield") # <<<<<<<<<<<<<<
|
|
22161
22232
|
*
|
|
22162
|
-
* cdef char
|
|
22233
|
+
* cdef unsigned char max_arg(self):
|
|
22163
22234
|
*/
|
|
22164
22235
|
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler), __pyx_n_s_init); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 14, __pyx_L1_error)
|
|
22165
22236
|
__Pyx_GOTREF(__pyx_t_2);
|
|
@@ -22212,65 +22283,127 @@ static int __pyx_pf_9mettagrid_7actions_6shield_6Shield___init__(struct __pyx_ob
|
|
|
22212
22283
|
/* "mettagrid/actions/shield.pyx":16
|
|
22213
22284
|
* MettaActionHandler.__init__(self, cfg, "shield")
|
|
22214
22285
|
*
|
|
22215
|
-
* cdef char
|
|
22286
|
+
* cdef unsigned char max_arg(self): # <<<<<<<<<<<<<<
|
|
22287
|
+
* return 0
|
|
22288
|
+
*
|
|
22289
|
+
*/
|
|
22290
|
+
|
|
22291
|
+
static unsigned char __pyx_f_9mettagrid_7actions_6shield_6Shield_max_arg(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_6shield_Shield *__pyx_v_self) {
|
|
22292
|
+
unsigned char __pyx_r;
|
|
22293
|
+
|
|
22294
|
+
/* "mettagrid/actions/shield.pyx":17
|
|
22295
|
+
*
|
|
22296
|
+
* cdef unsigned char max_arg(self):
|
|
22297
|
+
* return 0 # <<<<<<<<<<<<<<
|
|
22298
|
+
*
|
|
22299
|
+
*
|
|
22300
|
+
*/
|
|
22301
|
+
__pyx_r = 0;
|
|
22302
|
+
goto __pyx_L0;
|
|
22303
|
+
|
|
22304
|
+
/* "mettagrid/actions/shield.pyx":16
|
|
22305
|
+
* MettaActionHandler.__init__(self, cfg, "shield")
|
|
22306
|
+
*
|
|
22307
|
+
* cdef unsigned char max_arg(self): # <<<<<<<<<<<<<<
|
|
22308
|
+
* return 0
|
|
22309
|
+
*
|
|
22310
|
+
*/
|
|
22311
|
+
|
|
22312
|
+
/* function exit code */
|
|
22313
|
+
__pyx_L0:;
|
|
22314
|
+
return __pyx_r;
|
|
22315
|
+
}
|
|
22316
|
+
|
|
22317
|
+
/* "mettagrid/actions/shield.pyx":20
|
|
22318
|
+
*
|
|
22319
|
+
*
|
|
22320
|
+
* cdef bint _handle_action( # <<<<<<<<<<<<<<
|
|
22216
22321
|
* self,
|
|
22217
22322
|
* unsigned int actor_id,
|
|
22218
22323
|
*/
|
|
22219
22324
|
|
|
22220
|
-
static
|
|
22221
|
-
|
|
22325
|
+
static int __pyx_f_9mettagrid_7actions_6shield_6Shield__handle_action(CYTHON_UNUSED struct __pyx_obj_9mettagrid_7actions_6shield_Shield *__pyx_v_self, CYTHON_UNUSED unsigned int __pyx_v_actor_id, __pyx_t_9mettagrid_7objects_Agent *__pyx_v_actor, CYTHON_UNUSED __pyx_t_10puffergrid_6action_ActionArg __pyx_v_arg) {
|
|
22326
|
+
int __pyx_r;
|
|
22222
22327
|
int __pyx_t_1;
|
|
22223
22328
|
|
|
22224
|
-
/* "mettagrid/actions/shield.pyx":
|
|
22329
|
+
/* "mettagrid/actions/shield.pyx":26
|
|
22225
22330
|
* ActionArg arg):
|
|
22226
22331
|
*
|
|
22227
22332
|
* if actor.shield: # <<<<<<<<<<<<<<
|
|
22228
|
-
* actor.shield =
|
|
22229
|
-
*
|
|
22333
|
+
* actor.shield = False
|
|
22334
|
+
* elif actor.energy >= actor.shield_upkeep:
|
|
22230
22335
|
*/
|
|
22231
22336
|
__pyx_t_1 = (__pyx_v_actor->shield != 0);
|
|
22232
22337
|
if (__pyx_t_1) {
|
|
22233
22338
|
|
|
22234
|
-
/* "mettagrid/actions/shield.pyx":
|
|
22339
|
+
/* "mettagrid/actions/shield.pyx":27
|
|
22235
22340
|
*
|
|
22236
22341
|
* if actor.shield:
|
|
22237
|
-
* actor.shield =
|
|
22238
|
-
*
|
|
22239
|
-
* actor.shield =
|
|
22342
|
+
* actor.shield = False # <<<<<<<<<<<<<<
|
|
22343
|
+
* elif actor.energy >= actor.shield_upkeep:
|
|
22344
|
+
* actor.shield = True
|
|
22240
22345
|
*/
|
|
22241
|
-
__pyx_v_actor->shield =
|
|
22346
|
+
__pyx_v_actor->shield = 0;
|
|
22242
22347
|
|
|
22243
|
-
/* "mettagrid/actions/shield.pyx":
|
|
22348
|
+
/* "mettagrid/actions/shield.pyx":26
|
|
22244
22349
|
* ActionArg arg):
|
|
22245
22350
|
*
|
|
22246
22351
|
* if actor.shield: # <<<<<<<<<<<<<<
|
|
22247
|
-
* actor.shield =
|
|
22248
|
-
*
|
|
22352
|
+
* actor.shield = False
|
|
22353
|
+
* elif actor.energy >= actor.shield_upkeep:
|
|
22249
22354
|
*/
|
|
22250
22355
|
goto __pyx_L3;
|
|
22251
22356
|
}
|
|
22252
22357
|
|
|
22253
|
-
/* "mettagrid/actions/shield.pyx":
|
|
22358
|
+
/* "mettagrid/actions/shield.pyx":28
|
|
22359
|
+
* if actor.shield:
|
|
22360
|
+
* actor.shield = False
|
|
22361
|
+
* elif actor.energy >= actor.shield_upkeep: # <<<<<<<<<<<<<<
|
|
22362
|
+
* actor.shield = True
|
|
22363
|
+
*
|
|
22364
|
+
*/
|
|
22365
|
+
__pyx_t_1 = (__pyx_v_actor->energy >= __pyx_v_actor->shield_upkeep);
|
|
22366
|
+
if (__pyx_t_1) {
|
|
22367
|
+
|
|
22368
|
+
/* "mettagrid/actions/shield.pyx":29
|
|
22369
|
+
* actor.shield = False
|
|
22370
|
+
* elif actor.energy >= actor.shield_upkeep:
|
|
22371
|
+
* actor.shield = True # <<<<<<<<<<<<<<
|
|
22372
|
+
*
|
|
22373
|
+
* return True
|
|
22374
|
+
*/
|
|
22375
|
+
__pyx_v_actor->shield = 1;
|
|
22376
|
+
|
|
22377
|
+
/* "mettagrid/actions/shield.pyx":28
|
|
22378
|
+
* if actor.shield:
|
|
22379
|
+
* actor.shield = False
|
|
22380
|
+
* elif actor.energy >= actor.shield_upkeep: # <<<<<<<<<<<<<<
|
|
22254
22381
|
* actor.shield = True
|
|
22255
|
-
* else:
|
|
22256
|
-
* actor.shield = False # <<<<<<<<<<<<<<
|
|
22257
22382
|
*
|
|
22258
22383
|
*/
|
|
22259
|
-
/*else*/ {
|
|
22260
|
-
__pyx_v_actor->shield = 0;
|
|
22261
22384
|
}
|
|
22262
22385
|
__pyx_L3:;
|
|
22263
22386
|
|
|
22264
|
-
/* "mettagrid/actions/shield.pyx":
|
|
22265
|
-
*
|
|
22387
|
+
/* "mettagrid/actions/shield.pyx":31
|
|
22388
|
+
* actor.shield = True
|
|
22389
|
+
*
|
|
22390
|
+
* return True # <<<<<<<<<<<<<<
|
|
22266
22391
|
*
|
|
22267
|
-
*
|
|
22392
|
+
*
|
|
22393
|
+
*/
|
|
22394
|
+
__pyx_r = 1;
|
|
22395
|
+
goto __pyx_L0;
|
|
22396
|
+
|
|
22397
|
+
/* "mettagrid/actions/shield.pyx":20
|
|
22398
|
+
*
|
|
22399
|
+
*
|
|
22400
|
+
* cdef bint _handle_action( # <<<<<<<<<<<<<<
|
|
22268
22401
|
* self,
|
|
22269
22402
|
* unsigned int actor_id,
|
|
22270
22403
|
*/
|
|
22271
22404
|
|
|
22272
22405
|
/* function exit code */
|
|
22273
|
-
|
|
22406
|
+
__pyx_L0:;
|
|
22274
22407
|
return __pyx_r;
|
|
22275
22408
|
}
|
|
22276
22409
|
|
|
@@ -23810,7 +23943,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
|
23810
23943
|
__Pyx_GOTREF(__pyx_tuple__8);
|
|
23811
23944
|
__Pyx_GIVEREF(__pyx_tuple__8);
|
|
23812
23945
|
|
|
23813
|
-
/* "
|
|
23946
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":986
|
|
23814
23947
|
* __pyx_import_array()
|
|
23815
23948
|
* except Exception:
|
|
23816
23949
|
* raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
|
|
@@ -23821,7 +23954,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
|
|
|
23821
23954
|
__Pyx_GOTREF(__pyx_tuple__9);
|
|
23822
23955
|
__Pyx_GIVEREF(__pyx_tuple__9);
|
|
23823
23956
|
|
|
23824
|
-
/* "
|
|
23957
|
+
/* "../../../../miniforge3/envs/metta/lib/python3.11/site-packages/numpy/__init__.cython-30.pxd":992
|
|
23825
23958
|
* _import_umath()
|
|
23826
23959
|
* except Exception:
|
|
23827
23960
|
* raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
|
|
@@ -24035,7 +24168,8 @@ static int __Pyx_modinit_type_init_code(void) {
|
|
|
24035
24168
|
__pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler = (struct __pyx_vtabstruct_9mettagrid_7actions_7actions_MettaActionHandler*)__Pyx_GetVtable(__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler); if (unlikely(!__pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler)) __PYX_ERR(1, 2, __pyx_L1_error)
|
|
24036
24169
|
__pyx_vtabptr_9mettagrid_7actions_6shield_Shield = &__pyx_vtable_9mettagrid_7actions_6shield_Shield;
|
|
24037
24170
|
__pyx_vtable_9mettagrid_7actions_6shield_Shield.__pyx_base = *__pyx_vtabptr_9mettagrid_7actions_7actions_MettaActionHandler;
|
|
24038
|
-
__pyx_vtable_9mettagrid_7actions_6shield_Shield.__pyx_base.
|
|
24171
|
+
__pyx_vtable_9mettagrid_7actions_6shield_Shield.__pyx_base.__pyx_base.max_arg = (unsigned char (*)(struct __pyx_obj_10puffergrid_6action_ActionHandler *))__pyx_f_9mettagrid_7actions_6shield_6Shield_max_arg;
|
|
24172
|
+
__pyx_vtable_9mettagrid_7actions_6shield_Shield.__pyx_base._handle_action = (int (*)(struct __pyx_obj_9mettagrid_7actions_7actions_MettaActionHandler *, unsigned int, __pyx_t_9mettagrid_7objects_Agent *, __pyx_t_10puffergrid_6action_ActionArg))__pyx_f_9mettagrid_7actions_6shield_6Shield__handle_action;
|
|
24039
24173
|
#if CYTHON_USE_TYPE_SPECS
|
|
24040
24174
|
__pyx_t_2 = PyTuple_Pack(1, (PyObject *)__pyx_ptype_9mettagrid_7actions_7actions_MettaActionHandler); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 12, __pyx_L1_error)
|
|
24041
24175
|
__Pyx_GOTREF(__pyx_t_2);
|
|
@@ -24284,12 +24418,12 @@ static int __Pyx_modinit_type_import_code(void) {
|
|
|
24284
24418
|
__pyx_ptype_10puffergrid_6action_ActionHandler = __Pyx_ImportType_3_0_11(__pyx_t_1, "puffergrid.action", "ActionHandler", sizeof(struct __pyx_obj_10puffergrid_6action_ActionHandler), __PYX_GET_STRUCT_ALIGNMENT_3_0_11(struct __pyx_obj_10puffergrid_6action_ActionHandler),__Pyx_ImportType_CheckSize_Warn_3_0_11); if (!__pyx_ptype_10puffergrid_6action_ActionHandler) __PYX_ERR(9, 5, __pyx_L1_error)
|
|
24285
24419
|
__pyx_vtabptr_10puffergrid_6action_ActionHandler = (struct __pyx_vtabstruct_10puffergrid_6action_ActionHandler*)__Pyx_GetVtable(__pyx_ptype_10puffergrid_6action_ActionHandler); if (unlikely(!__pyx_vtabptr_10puffergrid_6action_ActionHandler)) __PYX_ERR(9, 5, __pyx_L1_error)
|
|
24286
24420
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
24287
|
-
__pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3,
|
|
24421
|
+
__pyx_t_1 = PyImport_ImportModule("mettagrid.objects"); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 193, __pyx_L1_error)
|
|
24288
24422
|
__Pyx_GOTREF(__pyx_t_1);
|
|
24289
|
-
__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,
|
|
24290
|
-
__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,
|
|
24291
|
-
__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,
|
|
24292
|
-
__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,
|
|
24423
|
+
__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)
|
|
24424
|
+
__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)
|
|
24425
|
+
__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)
|
|
24426
|
+
__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)
|
|
24293
24427
|
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
|
24294
24428
|
__Pyx_RefNannyFinishContext();
|
|
24295
24429
|
return 0;
|
|
@@ -30952,77 +31086,6 @@ raise_neg_overflow:
|
|
|
30952
31086
|
return (unsigned short) -1;
|
|
30953
31087
|
}
|
|
30954
31088
|
|
|
30955
|
-
/* CIntToPy */
|
|
30956
|
-
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_char(char value) {
|
|
30957
|
-
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
30958
|
-
#pragma GCC diagnostic push
|
|
30959
|
-
#pragma GCC diagnostic ignored "-Wconversion"
|
|
30960
|
-
#endif
|
|
30961
|
-
const char neg_one = (char) -1, const_zero = (char) 0;
|
|
30962
|
-
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|
|
30963
|
-
#pragma GCC diagnostic pop
|
|
30964
|
-
#endif
|
|
30965
|
-
const int is_unsigned = neg_one > const_zero;
|
|
30966
|
-
if (is_unsigned) {
|
|
30967
|
-
if (sizeof(char) < sizeof(long)) {
|
|
30968
|
-
return PyInt_FromLong((long) value);
|
|
30969
|
-
} else if (sizeof(char) <= sizeof(unsigned long)) {
|
|
30970
|
-
return PyLong_FromUnsignedLong((unsigned long) value);
|
|
30971
|
-
#ifdef HAVE_LONG_LONG
|
|
30972
|
-
} else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
|
|
30973
|
-
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
|
|
30974
|
-
#endif
|
|
30975
|
-
}
|
|
30976
|
-
} else {
|
|
30977
|
-
if (sizeof(char) <= sizeof(long)) {
|
|
30978
|
-
return PyInt_FromLong((long) value);
|
|
30979
|
-
#ifdef HAVE_LONG_LONG
|
|
30980
|
-
} else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
|
|
30981
|
-
return PyLong_FromLongLong((PY_LONG_LONG) value);
|
|
30982
|
-
#endif
|
|
30983
|
-
}
|
|
30984
|
-
}
|
|
30985
|
-
{
|
|
30986
|
-
unsigned char *bytes = (unsigned char *)&value;
|
|
30987
|
-
#if !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX >= 0x030d00A4
|
|
30988
|
-
if (is_unsigned) {
|
|
30989
|
-
return PyLong_FromUnsignedNativeBytes(bytes, sizeof(value), -1);
|
|
30990
|
-
} else {
|
|
30991
|
-
return PyLong_FromNativeBytes(bytes, sizeof(value), -1);
|
|
30992
|
-
}
|
|
30993
|
-
#elif !CYTHON_COMPILING_IN_LIMITED_API && PY_VERSION_HEX < 0x030d0000
|
|
30994
|
-
int one = 1; int little = (int)*(unsigned char *)&one;
|
|
30995
|
-
return _PyLong_FromByteArray(bytes, sizeof(char),
|
|
30996
|
-
little, !is_unsigned);
|
|
30997
|
-
#else
|
|
30998
|
-
int one = 1; int little = (int)*(unsigned char *)&one;
|
|
30999
|
-
PyObject *from_bytes, *result = NULL;
|
|
31000
|
-
PyObject *py_bytes = NULL, *arg_tuple = NULL, *kwds = NULL, *order_str = NULL;
|
|
31001
|
-
from_bytes = PyObject_GetAttrString((PyObject*)&PyLong_Type, "from_bytes");
|
|
31002
|
-
if (!from_bytes) return NULL;
|
|
31003
|
-
py_bytes = PyBytes_FromStringAndSize((char*)bytes, sizeof(char));
|
|
31004
|
-
if (!py_bytes) goto limited_bad;
|
|
31005
|
-
order_str = PyUnicode_FromString(little ? "little" : "big");
|
|
31006
|
-
if (!order_str) goto limited_bad;
|
|
31007
|
-
arg_tuple = PyTuple_Pack(2, py_bytes, order_str);
|
|
31008
|
-
if (!arg_tuple) goto limited_bad;
|
|
31009
|
-
if (!is_unsigned) {
|
|
31010
|
-
kwds = PyDict_New();
|
|
31011
|
-
if (!kwds) goto limited_bad;
|
|
31012
|
-
if (PyDict_SetItemString(kwds, "signed", __Pyx_NewRef(Py_True))) goto limited_bad;
|
|
31013
|
-
}
|
|
31014
|
-
result = PyObject_Call(from_bytes, arg_tuple, kwds);
|
|
31015
|
-
limited_bad:
|
|
31016
|
-
Py_XDECREF(kwds);
|
|
31017
|
-
Py_XDECREF(arg_tuple);
|
|
31018
|
-
Py_XDECREF(order_str);
|
|
31019
|
-
Py_XDECREF(py_bytes);
|
|
31020
|
-
Py_XDECREF(from_bytes);
|
|
31021
|
-
return result;
|
|
31022
|
-
#endif
|
|
31023
|
-
}
|
|
31024
|
-
}
|
|
31025
|
-
|
|
31026
31089
|
/* CIntFromPy */
|
|
31027
31090
|
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
|
|
31028
31091
|
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
|