(self)
return [0, obs, message_decoded["i"]]
Description: Get the next step of the match  
        Return values(Format: "0th element - Meaning - Other elements"):
        * 0 - Agent is still alive - OBS and Turn ID
        * 1 - Agent is dead - Nothing
        * 2 - Match has ended - Reward and agent item ID correlating to \
pommerman.constants.Items
Description: Get the next step of the match  
        Return values(Format: "0th element - Meaning - Other elements"):
        * 0 - Agent is still alive - OBS and Turn ID
        * 1 - Agent is dead - Nothing
        * 2 - Match has ended - Reward and agent item ID correlating to \
pommerman.constants.Items
Description : Get the next step of the match Return values ( Format : 0th element - Meaning - Other elements ) : * 0 - Agent is still alive - OBS and Turn ID * 1 - Agent is dead - Nothing * 2 - Match has ended - Reward and agent item ID correlating to \ pommerman . constants . Items
def match_get(self):
        """Description: Get the next step of the match  
        Return values(Format: "0th element - Meaning - Other elements"):
        * 0 - Agent is still alive - OBS and Turn ID
        * 1 - Agent is dead - Nothing
        * 2 - Match has ended - Reward and agent item ID correlating to \
pommerman.constants.Items
        """
        self.lock.acquire()
        try:
            message_recieved = self.ws_.recv()
        except:
            raise Exception(constants.Exceptions.net_respond_fail.value)
        finally:
            self.lock.release()
        try:
            # Messages with normal match data are compressed using GZIP while
            # match end notifications aren't. So we move on to that if this
            # fails to decompress with gzip.
            message_decoded = rapidjson.loads(
                str(gzip.decompress(message_recieved), "utf-8"))
        except:
            try:
                message_decoded = rapidjson.loads(message_recieved)
                if message_decoded[
                        "intent"] == constants.NetworkCommands.match_end.value:
                    return [
                        2,
                        int(message_decoded["reward"]),
                        int(message_decoded["agent"])
                    ]
            except:
                raise Exception(constants.Exceptions.net_invalid_response.value)
        # Info: message_decoded - ["d"]=Dead, ["o"]=OBS, ["i"] = Turn ID
        if message_decoded["d"]:
            return [1]
        obs = message_decoded["o"]
        obs["teammate"] = pommerman.constants.Item[obs["teammate"]]
        # Note: If position is not tuple SimpleAgent *will* error out
        obs["position"] = tuple(obs["position"])
        for x, y in enumerate(obs["enemies"]):
            obs["enemies"][x] = pommerman.constants.Item[y]
        for i in ["board", "bomb_life", "bomb_blast_strength"]:
            obs[i] = numpy.asarray(obs[i])
        return [0, obs, message_decoded["i"]]
def match_get ( self ) : self . lock . acquire ( ) try : message_recieved = self . ws_ . recv ( ) except : raise Exception ( constants . Exceptions . net_respond_fail . value ) finally : self . lock . release ( ) try : # Messages with normal match data are compressed using GZIP while # match end notifications aren't. So we move on to that if this # fails to decompress with gzip. message_decoded = rapidjson . loads ( str ( gzip . decompress ( message_recieved ) , "utf-8" ) ) except : try : message_decoded = rapidjson . loads ( message_recieved ) if message_decoded [ "intent" ] == constants . NetworkCommands . match_end . value : return [ 2 , int ( message_decoded [ "reward" ] ) , int ( message_decoded [ "agent" ] ) ] except : raise Exception ( constants . Exceptions . net_invalid_response . value ) # Info: message_decoded - ["d"]=Dead, ["o"]=OBS, ["i"] = Turn ID if message_decoded [ "d" ] : return [ 1 ] obs = message_decoded [ "o" ] obs [ "teammate" ] = pommerman . constants . Item [ obs [ "teammate" ] ] # Note: If position is not tuple SimpleAgent *will* error out obs [ "position" ] = tuple ( obs [ "position" ] ) for x , y in enumerate ( obs [ "enemies" ] ) : obs [ "enemies" ] [ x ] = pommerman . constants . Item [ y ] for i in [ "board" , "bomb_life" , "bomb_blast_strength" ] : obs [ i ] = numpy . asarray ( obs [ i ] ) return [ 0 , obs , message_decoded [ "i" ] ]