當前位置: 首頁>>代碼示例>>Python>>正文


Python simulation.Simulation方法代碼示例

本文整理匯總了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 
開發者ID:basicworld,項目名稱:py_structure,代碼行數:18,代碼來源:haiguan_simulation.py

示例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)) 
開發者ID:avelkoski,項目名稱:VacuumAI,代碼行數:21,代碼來源:main.py

示例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} 
開發者ID:itsZN,項目名稱:vulnsite,代碼行數:29,代碼來源:globalVals.py


注:本文中的simulation.Simulation方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。