Skip to content

Commit

Permalink
Adding missing get_policy and get_value to qlearning
Browse files Browse the repository at this point in the history
  • Loading branch information
kcelebi committed Sep 8, 2024
1 parent c74c1d4 commit 1a622f4
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/machine_learning/q_learning_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,10 @@ def update(self, state, action, next_state, reward):
self.q_values[(state, action)] = self.get_Q_value(state, action) + self.alpha * (reward + self.discount*NSQ - self.get_Q_value(state, action))


def get_policy(self, state):
return self.compute_action_from_Q_values(state)



def get_value(self, state):
return self.compute_value_from_Q_values(state)


0 comments on commit 1a622f4

Please sign in to comment.