<commit_before>import numpy as np

from . import utils

class Planner(object):
    """
    Planner
    """
    def __init__(self, num_actions):
        self.EXPLORATION_FRACTION = 0.2     # real, 0 < x < 1
        self.OBSERVATION_FRACTION = 0.5    # real, 0 < x < 1

        self.act = False
        self.action = np.zeros((num_actions, 1))


    def add_group(self):
        self.plan.append(0)


    def explore(self):
        """
        Forms a planner plan
        """
        
        self.act = True
        
        # Exploratory commands are only generated at the basic command feature
        # level (k = 3). Features and higher-level commands are not excited.

        num_actions = np.size(self.action)
        #handles motor commands as all-or-none
        self.action = np.zeros(np.size(num_actions))

        # old code: only one action element active
        self.action[int(np.random.random_sample() * num_actions)] = 1

        #     % new code
        #     N = 1; %adjust this<97>typical number of ones per exploratory action<commit_msg>planner.py: More 1xN => N-element vector<commit_after>import numpy as np

from . import utils

class Planner(object):
    """
    Planner
    """
    def __init__(self, num_actions):
        self.EXPLORATION_FRACTION = 0.2     # real, 0 < x < 1
        self.OBSERVATION_FRACTION = 0.5    # real, 0 < x < 1

        self.act = False
        self.action = np.zeros(num_actions)


    def add_group(self):
        self.plan.append(0)


    def explore(self):
        """
        Forms a planner plan
        """
        
        self.act = True
        
        # Exploratory commands are only generated at the basic command feature
        # level (k = 3). Features and higher-level commands are not excited.

        num_actions = np.size(self.action)
        #handles motor commands as all-or-none
        self.action = np.zeros(np.size(num_actions))

        # old code: only one action element active
        self.action[int(np.random.random_sample() * num_actions)] = 1

        #     % new code
        #     N = 1; %adjust this<97>typical number of ones per exploratory action
{'fraction_non_alphanumeric': 0.09813084112149532, 'fraction_numerical': 0.014018691588785047, 'mean_word_length': 1.9944055944055945, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '180785', 'n_tokens_mistral': 682, 'n_tokens_neox': 643, 'n_words': 186}