def step(self, goal_candidate, candidate_reward, current_reward):
        """ Evaluate and recommend a goal candidate """
        self.time_since_acted += 1.
        goal = None
        # Update the list of goal candidates 
        self.goal_candidates.append(goal_candidate)
        self.expected_reward.append(candidate_reward)
        self.time_since_observed.append(0.)
        # Estimate the value of each candidate
        decayed_reward = np.array(self.expected_reward) / ( 1. + 
                self.REWARD_DECAY_RATE * np.array(self.time_since_observed))
        value = (decayed_reward - current_reward + 
                 self.ACTION_PROPENSITY * self.time_since_acted)
        # Find the most likely candidate
        best_goal_index = np.where(value == max(value))[0][-1]
        highest_value = value[best_goal_index]
        # Check whether the best candidate is good enough to pick 
        if highest_value > 0.:
            goal = self.goal_candidates.pop(best_goal_index)
            self.expected_reward.pop(best_goal_index)
            self.time_since_observed.pop(best_goal_index)
            self.goal_candidates = []
            self.expected_reward = []
            self.time_since_observed = []
            self.time_since_acted = 0.
        # If the list of candidates is too long, reduce it
        if len(self.goal_candidates) > self.MAX_LENGTH:
            worst_goal_index = np.where(self.expected_reward == 
                                        min(self.expected_reward))[0][0]
            self.goal_candidates.pop(worst_goal_index)
            self.expected_reward.pop(worst_goal_index)
            self.time_since_observed.pop(worst_goal_index)
        return goal
dataset/ETHPy150Open matt2000/becca/core/arborkey.py/Arborkey.step/original