<commit_before>from oscar.agent.custom_agent import CustomAgent
from oscar.meta_action import *
import pickle

class Explorator(CustomAgent):
    def __init__(self, message="I hate you"):
        self._message = message
        self.coordinates_helper = Coordinates_helper()
        self.cur_location = None
        self.obs_log = []
        super().__init__()

    def scout_sent(self):
        print("scout sent")

    def step(self, obs):
        if not self.cur_location:
            self.cur_location = self.coordinates_helper.get_loc_in_minimap(obs)

        if len(self.obs_log) < 50:
            self.obs_log.append(obs)
            if len(self.obs_log) == 50:
                pickle.dump( self.obs_log, open( "obs.p", "wb" ) )


        play = {}

        meta_action = None
        try:
            meta_action = scout(obs, self.coordinates_helper, self.cur_location)
            if meta_action:
                play["success_callback"] = self.scout_sent
        except NoValidSCVError:
            #print("scouting failed")
            meta_action = [actions.FunctionCall(NO_OP, [])]

        play["actions"] = meta_action
        return play

    def print_tree(self, depth):
        return "I am a {} and my depth is {}. I have a message to tell you : {}".format(type(self).__name__, depth
                                                                                        , self._message)<commit_msg>Removed debug code in explorator agent<commit_after>from oscar.agent.custom_agent import CustomAgent
from oscar.meta_action import *
import pickle

class Explorator(CustomAgent):
    def __init__(self, message="I hate you"):
        self._message = message
        self.coordinates_helper = Coordinates_helper()
        self.cur_location = None
        super().__init__()

    def scout_sent(self):
        print("scout sent")

    def step(self, obs):
        if not self.cur_location:
            self.cur_location = self.coordinates_helper.get_loc_in_minimap(obs)

        play = {}

        meta_action = None
        try:
            meta_action = scout(obs, self.coordinates_helper, self.cur_location)
            if meta_action:
                play["success_callback"] = self.scout_sent
        except NoValidSCVError:
            print("scouting failed")
            meta_action = [actions.FunctionCall(NO_OP, [])]

        play["actions"] = meta_action
        return play

    def print_tree(self, depth):
        return "I am a {} and my depth is {}. I have a message to tell you : {}".format(type(self).__name__, depth
                                                                                        , self._message)
{'fraction_non_alphanumeric': 0.09529190207156309, 'fraction_numerical': 0.0015065913370998117, 'mean_word_length': 1.9543937708565073, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '345925', 'n_tokens_mistral': 751, 'n_tokens_neox': 725, 'n_words': 173}