Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lab5
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
tddc17-coolkidz
lab5
Commits
e173a575
Commit
e173a575
authored
5 years ago
by
nambh713
Browse files
Options
Downloads
Patches
Plain Diff
added comments
parent
cb0f1435
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
QLearning/bin/QLearningController.class
+0
-0
0 additions, 0 deletions
QLearning/bin/QLearningController.class
QLearning/src/QLearningController.java
+1
-8
1 addition, 8 deletions
QLearning/src/QLearningController.java
with
1 addition
and
8 deletions
QLearning/bin/QLearningController.class
+
0
−
0
View file @
e173a575
No preview for this file type
This diff is collapsed.
Click to expand it.
QLearning/src/QLearningController.java
+
1
−
8
View file @
e173a575
...
...
@@ -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 */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment