标签: anylogic
在我的 AnyLogic 仿真模型中,我有两个源并在一个闭环中通过两个服务块。开始时,我注入了 1 辆 50T 卡车和 2 辆 20T 卡车。
此处为描述性图片:
Image of Model
在第二个服务块“crusher1”,我希望队列始终优先考虑代理“truck50ts”而不是“truck20ts”。这怎么办?
答案 0 :(得分:0)
将您的 Service 块替换为 Seize、Queue、Delay 和 Release 块(与 Service 相同,但为您提供更多选项).
Service
Seize
Queue
Delay
Release
在 Queue 属性中,将队列优先级设置为“代理比较”。
在条件代码中,写agent1 instanceof Truck_50tons ? true : false如下:
agent1 instanceof Truck_50tons ? true : false
这假设您的 50t 卡车是名为 Truck_50tons 的自定义代理类型的代理(在源头创建)
Truck_50tons