Baseball game test is failing
Closed this issue · 1 comments
jerry871002 commented
https://github.com/jerry871002/bayesian-strategy-inference/actions/runs/5841852816/job/15842391174
+ python run.py baseball bpr-okr -n 5 --new-phi-opponent -q 3
----- (bpr-okr agent, New Phi opponent) q = 3 -----
Traceback (most recent call last):
File "/home/runner/work/bayesian-strategy-inference/bayesian-strategy-inference/src/run.py", line 195, in <module>
run(args)
File "/home/runner/work/bayesian-strategy-inference/bayesian-strategy-inference/src/run.py", line 49, in run
run_bpr_okr(args)
File "/home/runner/work/bayesian-strategy-inference/bayesian-strategy-inference/src/baseball_game/run.py", line 355, in run_bpr_okr
policy_preds.append(step_5_policy_preds[i])
IndexError: list index out of range
+ python run.py baseball bsi-pt -n 5 -e 2
----- (bsi-pt agent) Test random switch opponent -----
Traceback (most recent call last):
File "run.py", line 195, in <module>
run(args)
File "run.py", line 53, in run
run_bsi_pt(args)
File "/home/runner/work/bayesian-strategy-inference/bayesian-strategy-inference/src/baseball_game/run.py", line 648, in run_bsi_pt
policy_preds.append(step_2_policy_preds[i])
IndexError: list index out of range
jerry871002 commented
The cause of this issue is this piece of code that is executed after each episode
The problem was that if the intra-belief
happens to be uniformly distributed (which is quite unlikely, so the error does not happen every time), the code enters the first if
block, and the step_i_policy_preds
arrays aren't properly "aligned", causing the next episode having an IndexError
. (i
increased but the length of the array wasn't)