本文整理匯總了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}