【发布时间】:2017-08-31 04:39:51
【问题描述】:
我正在尝试运行 ManPy 模拟引擎。我安装了所有依赖项并安装了 DREAM 模块。现在我正在尝试从 ManPy 网站 (http://www.manpy-simulation.org) 运行简单的服务器示例:
from dream.simulation.imports import Source, Queue, Machine, Exit
from dream.simulation.Globals import runSimulation
#define the objects of the model
S=Source('S1','Source',interarrivalTime={'distributionType':'Fixed','mean':0.5}, entity='Dream.Part')
Q=Queue('Q1','Queue', capacity=1)
M=Machine('M1','Machine', processingTime={'distributionType':'Fixed','mean':0.25})
E=Exit('E1','Exit')
#define predecessors and successors for the objects
S.defineRouting(successorList=[Q])
Q.defineRouting(predecessorList=[S],successorList=[M])
M.defineRouting(predecessorList=[Q],successorList=[E])
E.defineRouting(predecessorList=[M])
# call the runSimulation giving the objects and the length of the experiment
runSimulation(objectList=[S,Q,M,E], maxSimTime=1440.0)
# calculate metrics
working_ratio = (M.totalWorkingTime/1440.0)*100
#print the results
print "the system produced", E.numOfExits, "parts"
print "the total working ratio of the Machine is", working_ratio, "%"'
根据网站的预期结果是
系统生产了 2880 个零件
机器总工作率为50.0%
但与此相反,当我执行脚本时,我收到以下语句:
系统生产了 1440 个零件
机器总工作比例为0.0%
生产的零件数量只是最大模拟时间(以秒为单位)。
有什么建议或有同样问题的人吗?
【问题讨论】:
标签: python simulation simpy