I've uncommented line 372 in widget.py. But I still get the following error. It seems that there is some error when calculating the next state... I've never successfully run this code so far.
`runfile('C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py', wdir='C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master')
0 with 64 cases, total 0 processed
1 with 831 cases, total 64 processed
Reloaded modules: scoring
length of dice_to_id 252
length of kept_to_id 462
reachables: 2794 out of 4118
unreachables: 1324 out of 4118
$$$ 0 with 64 cases, total 0 processed
$$$ 1 with 831 cases, total 64 processed
100 processed, 0.22
200 processed, 0.213
300 processed, 0.213
400 processed, 0.21
500 processed, 0.264
600 processed, 0.21
700 processed, 0.206
800 processed, 0.298
2 with 4951 cases, total 895 processed
current state (7103,43)
roll (1, 1, 1, 1, 1) in category 3K
next state mask (7167, 43)
$$$ 2 with 4951 cases, total 895 processed
key does not exist (state,upper_score)=(7167,43)
Traceback (most recent call last):
File "", line 1, in
runfile('C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py', wdir='C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master')
File "C:\Users\Wei Miao\Anaconda3\envs\tesst-env\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile
execfile(filename, namespace)
File "C:\Users\Wei Miao\Anaconda3\envs\tesst-env\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 95, in execfile
exec(compile(scripttext, filename, 'exec'), glob, loc)
File "C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py", line 372, in
training_expectation()
File "C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py", line 294, in training_expectation
process_main1((mask, upper_score), yahtzee=0)
File "C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py", line 255, in process_main1
e0,e0_action,e0_full= expectation_exit(state, yahtzee)
File "C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py", line 128, in expectation_exit
raise ValueError
I've uncommented line 372 in widget.py. But I still get the following error. It seems that there is some error when calculating the next state... I've never successfully run this code so far.
`runfile('C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py', wdir='C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master') 0 with 64 cases, total 0 processed 1 with 831 cases, total 64 processed Reloaded modules: scoring length of dice_to_id 252 length of kept_to_id 462 reachables: 2794 out of 4118 unreachables: 1324 out of 4118 $$$ 0 with 64 cases, total 0 processed $$$ 1 with 831 cases, total 64 processed 100 processed, 0.22 200 processed, 0.213 300 processed, 0.213 400 processed, 0.21 500 processed, 0.264 600 processed, 0.21 700 processed, 0.206 800 processed, 0.298 2 with 4951 cases, total 895 processed current state (7103,43) roll (1, 1, 1, 1, 1) in category 3K next state mask (7167, 43) $$$ 2 with 4951 cases, total 895 processed key does not exist (state,upper_score)=(7167,43) Traceback (most recent call last):
File "", line 1, in
runfile('C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py', wdir='C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master')
File "C:\Users\Wei Miao\Anaconda3\envs\tesst-env\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 827, in runfile execfile(filename, namespace)
File "C:\Users\Wei Miao\Anaconda3\envs\tesst-env\lib\site-packages\spyder_kernels\customize\spydercustomize.py", line 95, in execfile exec(compile(scripttext, filename, 'exec'), glob, loc)
File "C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py", line 372, in
training_expectation()
File "C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py", line 294, in training_expectation process_main1((mask, upper_score), yahtzee=0)
File "C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py", line 255, in process_main1 e0,e0_action,e0_full= expectation_exit(state, yahtzee)
File "C:/Users/Wei Miao/Desktop/yahtzee-optimal-strategy-master_oringinal/yahtzee-optimal-strategy-master/widget.py", line 128, in expectation_exit raise ValueError
ValueError`