o
    ci                     @   sJ   d dl Zd dlmZmZmZ d dlmZ dZdZ	dZ
G dd dejZdS )	    N)DiscreteBoxDict)Repeated         c                   @   s0   e Zd ZdZdd ZdddddZdd	 ZdS )
	SimpleRPGai  Example of a custom env with a complex, structured observation.

    The observation is a list of players, each of which is a Dict of
    attributes, and may further hold a list of items (categorical space).

    Note that the env doesn't train, it's just a dummy example to show how to
    use spaces.Repeated in a custom model (see CustomRPGModel below).
    c                 C   sz   d| _ td| _td| _tdddd| _ttdd	d
dtddddt| jtdt| jt	dd| _
t| j
td| _d S )Nr   r      i(#  i'  )r   )shapeid   )r      )
   )max_len)locationstatusitemseffects)cur_posr   action_space
item_spacer   effect_spacer   r   	MAX_ITEMSMAX_EFFECTSplayer_spaceMAX_PLAYERSobservation_space)selfconfig r    ^/home/ubuntu/.local/lib/python3.10/site-packages/ray/rllib/examples/envs/classes/simple_rpg.py__init__   s   


zSimpleRPG.__init__N)seedoptionsc                C   s   | j  i fS )Nr   sample)r   r#   r$   r    r    r!   reset-   s   zSimpleRPG.resetc                 C   s   | j  dddi fS )Nr   TFr%   )r   actionr    r    r!   step0   s   zSimpleRPG.step)__name__
__module____qualname____doc__r"   r'   r)   r    r    r    r!   r	      s
    	r	   )	gymnasiumgymgymnasium.spacesr   r   r   ray.rllib.utils.spaces.repeatedr   r   r   r   Envr	   r    r    r    r!   <module>   s    