ecc8b0b34138fa480e1b1876fd2695c07be9b159,simple_rl/tasks/navigation/NavigationMDP.py,NavigationMDP,reset_goals,#NavigationMDP#,179
Before Change
// Assume all goals are same
self.cells[goal_r, goal_c] = len(self.cell_types)
self.cell_rewards[goal_r, goal_c] = self.goal_rewards[0]
self.goal_xy_to_idx[(goal_loc[0], goal_loc[1])] = 0
else:
// Each goal is different in type and rewards
self.cells[goal_r, goal_c] = len(self.cell_types) + goal_idx
self.cell_rewards[goal_r, goal_c] = self.goal_rewards[goal_idx]
self.goal_xy_to_idx[(goal_loc[0], goal_loc[1])] = goal_idx
self._policy_invalidated = True
def _reward_func(self, state, action):
After Change
self.goal_cell_locs = goal_cell_locs
self.goal_cell_rewards = goal_cell_rewards
self.goal_cell_types = goal_types
self.goal_cell_ids = list(range(self.living_cell_ids[-1] + 1,
self.living_cell_ids[-1] + 1 + len(
self.goal_cell_locs)))
// Reset goal xy to idx dict
self.goal_xy_to_idx = {}
// Reset cell type and cell reward grid with no goals
self.state_space = self.state_space_wo_goals.copy()
self.state_rewards = self.state_rewards_wo_goals.copy()
// Update goals and their rewards
for idx, goal_loc in enumerate(self.goal_cell_locs):
goal_r, goal_c = self._xy_to_rowcol(goal_loc[0], goal_loc[1])
self.state_space[goal_r, goal_c] = self.goal_cell_ids[idx]
self.state_rewards[goal_r, goal_c] = self.goal_cell_rewards[idx]
self.goal_xy_to_idx[(goal_loc[0], goal_loc[1])] = idx
self.cell_ids = self.living_cell_ids + self.goal_cell_ids
self.cell_types = self.living_cell_types + self.goal_cell_types
self.cell_type_rewards = self.living_cell_rewards + self.goal_cell_rewards
self._policy_invalidated = True
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: david-abel/simple_rl
Commit Name: ecc8b0b34138fa480e1b1876fd2695c07be9b159
Time: 2018-08-22
Author: yagneshrevar@gmail.com
File Name: simple_rl/tasks/navigation/NavigationMDP.py
Class Name: NavigationMDP
Method Name: reset_goals
Project Name: david-abel/simple_rl
Commit Name: ecc8b0b34138fa480e1b1876fd2695c07be9b159
Time: 2018-08-22
Author: yagneshrevar@gmail.com
File Name: simple_rl/tasks/navigation/NavigationMDP.py
Class Name: NavigationMDP
Method Name: reset_goals
Project Name: CamDavidsonPilon/lifelines
Commit Name: b46c893e2c0f9cd505b597c2ff215a0df04b6050
Time: 2020-05-19
Author: cam.davidson.pilon@gmail.com
File Name: lifelines/fitters/npmle.py
Class Name:
Method Name: log_likelihood
Project Name: LCAV/pyroomacoustics
Commit Name: f2e989565ab89af58dff63ab3cf89fe63af38327
Time: 2020-06-02
Author: fakufaku@gmail.com
File Name: examples/raytracing.py
Class Name:
Method Name: