Question: Problem 8 ( 1 pt ) . A strategy can also take advantage of the Swine swap rule. Implement swap _ strategy, which Rolls 0

Problem 8(1 pt). A strategy can also take advantage of the Swine swap rule. Implement swap_strategy, which
Rolls 0 if it would cause a beneficial swap that gains points.
Rolls BASELINE_NUM_ROLLS if rolling 0 would cause a harmful swap that loses points.
If rolling 0 would not cause a swap, then do so if it would give at least BACON_MARGIN points and roll BASELINE_NUM_ROLLS otherwise.
Test your implementation before moving on:
python3 hog_grader.py -q 8
Once you have implemented this strategy, update run_experiments to evaluate your new strategy against the baseline. You should find that it performs even better than bacon_strategy, on average.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!