在模拟时更改模拟过程中的资源数量
我目前正在制作一个模型,该模型在整个工作日中模拟了一个simpy的交付过程。交货是由一次交付一个包裹的车手进行的。包装需要在特定时间窗口中交付。此外,该系统全天都涉及波动的需求。因此,我想调整系统可用的员工数量,以每小时匹配波动的需求。 我将骑手建模为具有一定能力的资源。是否有可能在模拟运行期间调整资源的能力,或者还有其他方法可以用我的系统对骑手进行建模?
我已经在小型文档,示例或其他帖子中寻找了可能的解决方案。但是,我还没有成功。因此,对于任何建议或可能的解决方案,我将非常感谢!先感谢您。
I am currently working on a model which simulates a delivery process throughout an operating day in simpy. The deliveries are conducted by riders which are delivering one package at a time. The packages need to be delivered within a certain time window. In addition, the system deals with fluctuating demand throughout the day. Therefore, I would like to adapt the number of employees available to the system matching the fluctuating demand on an hourly basis.
I modelled the riders as a resource with a certain capacity. Is there any possibility to adjust the capacity of the resource during a simulation run or are there other ways to model the riders with my system?
I already looked for possible solution within the simpy documentation, examples or other posts. However, I was not successful yet. Thus, for any advice or possible solutions I would be very grateful! Thank you in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用商店代替资源。资源具有修复数量的资源。商店的工作更像是带有最大容量的列表的队列后备。要减少商店中的数字,只需停止将对象放回商店。
因此,我将一家商店包裹了一个班级来管理骑手人数。
Use a store instead of a resource. Resources has a fix number of resources. Stores works a bit like a bit more like a queue backed with a list with a optional max capacity. To reduce then number in the store, just stop putting the object back into the store.
So is a example I wrapped a store with a class to manage the number of riders.
我喜欢提供的答案,但是有一些(例如我自己)喜欢或多或少地使用这些资源。结果,我写了一个
simpy.resource
的子类,该类只是在持续时间内消耗资源。我认为这更适合建模一个生病的人或类似的东西……好像不再存在该人,而是仅仅是“更高的优先”任务。这种方法还可以使监视易于插入(在方法中)开始计算病假时间,转移的次数等。取决于模型的上下文。将原因
参数放入redaim_capacity
方法的目的是为了监视不同类别的不可用类别,甚至可能很有用。对于
PriorityResource
和prementiveresource
是编写的或必须更改为使用Store
。I like the answer provided, but there are some - such as myself - that like to use the resources more or less as they are written. As a result, I wrote a subclass of
simpy.Resource
which simply consumes the resource for a duration. I think that this is more appropriate to model a person who is out sick or something along those lines... it isn't as if the person no longer exists, but is simply on a "higher priority" task. This approach also makes monitoring easier to insert as you can - within the method - start counting sick time, number of times diverted, etc. depending on the context of the model. It may even be useful to put areason
parameter into thereduce_capacity
method for the purposes of monitoring different categories of unavailability.One would have to change the method somewhat for
PriorityResource
andPreemptiveResource
, but the basic methodology works well without changing the basic functionality of theResource
as it is written or having to change to using theStore
.