Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义多智能体环境 #28

Open
shswdmx1 opened this issue Mar 13, 2024 · 3 comments
Open

自定义多智能体环境 #28

shswdmx1 opened this issue Mar 13, 2024 · 3 comments

Comments

@shswdmx1
Copy link

在new_env_mas.py文件中,self.state_space = Box(low=0, high=1, shape=[self.dim_state, ], dtype=np.float32, seed=self.seed)这句代码是定义智能体的状态空间。但是这样的话每个智能体的观测就都是一样的对吧。假如我现在有两个智能体,观测是给定的两列数据,也就是每个智能体的观测都对应一列数据,那这样的话每个智能体的观测范围就是不一致的。比如:
obs_space1 = Box(low=self.data1.min(), high=self.data1.max(), shape=(self.dim_obs,), dtype=np.float32, seed=self.seed)
obs_space2 = Box(low=self.data2.min(), high=self.data2.max(), shape=(self.dim_obs,), dtype=np.float32, seed=self.seed)
那请问这样的智能体该如何在new_env_mas.py文件中定义观测空间呢?

@wenzhangliu
Copy link
Collaborator

目前new_env_mas.py里给出的针对同质智能体(所有智能体的各种属性都一样)的示例。但是你提到的情况应该没有影响,只要每个智能体的obs_shape一样,在外部应该是不区分取值范围的。如果你需要在外部访问每个智能体的观测范围,不妨在这个文件中新增self.obs_space1,self.obs_space2这样的成员变量。

@shswdmx1
Copy link
Author

屏幕截图 2024-03-14 151610
为啥tensorborad这些图并没有展示出来呢?

@wenzhangliu
Copy link
Collaborator

貌似是因为纵坐标显示范围太大

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants