本文整理汇总了Python中simulation.Simulation方法的典型用法代码示例。如果您正苦于以下问题:Python simulation.Simulation方法的具体用法?Python simulation.Simulation怎么用?Python simulation.Simulation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类simulation
的用法示例。
在下文中一共展示了simulation.Simulation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import simulation [as 别名]
# 或者: from simulation import Simulation [as 别名]
def __init__(self, gate_num, duration, arrive_interval, check_interval):
"""
@gate_num
@duration
@arrive_interval ??????
@check_interval ??????
"""
self.simulation = Simulation(duration) # ?????Simulation ??
self.waitline = SQueue() # ??
self.duration = duration
self.gates = [0] * gate_num # 0 ????????? 1 ????
self.total_wait_time = 0
self.total_used_time = 0
self.car_num = 0
self.arrive_interval = arrive_interval
self.check_interval = check_interval
示例2: main
# 需要导入模块: import simulation [as 别名]
# 或者: from simulation import Simulation [as 别名]
def main():
if len(argv)==4:
runs = int(argv[1])
duration = int(argv[2])
plot = int(argv[3])
else:
print 'Runs, Duration, and Plotting Args Required'
exit(-1)
sim = Simulation(location,shape,plot)
rwds,clnd = [],[]
for i in xrange(runs):
rwd, cln = sim.run(duration)
rwds.append(rwd), clnd.append(cln)
if plot: gif(i)
print 'Average Reward: ' + str(mean(rwds))
print 'Average Cells Cleaned: ' + str(mean(clnd))
示例3: init
# 需要导入模块: import simulation [as 别名]
# 或者: from simulation import Simulation [as 别名]
def init(_args,_root):
global args
args = _args
global db
db = Database(clean=args.clean)
global postCache
postCache = Cache()
global commentCache
commentCache = Cache()
global messageCache
messageCache = Cache()
global userNotifCache
userNotifCache = Cache()
global root
root = _root
global sim
sim = simulation.Simulation(clean=args.clean)
global conf
conf = {"startingPoints":0}