def run():
"""Run the agent for a finite number of trials."""
# Set up environment and agent
e = Environment() # create environment (also adds some dummy traffic)
a = e.create_agent(LearningAgent) # create agent
#e.set_primary_agent(a, enforce_deadline=False)
e.set_primary_agent(a, enforce_deadline=True) # set agent to track
# Now simulate it
sim = Simulator(e, update_delay=1.0) # reduce update_delay to speed up simulation
sim.run(n_trials=10) # press Esc or close pygame window to quit
评论列表
文章目录