Can you connect 2 separate flowcharts with one restricted area?

我只是一个虾纸丫 提交于 2020-01-15 10:23:12

问题


Our model has a ProductionOrder seize some Operators. The seize block has a Prepare flowchart for the Operators to move through an airlock (PAL) into a room. After the ProductionOrder operation (a delay block), the Operators are released and have a Wrap-Up flowchart that sends them out of the room through the same airlock. Because this airlock can only have 2 people, we need to restrict the combined Operators in the Prepare and Wrap-up flowcharts to 2 people in the airlock regardless of them coming in or going out (i.e. max 2 at any time).

If we do this by connecting the blocks with connectors, an error comes up basically saying you can't connect a Prepare flowchart to a Wrap-up flowchart.

Is there a way to link the circled queues and restricted area start blocks?


回答1:


Instead of using a queue (PALqueue) use a wait block there (in both flows)

And you can do in the on enter of each wait block PALqueue:

if(PALCapacityLimit.entitiesInside()+PALCapacityLimit1.entitiesInside()<2){
    self.free(agent);
}

And in the on onter of the PalInLimit (both)

if(PALqueue.size()>0)
PALqueue.free(PALqueue.get(0)); //remember now PALqueue is a wait block
else if(PALqueue1.size()>0)
PALqueue1.free(PALqueue1.get(0));

And there you go :)



来源:https://stackoverflow.com/questions/58664864/can-you-connect-2-separate-flowcharts-with-one-restricted-area

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!