ying-wen / malib_deprecated

A Multi-agent Learning Framework
MIT License
61 stars 16 forks source link

Environment Specification #18

Closed Phutoast closed 5 years ago

Phutoast commented 5 years ago

For example in the class MatrixGame the base-code asserts the number of agent_num and action_num. Why would the user has to specify these number when it is already predefined (as an assertion)

Example,

if self.game == 'coordination_0_0':
    assert self.agent_num == 2
    assert self.action_num == 2
    self.payoff[0]=[[1,-1],
                   [-1,-1]]
    self.payoff[1]=[[1,-1],
                   [-1,-1]]
Phutoast commented 5 years ago

Furthermore, we already that a method get_game_list, which maps the game name to agent_num and action_num. For example

@staticmethod
def get_game_list():
    return {
        'zero_sum': {'agent_num': 2, 'action_num': 2}
    }
ying-wen commented 5 years ago

This is a good question. In a pre-defined matrix game/matrix game, the agent number is fixed. This information still required in the init(), because I want to keep the interfaces consistent with the other games/envs, and also want the outside (env) would explicitly know/define the agent number before instantiating an environment. As for the action number, it is redundant in initialization, the agents are expected to know the action space and observation/state space after the environment initialization.