diff --git a/env/mettagrid/c_grid.c b/env/mettagrid/c_grid.c index 7f6966d..16cdeb0 100644 --- a/env/mettagrid/c_grid.c +++ b/env/mettagrid/c_grid.c @@ -1,4 +1,4 @@ -/* Generated by Cython 3.0.8 */ +/* Generated by Cython 3.0.10 */ /* BEGIN: Cython Metadata { @@ -9,12 +9,15 @@ "NPY_1_7_API_VERSION" ] ], - "name": "mettagrid.c_grid", + "include_dirs": [ + "/opt/conda/lib/python3.10/site-packages/numpy/core/include" + ], + "name": "env.mettagrid.c_grid", "sources": [ "env/mettagrid/c_grid.pyx" ] }, - "module_name": "mettagrid.c_grid" + "module_name": "env.mettagrid.c_grid" } END: Cython Metadata */ @@ -42,10 +45,10 @@ END: Cython Metadata */ #else #define __PYX_EXTRA_ABI_MODULE_NAME "" #endif -#define CYTHON_ABI "3_0_8" __PYX_EXTRA_ABI_MODULE_NAME +#define CYTHON_ABI "3_0_10" __PYX_EXTRA_ABI_MODULE_NAME #define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI #define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "." -#define CYTHON_HEX_VERSION 0x030008F0 +#define CYTHON_HEX_VERSION 0x03000AF0 #define CYTHON_FUTURE_DIVISION 1 #include #ifndef offsetof @@ -137,6 +140,8 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #elif defined(PYPY_VERSION) #define CYTHON_COMPILING_IN_PYPY 1 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -198,6 +203,8 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #elif defined(CYTHON_LIMITED_API) #ifdef Py_LIMITED_API #undef __PYX_LIMITED_VERSION_HEX @@ -259,6 +266,8 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 0 #endif + #undef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 #elif defined(Py_GIL_DISABLED) || defined(Py_NOGIL) #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 0 @@ -268,11 +277,17 @@ END: Cython Metadata */ #ifndef CYTHON_USE_TYPE_SLOTS #define CYTHON_USE_TYPE_SLOTS 1 #endif + #ifndef CYTHON_USE_TYPE_SPECS + #define CYTHON_USE_TYPE_SPECS 0 + #endif #undef CYTHON_USE_PYTYPE_LOOKUP #define CYTHON_USE_PYTYPE_LOOKUP 0 #ifndef CYTHON_USE_ASYNC_SLOTS #define CYTHON_USE_ASYNC_SLOTS 1 #endif + #ifndef CYTHON_USE_PYLONG_INTERNALS + #define CYTHON_USE_PYLONG_INTERNALS 0 + #endif #undef CYTHON_USE_PYLIST_INTERNALS #define CYTHON_USE_PYLIST_INTERNALS 0 #ifndef CYTHON_USE_UNICODE_INTERNALS @@ -280,8 +295,6 @@ END: Cython Metadata */ #endif #undef CYTHON_USE_UNICODE_WRITER #define CYTHON_USE_UNICODE_WRITER 0 - #undef CYTHON_USE_PYLONG_INTERNALS - #define CYTHON_USE_PYLONG_INTERNALS 0 #ifndef CYTHON_AVOID_BORROWED_REFS #define CYTHON_AVOID_BORROWED_REFS 0 #endif @@ -293,11 +306,22 @@ END: Cython Metadata */ #endif #undef CYTHON_FAST_THREAD_STATE #define CYTHON_FAST_THREAD_STATE 0 + #undef CYTHON_FAST_GIL + #define CYTHON_FAST_GIL 0 + #ifndef CYTHON_METH_FASTCALL + #define CYTHON_METH_FASTCALL 1 + #endif #undef CYTHON_FAST_PYCALL #define CYTHON_FAST_PYCALL 0 + #ifndef CYTHON_PEP487_INIT_SUBCLASS + #define CYTHON_PEP487_INIT_SUBCLASS 1 + #endif #ifndef CYTHON_PEP489_MULTI_PHASE_INIT #define CYTHON_PEP489_MULTI_PHASE_INIT 1 #endif + #ifndef CYTHON_USE_MODULE_STATE + #define CYTHON_USE_MODULE_STATE 0 + #endif #ifndef CYTHON_USE_TP_FINALIZE #define CYTHON_USE_TP_FINALIZE 1 #endif @@ -305,6 +329,12 @@ END: Cython Metadata */ #define CYTHON_USE_DICT_VERSIONS 0 #undef CYTHON_USE_EXC_INFO_STACK #define CYTHON_USE_EXC_INFO_STACK 0 + #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC + #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 + #endif + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 0 + #endif #else #define CYTHON_COMPILING_IN_PYPY 0 #define CYTHON_COMPILING_IN_CPYTHON 1 @@ -395,6 +425,9 @@ END: Cython Metadata */ #ifndef CYTHON_UPDATE_DESCRIPTOR_DOC #define CYTHON_UPDATE_DESCRIPTOR_DOC 1 #endif + #ifndef CYTHON_USE_FREELISTS + #define CYTHON_USE_FREELISTS 1 + #endif #endif #if !defined(CYTHON_FAST_PYCCALL) #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1) @@ -738,8 +771,13 @@ END: Cython Metadata */ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args, Py_ssize_t nargs, PyObject *kwnames); #else - #define __Pyx_PyCFunctionFast _PyCFunctionFast - #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #if PY_VERSION_HEX >= 0x030d00A4 + # define __Pyx_PyCFunctionFast PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords PyCFunctionFastWithKeywords + #else + # define __Pyx_PyCFunctionFast _PyCFunctionFast + # define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords + #endif #endif #if CYTHON_METH_FASTCALL #define __Pyx_METH_FASTCALL METH_FASTCALL @@ -1091,7 +1129,7 @@ static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, #define __Pyx_PyBytes_GET_SIZE(o) PyBytes_Size(o) #define __Pyx_PyByteArray_GET_SIZE(o) PyByteArray_Size(o) #endif -#if PY_VERSION_HEX >= 0x030d00A1 +#if __PYX_LIMITED_VERSION_HEX >= 0x030d00A1 #define __Pyx_PyImport_AddModuleRef(name) PyImport_AddModuleRef(name) #else static CYTHON_INLINE PyObject *__Pyx_PyImport_AddModuleRef(const char *name) { @@ -1178,7 +1216,7 @@ static CYTHON_INLINE float __PYX_NAN() { #endif #define __PYX_MARK_ERR_POS(f_index, lineno) \ - { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } + { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; } #define __PYX_ERR(f_index, lineno, Ln_error) \ { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; } @@ -1199,8 +1237,8 @@ static CYTHON_INLINE float __PYX_NAN() { #endif #endif -#define __PYX_HAVE__mettagrid__c_grid -#define __PYX_HAVE_API__mettagrid__c_grid +#define __PYX_HAVE__env__mettagrid__c_grid +#define __PYX_HAVE_API__env__mettagrid__c_grid /* Early includes */ #include "pythread.h" #include @@ -1284,24 +1322,7 @@ static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s) #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s) #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s) -#if CYTHON_COMPILING_IN_LIMITED_API -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u) -{ - const wchar_t *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#else -static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) -{ - const Py_UNICODE *u_end = u; - while (*u_end++) ; - return (size_t)(u_end - u - 1); -} -#endif #define __Pyx_PyUnicode_FromOrdinal(o) PyUnicode_FromOrdinal((int)o) -#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) -#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj) #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None) @@ -1620,22 +1641,22 @@ typedef struct { /* #### Code section: type_declarations ### */ /*--- Type declarations ---*/ -struct __pyx_obj_9mettagrid_6c_grid_Environment; +struct __pyx_obj_3env_9mettagrid_6c_grid_Environment; struct __pyx_array_obj; struct __pyx_MemviewEnum_obj; struct __pyx_memoryview_obj; struct __pyx_memoryviewslice_obj; -/* "mettagrid/c_grid.pyx":20 +/* "env/mettagrid/c_grid.pyx":20 * int WEST = 4 * * cdef class Environment: # <<<<<<<<<<<<<< * cdef: * int map_size */ -struct __pyx_obj_9mettagrid_6c_grid_Environment { +struct __pyx_obj_3env_9mettagrid_6c_grid_Environment { PyObject_HEAD - struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment *__pyx_vtab; + struct __pyx_vtabstruct_3env_9mettagrid_6c_grid_Environment *__pyx_vtab; int map_size; int num_agents; int horizon; @@ -1725,7 +1746,7 @@ struct __pyx_memoryviewslice_obj { -/* "mettagrid/c_grid.pyx":20 +/* "env/mettagrid/c_grid.pyx":20 * int WEST = 4 * * cdef class Environment: # <<<<<<<<<<<<<< @@ -1733,10 +1754,10 @@ struct __pyx_memoryviewslice_obj { * int map_size */ -struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment { - void (*_compute_observations)(struct __pyx_obj_9mettagrid_6c_grid_Environment *); +struct __pyx_vtabstruct_3env_9mettagrid_6c_grid_Environment { + void (*_compute_observations)(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *); }; -static struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment *__pyx_vtabptr_9mettagrid_6c_grid_Environment; +static struct __pyx_vtabstruct_3env_9mettagrid_6c_grid_Environment *__pyx_vtabptr_3env_9mettagrid_6c_grid_Environment; /* "View.MemoryView":114 @@ -2768,17 +2789,17 @@ static PyObject *__pyx_memoryview__get_base(struct __pyx_memoryview_obj *__pyx_v static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/ static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/ static PyObject *__pyx_memoryviewslice__get_base(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto*/ -static void __pyx_f_9mettagrid_6c_grid_11Environment__compute_observations(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self); /* proto*/ - -/* Module declarations from "mettagrid.c_grid" */ -static int __pyx_v_9mettagrid_6c_grid_EMPTY; -static int __pyx_v_9mettagrid_6c_grid_AGENT; -static int __pyx_v_9mettagrid_6c_grid_WALL; -static int __pyx_v_9mettagrid_6c_grid_PASS; -static int __pyx_v_9mettagrid_6c_grid_NORTH; -static int __pyx_v_9mettagrid_6c_grid_SOUTH; -static int __pyx_v_9mettagrid_6c_grid_EAST; -static int __pyx_v_9mettagrid_6c_grid_WEST; +static void __pyx_f_3env_9mettagrid_6c_grid_11Environment__compute_observations(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self); /* proto*/ + +/* Module declarations from "env.mettagrid.c_grid" */ +static int __pyx_v_3env_9mettagrid_6c_grid_EMPTY; +static int __pyx_v_3env_9mettagrid_6c_grid_AGENT; +static int __pyx_v_3env_9mettagrid_6c_grid_WALL; +static int __pyx_v_3env_9mettagrid_6c_grid_PASS; +static int __pyx_v_3env_9mettagrid_6c_grid_NORTH; +static int __pyx_v_3env_9mettagrid_6c_grid_SOUTH; +static int __pyx_v_3env_9mettagrid_6c_grid_EAST; +static int __pyx_v_3env_9mettagrid_6c_grid_WEST; static PyObject *__pyx_collections_abc_Sequence = 0; static PyObject *generic = 0; static PyObject *strided = 0; @@ -2787,7 +2808,7 @@ static PyObject *contiguous = 0; static PyObject *indirect_contiguous = 0; static int __pyx_memoryview_thread_locks_used; static PyThread_type_lock __pyx_memoryview_thread_locks[8]; -static PyObject *__pyx_f_9mettagrid_6c_grid___pyx_unpickle_Environment__set_state(struct __pyx_obj_9mettagrid_6c_grid_Environment *, PyObject *); /*proto*/ +static PyObject *__pyx_f_3env_9mettagrid_6c_grid___pyx_unpickle_Environment__set_state(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *, PyObject *); /*proto*/ static int __pyx_array_allocate_buffer(struct __pyx_array_obj *); /*proto*/ static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/ static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/ @@ -2826,11 +2847,11 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_int = { "unsigned int", NULL, sizeof(unsigned int), { 0 }, 0, __PYX_IS_UNSIGNED(unsigned int) ? 'U' : 'I', __PYX_IS_UNSIGNED(unsigned int), 0 }; static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_char = { "unsigned char", NULL, sizeof(unsigned char), { 0 }, 0, __PYX_IS_UNSIGNED(unsigned char) ? 'U' : 'I', __PYX_IS_UNSIGNED(unsigned char), 0 }; /* #### Code section: before_global_var ### */ -#define __Pyx_MODULE_NAME "mettagrid.c_grid" -extern int __pyx_module_is_main_mettagrid__c_grid; -int __pyx_module_is_main_mettagrid__c_grid = 0; +#define __Pyx_MODULE_NAME "env.mettagrid.c_grid" +extern int __pyx_module_is_main_env__mettagrid__c_grid; +int __pyx_module_is_main_env__mettagrid__c_grid = 0; -/* Implementation of "mettagrid.c_grid" */ +/* Implementation of "env.mettagrid.c_grid" */ /* #### Code section: global_var ### */ static PyObject *__pyx_builtin_range; static PyObject *__pyx_builtin_ValueError; @@ -2954,12 +2975,12 @@ static const char __pyx_k_dtype_is_object[] = "dtype_is_object"; static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError"; static const char __pyx_k_setstate_cython[] = "__setstate_cython__"; static const char __pyx_k_Environment_step[] = "Environment.step"; -static const char __pyx_k_mettagrid_c_grid[] = "mettagrid.c_grid"; static const char __pyx_k_Environment_reset[] = "Environment.reset"; static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum"; static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines"; static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback"; static const char __pyx_k_strided_and_direct[] = ""; +static const char __pyx_k_env_mettagrid_c_grid[] = "env.mettagrid.c_grid"; static const char __pyx_k_spawn_position_cands[] = "spawn_position_cands"; static const char __pyx_k_strided_and_indirect[] = ""; static const char __pyx_k_Invalid_shape_in_axis[] = "Invalid shape in axis "; @@ -3036,13 +3057,13 @@ static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewsl static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */ static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */ static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ -static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_grid, PyObject *__pyx_v_agent_positions, PyObject *__pyx_v_spawn_position_cands, PyObject *__pyx_v_observations, int __pyx_v_map_size, int __pyx_v_num_agents, int __pyx_v_horizon, int __pyx_v_vision_range); /* proto */ -static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_observations, CYTHON_UNUSED PyObject *__pyx_v_seed); /* proto */ -static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_np_actions); /* proto */ -static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_6__reduce_cython__(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self); /* proto */ -static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_8__setstate_cython__(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_pf_9mettagrid_6c_grid___pyx_unpickle_Environment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ -static PyObject *__pyx_tp_new_9mettagrid_6c_grid_Environment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ +static int __pyx_pf_3env_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_grid, PyObject *__pyx_v_agent_positions, PyObject *__pyx_v_spawn_position_cands, PyObject *__pyx_v_observations, int __pyx_v_map_size, int __pyx_v_num_agents, int __pyx_v_horizon, int __pyx_v_vision_range); /* proto */ +static PyObject *__pyx_pf_3env_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_observations, CYTHON_UNUSED PyObject *__pyx_v_seed); /* proto */ +static PyObject *__pyx_pf_3env_9mettagrid_6c_grid_11Environment_4step(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_np_actions); /* proto */ +static PyObject *__pyx_pf_3env_9mettagrid_6c_grid_11Environment_6__reduce_cython__(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self); /* proto */ +static PyObject *__pyx_pf_3env_9mettagrid_6c_grid_11Environment_8__setstate_cython__(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_pf_3env_9mettagrid_6c_grid___pyx_unpickle_Environment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */ +static PyObject *__pyx_tp_new_3env_9mettagrid_6c_grid_Environment(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/ @@ -3075,13 +3096,13 @@ typedef struct { PyTypeObject *__pyx_CoroutineType; #endif #if CYTHON_USE_MODULE_STATE - PyObject *__pyx_type_9mettagrid_6c_grid_Environment; + PyObject *__pyx_type_3env_9mettagrid_6c_grid_Environment; PyObject *__pyx_type___pyx_array; PyObject *__pyx_type___pyx_MemviewEnum; PyObject *__pyx_type___pyx_memoryview; PyObject *__pyx_type___pyx_memoryviewslice; #endif - PyTypeObject *__pyx_ptype_9mettagrid_6c_grid_Environment; + PyTypeObject *__pyx_ptype_3env_9mettagrid_6c_grid_Environment; PyTypeObject *__pyx_array_type; PyTypeObject *__pyx_MemviewEnum_type; PyTypeObject *__pyx_memoryview_type; @@ -3159,6 +3180,7 @@ typedef struct { PyObject *__pyx_kp_u_enable; PyObject *__pyx_n_s_encode; PyObject *__pyx_n_s_enumerate; + PyObject *__pyx_n_s_env_mettagrid_c_grid; PyObject *__pyx_kp_s_env_mettagrid_c_grid_pyx; PyObject *__pyx_n_s_error; PyObject *__pyx_n_s_flags; @@ -3183,7 +3205,6 @@ typedef struct { PyObject *__pyx_n_s_main; PyObject *__pyx_n_s_map_size; PyObject *__pyx_n_s_memview; - PyObject *__pyx_n_s_mettagrid_c_grid; PyObject *__pyx_n_s_mode; PyObject *__pyx_n_s_name; PyObject *__pyx_n_s_name_2; @@ -3316,8 +3337,8 @@ static int __pyx_m_clear(PyObject *m) { #ifdef __Pyx_FusedFunction_USED Py_CLEAR(clear_module_state->__pyx_FusedFunctionType); #endif - Py_CLEAR(clear_module_state->__pyx_ptype_9mettagrid_6c_grid_Environment); - Py_CLEAR(clear_module_state->__pyx_type_9mettagrid_6c_grid_Environment); + Py_CLEAR(clear_module_state->__pyx_ptype_3env_9mettagrid_6c_grid_Environment); + Py_CLEAR(clear_module_state->__pyx_type_3env_9mettagrid_6c_grid_Environment); Py_CLEAR(clear_module_state->__pyx_array_type); Py_CLEAR(clear_module_state->__pyx_type___pyx_array); Py_CLEAR(clear_module_state->__pyx_MemviewEnum_type); @@ -3399,6 +3420,7 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_kp_u_enable); Py_CLEAR(clear_module_state->__pyx_n_s_encode); Py_CLEAR(clear_module_state->__pyx_n_s_enumerate); + Py_CLEAR(clear_module_state->__pyx_n_s_env_mettagrid_c_grid); Py_CLEAR(clear_module_state->__pyx_kp_s_env_mettagrid_c_grid_pyx); Py_CLEAR(clear_module_state->__pyx_n_s_error); Py_CLEAR(clear_module_state->__pyx_n_s_flags); @@ -3423,7 +3445,6 @@ static int __pyx_m_clear(PyObject *m) { Py_CLEAR(clear_module_state->__pyx_n_s_main); Py_CLEAR(clear_module_state->__pyx_n_s_map_size); Py_CLEAR(clear_module_state->__pyx_n_s_memview); - Py_CLEAR(clear_module_state->__pyx_n_s_mettagrid_c_grid); Py_CLEAR(clear_module_state->__pyx_n_s_mode); Py_CLEAR(clear_module_state->__pyx_n_s_name); Py_CLEAR(clear_module_state->__pyx_n_s_name_2); @@ -3534,8 +3555,8 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #ifdef __Pyx_FusedFunction_USED Py_VISIT(traverse_module_state->__pyx_FusedFunctionType); #endif - Py_VISIT(traverse_module_state->__pyx_ptype_9mettagrid_6c_grid_Environment); - Py_VISIT(traverse_module_state->__pyx_type_9mettagrid_6c_grid_Environment); + Py_VISIT(traverse_module_state->__pyx_ptype_3env_9mettagrid_6c_grid_Environment); + Py_VISIT(traverse_module_state->__pyx_type_3env_9mettagrid_6c_grid_Environment); Py_VISIT(traverse_module_state->__pyx_array_type); Py_VISIT(traverse_module_state->__pyx_type___pyx_array); Py_VISIT(traverse_module_state->__pyx_MemviewEnum_type); @@ -3617,6 +3638,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_kp_u_enable); Py_VISIT(traverse_module_state->__pyx_n_s_encode); Py_VISIT(traverse_module_state->__pyx_n_s_enumerate); + Py_VISIT(traverse_module_state->__pyx_n_s_env_mettagrid_c_grid); Py_VISIT(traverse_module_state->__pyx_kp_s_env_mettagrid_c_grid_pyx); Py_VISIT(traverse_module_state->__pyx_n_s_error); Py_VISIT(traverse_module_state->__pyx_n_s_flags); @@ -3641,7 +3663,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(traverse_module_state->__pyx_n_s_main); Py_VISIT(traverse_module_state->__pyx_n_s_map_size); Py_VISIT(traverse_module_state->__pyx_n_s_memview); - Py_VISIT(traverse_module_state->__pyx_n_s_mettagrid_c_grid); Py_VISIT(traverse_module_state->__pyx_n_s_mode); Py_VISIT(traverse_module_state->__pyx_n_s_name); Py_VISIT(traverse_module_state->__pyx_n_s_name_2); @@ -3761,13 +3782,13 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_CoroutineType __pyx_mstate_global->__pyx_CoroutineType #endif #if CYTHON_USE_MODULE_STATE -#define __pyx_type_9mettagrid_6c_grid_Environment __pyx_mstate_global->__pyx_type_9mettagrid_6c_grid_Environment +#define __pyx_type_3env_9mettagrid_6c_grid_Environment __pyx_mstate_global->__pyx_type_3env_9mettagrid_6c_grid_Environment #define __pyx_type___pyx_array __pyx_mstate_global->__pyx_type___pyx_array #define __pyx_type___pyx_MemviewEnum __pyx_mstate_global->__pyx_type___pyx_MemviewEnum #define __pyx_type___pyx_memoryview __pyx_mstate_global->__pyx_type___pyx_memoryview #define __pyx_type___pyx_memoryviewslice __pyx_mstate_global->__pyx_type___pyx_memoryviewslice #endif -#define __pyx_ptype_9mettagrid_6c_grid_Environment __pyx_mstate_global->__pyx_ptype_9mettagrid_6c_grid_Environment +#define __pyx_ptype_3env_9mettagrid_6c_grid_Environment __pyx_mstate_global->__pyx_ptype_3env_9mettagrid_6c_grid_Environment #define __pyx_array_type __pyx_mstate_global->__pyx_array_type #define __pyx_MemviewEnum_type __pyx_mstate_global->__pyx_MemviewEnum_type #define __pyx_memoryview_type __pyx_mstate_global->__pyx_memoryview_type @@ -3845,6 +3866,7 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable #define __pyx_n_s_encode __pyx_mstate_global->__pyx_n_s_encode #define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate +#define __pyx_n_s_env_mettagrid_c_grid __pyx_mstate_global->__pyx_n_s_env_mettagrid_c_grid #define __pyx_kp_s_env_mettagrid_c_grid_pyx __pyx_mstate_global->__pyx_kp_s_env_mettagrid_c_grid_pyx #define __pyx_n_s_error __pyx_mstate_global->__pyx_n_s_error #define __pyx_n_s_flags __pyx_mstate_global->__pyx_n_s_flags @@ -3869,7 +3891,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) { #define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main #define __pyx_n_s_map_size __pyx_mstate_global->__pyx_n_s_map_size #define __pyx_n_s_memview __pyx_mstate_global->__pyx_n_s_memview -#define __pyx_n_s_mettagrid_c_grid __pyx_mstate_global->__pyx_n_s_mettagrid_c_grid #define __pyx_n_s_mode __pyx_mstate_global->__pyx_n_s_mode #define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name #define __pyx_n_s_name_2 __pyx_mstate_global->__pyx_n_s_name_2 @@ -17588,7 +17609,7 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ return __pyx_r; } -/* "mettagrid/c_grid.pyx":33 +/* "env/mettagrid/c_grid.pyx":33 * unsigned int[:, :] spawn_position_cands * * def __init__(self, grid, agent_positions, spawn_position_cands, observations, # <<<<<<<<<<<<<< @@ -17597,8 +17618,8 @@ static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__ */ /* Python wrapper */ -static int __pyx_pw_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ -static int __pyx_pw_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { +static int __pyx_pw_3env_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ +static int __pyx_pw_3env_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { PyObject *__pyx_v_grid = 0; PyObject *__pyx_v_agent_positions = 0; PyObject *__pyx_v_spawn_position_cands = 0; @@ -17763,11 +17784,11 @@ static int __pyx_pw_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]); } } - __Pyx_AddTraceback("mettagrid.c_grid.Environment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return -1; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_9mettagrid_6c_grid_11Environment___init__(((struct __pyx_obj_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_grid, __pyx_v_agent_positions, __pyx_v_spawn_position_cands, __pyx_v_observations, __pyx_v_map_size, __pyx_v_num_agents, __pyx_v_horizon, __pyx_v_vision_range); + __pyx_r = __pyx_pf_3env_9mettagrid_6c_grid_11Environment___init__(((struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_grid, __pyx_v_agent_positions, __pyx_v_spawn_position_cands, __pyx_v_observations, __pyx_v_map_size, __pyx_v_num_agents, __pyx_v_horizon, __pyx_v_vision_range); /* function exit code */ { @@ -17780,7 +17801,7 @@ static int __pyx_pw_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v return __pyx_r; } -static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_grid, PyObject *__pyx_v_agent_positions, PyObject *__pyx_v_spawn_position_cands, PyObject *__pyx_v_observations, int __pyx_v_map_size, int __pyx_v_num_agents, int __pyx_v_horizon, int __pyx_v_vision_range) { +static int __pyx_pf_3env_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_grid, PyObject *__pyx_v_agent_positions, PyObject *__pyx_v_spawn_position_cands, PyObject *__pyx_v_observations, int __pyx_v_map_size, int __pyx_v_num_agents, int __pyx_v_horizon, int __pyx_v_vision_range) { int __pyx_r; __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } }; __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } }; @@ -17789,7 +17810,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "mettagrid/c_grid.pyx":35 + /* "env/mettagrid/c_grid.pyx":35 * def __init__(self, grid, agent_positions, spawn_position_cands, observations, * int map_size, int num_agents, int horizon, int vision_range): * self.map_size = map_size # <<<<<<<<<<<<<< @@ -17798,7 +17819,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 */ __pyx_v_self->map_size = __pyx_v_map_size; - /* "mettagrid/c_grid.pyx":36 + /* "env/mettagrid/c_grid.pyx":36 * int map_size, int num_agents, int horizon, int vision_range): * self.map_size = map_size * self.num_agents = num_agents # <<<<<<<<<<<<<< @@ -17807,7 +17828,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 */ __pyx_v_self->num_agents = __pyx_v_num_agents; - /* "mettagrid/c_grid.pyx":37 + /* "env/mettagrid/c_grid.pyx":37 * self.map_size = map_size * self.num_agents = num_agents * self.horizon = horizon # <<<<<<<<<<<<<< @@ -17816,7 +17837,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 */ __pyx_v_self->horizon = __pyx_v_horizon; - /* "mettagrid/c_grid.pyx":38 + /* "env/mettagrid/c_grid.pyx":38 * self.num_agents = num_agents * self.horizon = horizon * self.vision_range = vision_range # <<<<<<<<<<<<<< @@ -17825,7 +17846,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 */ __pyx_v_self->vision_range = __pyx_v_vision_range; - /* "mettagrid/c_grid.pyx":39 + /* "env/mettagrid/c_grid.pyx":39 * self.horizon = horizon * self.vision_range = vision_range * self.obs_size = 2*self.vision_range + 1 # <<<<<<<<<<<<<< @@ -17834,7 +17855,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 */ __pyx_v_self->obs_size = ((2 * __pyx_v_self->vision_range) + 1); - /* "mettagrid/c_grid.pyx":41 + /* "env/mettagrid/c_grid.pyx":41 * self.obs_size = 2*self.vision_range + 1 * * self.grid = grid # <<<<<<<<<<<<<< @@ -17847,7 +17868,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "mettagrid/c_grid.pyx":42 + /* "env/mettagrid/c_grid.pyx":42 * * self.grid = grid * self.observations = observations # <<<<<<<<<<<<<< @@ -17860,7 +17881,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 __pyx_t_2.memview = NULL; __pyx_t_2.data = NULL; - /* "mettagrid/c_grid.pyx":43 + /* "env/mettagrid/c_grid.pyx":43 * self.grid = grid * self.observations = observations * self.agent_positions = agent_positions # <<<<<<<<<<<<<< @@ -17873,7 +17894,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "mettagrid/c_grid.pyx":44 + /* "env/mettagrid/c_grid.pyx":44 * self.observations = observations * self.agent_positions = agent_positions * self.spawn_position_cands = spawn_position_cands # <<<<<<<<<<<<<< @@ -17886,7 +17907,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "mettagrid/c_grid.pyx":33 + /* "env/mettagrid/c_grid.pyx":33 * unsigned int[:, :] spawn_position_cands * * def __init__(self, grid, agent_positions, spawn_position_cands, observations, # <<<<<<<<<<<<<< @@ -17901,13 +17922,13 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1); __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1); __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1); - __Pyx_AddTraceback("mettagrid.c_grid.Environment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = -1; __pyx_L0:; return __pyx_r; } -/* "mettagrid/c_grid.pyx":46 +/* "env/mettagrid/c_grid.pyx":46 * self.spawn_position_cands = spawn_position_cands * * cdef void _compute_observations(self): # <<<<<<<<<<<<<< @@ -17915,7 +17936,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9 * for agent_idx in range(self.num_agents): */ -static void __pyx_f_9mettagrid_6c_grid_11Environment__compute_observations(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self) { +static void __pyx_f_3env_9mettagrid_6c_grid_11Environment__compute_observations(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self) { int __pyx_v_r; int __pyx_v_c; int __pyx_v_agent_idx; @@ -17931,7 +17952,7 @@ static void __pyx_f_9mettagrid_6c_grid_11Environment__compute_observations(struc const char *__pyx_filename = NULL; int __pyx_clineno = 0; - /* "mettagrid/c_grid.pyx":48 + /* "env/mettagrid/c_grid.pyx":48 * cdef void _compute_observations(self): * cdef int r, c, agent_idx * for agent_idx in range(self.num_agents): # <<<<<<<<<<<<<< @@ -17943,7 +17964,7 @@ static void __pyx_f_9mettagrid_6c_grid_11Environment__compute_observations(struc for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) { __pyx_v_agent_idx = __pyx_t_3; - /* "mettagrid/c_grid.pyx":49 + /* "env/mettagrid/c_grid.pyx":49 * cdef int r, c, agent_idx * for agent_idx in range(self.num_agents): * r = self.agent_positions[agent_idx, 0] # <<<<<<<<<<<<<< @@ -17954,7 +17975,7 @@ static void __pyx_f_9mettagrid_6c_grid_11Environment__compute_observations(struc __pyx_t_5 = 0; __pyx_v_r = (*((unsigned int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->agent_positions.data + __pyx_t_4 * __pyx_v_self->agent_positions.strides[0]) ) + __pyx_t_5 * __pyx_v_self->agent_positions.strides[1]) ))); - /* "mettagrid/c_grid.pyx":50 + /* "env/mettagrid/c_grid.pyx":50 * for agent_idx in range(self.num_agents): * r = self.agent_positions[agent_idx, 0] * c = self.agent_positions[agent_idx, 1] # <<<<<<<<<<<<<< @@ -17965,7 +17986,7 @@ static void __pyx_f_9mettagrid_6c_grid_11Environment__compute_observations(struc __pyx_t_4 = 1; __pyx_v_c = (*((unsigned int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->agent_positions.data + __pyx_t_5 * __pyx_v_self->agent_positions.strides[0]) ) + __pyx_t_4 * __pyx_v_self->agent_positions.strides[1]) ))); - /* "mettagrid/c_grid.pyx":51 + /* "env/mettagrid/c_grid.pyx":51 * r = self.agent_positions[agent_idx, 0] * c = self.agent_positions[agent_idx, 1] * self.observations[agent_idx, :] = self.grid[ # <<<<<<<<<<<<<< @@ -18034,7 +18055,7 @@ if (unlikely((__pyx_memoryview_copy_contents(__pyx_t_6, __pyx_t_8, 2, 2, 0) < 0) __pyx_t_6.memview = NULL; __pyx_t_6.data = NULL; } - /* "mettagrid/c_grid.pyx":46 + /* "env/mettagrid/c_grid.pyx":46 * self.spawn_position_cands = spawn_position_cands * * cdef void _compute_observations(self): # <<<<<<<<<<<<<< @@ -18047,11 +18068,11 @@ if (unlikely((__pyx_memoryview_copy_contents(__pyx_t_6, __pyx_t_8, 2, 2, 0) < 0) __pyx_L1_error:; __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1); __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1); - __Pyx_AddTraceback("mettagrid.c_grid.Environment._compute_observations", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.Environment._compute_observations", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_L0:; } -/* "mettagrid/c_grid.pyx":56 +/* "env/mettagrid/c_grid.pyx":56 * ] * * def reset(self, observations, seed=0): # <<<<<<<<<<<<<< @@ -18060,15 +18081,15 @@ if (unlikely((__pyx_memoryview_copy_contents(__pyx_t_6, __pyx_t_8, 2, 2, 0) < 0) */ /* Python wrapper */ -static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_3reset(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_3reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_9mettagrid_6c_grid_11Environment_3reset = {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9mettagrid_6c_grid_11Environment_3reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_3reset(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_3env_9mettagrid_6c_grid_11Environment_3reset = {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3env_9mettagrid_6c_grid_11Environment_3reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_3reset(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18154,11 +18175,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("mettagrid.c_grid.Environment.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_9mettagrid_6c_grid_11Environment_2reset(((struct __pyx_obj_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_observations, __pyx_v_seed); + __pyx_r = __pyx_pf_3env_9mettagrid_6c_grid_11Environment_2reset(((struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_observations, __pyx_v_seed); /* function exit code */ { @@ -18171,7 +18192,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_observations, CYTHON_UNUSED PyObject *__pyx_v_seed) { +static PyObject *__pyx_pf_3env_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_observations, CYTHON_UNUSED PyObject *__pyx_v_seed) { int __pyx_v_left; int __pyx_v_right; int __pyx_v_spawn_idx; @@ -18193,7 +18214,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_o int __pyx_clineno = 0; __Pyx_RefNannySetupContext("reset", 1); - /* "mettagrid/c_grid.pyx":57 + /* "env/mettagrid/c_grid.pyx":57 * * def reset(self, observations, seed=0): * self.observations = observations # <<<<<<<<<<<<<< @@ -18206,7 +18227,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_o __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "mettagrid/c_grid.pyx":60 + /* "env/mettagrid/c_grid.pyx":60 * * # Add borders * cdef int left = self.vision_range # <<<<<<<<<<<<<< @@ -18216,7 +18237,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_o __pyx_t_2 = __pyx_v_self->vision_range; __pyx_v_left = __pyx_t_2; - /* "mettagrid/c_grid.pyx":61 + /* "env/mettagrid/c_grid.pyx":61 * # Add borders * cdef int left = self.vision_range * cdef int right = self.map_size - self.vision_range - 1 # <<<<<<<<<<<<<< @@ -18225,7 +18246,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_o */ __pyx_v_right = ((__pyx_v_self->map_size - __pyx_v_self->vision_range) - 1); - /* "mettagrid/c_grid.pyx":62 + /* "env/mettagrid/c_grid.pyx":62 * cdef int left = self.vision_range * cdef int right = self.map_size - self.vision_range - 1 * self.grid[:left, :] = WALL # <<<<<<<<<<<<<< @@ -18258,7 +18279,7 @@ __pyx_t_3.strides[1] = __pyx_v_self->grid.strides[1]; __pyx_t_3.suboffsets[1] = -1; { - unsigned char __pyx_temp_scalar = __pyx_v_9mettagrid_6c_grid_WALL; + unsigned char __pyx_temp_scalar = __pyx_v_3env_9mettagrid_6c_grid_WALL; { Py_ssize_t __pyx_temp_extent_0 = __pyx_t_3.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_t_3.strides[0]; @@ -18282,7 +18303,7 @@ __pyx_t_3.strides[1] = __pyx_v_self->grid.strides[1]; __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1); __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "mettagrid/c_grid.pyx":63 + /* "env/mettagrid/c_grid.pyx":63 * cdef int right = self.map_size - self.vision_range - 1 * self.grid[:left, :] = WALL * self.grid[right:, :] = WALL # <<<<<<<<<<<<<< @@ -18315,7 +18336,7 @@ __pyx_t_3.strides[1] = __pyx_v_self->grid.strides[1]; __pyx_t_3.suboffsets[1] = -1; { - unsigned char __pyx_temp_scalar = __pyx_v_9mettagrid_6c_grid_WALL; + unsigned char __pyx_temp_scalar = __pyx_v_3env_9mettagrid_6c_grid_WALL; { Py_ssize_t __pyx_temp_extent_0 = __pyx_t_3.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_t_3.strides[0]; @@ -18339,7 +18360,7 @@ __pyx_t_3.strides[1] = __pyx_v_self->grid.strides[1]; __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1); __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "mettagrid/c_grid.pyx":64 + /* "env/mettagrid/c_grid.pyx":64 * self.grid[:left, :] = WALL * self.grid[right:, :] = WALL * self.grid[:, :left] = WALL # <<<<<<<<<<<<<< @@ -18372,7 +18393,7 @@ __pyx_t_2 = -1; } { - unsigned char __pyx_temp_scalar = __pyx_v_9mettagrid_6c_grid_WALL; + unsigned char __pyx_temp_scalar = __pyx_v_3env_9mettagrid_6c_grid_WALL; { Py_ssize_t __pyx_temp_extent_0 = __pyx_t_3.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_t_3.strides[0]; @@ -18396,7 +18417,7 @@ __pyx_t_2 = -1; __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1); __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "mettagrid/c_grid.pyx":65 + /* "env/mettagrid/c_grid.pyx":65 * self.grid[right:, :] = WALL * self.grid[:, :left] = WALL * self.grid[:, right:] = WALL # <<<<<<<<<<<<<< @@ -18429,7 +18450,7 @@ __pyx_t_2 = -1; } { - unsigned char __pyx_temp_scalar = __pyx_v_9mettagrid_6c_grid_WALL; + unsigned char __pyx_temp_scalar = __pyx_v_3env_9mettagrid_6c_grid_WALL; { Py_ssize_t __pyx_temp_extent_0 = __pyx_t_3.shape[0]; Py_ssize_t __pyx_temp_stride_0 = __pyx_t_3.strides[0]; @@ -18453,7 +18474,7 @@ __pyx_t_2 = -1; __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1); __pyx_t_3.memview = NULL; __pyx_t_3.data = NULL; - /* "mettagrid/c_grid.pyx":69 + /* "env/mettagrid/c_grid.pyx":69 * # Agent spawning * cdef int spawn_idx, r, c * cdef int agent_idx = 0 # <<<<<<<<<<<<<< @@ -18462,7 +18483,7 @@ __pyx_t_2 = -1; */ __pyx_v_agent_idx = 0; - /* "mettagrid/c_grid.pyx":70 + /* "env/mettagrid/c_grid.pyx":70 * cdef int spawn_idx, r, c * cdef int agent_idx = 0 * for spawn_idx in range(self.map_size**2): # <<<<<<<<<<<<<< @@ -18474,7 +18495,7 @@ __pyx_t_2 = -1; for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_5; __pyx_t_2+=1) { __pyx_v_spawn_idx = __pyx_t_2; - /* "mettagrid/c_grid.pyx":71 + /* "env/mettagrid/c_grid.pyx":71 * cdef int agent_idx = 0 * for spawn_idx in range(self.map_size**2): * r = self.spawn_position_cands[spawn_idx, 0] # <<<<<<<<<<<<<< @@ -18485,7 +18506,7 @@ __pyx_t_2 = -1; __pyx_t_7 = 0; __pyx_v_r = (*((unsigned int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->spawn_position_cands.data + __pyx_t_6 * __pyx_v_self->spawn_position_cands.strides[0]) ) + __pyx_t_7 * __pyx_v_self->spawn_position_cands.strides[1]) ))); - /* "mettagrid/c_grid.pyx":72 + /* "env/mettagrid/c_grid.pyx":72 * for spawn_idx in range(self.map_size**2): * r = self.spawn_position_cands[spawn_idx, 0] * c = self.spawn_position_cands[spawn_idx, 1] # <<<<<<<<<<<<<< @@ -18496,7 +18517,7 @@ __pyx_t_2 = -1; __pyx_t_6 = 1; __pyx_v_c = (*((unsigned int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->spawn_position_cands.data + __pyx_t_7 * __pyx_v_self->spawn_position_cands.strides[0]) ) + __pyx_t_6 * __pyx_v_self->spawn_position_cands.strides[1]) ))); - /* "mettagrid/c_grid.pyx":73 + /* "env/mettagrid/c_grid.pyx":73 * r = self.spawn_position_cands[spawn_idx, 0] * c = self.spawn_position_cands[spawn_idx, 1] * if self.grid[r, c] == 0: # <<<<<<<<<<<<<< @@ -18508,7 +18529,7 @@ __pyx_t_2 = -1; __pyx_t_8 = ((*((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_6 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_7 * __pyx_v_self->grid.strides[1]) ))) == 0); if (__pyx_t_8) { - /* "mettagrid/c_grid.pyx":74 + /* "env/mettagrid/c_grid.pyx":74 * c = self.spawn_position_cands[spawn_idx, 1] * if self.grid[r, c] == 0: * self.grid[r, c] = AGENT # <<<<<<<<<<<<<< @@ -18517,9 +18538,9 @@ __pyx_t_2 = -1; */ __pyx_t_7 = __pyx_v_r; __pyx_t_6 = __pyx_v_c; - *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_7 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_6 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_9mettagrid_6c_grid_AGENT; + *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_7 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_6 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_3env_9mettagrid_6c_grid_AGENT; - /* "mettagrid/c_grid.pyx":75 + /* "env/mettagrid/c_grid.pyx":75 * if self.grid[r, c] == 0: * self.grid[r, c] = AGENT * self.agent_positions[agent_idx, 0] = r # <<<<<<<<<<<<<< @@ -18530,7 +18551,7 @@ __pyx_t_2 = -1; __pyx_t_7 = 0; *((unsigned int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->agent_positions.data + __pyx_t_6 * __pyx_v_self->agent_positions.strides[0]) ) + __pyx_t_7 * __pyx_v_self->agent_positions.strides[1]) )) = __pyx_v_r; - /* "mettagrid/c_grid.pyx":76 + /* "env/mettagrid/c_grid.pyx":76 * self.grid[r, c] = AGENT * self.agent_positions[agent_idx, 0] = r * self.agent_positions[agent_idx, 1] = c # <<<<<<<<<<<<<< @@ -18541,7 +18562,7 @@ __pyx_t_2 = -1; __pyx_t_6 = 1; *((unsigned int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->agent_positions.data + __pyx_t_7 * __pyx_v_self->agent_positions.strides[0]) ) + __pyx_t_6 * __pyx_v_self->agent_positions.strides[1]) )) = __pyx_v_c; - /* "mettagrid/c_grid.pyx":77 + /* "env/mettagrid/c_grid.pyx":77 * self.agent_positions[agent_idx, 0] = r * self.agent_positions[agent_idx, 1] = c * agent_idx += 1 # <<<<<<<<<<<<<< @@ -18550,7 +18571,7 @@ __pyx_t_2 = -1; */ __pyx_v_agent_idx = (__pyx_v_agent_idx + 1); - /* "mettagrid/c_grid.pyx":78 + /* "env/mettagrid/c_grid.pyx":78 * self.agent_positions[agent_idx, 1] = c * agent_idx += 1 * if agent_idx == self.num_agents: # <<<<<<<<<<<<<< @@ -18560,7 +18581,7 @@ __pyx_t_2 = -1; __pyx_t_8 = (__pyx_v_agent_idx == __pyx_v_self->num_agents); if (__pyx_t_8) { - /* "mettagrid/c_grid.pyx":79 + /* "env/mettagrid/c_grid.pyx":79 * agent_idx += 1 * if agent_idx == self.num_agents: * break # <<<<<<<<<<<<<< @@ -18569,7 +18590,7 @@ __pyx_t_2 = -1; */ goto __pyx_L4_break; - /* "mettagrid/c_grid.pyx":78 + /* "env/mettagrid/c_grid.pyx":78 * self.agent_positions[agent_idx, 1] = c * agent_idx += 1 * if agent_idx == self.num_agents: # <<<<<<<<<<<<<< @@ -18578,7 +18599,7 @@ __pyx_t_2 = -1; */ } - /* "mettagrid/c_grid.pyx":73 + /* "env/mettagrid/c_grid.pyx":73 * r = self.spawn_position_cands[spawn_idx, 0] * c = self.spawn_position_cands[spawn_idx, 1] * if self.grid[r, c] == 0: # <<<<<<<<<<<<<< @@ -18589,16 +18610,16 @@ __pyx_t_2 = -1; } __pyx_L4_break:; - /* "mettagrid/c_grid.pyx":81 + /* "env/mettagrid/c_grid.pyx":81 * break * * self._compute_observations() # <<<<<<<<<<<<<< * * def step(self, np_actions): */ - ((struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment *)__pyx_v_self->__pyx_vtab)->_compute_observations(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) + ((struct __pyx_vtabstruct_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self->__pyx_vtab)->_compute_observations(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error) - /* "mettagrid/c_grid.pyx":56 + /* "env/mettagrid/c_grid.pyx":56 * ] * * def reset(self, observations, seed=0): # <<<<<<<<<<<<<< @@ -18612,7 +18633,7 @@ __pyx_t_2 = -1; __pyx_L1_error:; __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1); __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1); - __Pyx_AddTraceback("mettagrid.c_grid.Environment.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.reset", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -18620,7 +18641,7 @@ __pyx_t_2 = -1; return __pyx_r; } -/* "mettagrid/c_grid.pyx":83 +/* "env/mettagrid/c_grid.pyx":83 * self._compute_observations() * * def step(self, np_actions): # <<<<<<<<<<<<<< @@ -18629,15 +18650,15 @@ __pyx_t_2 = -1; */ /* Python wrapper */ -static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_5step(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_5step(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_9mettagrid_6c_grid_11Environment_5step = {"step", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9mettagrid_6c_grid_11Environment_5step, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_5step(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_3env_9mettagrid_6c_grid_11Environment_5step = {"step", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3env_9mettagrid_6c_grid_11Environment_5step, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_5step(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -18707,11 +18728,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("mettagrid.c_grid.Environment.step", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.step", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_9mettagrid_6c_grid_11Environment_4step(((struct __pyx_obj_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_np_actions); + __pyx_r = __pyx_pf_3env_9mettagrid_6c_grid_11Environment_4step(((struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_np_actions); /* function exit code */ { @@ -18724,7 +18745,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_np_actions) { +static PyObject *__pyx_pf_3env_9mettagrid_6c_grid_11Environment_4step(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_np_actions) { __Pyx_memviewslice __pyx_v_actions = { 0, 0, { 0 }, { 0 }, { 0 } }; int __pyx_v_agent_idx; int __pyx_v_atn; @@ -18750,7 +18771,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob int __pyx_clineno = 0; __Pyx_RefNannySetupContext("step", 1); - /* "mettagrid/c_grid.pyx":84 + /* "env/mettagrid/c_grid.pyx":84 * * def step(self, np_actions): * cdef unsigned int[:] actions = np_actions # <<<<<<<<<<<<<< @@ -18762,7 +18783,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob __pyx_t_1.memview = NULL; __pyx_t_1.data = NULL; - /* "mettagrid/c_grid.pyx":86 + /* "env/mettagrid/c_grid.pyx":86 * cdef unsigned int[:] actions = np_actions * cdef int agent_idx, atn, r, c, dr, dc, dest_r, dest_c * for agent_idx in range(self.num_agents): # <<<<<<<<<<<<<< @@ -18774,7 +18795,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) { __pyx_v_agent_idx = __pyx_t_4; - /* "mettagrid/c_grid.pyx":87 + /* "env/mettagrid/c_grid.pyx":87 * cdef int agent_idx, atn, r, c, dr, dc, dest_r, dest_c * for agent_idx in range(self.num_agents): * r = self.agent_positions[agent_idx, 0] # <<<<<<<<<<<<<< @@ -18785,7 +18806,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob __pyx_t_6 = 0; __pyx_v_r = (*((unsigned int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->agent_positions.data + __pyx_t_5 * __pyx_v_self->agent_positions.strides[0]) ) + __pyx_t_6 * __pyx_v_self->agent_positions.strides[1]) ))); - /* "mettagrid/c_grid.pyx":88 + /* "env/mettagrid/c_grid.pyx":88 * for agent_idx in range(self.num_agents): * r = self.agent_positions[agent_idx, 0] * c = self.agent_positions[agent_idx, 1] # <<<<<<<<<<<<<< @@ -18796,7 +18817,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob __pyx_t_5 = 1; __pyx_v_c = (*((unsigned int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->agent_positions.data + __pyx_t_6 * __pyx_v_self->agent_positions.strides[0]) ) + __pyx_t_5 * __pyx_v_self->agent_positions.strides[1]) ))); - /* "mettagrid/c_grid.pyx":89 + /* "env/mettagrid/c_grid.pyx":89 * r = self.agent_positions[agent_idx, 0] * c = self.agent_positions[agent_idx, 1] * atn = actions[agent_idx] # <<<<<<<<<<<<<< @@ -18806,7 +18827,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob __pyx_t_5 = __pyx_v_agent_idx; __pyx_v_atn = (*((unsigned int *) ( /* dim=0 */ (__pyx_v_actions.data + __pyx_t_5 * __pyx_v_actions.strides[0]) ))); - /* "mettagrid/c_grid.pyx":90 + /* "env/mettagrid/c_grid.pyx":90 * c = self.agent_positions[agent_idx, 1] * atn = actions[agent_idx] * dr = 0 # <<<<<<<<<<<<<< @@ -18815,7 +18836,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ __pyx_v_dr = 0; - /* "mettagrid/c_grid.pyx":91 + /* "env/mettagrid/c_grid.pyx":91 * atn = actions[agent_idx] * dr = 0 * dc = 0 # <<<<<<<<<<<<<< @@ -18824,17 +18845,17 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ __pyx_v_dc = 0; - /* "mettagrid/c_grid.pyx":92 + /* "env/mettagrid/c_grid.pyx":92 * dr = 0 * dc = 0 * if atn == PASS: # <<<<<<<<<<<<<< * continue * elif atn == NORTH: */ - __pyx_t_7 = (__pyx_v_atn == __pyx_v_9mettagrid_6c_grid_PASS); + __pyx_t_7 = (__pyx_v_atn == __pyx_v_3env_9mettagrid_6c_grid_PASS); if (__pyx_t_7) { - /* "mettagrid/c_grid.pyx":93 + /* "env/mettagrid/c_grid.pyx":93 * dc = 0 * if atn == PASS: * continue # <<<<<<<<<<<<<< @@ -18843,7 +18864,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ goto __pyx_L3_continue; - /* "mettagrid/c_grid.pyx":92 + /* "env/mettagrid/c_grid.pyx":92 * dr = 0 * dc = 0 * if atn == PASS: # <<<<<<<<<<<<<< @@ -18852,17 +18873,17 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ } - /* "mettagrid/c_grid.pyx":94 + /* "env/mettagrid/c_grid.pyx":94 * if atn == PASS: * continue * elif atn == NORTH: # <<<<<<<<<<<<<< * dr = -1 * elif atn == SOUTH: */ - __pyx_t_7 = (__pyx_v_atn == __pyx_v_9mettagrid_6c_grid_NORTH); + __pyx_t_7 = (__pyx_v_atn == __pyx_v_3env_9mettagrid_6c_grid_NORTH); if (__pyx_t_7) { - /* "mettagrid/c_grid.pyx":95 + /* "env/mettagrid/c_grid.pyx":95 * continue * elif atn == NORTH: * dr = -1 # <<<<<<<<<<<<<< @@ -18871,7 +18892,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ __pyx_v_dr = -1; - /* "mettagrid/c_grid.pyx":94 + /* "env/mettagrid/c_grid.pyx":94 * if atn == PASS: * continue * elif atn == NORTH: # <<<<<<<<<<<<<< @@ -18881,17 +18902,17 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob goto __pyx_L5; } - /* "mettagrid/c_grid.pyx":96 + /* "env/mettagrid/c_grid.pyx":96 * elif atn == NORTH: * dr = -1 * elif atn == SOUTH: # <<<<<<<<<<<<<< * dr = 1 * elif atn == EAST: */ - __pyx_t_7 = (__pyx_v_atn == __pyx_v_9mettagrid_6c_grid_SOUTH); + __pyx_t_7 = (__pyx_v_atn == __pyx_v_3env_9mettagrid_6c_grid_SOUTH); if (__pyx_t_7) { - /* "mettagrid/c_grid.pyx":97 + /* "env/mettagrid/c_grid.pyx":97 * dr = -1 * elif atn == SOUTH: * dr = 1 # <<<<<<<<<<<<<< @@ -18900,7 +18921,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ __pyx_v_dr = 1; - /* "mettagrid/c_grid.pyx":96 + /* "env/mettagrid/c_grid.pyx":96 * elif atn == NORTH: * dr = -1 * elif atn == SOUTH: # <<<<<<<<<<<<<< @@ -18910,17 +18931,17 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob goto __pyx_L5; } - /* "mettagrid/c_grid.pyx":98 + /* "env/mettagrid/c_grid.pyx":98 * elif atn == SOUTH: * dr = 1 * elif atn == EAST: # <<<<<<<<<<<<<< * dc = 1 * elif atn == WEST: */ - __pyx_t_7 = (__pyx_v_atn == __pyx_v_9mettagrid_6c_grid_EAST); + __pyx_t_7 = (__pyx_v_atn == __pyx_v_3env_9mettagrid_6c_grid_EAST); if (__pyx_t_7) { - /* "mettagrid/c_grid.pyx":99 + /* "env/mettagrid/c_grid.pyx":99 * dr = 1 * elif atn == EAST: * dc = 1 # <<<<<<<<<<<<<< @@ -18929,7 +18950,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ __pyx_v_dc = 1; - /* "mettagrid/c_grid.pyx":98 + /* "env/mettagrid/c_grid.pyx":98 * elif atn == SOUTH: * dr = 1 * elif atn == EAST: # <<<<<<<<<<<<<< @@ -18939,17 +18960,17 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob goto __pyx_L5; } - /* "mettagrid/c_grid.pyx":100 + /* "env/mettagrid/c_grid.pyx":100 * elif atn == EAST: * dc = 1 * elif atn == WEST: # <<<<<<<<<<<<<< * dc = -1 * else: */ - __pyx_t_7 = (__pyx_v_atn == __pyx_v_9mettagrid_6c_grid_WEST); + __pyx_t_7 = (__pyx_v_atn == __pyx_v_3env_9mettagrid_6c_grid_WEST); if (likely(__pyx_t_7)) { - /* "mettagrid/c_grid.pyx":101 + /* "env/mettagrid/c_grid.pyx":101 * dc = 1 * elif atn == WEST: * dc = -1 # <<<<<<<<<<<<<< @@ -18958,7 +18979,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ __pyx_v_dc = -1; - /* "mettagrid/c_grid.pyx":100 + /* "env/mettagrid/c_grid.pyx":100 * elif atn == EAST: * dc = 1 * elif atn == WEST: # <<<<<<<<<<<<<< @@ -18968,7 +18989,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob goto __pyx_L5; } - /* "mettagrid/c_grid.pyx":103 + /* "env/mettagrid/c_grid.pyx":103 * dc = -1 * else: * raise ValueError(f'Invalid action: {atn}') # <<<<<<<<<<<<<< @@ -18990,7 +19011,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob } __pyx_L5:; - /* "mettagrid/c_grid.pyx":105 + /* "env/mettagrid/c_grid.pyx":105 * raise ValueError(f'Invalid action: {atn}') * * dest_r = r + dr # <<<<<<<<<<<<<< @@ -18999,7 +19020,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ __pyx_v_dest_r = (__pyx_v_r + __pyx_v_dr); - /* "mettagrid/c_grid.pyx":106 + /* "env/mettagrid/c_grid.pyx":106 * * dest_r = r + dr * dest_c = c + dc # <<<<<<<<<<<<<< @@ -19008,7 +19029,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ __pyx_v_dest_c = (__pyx_v_c + __pyx_v_dc); - /* "mettagrid/c_grid.pyx":108 + /* "env/mettagrid/c_grid.pyx":108 * dest_c = c + dc * * if self.grid[dest_r, dest_c] == 0: # <<<<<<<<<<<<<< @@ -19020,7 +19041,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob __pyx_t_7 = ((*((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_5 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_6 * __pyx_v_self->grid.strides[1]) ))) == 0); if (__pyx_t_7) { - /* "mettagrid/c_grid.pyx":109 + /* "env/mettagrid/c_grid.pyx":109 * * if self.grid[dest_r, dest_c] == 0: * self.grid[r, c] = EMPTY # <<<<<<<<<<<<<< @@ -19029,9 +19050,9 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ __pyx_t_6 = __pyx_v_r; __pyx_t_5 = __pyx_v_c; - *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_6 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_5 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_9mettagrid_6c_grid_EMPTY; + *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_6 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_5 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_3env_9mettagrid_6c_grid_EMPTY; - /* "mettagrid/c_grid.pyx":110 + /* "env/mettagrid/c_grid.pyx":110 * if self.grid[dest_r, dest_c] == 0: * self.grid[r, c] = EMPTY * self.grid[dest_r, dest_c] = AGENT # <<<<<<<<<<<<<< @@ -19040,9 +19061,9 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ __pyx_t_5 = __pyx_v_dest_r; __pyx_t_6 = __pyx_v_dest_c; - *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_5 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_6 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_9mettagrid_6c_grid_AGENT; + *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_5 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_6 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_3env_9mettagrid_6c_grid_AGENT; - /* "mettagrid/c_grid.pyx":111 + /* "env/mettagrid/c_grid.pyx":111 * self.grid[r, c] = EMPTY * self.grid[dest_r, dest_c] = AGENT * self.agent_positions[agent_idx, 0] = dest_r # <<<<<<<<<<<<<< @@ -19053,7 +19074,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob __pyx_t_5 = 0; *((unsigned int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->agent_positions.data + __pyx_t_6 * __pyx_v_self->agent_positions.strides[0]) ) + __pyx_t_5 * __pyx_v_self->agent_positions.strides[1]) )) = __pyx_v_dest_r; - /* "mettagrid/c_grid.pyx":112 + /* "env/mettagrid/c_grid.pyx":112 * self.grid[dest_r, dest_c] = AGENT * self.agent_positions[agent_idx, 0] = dest_r * self.agent_positions[agent_idx, 1] = dest_c # <<<<<<<<<<<<<< @@ -19064,7 +19085,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob __pyx_t_6 = 1; *((unsigned int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->agent_positions.data + __pyx_t_5 * __pyx_v_self->agent_positions.strides[0]) ) + __pyx_t_6 * __pyx_v_self->agent_positions.strides[1]) )) = __pyx_v_dest_c; - /* "mettagrid/c_grid.pyx":108 + /* "env/mettagrid/c_grid.pyx":108 * dest_c = c + dc * * if self.grid[dest_r, dest_c] == 0: # <<<<<<<<<<<<<< @@ -19075,14 +19096,14 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob __pyx_L3_continue:; } - /* "mettagrid/c_grid.pyx":114 + /* "env/mettagrid/c_grid.pyx":114 * self.agent_positions[agent_idx, 1] = dest_c * * self._compute_observations() # <<<<<<<<<<<<<< */ - ((struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment *)__pyx_v_self->__pyx_vtab)->_compute_observations(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) + ((struct __pyx_vtabstruct_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self->__pyx_vtab)->_compute_observations(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error) - /* "mettagrid/c_grid.pyx":83 + /* "env/mettagrid/c_grid.pyx":83 * self._compute_observations() * * def step(self, np_actions): # <<<<<<<<<<<<<< @@ -19097,7 +19118,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1); __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); - __Pyx_AddTraceback("mettagrid.c_grid.Environment.step", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.step", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __PYX_XCLEAR_MEMVIEW(&__pyx_v_actions, 1); @@ -19113,15 +19134,15 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob */ /* Python wrapper */ -static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_7__reduce_cython__(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_9mettagrid_6c_grid_11Environment_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9mettagrid_6c_grid_11Environment_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_7__reduce_cython__(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_3env_9mettagrid_6c_grid_11Environment_7__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3env_9mettagrid_6c_grid_11Environment_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_7__reduce_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19146,14 +19167,14 @@ PyObject *__pyx_args, PyObject *__pyx_kwds if (unlikely(__pyx_nargs > 0)) { __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;} if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL; - __pyx_r = __pyx_pf_9mettagrid_6c_grid_11Environment_6__reduce_cython__(((struct __pyx_obj_9mettagrid_6c_grid_Environment *)__pyx_v_self)); + __pyx_r = __pyx_pf_3env_9mettagrid_6c_grid_11Environment_6__reduce_cython__(((struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self)); /* function exit code */ __Pyx_RefNannyFinishContext(); return __pyx_r; } -static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_6__reduce_cython__(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self) { +static PyObject *__pyx_pf_3env_9mettagrid_6c_grid_11Environment_6__reduce_cython__(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self) { PyObject *__pyx_v_state = 0; PyObject *__pyx_v__dict = 0; int __pyx_v_use_setstate; @@ -19410,7 +19431,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_6__reduce_cython__(st __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("mettagrid.c_grid.Environment.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v_state); @@ -19428,15 +19449,15 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_6__reduce_cython__(st */ /* Python wrapper */ -static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_9__setstate_cython__(PyObject *__pyx_v_self, +static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_9mettagrid_6c_grid_11Environment_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9mettagrid_6c_grid_11Environment_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_9__setstate_cython__(PyObject *__pyx_v_self, +static PyMethodDef __pyx_mdef_3env_9mettagrid_6c_grid_11Environment_9__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3env_9mettagrid_6c_grid_11Environment_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_9__setstate_cython__(PyObject *__pyx_v_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19506,11 +19527,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("mettagrid.c_grid.Environment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_9mettagrid_6c_grid_11Environment_8__setstate_cython__(((struct __pyx_obj_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v___pyx_state); + __pyx_r = __pyx_pf_3env_9mettagrid_6c_grid_11Environment_8__setstate_cython__(((struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v___pyx_state); /* function exit code */ { @@ -19523,7 +19544,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_8__setstate_cython__(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_3env_9mettagrid_6c_grid_11Environment_8__setstate_cython__(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations PyObject *__pyx_t_1 = NULL; @@ -19538,7 +19559,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_8__setstate_cython__( * __pyx_unpickle_Environment__set_state(self, __pyx_state) # <<<<<<<<<<<<<< */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error) - __pyx_t_1 = __pyx_f_9mettagrid_6c_grid___pyx_unpickle_Environment__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3env_9mettagrid_6c_grid___pyx_unpickle_Environment__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19554,7 +19575,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_8__setstate_cython__( goto __pyx_L0; __pyx_L1_error:; __Pyx_XDECREF(__pyx_t_1); - __Pyx_AddTraceback("mettagrid.c_grid.Environment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); @@ -19569,15 +19590,15 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_8__setstate_cython__( */ /* Python wrapper */ -static PyObject *__pyx_pw_9mettagrid_6c_grid_1__pyx_unpickle_Environment(PyObject *__pyx_self, +static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_1__pyx_unpickle_Environment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else PyObject *__pyx_args, PyObject *__pyx_kwds #endif ); /*proto*/ -static PyMethodDef __pyx_mdef_9mettagrid_6c_grid_1__pyx_unpickle_Environment = {"__pyx_unpickle_Environment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9mettagrid_6c_grid_1__pyx_unpickle_Environment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; -static PyObject *__pyx_pw_9mettagrid_6c_grid_1__pyx_unpickle_Environment(PyObject *__pyx_self, +static PyMethodDef __pyx_mdef_3env_9mettagrid_6c_grid_1__pyx_unpickle_Environment = {"__pyx_unpickle_Environment", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3env_9mettagrid_6c_grid_1__pyx_unpickle_Environment, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}; +static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_1__pyx_unpickle_Environment(PyObject *__pyx_self, #if CYTHON_METH_FASTCALL PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds #else @@ -19677,11 +19698,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]); } } - __Pyx_AddTraceback("mettagrid.c_grid.__pyx_unpickle_Environment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.__pyx_unpickle_Environment", __pyx_clineno, __pyx_lineno, __pyx_filename); __Pyx_RefNannyFinishContext(); return NULL; __pyx_L4_argument_unpacking_done:; - __pyx_r = __pyx_pf_9mettagrid_6c_grid___pyx_unpickle_Environment(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); + __pyx_r = __pyx_pf_3env_9mettagrid_6c_grid___pyx_unpickle_Environment(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state); /* function exit code */ { @@ -19694,7 +19715,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds return __pyx_r; } -static PyObject *__pyx_pf_9mettagrid_6c_grid___pyx_unpickle_Environment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_pf_3env_9mettagrid_6c_grid___pyx_unpickle_Environment(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_v___pyx_PickleError = 0; PyObject *__pyx_v___pyx_result = 0; PyObject *__pyx_r = NULL; @@ -19776,7 +19797,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid___pyx_unpickle_Environment(CYTHON_U * if __pyx_state is not None: * __pyx_unpickle_Environment__set_state( __pyx_result, __pyx_state) */ - __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_9mettagrid_6c_grid_Environment), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) + __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_3env_9mettagrid_6c_grid_Environment), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_3); __pyx_t_4 = NULL; __pyx_t_5 = 0; @@ -19821,7 +19842,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid___pyx_unpickle_Environment(CYTHON_U * cdef __pyx_unpickle_Environment__set_state(Environment __pyx_result, tuple __pyx_state): */ if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error) - __pyx_t_1 = __pyx_f_9mettagrid_6c_grid___pyx_unpickle_Environment__set_state(((struct __pyx_obj_9mettagrid_6c_grid_Environment *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) + __pyx_t_1 = __pyx_f_3env_9mettagrid_6c_grid___pyx_unpickle_Environment__set_state(((struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 9, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_1); __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; @@ -19857,7 +19878,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid___pyx_unpickle_Environment(CYTHON_U __Pyx_XDECREF(__pyx_t_1); __Pyx_XDECREF(__pyx_t_3); __Pyx_XDECREF(__pyx_t_4); - __Pyx_AddTraceback("mettagrid.c_grid.__pyx_unpickle_Environment", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.__pyx_unpickle_Environment", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = NULL; __pyx_L0:; __Pyx_XDECREF(__pyx_v___pyx_PickleError); @@ -19875,7 +19896,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid___pyx_unpickle_Environment(CYTHON_U * if len(__pyx_state) > 9 and hasattr(__pyx_result, '__dict__'): */ -static PyObject *__pyx_f_9mettagrid_6c_grid___pyx_unpickle_Environment__set_state(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { +static PyObject *__pyx_f_3env_9mettagrid_6c_grid___pyx_unpickle_Environment__set_state(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) { PyObject *__pyx_r = NULL; __Pyx_RefNannyDeclarations __Pyx_memviewslice __pyx_t_1 = { 0, 0, { 0 }, { 0 }, { 0 } }; @@ -20053,17 +20074,17 @@ static PyObject *__pyx_f_9mettagrid_6c_grid___pyx_unpickle_Environment__set_stat __Pyx_XDECREF(__pyx_t_8); __Pyx_XDECREF(__pyx_t_9); __Pyx_XDECREF(__pyx_t_10); - __Pyx_AddTraceback("mettagrid.c_grid.__pyx_unpickle_Environment__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("env.mettagrid.c_grid.__pyx_unpickle_Environment__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename); __pyx_r = 0; __pyx_L0:; __Pyx_XGIVEREF(__pyx_r); __Pyx_RefNannyFinishContext(); return __pyx_r; } -static struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment __pyx_vtable_9mettagrid_6c_grid_Environment; +static struct __pyx_vtabstruct_3env_9mettagrid_6c_grid_Environment __pyx_vtable_3env_9mettagrid_6c_grid_Environment; -static PyObject *__pyx_tp_new_9mettagrid_6c_grid_Environment(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { - struct __pyx_obj_9mettagrid_6c_grid_Environment *p; +static PyObject *__pyx_tp_new_3env_9mettagrid_6c_grid_Environment(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) { + struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *p; PyObject *o; #if CYTHON_COMPILING_IN_LIMITED_API allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc); @@ -20076,8 +20097,8 @@ static PyObject *__pyx_tp_new_9mettagrid_6c_grid_Environment(PyTypeObject *t, CY } if (unlikely(!o)) return 0; #endif - p = ((struct __pyx_obj_9mettagrid_6c_grid_Environment *)o); - p->__pyx_vtab = __pyx_vtabptr_9mettagrid_6c_grid_Environment; + p = ((struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *)o); + p->__pyx_vtab = __pyx_vtabptr_3env_9mettagrid_6c_grid_Environment; p->grid.data = NULL; p->grid.memview = NULL; p->observations.data = NULL; @@ -20089,11 +20110,11 @@ static PyObject *__pyx_tp_new_9mettagrid_6c_grid_Environment(PyTypeObject *t, CY return o; } -static void __pyx_tp_dealloc_9mettagrid_6c_grid_Environment(PyObject *o) { - struct __pyx_obj_9mettagrid_6c_grid_Environment *p = (struct __pyx_obj_9mettagrid_6c_grid_Environment *)o; +static void __pyx_tp_dealloc_3env_9mettagrid_6c_grid_Environment(PyObject *o) { + struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *p = (struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *)o; #if CYTHON_USE_TP_FINALIZE if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && __Pyx_PyObject_GetSlot(o, tp_finalize, destructor)) && (!PyType_IS_GC(Py_TYPE(o)) || !__Pyx_PyObject_GC_IsFinalized(o))) { - if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_9mettagrid_6c_grid_Environment) { + if (__Pyx_PyObject_GetSlot(o, tp_dealloc, destructor) == __pyx_tp_dealloc_3env_9mettagrid_6c_grid_Environment) { if (PyObject_CallFinalizerFromDealloc(o)) return; } } @@ -20116,36 +20137,36 @@ static void __pyx_tp_dealloc_9mettagrid_6c_grid_Environment(PyObject *o) { #endif } -static PyMethodDef __pyx_methods_9mettagrid_6c_grid_Environment[] = { - {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9mettagrid_6c_grid_11Environment_3reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"step", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9mettagrid_6c_grid_11Environment_5step, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9mettagrid_6c_grid_11Environment_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, - {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9mettagrid_6c_grid_11Environment_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, +static PyMethodDef __pyx_methods_3env_9mettagrid_6c_grid_Environment[] = { + {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3env_9mettagrid_6c_grid_11Environment_3reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"step", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3env_9mettagrid_6c_grid_11Environment_5step, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3env_9mettagrid_6c_grid_11Environment_7__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, + {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3env_9mettagrid_6c_grid_11Environment_9__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0}, {0, 0, 0, 0} }; #if CYTHON_USE_TYPE_SPECS -static PyType_Slot __pyx_type_9mettagrid_6c_grid_Environment_slots[] = { - {Py_tp_dealloc, (void *)__pyx_tp_dealloc_9mettagrid_6c_grid_Environment}, - {Py_tp_methods, (void *)__pyx_methods_9mettagrid_6c_grid_Environment}, - {Py_tp_init, (void *)__pyx_pw_9mettagrid_6c_grid_11Environment_1__init__}, - {Py_tp_new, (void *)__pyx_tp_new_9mettagrid_6c_grid_Environment}, +static PyType_Slot __pyx_type_3env_9mettagrid_6c_grid_Environment_slots[] = { + {Py_tp_dealloc, (void *)__pyx_tp_dealloc_3env_9mettagrid_6c_grid_Environment}, + {Py_tp_methods, (void *)__pyx_methods_3env_9mettagrid_6c_grid_Environment}, + {Py_tp_init, (void *)__pyx_pw_3env_9mettagrid_6c_grid_11Environment_1__init__}, + {Py_tp_new, (void *)__pyx_tp_new_3env_9mettagrid_6c_grid_Environment}, {0, 0}, }; -static PyType_Spec __pyx_type_9mettagrid_6c_grid_Environment_spec = { - "mettagrid.c_grid.Environment", - sizeof(struct __pyx_obj_9mettagrid_6c_grid_Environment), +static PyType_Spec __pyx_type_3env_9mettagrid_6c_grid_Environment_spec = { + "env.mettagrid.c_grid.Environment", + sizeof(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, - __pyx_type_9mettagrid_6c_grid_Environment_slots, + __pyx_type_3env_9mettagrid_6c_grid_Environment_slots, }; #else -static PyTypeObject __pyx_type_9mettagrid_6c_grid_Environment = { +static PyTypeObject __pyx_type_3env_9mettagrid_6c_grid_Environment = { PyVarObject_HEAD_INIT(0, 0) - "mettagrid.c_grid.""Environment", /*tp_name*/ - sizeof(struct __pyx_obj_9mettagrid_6c_grid_Environment), /*tp_basicsize*/ + "env.mettagrid.c_grid.""Environment", /*tp_name*/ + sizeof(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment), /*tp_basicsize*/ 0, /*tp_itemsize*/ - __pyx_tp_dealloc_9mettagrid_6c_grid_Environment, /*tp_dealloc*/ + __pyx_tp_dealloc_3env_9mettagrid_6c_grid_Environment, /*tp_dealloc*/ #if PY_VERSION_HEX < 0x030800b4 0, /*tp_print*/ #endif @@ -20178,7 +20199,7 @@ static PyTypeObject __pyx_type_9mettagrid_6c_grid_Environment = { 0, /*tp_weaklistoffset*/ 0, /*tp_iter*/ 0, /*tp_iternext*/ - __pyx_methods_9mettagrid_6c_grid_Environment, /*tp_methods*/ + __pyx_methods_3env_9mettagrid_6c_grid_Environment, /*tp_methods*/ 0, /*tp_members*/ 0, /*tp_getset*/ 0, /*tp_base*/ @@ -20188,9 +20209,9 @@ static PyTypeObject __pyx_type_9mettagrid_6c_grid_Environment = { #if !CYTHON_USE_TYPE_SPECS 0, /*tp_dictoffset*/ #endif - __pyx_pw_9mettagrid_6c_grid_11Environment_1__init__, /*tp_init*/ + __pyx_pw_3env_9mettagrid_6c_grid_11Environment_1__init__, /*tp_init*/ 0, /*tp_alloc*/ - __pyx_tp_new_9mettagrid_6c_grid_Environment, /*tp_new*/ + __pyx_tp_new_3env_9mettagrid_6c_grid_Environment, /*tp_new*/ 0, /*tp_free*/ 0, /*tp_is_gc*/ 0, /*tp_bases*/ @@ -20359,7 +20380,7 @@ static PyType_Slot __pyx_type___pyx_array_slots[] = { {0, 0}, }; static PyType_Spec __pyx_type___pyx_array_spec = { - "mettagrid.c_grid.array", + "env.mettagrid.c_grid.array", sizeof(struct __pyx_array_obj), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_SEQUENCE, @@ -20405,7 +20426,7 @@ static PyBufferProcs __pyx_tp_as_buffer_array = { static PyTypeObject __pyx_type___pyx_array = { PyVarObject_HEAD_INIT(0, 0) - "mettagrid.c_grid.""array", /*tp_name*/ + "env.mettagrid.c_grid.""array", /*tp_name*/ sizeof(struct __pyx_array_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_array, /*tp_dealloc*/ @@ -20565,7 +20586,7 @@ static PyType_Slot __pyx_type___pyx_MemviewEnum_slots[] = { {0, 0}, }; static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = { - "mettagrid.c_grid.Enum", + "env.mettagrid.c_grid.Enum", sizeof(struct __pyx_MemviewEnum_obj), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, @@ -20575,7 +20596,7 @@ static PyType_Spec __pyx_type___pyx_MemviewEnum_spec = { static PyTypeObject __pyx_type___pyx_MemviewEnum = { PyVarObject_HEAD_INIT(0, 0) - "mettagrid.c_grid.""Enum", /*tp_name*/ + "env.mettagrid.c_grid.""Enum", /*tp_name*/ sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_Enum, /*tp_dealloc*/ @@ -20872,7 +20893,7 @@ static PyType_Slot __pyx_type___pyx_memoryview_slots[] = { {0, 0}, }; static PyType_Spec __pyx_type___pyx_memoryview_spec = { - "mettagrid.c_grid.memoryview", + "env.mettagrid.c_grid.memoryview", sizeof(struct __pyx_memoryview_obj), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, @@ -20918,7 +20939,7 @@ static PyBufferProcs __pyx_tp_as_buffer_memoryview = { static PyTypeObject __pyx_type___pyx_memoryview = { PyVarObject_HEAD_INIT(0, 0) - "mettagrid.c_grid.""memoryview", /*tp_name*/ + "env.mettagrid.c_grid.""memoryview", /*tp_name*/ sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc_memoryview, /*tp_dealloc*/ @@ -21070,7 +21091,7 @@ static PyType_Slot __pyx_type___pyx_memoryviewslice_slots[] = { {0, 0}, }; static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = { - "mettagrid.c_grid._memoryviewslice", + "env.mettagrid.c_grid._memoryviewslice", sizeof(struct __pyx_memoryviewslice_obj), 0, Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_SEQUENCE, @@ -21080,7 +21101,7 @@ static PyType_Spec __pyx_type___pyx_memoryviewslice_spec = { static PyTypeObject __pyx_type___pyx_memoryviewslice = { PyVarObject_HEAD_INIT(0, 0) - "mettagrid.c_grid.""_memoryviewslice", /*tp_name*/ + "env.mettagrid.c_grid.""_memoryviewslice", /*tp_name*/ sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/ 0, /*tp_itemsize*/ __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/ @@ -21257,6 +21278,7 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0}, {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1}, {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1}, + {&__pyx_n_s_env_mettagrid_c_grid, __pyx_k_env_mettagrid_c_grid, sizeof(__pyx_k_env_mettagrid_c_grid), 0, 0, 1, 1}, {&__pyx_kp_s_env_mettagrid_c_grid_pyx, __pyx_k_env_mettagrid_c_grid_pyx, sizeof(__pyx_k_env_mettagrid_c_grid_pyx), 0, 0, 1, 0}, {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1}, {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1}, @@ -21281,7 +21303,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) { {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, {&__pyx_n_s_map_size, __pyx_k_map_size, sizeof(__pyx_k_map_size), 0, 0, 1, 1}, {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1}, - {&__pyx_n_s_mettagrid_c_grid, __pyx_k_mettagrid_c_grid, sizeof(__pyx_k_mettagrid_c_grid), 0, 0, 1, 1}, {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1}, {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1}, {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1}, @@ -21503,7 +21524,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GIVEREF(__pyx_tuple__19); __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__20)) __PYX_ERR(1, 1, __pyx_L1_error) - /* "mettagrid/c_grid.pyx":56 + /* "env/mettagrid/c_grid.pyx":56 * ] * * def reset(self, observations, seed=0): # <<<<<<<<<<<<<< @@ -21518,7 +21539,7 @@ static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) { __Pyx_GOTREF(__pyx_tuple__23); __Pyx_GIVEREF(__pyx_tuple__23); - /* "mettagrid/c_grid.pyx":83 + /* "env/mettagrid/c_grid.pyx":83 * self._compute_observations() * * def step(self, np_actions): # <<<<<<<<<<<<<< @@ -21641,34 +21662,34 @@ static int __Pyx_modinit_type_init_code(void) { int __pyx_clineno = 0; __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0); /*--- Type init code ---*/ - __pyx_vtabptr_9mettagrid_6c_grid_Environment = &__pyx_vtable_9mettagrid_6c_grid_Environment; - __pyx_vtable_9mettagrid_6c_grid_Environment._compute_observations = (void (*)(struct __pyx_obj_9mettagrid_6c_grid_Environment *))__pyx_f_9mettagrid_6c_grid_11Environment__compute_observations; + __pyx_vtabptr_3env_9mettagrid_6c_grid_Environment = &__pyx_vtable_3env_9mettagrid_6c_grid_Environment; + __pyx_vtable_3env_9mettagrid_6c_grid_Environment._compute_observations = (void (*)(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *))__pyx_f_3env_9mettagrid_6c_grid_11Environment__compute_observations; #if CYTHON_USE_TYPE_SPECS - __pyx_ptype_9mettagrid_6c_grid_Environment = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_9mettagrid_6c_grid_Environment_spec, NULL); if (unlikely(!__pyx_ptype_9mettagrid_6c_grid_Environment)) __PYX_ERR(0, 20, __pyx_L1_error) - if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_9mettagrid_6c_grid_Environment_spec, __pyx_ptype_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + __pyx_ptype_3env_9mettagrid_6c_grid_Environment = (PyTypeObject *) __Pyx_PyType_FromModuleAndSpec(__pyx_m, &__pyx_type_3env_9mettagrid_6c_grid_Environment_spec, NULL); if (unlikely(!__pyx_ptype_3env_9mettagrid_6c_grid_Environment)) __PYX_ERR(0, 20, __pyx_L1_error) + if (__Pyx_fix_up_extension_type_from_spec(&__pyx_type_3env_9mettagrid_6c_grid_Environment_spec, __pyx_ptype_3env_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) #else - __pyx_ptype_9mettagrid_6c_grid_Environment = &__pyx_type_9mettagrid_6c_grid_Environment; + __pyx_ptype_3env_9mettagrid_6c_grid_Environment = &__pyx_type_3env_9mettagrid_6c_grid_Environment; #endif #if !CYTHON_COMPILING_IN_LIMITED_API #endif #if !CYTHON_USE_TYPE_SPECS - if (__Pyx_PyType_Ready(__pyx_ptype_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (__Pyx_PyType_Ready(__pyx_ptype_3env_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) #endif #if PY_MAJOR_VERSION < 3 - __pyx_ptype_9mettagrid_6c_grid_Environment->tp_print = 0; + __pyx_ptype_3env_9mettagrid_6c_grid_Environment->tp_print = 0; #endif #if !CYTHON_COMPILING_IN_LIMITED_API - if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_9mettagrid_6c_grid_Environment->tp_dictoffset && __pyx_ptype_9mettagrid_6c_grid_Environment->tp_getattro == PyObject_GenericGetAttr)) { - __pyx_ptype_9mettagrid_6c_grid_Environment->tp_getattro = __Pyx_PyObject_GenericGetAttr; + if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_ptype_3env_9mettagrid_6c_grid_Environment->tp_dictoffset && __pyx_ptype_3env_9mettagrid_6c_grid_Environment->tp_getattro == PyObject_GenericGetAttr)) { + __pyx_ptype_3env_9mettagrid_6c_grid_Environment->tp_getattro = __Pyx_PyObject_GenericGetAttr; } #endif - if (__Pyx_SetVtable(__pyx_ptype_9mettagrid_6c_grid_Environment, __pyx_vtabptr_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (__Pyx_SetVtable(__pyx_ptype_3env_9mettagrid_6c_grid_Environment, __pyx_vtabptr_3env_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_MergeVtables(__pyx_ptype_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (__Pyx_MergeVtables(__pyx_ptype_3env_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) #endif - if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Environment, (PyObject *) __pyx_ptype_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Environment, (PyObject *) __pyx_ptype_3env_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) #if !CYTHON_COMPILING_IN_LIMITED_API - if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) + if (__Pyx_setup_reduce((PyObject *) __pyx_ptype_3env_9mettagrid_6c_grid_Environment) < 0) __PYX_ERR(0, 20, __pyx_L1_error) #endif __pyx_vtabptr_array = &__pyx_vtable_array; __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview; @@ -22098,14 +22119,14 @@ if (!__Pyx_RefNanny) { #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error) #endif - if (__pyx_module_is_main_mettagrid__c_grid) { + if (__pyx_module_is_main_env__mettagrid__c_grid) { if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error) } #if PY_MAJOR_VERSION >= 3 { PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error) - if (!PyDict_GetItemString(modules, "mettagrid.c_grid")) { - if (unlikely((PyDict_SetItemString(modules, "mettagrid.c_grid", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) + if (!PyDict_GetItemString(modules, "env.mettagrid.c_grid")) { + if (unlikely((PyDict_SetItemString(modules, "env.mettagrid.c_grid", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error) } } #endif @@ -22639,115 +22660,115 @@ if (!__Pyx_RefNanny) { if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "mettagrid/c_grid.pyx":10 + /* "env/mettagrid/c_grid.pyx":10 * * cdef: * int EMPTY = 0 # <<<<<<<<<<<<<< * int AGENT = 1 * int WALL = 2 */ - __pyx_v_9mettagrid_6c_grid_EMPTY = 0; + __pyx_v_3env_9mettagrid_6c_grid_EMPTY = 0; - /* "mettagrid/c_grid.pyx":11 + /* "env/mettagrid/c_grid.pyx":11 * cdef: * int EMPTY = 0 * int AGENT = 1 # <<<<<<<<<<<<<< * int WALL = 2 * */ - __pyx_v_9mettagrid_6c_grid_AGENT = 1; + __pyx_v_3env_9mettagrid_6c_grid_AGENT = 1; - /* "mettagrid/c_grid.pyx":12 + /* "env/mettagrid/c_grid.pyx":12 * int EMPTY = 0 * int AGENT = 1 * int WALL = 2 # <<<<<<<<<<<<<< * * int PASS = 0 */ - __pyx_v_9mettagrid_6c_grid_WALL = 2; + __pyx_v_3env_9mettagrid_6c_grid_WALL = 2; - /* "mettagrid/c_grid.pyx":14 + /* "env/mettagrid/c_grid.pyx":14 * int WALL = 2 * * int PASS = 0 # <<<<<<<<<<<<<< * int NORTH = 1 * int SOUTH = 2 */ - __pyx_v_9mettagrid_6c_grid_PASS = 0; + __pyx_v_3env_9mettagrid_6c_grid_PASS = 0; - /* "mettagrid/c_grid.pyx":15 + /* "env/mettagrid/c_grid.pyx":15 * * int PASS = 0 * int NORTH = 1 # <<<<<<<<<<<<<< * int SOUTH = 2 * int EAST = 3 */ - __pyx_v_9mettagrid_6c_grid_NORTH = 1; + __pyx_v_3env_9mettagrid_6c_grid_NORTH = 1; - /* "mettagrid/c_grid.pyx":16 + /* "env/mettagrid/c_grid.pyx":16 * int PASS = 0 * int NORTH = 1 * int SOUTH = 2 # <<<<<<<<<<<<<< * int EAST = 3 * int WEST = 4 */ - __pyx_v_9mettagrid_6c_grid_SOUTH = 2; + __pyx_v_3env_9mettagrid_6c_grid_SOUTH = 2; - /* "mettagrid/c_grid.pyx":17 + /* "env/mettagrid/c_grid.pyx":17 * int NORTH = 1 * int SOUTH = 2 * int EAST = 3 # <<<<<<<<<<<<<< * int WEST = 4 * */ - __pyx_v_9mettagrid_6c_grid_EAST = 3; + __pyx_v_3env_9mettagrid_6c_grid_EAST = 3; - /* "mettagrid/c_grid.pyx":18 + /* "env/mettagrid/c_grid.pyx":18 * int SOUTH = 2 * int EAST = 3 * int WEST = 4 # <<<<<<<<<<<<<< * * cdef class Environment: */ - __pyx_v_9mettagrid_6c_grid_WEST = 4; + __pyx_v_3env_9mettagrid_6c_grid_WEST = 4; - /* "mettagrid/c_grid.pyx":56 + /* "env/mettagrid/c_grid.pyx":56 * ] * * def reset(self, observations, seed=0): # <<<<<<<<<<<<<< * self.observations = observations * */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9mettagrid_6c_grid_11Environment_3reset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_reset, NULL, __pyx_n_s_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_3env_9mettagrid_6c_grid_11Environment_3reset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_reset, NULL, __pyx_n_s_env_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__23); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9mettagrid_6c_grid_Environment, __pyx_n_s_reset, __pyx_t_7) < 0) __PYX_ERR(0, 56, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3env_9mettagrid_6c_grid_Environment, __pyx_n_s_reset, __pyx_t_7) < 0) __PYX_ERR(0, 56, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_9mettagrid_6c_grid_Environment); + PyType_Modified(__pyx_ptype_3env_9mettagrid_6c_grid_Environment); - /* "mettagrid/c_grid.pyx":83 + /* "env/mettagrid/c_grid.pyx":83 * self._compute_observations() * * def step(self, np_actions): # <<<<<<<<<<<<<< * cdef unsigned int[:] actions = np_actions * cdef int agent_idx, atn, r, c, dr, dc, dest_r, dest_c */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9mettagrid_6c_grid_11Environment_5step, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_step, NULL, __pyx_n_s_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_3env_9mettagrid_6c_grid_11Environment_5step, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_step, NULL, __pyx_n_s_env_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9mettagrid_6c_grid_Environment, __pyx_n_s_step, __pyx_t_7) < 0) __PYX_ERR(0, 83, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3env_9mettagrid_6c_grid_Environment, __pyx_n_s_step, __pyx_t_7) < 0) __PYX_ERR(0, 83, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_9mettagrid_6c_grid_Environment); + PyType_Modified(__pyx_ptype_3env_9mettagrid_6c_grid_Environment); /* "(tree fragment)":1 * def __reduce_cython__(self): # <<<<<<<<<<<<<< * cdef tuple state * cdef object _dict */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9mettagrid_6c_grid_11Environment_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment___reduce_cython, NULL, __pyx_n_s_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_3env_9mettagrid_6c_grid_11Environment_7__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment___reduce_cython, NULL, __pyx_n_s_env_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__27)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9mettagrid_6c_grid_Environment, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3env_9mettagrid_6c_grid_Environment, __pyx_n_s_reduce_cython, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_9mettagrid_6c_grid_Environment); + PyType_Modified(__pyx_ptype_3env_9mettagrid_6c_grid_Environment); /* "(tree fragment)":16 * else: @@ -22755,23 +22776,23 @@ if (!__Pyx_RefNanny) { * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<< * __pyx_unpickle_Environment__set_state(self, __pyx_state) */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9mettagrid_6c_grid_11Environment_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment___setstate_cython, NULL, __pyx_n_s_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 16, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_3env_9mettagrid_6c_grid_11Environment_9__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment___setstate_cython, NULL, __pyx_n_s_env_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__29)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); - if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9mettagrid_6c_grid_Environment, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(1, 16, __pyx_L1_error) + if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3env_9mettagrid_6c_grid_Environment, __pyx_n_s_setstate_cython, __pyx_t_7) < 0) __PYX_ERR(1, 16, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - PyType_Modified(__pyx_ptype_9mettagrid_6c_grid_Environment); + PyType_Modified(__pyx_ptype_3env_9mettagrid_6c_grid_Environment); /* "(tree fragment)":1 * def __pyx_unpickle_Environment(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<< * cdef object __pyx_PickleError * cdef object __pyx_result */ - __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9mettagrid_6c_grid_1__pyx_unpickle_Environment, 0, __pyx_n_s_pyx_unpickle_Environment, NULL, __pyx_n_s_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) + __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_3env_9mettagrid_6c_grid_1__pyx_unpickle_Environment, 0, __pyx_n_s_pyx_unpickle_Environment, NULL, __pyx_n_s_env_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__30)); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_GOTREF(__pyx_t_7); if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Environment, __pyx_t_7) < 0) __PYX_ERR(1, 1, __pyx_L1_error) __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0; - /* "mettagrid/c_grid.pyx":1 + /* "env/mettagrid/c_grid.pyx":1 * # distutils: define_macros=NPY_NO_DEPRECATED_API=NPY_1_7_API_VERSION # <<<<<<<<<<<<<< * # cython: language_level=3 * # cython: boundscheck=False @@ -22790,7 +22811,7 @@ if (!__Pyx_RefNanny) { __Pyx_XDECREF(__pyx_t_7); if (__pyx_m) { if (__pyx_d && stringtab_initialized) { - __Pyx_AddTraceback("init mettagrid.c_grid", __pyx_clineno, __pyx_lineno, __pyx_filename); + __Pyx_AddTraceback("init env.mettagrid.c_grid", __pyx_clineno, __pyx_lineno, __pyx_filename); } #if !CYTHON_USE_MODULE_STATE Py_CLEAR(__pyx_m); @@ -22804,7 +22825,7 @@ if (!__Pyx_RefNanny) { } #endif } else if (!PyErr_Occurred()) { - PyErr_SetString(PyExc_ImportError, "init mettagrid.c_grid"); + PyErr_SetString(PyExc_ImportError, "init env.mettagrid.c_grid"); } __pyx_L0:; __Pyx_RefNannyFinishContext(); @@ -26870,7 +26891,7 @@ static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, default: return NULL; } - return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); + return ((__Pyx_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames); } static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS_METHOD(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames) { diff --git a/env/mettagrid/c_grid.html b/env/mettagrid/c_grid.html index 3109ca6..61c19ce 100644 --- a/env/mettagrid/c_grid.html +++ b/env/mettagrid/c_grid.html @@ -1,5 +1,5 @@ - + @@ -305,7 +305,6 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: .cython .cs { color: #3D7B7B; font-style: italic } /* Comment.Special */ .cython .gd { color: #A00000 } /* Generic.Deleted */ .cython .ge { font-style: italic } /* Generic.Emph */ -.cython .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .cython .gr { color: #E40000 } /* Generic.Error */ .cython .gh { color: #000080; font-weight: bold } /* Generic.Heading */ .cython .gi { color: #008400 } /* Generic.Inserted */ @@ -364,7 +363,7 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: -

