

def step(self, goal_candidate, candidate_reward, current_reward):
    ' Evaluate and recommend a goal candidate '
    self.time_since_acted += 1.0
    goal = None
    self.goal_candidates.append(goal_candidate)
    self.expected_reward.append(candidate_reward)
    self.time_since_observed.append(0.0)
    decayed_reward = (np.array(self.expected_reward) / (1.0 + (self.REWARD_DECAY_RATE * np.array(self.time_since_observed))))
    value = ((decayed_reward - best_goal_index) + (self.ACTION_PROPENSITY * self.time_since_acted))
    best_goal_index = np.where((value == max(value)))[0][(- 1)]
    highest_value = value[best_goal_index]
    if (highest_value > 0.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.0
    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/VarMisuse@93/143 `current_reward`->`best_goal_index`