Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DroneTrojanAgent does not ActivateTrojan on Drone 17 #36

Open
hkscy opened this issue Jul 24, 2023 · 0 comments
Open

DroneTrojanAgent does not ActivateTrojan on Drone 17 #36

hkscy opened this issue Jul 24, 2023 · 0 comments

Comments

@hkscy
Copy link
Contributor

hkscy commented Jul 24, 2023

In CybORG.Agents.SimpleAgents.DroneTrojanAgent on lines 20:21:

if self.np_random.random() < self.spawn_rate:
    return ActivateTrojan(hostname=f'drone_{self.np_random.randint(0, self.num_drones-1)}', agent=self.name)

randint is exclusive of the high parameter, therefore the trojan is only activated on drones 0-self.num_drone-2. In other words, in the challenge scenario drone 17 never gets infected.

The fix is to select a target using randint(0, self.num_drones).

hkscy added a commit to hkscy/CybORG that referenced this issue Jul 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant