mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-03 21:02:38 +02:00
rm useless file and update obs space
This commit is contained in:
parent
fe0e62806d
commit
2eccf80ca3
2 changed files with 13 additions and 64 deletions
|
|
@ -6,7 +6,7 @@ from gymnasium import spaces
|
|||
from pydantic import ConfigDict, Field
|
||||
|
||||
from metagpt.environment.base_env_space import BaseEnvAction, BaseEnvActionType
|
||||
from metagpt.environment.werewolf.const import STEP_INSTRUCTIONS, RoleState
|
||||
from metagpt.environment.werewolf.const import STEP_INSTRUCTIONS
|
||||
|
||||
|
||||
class EnvActionType(BaseEnvActionType):
|
||||
|
|
@ -27,13 +27,21 @@ class EnvAction(BaseEnvAction):
|
|||
target_player_name: str = Field(default="", description="the name of the player who take the action")
|
||||
|
||||
|
||||
def get_observation_space(player_num: int) -> spaces.Dict:
|
||||
def get_observation_space() -> spaces.Dict:
|
||||
space = spaces.Dict(
|
||||
{
|
||||
"game_setup": spaces.Text(256),
|
||||
"step_idx": spaces.Discrete(len(STEP_INSTRUCTIONS)),
|
||||
"player_states": spaces.MultiDiscrete([len(RoleState)] * player_num),
|
||||
"vote_counts": spaces.MultiDiscrete([player_num - 1] * player_num),
|
||||
"player_current_dead": None, # TODO
|
||||
"living_players": spaces.Tuple(
|
||||
(spaces.Text(16), spaces.Text(16))
|
||||
), # TODO should be tuple of variable length
|
||||
"werewolf_players": spaces.Tuple(
|
||||
(spaces.Text(16), spaces.Text(16))
|
||||
), # TODO should be tuple of variable length
|
||||
"player_hunted": spaces.Text(16),
|
||||
"player_current_dead": spaces.Tuple((spaces.Text(16))), # TODO should be tuple of variable length
|
||||
"witch_poison_left": spaces.Discrete(2),
|
||||
"witch_antidote_left": spaces.Discrete(2),
|
||||
"winner": spaces.Text(16),
|
||||
"win_reason": spaces.Text(64),
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
"""
|
||||
@Time : 2023/9/26 1:12
|
||||
@Author : kevin-meng
|
||||
@File : arbiter.py
|
||||
"""
|
||||
|
||||
|
||||
ARBITER = """
|
||||
As an experienced Arbiter, you possess the necessary competence, sound judgment, and absolute objectivity. you promise that you will officiate in games with complete impartiality, respecting and adhering to the rules that govern them, in the true spirit of sportsmanship.
|
||||
|
||||
Please always remember the general duties of the Arbiters in a competition:
|
||||
a. Ensure fair play and adhere to the Anti-cheating regulations.
|
||||
b. Supervise the progress of the competition.
|
||||
c. Observe the game and enforce decisions made, imposing penalties on players where appropriate.
|
||||
d. Ensure that the Laws of the game are observed.
|
||||
|
||||
The rules governing this competition are as follows:
|
||||
===
|
||||
{rules}
|
||||
===
|
||||
|
||||
The scoring dimensions for judging in this game are as follows:
|
||||
===
|
||||
{dimensions}
|
||||
===
|
||||
|
||||
After the end of the competition, the Arbiter should submit a report, which includes:
|
||||
a. A summary report for the game.
|
||||
b. The final standings.
|
||||
c. Each player and their final score for each assessment category, along with the reasons for the ratings.
|
||||
d. Any other important information
|
||||
for example:
|
||||
|
||||
## Summary
|
||||
......
|
||||
|
||||
## Results and Standings (Top3)
|
||||
Top 1: player 1
|
||||
Top 2: player 2
|
||||
Top 2: player 3
|
||||
|
||||
## Scoring and Assessment Dimensions
|
||||
- player 1 : socre
|
||||
- dimension 1
|
||||
score: xx
|
||||
reason: xx
|
||||
- dimension 2
|
||||
score: xx
|
||||
reason: xx
|
||||
......
|
||||
- player 2
|
||||
......
|
||||
|
||||
## Conclusion
|
||||
......
|
||||
|
||||
"""
|
||||
Loading…
Add table
Add a link
Reference in a new issue