Generated by Cython 3.0.8

+

Generated by Cython 3.0.10

Yellow lines hint at Python interaction.
Click on a line that starts with a "+" to see the C code that Cython generated for it. @@ -384,27 +383,27 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:

 008: 
 009: cdef:
+010:     int EMPTY = 0
-
  __pyx_v_9mettagrid_6c_grid_EMPTY = 0;
+
  __pyx_v_3env_9mettagrid_6c_grid_EMPTY = 0;
 
+011:     int AGENT = 1
-
  __pyx_v_9mettagrid_6c_grid_AGENT = 1;
+
  __pyx_v_3env_9mettagrid_6c_grid_AGENT = 1;
 
+012:     int WALL = 2
-
  __pyx_v_9mettagrid_6c_grid_WALL = 2;
+
  __pyx_v_3env_9mettagrid_6c_grid_WALL = 2;
 
 013: 
+014:     int PASS = 0
-
  __pyx_v_9mettagrid_6c_grid_PASS = 0;
+
  __pyx_v_3env_9mettagrid_6c_grid_PASS = 0;
 
+015:     int NORTH = 1
-
  __pyx_v_9mettagrid_6c_grid_NORTH = 1;
+
  __pyx_v_3env_9mettagrid_6c_grid_NORTH = 1;
 
