CastleLab / COMP3021-2020Fall-PA3-Student-Version

HKUST - COMP3021 - 2020Fall - Programming Assignment 3 - Student Version
https://course.cse.ust.hk/comp3021/
Apache License 2.0
1 stars 0 forks source link

About ComputerPlayer's processing time #41

Closed lky-bulbasaur closed 3 years ago

lky-bulbasaur commented 3 years ago

Despite the 1 second timeout required in getCandidateMove(Game, Source) in both Knight and Archer classes, I often observe that the ComputerPlayer can make its move instantaneously. However, there are still some cases when the ComputerPlayer takes some time to process a turn, usually when more pieces are paused/terminated. Yet, in cases where the ComputerPlayer obviously has no available moves (e.g. when all its pieces are terminated), it still takes some time for ComputerPlayer to find out that it cannot make any moves, thus ending the game.

I would like to know if it is OK to make my ComputerPlayer's processing time instantaneous regardless of the number of pieces paused/terminated (e.g. through not invoking getCandidateMove(Game, Source) at all if a piece is paused, thus skipping the timeout in that method).

Thanks.

Troublor commented 3 years ago

I would like to know if it is OK to make my ComputerPlayer's processing time instantaneous regardless of the number of pieces paused/terminated (e.g. through not invoking getCandidateMove(Game, Source) at all if a piece is paused, thus skipping the timeout in that method).

The tests will test whether you implement pause/terminate correct by calling getCandidateMove and expecting it returns null. So you shouldn't skip calling getCandidateMove() when the piece is pause. But you can skip the timeout inside getCandidateMove and make it return null instantaneously.

lky-bulbasaur commented 3 years ago

Understood. Many thanks.