DREAM:ManPy 简单服务器示例不工作

DREAM: ManPy simple server example not working

我正在尝试 运行 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, "%"'

根据网站的预期结果是

the system produced 2880 parts

the total working ratio of the Machine is 50.0 %

但与此相反,当我执行脚本时收到声明:

the system produced 1440 parts

the total working ratio of the Machine is 0.0 %

生产零件的数量只是以秒为单位的最大模拟时间。

任何建议或有同样问题的人?

这是因为更新了 ManPy API 以便更灵活地声明分布​​。网站上的文档(我想 http://www.manpy-simulation.org/ ?)从未更新过,而且确实计划在找到时间时完成更多示例(参见下面的 PDF I link)。

这个例子的正确代码在这里: https://lab.nexedi.com/nexedi/dream/blob/master/dream/simulation/Examples/SingleServer.py

所以不是:

processingTime={'distributionType':'Fixed','mean':0.25}

但是: processingTime={'Fixed':{'mean':0.25}}

一般情况下,我们将分布类型作为外层字典的key,内层字典中的所有参数。

文档的更新版本(遗憾的是仍然是 PDF,还没有 html 版本)在这里: https://lab.nexedi.com/nexedi/dream/blob/master/ManPy_documentation.pdf。这包含更多示例。

如果不行请告知