question

Axel Kohonen avatar image
0 Likes"
Axel Kohonen asked Axel Kohonen commented

Process flow code behaves differently depending on if I use a breakpoint or not

Hi,

I am creating an elevator system where I have a single queue where the persons queue for the elevator regardless of the floor they are queuing at. So I would like to set the person into the queue, but keep their z coordinate as it was so I visually can see what floor they are waiting at. I want the person to be inside the queue so that I easily can get the statistics e.g. for the waiting time. I do not want a queue at each level as I only want the combined statistics for each elevator. Also I want to avoid visual clutter with queues at every floor (although a queue at each floor is acceptable if not possible otherwise)

I tried to do this using process flow by first using a travel to loc task to walk the person to the queue while staying at the floor (z coordinate) they are at, then move the person into the queue and then set the z coordinate to what it was before moving the person into the queue. The problem is that the code works nicely (the z coordinate is set and the person moves to the correct z coordinate) when I have a breakpoint in the code that sets the z coordinate. If I do not have a breakpoint the z coordinate is not set properly.

If I set a delay of say 1 second after the move and before the change visual activity in process flow then the code works correctly both when using and when not using the breakpoint. A zero second delay after the move does not work.

See the attached demo model that demonstrates the problem although it does not make any sense otherwise.

What am I missing here?

Thank you!

Kind regards,

Axel

FlexSim 17.2.3
elevatorcoordinatesfloor planbreakpoints
5 |100000

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

Steven Hamoen avatar image
3 Likes"
Steven Hamoen answered Axel Kohonen commented

@Axel Kohonen The queue uses the onpredraw to call the Item Placement logic. In your case this is still on "Stack Inside Queue" so after a small time (refreshrate) this code is called and executed. it is executed again if something changes inside the (like a new arrival or something leaving). So that is reason why delay 0 is not working and delay 1 sec is working. But your solution should be to switcht the Item Placement logic to "do nothing". Then you are in control of the placement.

· 1
5 |100000

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

Axel Kohonen avatar image Axel Kohonen commented ·

Thank you!

Setting to "do nothing" solves the issues.

Axel

0 Likes 0 ·
christian.n avatar image
1 Like"
christian.n answered Axel Kohonen commented

Hi Axel.

I looked through the demo model, and I agree that it does not seem to work as intended. I am pretty sure that, that what you are experiencing is a conflict between the placement logic in Queue1 and the placement logic in your process flow. I am not certain about when exactly the placement logic in the queue is executed, but it seems to happen after your own placement logic, except when you debug it. That seems pretty strange, and could potentially be a bug.

Try setting 'Item Placement' in the receiving queue to 'Do Nothing' in stead of 'Stack Inside Queue'.

That seems to solve the problem here.

Best regards
Christian

· 3
5 |100000

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

Axel Kohonen avatar image Axel Kohonen commented ·

Thank you @christian.norregaard!

@phil.bobo is this a bug since debugging and not debugging behaves differently or just that I did not use FlexSim properly?

Axel

0 Likes 0 ·
Steven Hamoen avatar image Steven Hamoen Axel Kohonen commented ·

@Axel Kohonen No this is not a bug. If nothing changes in your queue the placement function is only executed once so any change you made after that will work (until a second operator enters and the code is executed again) And by calling debug you give Flexsim the time to update the screen and call this function before you actually set the location. So if you would use a delay that is slightly bigger then the refreshrate you would get the same effect. But again only as long as the content of the queue doesn't change because then this function to update the locations of the content is called again.

1 Like 1 ·
Axel Kohonen avatar image Axel Kohonen Steven Hamoen commented ·

Hi @steven.hamoen

Thank you for the explanation!

Kind regards,

Axel

0 Likes 0 ·