Skip to content
Snippets Groups Projects
Commit 6610d720 authored by Franck Dary's avatar Franck Dary
Browse files

Reward func

parent f710681b
No related branches found
No related tags found
No related merge requests found
......@@ -214,6 +214,27 @@ def rewardG(appliable, config, action, missingLinks):
return reward
################################################################################
################################################################################
def rewardA(appliable, config, action, missingLinks):
if appliable:
if action.name != "BACK" :
reward = -action.getOracleScore(config, missingLinks)
else :
canceledRewards = []
found = 0
for i in range(len(config.historyPop))[::-1] :
if config.historyPop[i][0].name == "NOBACK" :
found += 1
if found == action.size :
break
else :
canceledRewards.append(config.historyPop[i][3])
reward = np.log(1-sum(canceledRewards)) if -sum(canceledRewards) > 0 else -1
else:
reward = -forbiddenReward
return reward
################################################################################
################################################################################
def reward3G(appliable, config, action, missingLinks):
if appliable:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment