We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f3e077 commit 031f3dfCopy full SHA for 031f3df
examples/epstein_civil_violence/epstein_civil_violence/model.py
@@ -141,3 +141,14 @@ def count_jailed(model):
141
if agent.breed == "citizen" and agent.jail_sentence > 0:
142
count += 1
143
return count
144
+
145
+ @staticmethod
146
+ def count_cops(model):
147
+ """
148
+ Helper method to count jailed agents.
149
150
+ count = 0
151
+ for agent in model.schedule.agents:
152
+ if agent.breed == "cop":
153
+ count += 1
154
+ return count
0 commit comments