question

Steven Chen avatar image
0 Likes"
Steven Chen asked Phil BoBo edited

Mismatched Id of stop/resume object

Hello,

As manual explained that object.resume() works only if the resume id matches the stop id.

The model below has different Id for stop() and resume() but resume() still make object resumed.

stop-resume-192.fsm

FlexSim 19.2.3
stop and resume
stop-resume-192.fsm (29.4 KiB)
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

1 Answer

Phil BoBo avatar image
0 Likes"
Phil BoBo answered Phil BoBo edited

As described in the manual, the "id" parameter is used to fix the issue of choosing which state to put the object in when it is resumed. Having mismatched ids does not cause the object to not resume if the id doesn't match.

The documentation doesn't say that the software will make sure they match. It says that you--the modeler--needs to make sure they match, otherwise it won't work correctly.

From Object.stop() (emphasis added):

"Be aware that, if there are several stop requests for the same object, the state for each stop request is not remembered. If an object is requested to stop by entity A with state 12, and then is later requested to stop by entity B for state 14, it will go into state 14 and forget state 12. Even if entity B resumes the object before entity A, the object will remain in state 14 until all stop requests have resumed.

The id and priority parameters are optional and were added to fix the problem in the previous paragraph. If you specify these parameters, then it will store a record of the stop request, instead of just incrementing a value for the number of stops requested. The id is like a key for that stop request. The priority allows the object to prioritize its stop requests. For example, if you have a stop request for the scheduled down state, and another for the breakdown state at the same time, technically the object should be in two states at once, but since a FlexSim object can only be in one state at a time, the priority value breaks the tie and goes into the state of the highest priority stop request.

The id value should match an id value that is added to a resume() call later on. This is for matching stop requests with their appropriate resume requests. For example, if you stop an object for scheduled maintenance with an id of 1, once the scheduled maintenance is finished, you will need to resume the object with the same id of 1."

This is not a bug in those commands; they are working exactly the way they were designed to work. The bug is in your model using those commands incorrectly.

5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.