Created
July 2, 2018 17:37
-
-
Save AurelianTactics/452aacc43f47059891fe82d75a38aadc to your computer and use it in GitHub Desktop.
reward_by_max_trajectory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
prev_step_max = 0 | |
-- reward that allows backtracking, only rewarded by getting max trajectory | |
function reward_by_max_trajectory() | |
frame_count = frame_count + 1 | |
local level_done = calc_progress(data) | |
local temp_progress = calc_trajectory_progress(data) | |
--local reward = reward_by_ring(data) --optional, modify reward by ring behavior | |
local reward = 0 | |
if (temp_progress ~= nil and temp_progress > prev_step_max) then | |
reward = (temp_progress/level_dict_len - prev_step_max/level_dict_len) * 9000 | |
reward = clip(reward,-400.1,400.1) | |
prev_step_max = temp_progress | |
end | |
if level_done >= 1 then | |
reward = reward + (1 - clip(frame_count/frame_limit, 0, 1)) * 1000 | |
end | |
return reward | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment