Skip to content
Snippets Groups Projects
Commit e173a575 authored by nambh713's avatar nambh713
Browse files

added comments

parent cb0f1435
No related branches found
No related tags found
No related merge requests found
No preview for this file type
......@@ -153,21 +153,14 @@ public class QLearningController extends Controller {
}
else {
double curQvalue = Qtable.get(prev_stateaction);
//System.out.print("cur q value: "+ curQvalue);
double Rvalue = StateAndReward.getRewardHover(previous_angle, previous_vx, previous_vy);
//System.out.print("r value"+ Rvalue);
double alpha = alpha(Ntable.get(prev_stateaction));
double Qmax = getMaxActionQValue(new_state);
//System.out.print("Qmax"+ Qmax);
//Q(s,a)
curQvalue = curQvalue + alpha *(Rvalue + GAMMA_DISCOUNT_FACTOR*Qmax -curQvalue);
Qtable.put(prev_stateaction, curQvalue);
}
/* TODO: IMPLEMENT Q-UPDATE HERE! */
/* See top for constants and below for helper functions */
int action = selectAction(new_state); /* Make sure you understand how it selects an action */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment