Skip to content

Commit

Permalink
actions comment
Browse files Browse the repository at this point in the history
  • Loading branch information
alexichepura committed May 22, 2023
1 parent fd27c3d commit 546b586
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions nn/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 23,15 @@ pub fn log_action_reward(action: usize, reward: f32) {

const ONE: f32 = 1.;
const ZERO: f32 = 0.;
// 0 - forward
// 1 - backward
// 2 - left
// 3 - right
// 4 - forward-left
// 5 - forward-right
// 6 - backward-left
// 7 - backward-right
// 8 - nothing
pub fn map_action_to_car(a: usize) -> (f32, f32, f32, f32) {
let gas = match a {
0 | 4 | 5 => ONE,
Expand Down

0 comments on commit 546b586

Please sign in to comment.