sat.py: correctly export model after game ended
This commit is contained in:
parent
d91dec3c81
commit
c47ca7ccc5
1 changed files with 1 additions and 1 deletions
2
sat.py
2
sat.py
|
@ -315,7 +315,7 @@ def print_model(model, cur_game_state, ls: Literals):
|
||||||
# evaluates the model to produce a full game history
|
# evaluates the model to produce a full game history
|
||||||
def evaluate_model(model, cur_game_state: GameState, ls: Literals) -> GameState:
|
def evaluate_model(model, cur_game_state: GameState, ls: Literals) -> GameState:
|
||||||
for m in range(len(cur_game_state.actions), cur_game_state.instance.max_winning_moves):
|
for m in range(len(cur_game_state.actions), cur_game_state.instance.max_winning_moves):
|
||||||
if model.get_py_value(ls.dummyturn[m]):
|
if model.get_py_value(ls.dummyturn[m]) or cur_game_state.is_over():
|
||||||
break
|
break
|
||||||
if model.get_py_value(ls.discard_any[m]):
|
if model.get_py_value(ls.discard_any[m]):
|
||||||
card_idx = next(i for i in range(0, cur_game_state.instance.deck_size) if model.get_py_value(ls.discard[m][i]))
|
card_idx = next(i for i in range(0, cur_game_state.instance.deck_size) if model.get_py_value(ls.discard[m][i]))
|
||||||
|
|
Loading…
Reference in a new issue