How to use the magent.model.BaseModel.__init__ function in magent

To help you get started, we’ve selected a few magent examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github geek-ai / MAgent / python / magent / builtin / rule_model / runaway.py View on Github external
def __init__(self, env, handle, away_handle, *args, **kwargs):
        BaseModel.__init__(self, env, handle)

        self.away_channel = env.get_channel(away_handle)
        self.attack_base, _ = env.get_view2attack(handle)
        self.move_back = 4

        print("attack base", self.attack_base, "away", self.away_channel)
github geek-ai / MAgent / python / magent / builtin / tf_model / base.py View on Github external
def __init__(self, env, handle, name, subclass_name):
        BaseModel.__init__(self, env, handle)
        self.name = name
        self.subclass_name = subclass_name
github geek-ai / MAgent / python / magent / builtin / rule_model / rush.py View on Github external
def __init__(self, env, handle, attack_handle, *args, **kwargs):
        BaseModel.__init__(self, env, handle)

        self.attack_channel = env.get_channel(attack_handle)
        self.attack_base, self.view2attack = env.get_view2attack(handle)

        print("attack_channel", self.attack_channel)
        print("view2attack", self.view2attack)
github geek-ai / MAgent / python / magent / builtin / mx_model / base.py View on Github external
def __init__(self, env, handle, name, subclass_name):
        """init a model

        Parameters
        ----------
        env: magent.Environment
        handle: handle (ctypes.c_int32)
        name: str
        subclass_name: str
            name of subclass
        """
        BaseModel.__init__(self, env, handle)
        self.name = name
        self.subclass_name = subclass_name
github geek-ai / MAgent / python / magent / builtin / rule_model / rushgather.py View on Github external
def __init__(self, env, handle, *args, **kwargs):
        BaseModel.__init__(self, env, handle)

        self.env = env
        self.handle = handle
        self.n_action = env.get_action_space(handle)
        self.view_size = env.get_view_space(handle)
        self.attack_base, self.view2attack = env.get_view2attack(handle)