import random
class PoliceDepartment:
def __init__(self, officers, tech_level, community_trust):
self.officers = officers
self.tech_level = tech_level # scale 110
self.community_trust = community_trust # scale 110
self.crime_rate = 100 # starting crime index
def apply_modern_policing(self):
print(“nApplying modern policing strategies…”)
# Body cameras increase trust
self.community_trust += 1
# AI & surveillance reduce crime
reduction = self.tech_level * random.uniform(0.5, 1.5)
self.crime_rate -= reduction
# Community policing effect
trust_effect = self.community_trust * random.uniform(0.3, 1.0)
self.crime_rate -= trust_effect
self.crime_rate = max(self.crime_rate, 0)
def simulate_future(self, years):
print(“n— Future Policing Simulation —“)
for year in range(1, years + 1):
print(f”nYear {year}:”)
# Tech improves over time
self.tech_level += random.choice([0, 1])
self.apply_modern_policing()
print(f”Officers: {self.officers}”)
print(f”Tech Level: {self.tech_level}”)
print(f”Community Trust: {self.community_trust:.2f}”)
print(f”Crime Rate Index: {self.crime_rate:.2f}”)
# Run simulation
dept = PoliceDepartment(officers=50, tech_level=5, community_trust=5)
dept.simulate_future(5)

Leave a Reply
You must be logged in to post a comment.