ANONYMOUS wrote:
> Hi all,
>
> I'm trying to understand the code for the `satisfactory_agent` and I'm confused by the `is_spy()` method. According to the rules of the game, only spies can know who other spies are.
> However, in the provided code, we are allowed to pass in `player_num` as a parameter to check if that player is a spy. Why is this allowed and are we allowed to use this in our agent?
>
> Cheers
Hi,
Per the tutorial and the warning in the project spec, there is no reason for you to read or understand BasicAgent and SatisfactoryAgent, and I (softly) discourage you from doing so.
Specifically, you are implicitly and explicitly forbidden from plagiarizing from these agents, and the project is explicitly simulating you solving a "novel" problem.
That is all to say that I do not believe looking at these agents will help you complete this project, and only risks accidentally plagiarizing from them (which is unlikely to result in an effective agent anyway, as they are intended to be very simple benchmarks).
With that said:
You have misunderstood the code, and the SatisfactoryAgent is not using any capabilities not available to other agents. You have assumed that `is_spy()` returns the global truth of whether an agent is a spy. It does not. It returns true if and only if the agent knows that player to be a spy (specifically in this case only if the agent is a spy and was given a list of all the spies at the start of the game, per the rules).
Hope that helps!
Cheers,
Gozz