mirror of
https://github.com/ltcptgeneral/cse151b-final-project.git
synced 2024-12-26 01:59:10 +00:00
f
This commit is contained in:
parent
3747af9d22
commit
284a29d7af
@ -56,6 +56,7 @@ class AI:
|
|||||||
# get emulated results
|
# get emulated results
|
||||||
results = results_callback(word)
|
results = results_callback(word)
|
||||||
if self.use_q_model:
|
if self.use_q_model:
|
||||||
|
self.q_env.set_state(self.q_env_state)
|
||||||
# step the q_env to match the guess we just made
|
# step the q_env to match the guess we just made
|
||||||
for i in range(len(word)):
|
for i in range(len(word)):
|
||||||
char = word[i]
|
char = word[i]
|
||||||
@ -141,9 +142,9 @@ class AI:
|
|||||||
best_word = None
|
best_word = None
|
||||||
for word, _ in self.best_words:
|
for word, _ in self.best_words:
|
||||||
# reset the state back to before we guessed a word
|
# reset the state back to before we guessed a word
|
||||||
self.q_env.set_state(self.q_env_state)
|
|
||||||
if pattern.match(word) and False not in [e in word for e in self.possible_letters]:
|
if pattern.match(word) and False not in [e in word for e in self.possible_letters]:
|
||||||
if self.use_q_model:
|
if self.use_q_model:
|
||||||
|
self.q_env.set_state(self.q_env_state)
|
||||||
# Use policy to grade word
|
# Use policy to grade word
|
||||||
# get the state and action pairs
|
# get the state and action pairs
|
||||||
curr_qval = 0
|
curr_qval = 0
|
||||||
@ -160,7 +161,6 @@ class AI:
|
|||||||
else:
|
else:
|
||||||
# otherwise return the word from eric heuristic
|
# otherwise return the word from eric heuristic
|
||||||
return word
|
return word
|
||||||
self.q_env.set_state(self.q_env_state)
|
|
||||||
return best_word
|
return best_word
|
||||||
|
|
||||||
def get_vocab(self, vocab_file):
|
def get_vocab(self, vocab_file):
|
||||||
|
Loading…
Reference in New Issue
Block a user