本文整理匯總了Python中Agent.Agent.print_params方法的典型用法代碼示例。如果您正苦於以下問題:Python Agent.print_params方法的具體用法?Python Agent.print_params怎麽用?Python Agent.print_params使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Agent.Agent
的用法示例。
在下文中一共展示了Agent.print_params方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: spawn_agent
# 需要導入模塊: from Agent import Agent [as 別名]
# 或者: from Agent.Agent import print_params [as 別名]
def spawn_agent(self):
lifespan = (self.rando.randint(60,400))#lifespan of the agent, agent stops surfing once lifespan is reached(60,400)
pagetime = (self.rando.randint(10,40))#Time spent on a page within a website, i.e youtube.com/watch...(10,40)
hometime = (self.rando.randint(60,180))#Time spent on a website from the list of sites, i.e youtube.com(60,180)
name = str(self.name) + " Agent " + str(len(self.all_agents)+1)#name = Overseer x: Agent y
new_agent = Agent(self.clock.get_time_passed(), self.sites,(pagetime),(hometime), name, (lifespan),self.clock)
print("")
print("Created an agent")
new_agent.print_params()
print("")
new_thread = surfThread(new_agent,Overseer.sim_time, self.mode, self.clock)
new_thread.start()#Agent begins surfing the web
self.threads.append(new_thread)
self.curr_agents_surfing.append(new_agent)
self.all_agents.append(new_agent)