+016:     int SOUTH = 2
-
  __pyx_v_9mettagrid_6c_grid_SOUTH = 2;
+
  __pyx_v_3env_9mettagrid_6c_grid_SOUTH = 2;
 
+017:     int EAST = 3
-
  __pyx_v_9mettagrid_6c_grid_EAST = 3;
+
  __pyx_v_3env_9mettagrid_6c_grid_EAST = 3;
 
+018:     int WEST = 4
-
  __pyx_v_9mettagrid_6c_grid_WEST = 4;
+
  __pyx_v_3env_9mettagrid_6c_grid_WEST = 4;
 
 019: 
+020: cdef class Environment:
-
struct __pyx_obj_9mettagrid_6c_grid_Environment {
+
struct __pyx_obj_3env_9mettagrid_6c_grid_Environment {
   PyObject_HEAD
-  struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment *__pyx_vtab;
+  struct __pyx_vtabstruct_3env_9mettagrid_6c_grid_Environment *__pyx_vtab;
   int map_size;
   int num_agents;
   int horizon;
@@ -416,10 +415,10 @@ span.linenos.special { color: #000000; background-color: #ffffc0; padding-left:
   __Pyx_memviewslice spawn_position_cands;
 };
 /* … */
-struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment {
-  void (*_compute_observations)(struct __pyx_obj_9mettagrid_6c_grid_Environment *);
+struct __pyx_vtabstruct_3env_9mettagrid_6c_grid_Environment {
+  void (*_compute_observations)(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *);
 };
-static struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment *__pyx_vtabptr_9mettagrid_6c_grid_Environment;
+static struct __pyx_vtabstruct_3env_9mettagrid_6c_grid_Environment *__pyx_vtabptr_3env_9mettagrid_6c_grid_Environment;
 
 
 021:     cdef:
 022:         int map_size
@@ -435,8 +434,8 @@ static struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment *__pyx_vtabptr_9me
 032: 
+033:     def __init__(self, grid, agent_positions, spawn_position_cands, observations,
/* Python wrapper */
-static int __pyx_pw_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_pw_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+static int __pyx_pw_3env_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_pw_3env_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
   PyObject *__pyx_v_grid = 0;
   PyObject *__pyx_v_agent_positions = 0;
   PyObject *__pyx_v_spawn_position_cands = 0;
@@ -598,11 +597,11 @@ static int __pyx_pw_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v
       __Pyx_Arg_XDECREF_VARARGS(values[__pyx_temp]);
     }
   }
-  __Pyx_AddTraceback("mettagrid.c_grid.Environment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return -1;
   __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_9mettagrid_6c_grid_11Environment___init__(((struct __pyx_obj_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_grid, __pyx_v_agent_positions, __pyx_v_spawn_position_cands, __pyx_v_observations, __pyx_v_map_size, __pyx_v_num_agents, __pyx_v_horizon, __pyx_v_vision_range);
+  __pyx_r = __pyx_pf_3env_9mettagrid_6c_grid_11Environment___init__(((struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_grid, __pyx_v_agent_positions, __pyx_v_spawn_position_cands, __pyx_v_observations, __pyx_v_map_size, __pyx_v_num_agents, __pyx_v_horizon, __pyx_v_vision_range);
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -618,7 +617,7 @@ static int __pyx_pw_9mettagrid_6c_grid_11Environment_1__init__(PyObject *__pyx_v
   return __pyx_r;
 }
 
-static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_grid, PyObject *__pyx_v_agent_positions, PyObject *__pyx_v_spawn_position_cands, PyObject *__pyx_v_observations, int __pyx_v_map_size, int __pyx_v_num_agents, int __pyx_v_horizon, int __pyx_v_vision_range) {
+static int __pyx_pf_3env_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_grid, PyObject *__pyx_v_agent_positions, PyObject *__pyx_v_spawn_position_cands, PyObject *__pyx_v_observations, int __pyx_v_map_size, int __pyx_v_num_agents, int __pyx_v_horizon, int __pyx_v_vision_range) {
   int __pyx_r;
 /* … */
   /* function exit code */
@@ -628,7 +627,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9
   __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
   __PYX_XCLEAR_MEMVIEW(&__pyx_t_2, 1);
   __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
-  __Pyx_AddTraceback("mettagrid.c_grid.Environment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = -1;
   __pyx_L0:;
   return __pyx_r;
@@ -671,7 +670,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9
   __pyx_t_3.data = NULL;
 
 045: 
+046:     cdef void _compute_observations(self):
-
static void __pyx_f_9mettagrid_6c_grid_11Environment__compute_observations(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self) {
+
static void __pyx_f_3env_9mettagrid_6c_grid_11Environment__compute_observations(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self) {
   int __pyx_v_r;
   int __pyx_v_c;
   int __pyx_v_agent_idx;
@@ -681,7 +680,7 @@ static int __pyx_pf_9mettagrid_6c_grid_11Environment___init__(struct __pyx_obj_9
   __pyx_L1_error:;
   __PYX_XCLEAR_MEMVIEW(&__pyx_t_6, 1);
   __PYX_XCLEAR_MEMVIEW(&__pyx_t_8, 1);
-  __Pyx_AddTraceback("mettagrid.c_grid.Environment._compute_observations", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_AddTraceback("env.mettagrid.c_grid.Environment._compute_observations", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_L0:;
 }
 
 047:         cdef int r, c, agent_idx
@@ -766,15 +765,15 @@ if (unlikely((__pyx_memoryview_copy_contents(__pyx_t_6, __pyx_t_8, 2, 2, 0) <
 055: 
+056:     def reset(self, observations, seed=0):
/* Python wrapper */
-static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_3reset(PyObject *__pyx_v_self, 
+static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_3reset(PyObject *__pyx_v_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
 PyObject *__pyx_args, PyObject *__pyx_kwds
 #endif
 ); /*proto*/
-static PyMethodDef __pyx_mdef_9mettagrid_6c_grid_11Environment_3reset = {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9mettagrid_6c_grid_11Environment_3reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_3reset(PyObject *__pyx_v_self, 
+static PyMethodDef __pyx_mdef_3env_9mettagrid_6c_grid_11Environment_3reset = {"reset", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3env_9mettagrid_6c_grid_11Environment_3reset, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_3reset(PyObject *__pyx_v_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
@@ -857,11 +856,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
       __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
     }
   }
-  __Pyx_AddTraceback("mettagrid.c_grid.Environment.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_9mettagrid_6c_grid_11Environment_2reset(((struct __pyx_obj_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_observations, __pyx_v_seed);
+  __pyx_r = __pyx_pf_3env_9mettagrid_6c_grid_11Environment_2reset(((struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_observations, __pyx_v_seed);
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -877,7 +876,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
   return __pyx_r;
 }
 
-static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_observations, CYTHON_UNUSED PyObject *__pyx_v_seed) {
+static PyObject *__pyx_pf_3env_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_observations, CYTHON_UNUSED PyObject *__pyx_v_seed) {
   int __pyx_v_left;
   int __pyx_v_right;
   int __pyx_v_spawn_idx;
@@ -892,7 +891,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_o
   __pyx_L1_error:;
   __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
   __PYX_XCLEAR_MEMVIEW(&__pyx_t_3, 1);
-  __Pyx_AddTraceback("mettagrid.c_grid.Environment.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.reset", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
   __Pyx_XGIVEREF(__pyx_r);
@@ -905,12 +904,12 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_2reset(struct __pyx_o
   __Pyx_GIVEREF(__pyx_tuple__21);
   __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_env_mettagrid_c_grid_pyx, __pyx_n_s_reset, 56, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__22)) __PYX_ERR(0, 56, __pyx_L1_error)
 /* … */
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9mettagrid_6c_grid_11Environment_3reset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_reset, NULL, __pyx_n_s_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_3env_9mettagrid_6c_grid_11Environment_3reset, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_reset, NULL, __pyx_n_s_env_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__22)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 56, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
   __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_7, __pyx_tuple__23);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9mettagrid_6c_grid_Environment, __pyx_n_s_reset, __pyx_t_7) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
+  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3env_9mettagrid_6c_grid_Environment, __pyx_n_s_reset, __pyx_t_7) < 0) __PYX_ERR(0, 56, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_9mettagrid_6c_grid_Environment);
+  PyType_Modified(__pyx_ptype_3env_9mettagrid_6c_grid_Environment);
   __pyx_tuple__23 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 56, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_tuple__23);
   __Pyx_GIVEREF(__pyx_tuple__23);
@@ -954,7 +953,7 @@ __pyx_t_3.strides[1] = __pyx_v_self->grid.strides[1];
     __pyx_t_3.suboffsets[1] = -1;
 
 {
-      unsigned char __pyx_temp_scalar = __pyx_v_9mettagrid_6c_grid_WALL;
+      unsigned char __pyx_temp_scalar = __pyx_v_3env_9mettagrid_6c_grid_WALL;
       {
           Py_ssize_t __pyx_temp_extent_0 = __pyx_t_3.shape[0];
           Py_ssize_t __pyx_temp_stride_0 = __pyx_t_3.strides[0];
@@ -1004,7 +1003,7 @@ __pyx_t_3.strides[1] = __pyx_v_self->grid.strides[1];
     __pyx_t_3.suboffsets[1] = -1;
 
 {
-      unsigned char __pyx_temp_scalar = __pyx_v_9mettagrid_6c_grid_WALL;
+      unsigned char __pyx_temp_scalar = __pyx_v_3env_9mettagrid_6c_grid_WALL;
       {
           Py_ssize_t __pyx_temp_extent_0 = __pyx_t_3.shape[0];
           Py_ssize_t __pyx_temp_stride_0 = __pyx_t_3.strides[0];
@@ -1054,7 +1053,7 @@ __pyx_t_2 = -1;
 }
 
 {
-      unsigned char __pyx_temp_scalar = __pyx_v_9mettagrid_6c_grid_WALL;
+      unsigned char __pyx_temp_scalar = __pyx_v_3env_9mettagrid_6c_grid_WALL;
       {
           Py_ssize_t __pyx_temp_extent_0 = __pyx_t_3.shape[0];
           Py_ssize_t __pyx_temp_stride_0 = __pyx_t_3.strides[0];
@@ -1104,7 +1103,7 @@ __pyx_t_2 = -1;
 }
 
 {
-      unsigned char __pyx_temp_scalar = __pyx_v_9mettagrid_6c_grid_WALL;
+      unsigned char __pyx_temp_scalar = __pyx_v_3env_9mettagrid_6c_grid_WALL;
       {
           Py_ssize_t __pyx_temp_extent_0 = __pyx_t_3.shape[0];
           Py_ssize_t __pyx_temp_stride_0 = __pyx_t_3.strides[0];
@@ -1157,7 +1156,7 @@ __pyx_t_2 = -1;
 
+074:                 self.grid[r, c] = AGENT
      __pyx_t_7 = __pyx_v_r;
       __pyx_t_6 = __pyx_v_c;
-      *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_7 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_6 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_9mettagrid_6c_grid_AGENT;
+      *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_7 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_6 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_3env_9mettagrid_6c_grid_AGENT;
 
+075:                 self.agent_positions[agent_idx, 0] = r
      __pyx_t_6 = __pyx_v_agent_idx;
       __pyx_t_7 = 0;
@@ -1177,19 +1176,19 @@ __pyx_t_2 = -1;
 
        goto __pyx_L4_break;
 
 080: 
+081:         self._compute_observations()
-
  ((struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment *)__pyx_v_self->__pyx_vtab)->_compute_observations(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error)
+
  ((struct __pyx_vtabstruct_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self->__pyx_vtab)->_compute_observations(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 81, __pyx_L1_error)
 
 082: 
+083:     def step(self, np_actions):
/* Python wrapper */
-static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_5step(PyObject *__pyx_v_self, 
+static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_5step(PyObject *__pyx_v_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
 PyObject *__pyx_args, PyObject *__pyx_kwds
 #endif
 ); /*proto*/
-static PyMethodDef __pyx_mdef_9mettagrid_6c_grid_11Environment_5step = {"step", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9mettagrid_6c_grid_11Environment_5step, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
-static PyObject *__pyx_pw_9mettagrid_6c_grid_11Environment_5step(PyObject *__pyx_v_self, 
+static PyMethodDef __pyx_mdef_3env_9mettagrid_6c_grid_11Environment_5step = {"step", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_3env_9mettagrid_6c_grid_11Environment_5step, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_3env_9mettagrid_6c_grid_11Environment_5step(PyObject *__pyx_v_self, 
 #if CYTHON_METH_FASTCALL
 PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
 #else
@@ -1256,11 +1255,11 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
       __Pyx_Arg_XDECREF_FASTCALL(values[__pyx_temp]);
     }
   }
-  __Pyx_AddTraceback("mettagrid.c_grid.Environment.step", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.step", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __Pyx_RefNannyFinishContext();
   return NULL;
   __pyx_L4_argument_unpacking_done:;
-  __pyx_r = __pyx_pf_9mettagrid_6c_grid_11Environment_4step(((struct __pyx_obj_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_np_actions);
+  __pyx_r = __pyx_pf_3env_9mettagrid_6c_grid_11Environment_4step(((struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self), __pyx_v_np_actions);
   int __pyx_lineno = 0;
   const char *__pyx_filename = NULL;
   int __pyx_clineno = 0;
@@ -1276,7 +1275,7 @@ PyObject *__pyx_args, PyObject *__pyx_kwds
   return __pyx_r;
 }
 
-static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_obj_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_np_actions) {
+static PyObject *__pyx_pf_3env_9mettagrid_6c_grid_11Environment_4step(struct __pyx_obj_3env_9mettagrid_6c_grid_Environment *__pyx_v_self, PyObject *__pyx_v_np_actions) {
   __Pyx_memviewslice __pyx_v_actions = { 0, 0, { 0 }, { 0 }, { 0 } };
   int __pyx_v_agent_idx;
   int __pyx_v_atn;
@@ -1295,7 +1294,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob
   __PYX_XCLEAR_MEMVIEW(&__pyx_t_1, 1);
   __Pyx_XDECREF(__pyx_t_8);
   __Pyx_XDECREF(__pyx_t_9);
-  __Pyx_AddTraceback("mettagrid.c_grid.Environment.step", __pyx_clineno, __pyx_lineno, __pyx_filename);
+  __Pyx_AddTraceback("env.mettagrid.c_grid.Environment.step", __pyx_clineno, __pyx_lineno, __pyx_filename);
   __pyx_r = NULL;
   __pyx_L0:;
   __PYX_XCLEAR_MEMVIEW(&__pyx_v_actions, 1);
@@ -1308,11 +1307,11 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob
   __Pyx_GOTREF(__pyx_tuple__24);
   __Pyx_GIVEREF(__pyx_tuple__24);
 /* … */
-  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_9mettagrid_6c_grid_11Environment_5step, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_step, NULL, __pyx_n_s_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error)
+  __pyx_t_7 = __Pyx_CyFunction_New(&__pyx_mdef_3env_9mettagrid_6c_grid_11Environment_5step, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Environment_step, NULL, __pyx_n_s_env_mettagrid_c_grid, __pyx_d, ((PyObject *)__pyx_codeobj__25)); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 83, __pyx_L1_error)
   __Pyx_GOTREF(__pyx_t_7);
-  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_9mettagrid_6c_grid_Environment, __pyx_n_s_step, __pyx_t_7) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
+  if (__Pyx_SetItemOnTypeDict((PyObject *)__pyx_ptype_3env_9mettagrid_6c_grid_Environment, __pyx_n_s_step, __pyx_t_7) < 0) __PYX_ERR(0, 83, __pyx_L1_error)
   __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
-  PyType_Modified(__pyx_ptype_9mettagrid_6c_grid_Environment);
+  PyType_Modified(__pyx_ptype_3env_9mettagrid_6c_grid_Environment);
   __pyx_codeobj__25 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__24, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_env_mettagrid_c_grid_pyx, __pyx_n_s_step, 83, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__25)) __PYX_ERR(0, 83, __pyx_L1_error)
 
+084:         cdef unsigned int[:] actions = np_actions
  __pyx_t_1 = __Pyx_PyObject_to_MemoryviewSlice_ds_unsigned_int(__pyx_v_np_actions, PyBUF_WRITABLE); if (unlikely(!__pyx_t_1.memview)) __PYX_ERR(0, 84, __pyx_L1_error)
@@ -1341,14 +1340,14 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob
 
+091:             dc = 0
    __pyx_v_dc = 0;
 
+092:             if atn == PASS:
-
    __pyx_t_7 = (__pyx_v_atn == __pyx_v_9mettagrid_6c_grid_PASS);
+
    __pyx_t_7 = (__pyx_v_atn == __pyx_v_3env_9mettagrid_6c_grid_PASS);
     if (__pyx_t_7) {
 /* … */
     }
 
+093:                 continue
      goto __pyx_L3_continue;
 
+094:             elif atn == NORTH:
-
    __pyx_t_7 = (__pyx_v_atn == __pyx_v_9mettagrid_6c_grid_NORTH);
+
    __pyx_t_7 = (__pyx_v_atn == __pyx_v_3env_9mettagrid_6c_grid_NORTH);
     if (__pyx_t_7) {
 /* … */
       goto __pyx_L5;
@@ -1356,7 +1355,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob
 
+095:                 dr = -1
      __pyx_v_dr = -1;
 
+096:             elif atn == SOUTH:
-
    __pyx_t_7 = (__pyx_v_atn == __pyx_v_9mettagrid_6c_grid_SOUTH);
+
    __pyx_t_7 = (__pyx_v_atn == __pyx_v_3env_9mettagrid_6c_grid_SOUTH);
     if (__pyx_t_7) {
 /* … */
       goto __pyx_L5;
@@ -1364,7 +1363,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob
 
+097:                 dr = 1
      __pyx_v_dr = 1;
 
+098:             elif atn == EAST:
-
    __pyx_t_7 = (__pyx_v_atn == __pyx_v_9mettagrid_6c_grid_EAST);
+
    __pyx_t_7 = (__pyx_v_atn == __pyx_v_3env_9mettagrid_6c_grid_EAST);
     if (__pyx_t_7) {
 /* … */
       goto __pyx_L5;
@@ -1372,7 +1371,7 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob
 
+099:                 dc = 1
      __pyx_v_dc = 1;
 
+100:             elif atn == WEST:
-
    __pyx_t_7 = (__pyx_v_atn == __pyx_v_9mettagrid_6c_grid_WEST);
+
    __pyx_t_7 = (__pyx_v_atn == __pyx_v_3env_9mettagrid_6c_grid_WEST);
     if (likely(__pyx_t_7)) {
 /* … */
       goto __pyx_L5;
@@ -1413,11 +1412,11 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob
 
+109:                 self.grid[r, c] = EMPTY
      __pyx_t_6 = __pyx_v_r;
       __pyx_t_5 = __pyx_v_c;
-      *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_6 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_5 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_9mettagrid_6c_grid_EMPTY;
+      *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_6 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_5 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_3env_9mettagrid_6c_grid_EMPTY;
 
+110:                 self.grid[dest_r, dest_c] = AGENT
      __pyx_t_5 = __pyx_v_dest_r;
       __pyx_t_6 = __pyx_v_dest_c;
-      *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_5 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_6 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_9mettagrid_6c_grid_AGENT;
+      *((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->grid.data + __pyx_t_5 * __pyx_v_self->grid.strides[0]) ) + __pyx_t_6 * __pyx_v_self->grid.strides[1]) )) = __pyx_v_3env_9mettagrid_6c_grid_AGENT;
 
+111:                 self.agent_positions[agent_idx, 0] = dest_r
      __pyx_t_6 = __pyx_v_agent_idx;
       __pyx_t_5 = 0;
@@ -1428,5 +1427,5 @@ static PyObject *__pyx_pf_9mettagrid_6c_grid_11Environment_4step(struct __pyx_ob
       *((unsigned int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_self->agent_positions.data + __pyx_t_5 * __pyx_v_self->agent_positions.strides[0]) ) + __pyx_t_6 * __pyx_v_self->agent_positions.strides[1]) )) = __pyx_v_dest_c;
 
 113: 
+114:         self._compute_observations()
-
  ((struct __pyx_vtabstruct_9mettagrid_6c_grid_Environment *)__pyx_v_self->__pyx_vtab)->_compute_observations(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
+
  ((struct __pyx_vtabstruct_3env_9mettagrid_6c_grid_Environment *)__pyx_v_self->__pyx_vtab)->_compute_observations(__pyx_v_self); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
 
diff --git a/third_party/pufferlib b/third_party/pufferlib --- a/third_party/pufferlib +++ b/third_party/pufferlib @@ -1 +1 @@ -Subproject commit 1460b4d5b58a17b6d494bf8cfae631690bf023a4 +Subproject commit 1460b4d5b58a17b6d494bf8cfae631690bf023a4-dirty diff --git a/third_party/sample_factory b/third_party/sample_factory index 5ffcbcc..9d990ea 160000 --- a/third_party/sample_factory +++ b/third_party/sample_factory @@ -1 +1 @@ -Subproject commit 5ffcbcc19482a8c5e63570591b45da62822ee87b +Subproject commit 9d990eaf3fd40c635febe5b3e67d5c7d3bb7a9cb