Markus Cueva avatar image
Markus Cueva posted Jeanette F commented

Kiva System Demo Model


This Kiva system demo model showcases some of the new AGV/AMR features that were added in FlexSim 2023, including new events and parameters to help with deadlock and allocation failure, and dynamic barrier management.

You can update the layout through five parameters, and then click the “Build” button to re-build the system.


amragv deadlockkiva model
· 8
5 |100000

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

Walker huang avatar image Walker huang commented ·

Hi Markus, is it possible to have tutorial videos share?

0 Likes 0 ·
Markus Cueva avatar image Markus Cueva ♦ Walker huang commented ·

Hi @Walker huang, if you haven't seen it already I highly recommend our recent Dev Talk video that covered Kiva systems modeling:

1 Like 1 ·
Walker huang avatar image Walker huang Markus Cueva ♦ commented ·

thank Markus! I had watched previously the video you shared.

0 Likes 0 ·
Show more comments
David Seo avatar image David Seo commented ·


I want to know more details about the event of in the line 69th 'await preemptAGV.te.event("OnAGVPreAllocate");'

The line is located in 'Route Around Deadlock' custom code activity of Deadlock / allocation failure shape.

I can't find the event explanation of 'event("OnAGVPreAllocate")'.

I want to know more details about it and it's doing.

Thank you.

0 Likes 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦ David Seo commented ·

It fires just before the allocation events as described here.

0 Likes 0 ·
SudheerReddy avatar image SudheerReddy commented ·


savedValues.push([cp, cp.routingConstraint]);

cp.routingConstraint = AGV.RoutingConstraint.Blocked;

In savedValues you are pushing cp.RoutingConstraint
then you are modifying cp.routingConstraint to AGV.RoutingConstraint.Blocked;

at line 33 there is await Delay.seconds(0);

line 37 int val = savedValues[i][2];

line 38 cp.routingConstraint = val;

Again you are over riding cp.routingConstraint to intial saved values which means you are removing Blocked

If we are overriding with initial value then why to keep cp.routingConstraint = AGV.RoutingConstraint.Blocked; ->What value this is adding


Above code is part of Block filled slots


0 Likes 0 ·
1695674468985.png (53.5 KiB)
1695675039113.png (11.0 KiB)
Jeanette F avatar image Jeanette F ♦♦ SudheerReddy commented ·

Hello @SudheerReddy,

This is a good question. This block of activities is triggered at the start of a travel task which is before the route for the Task Executer (TE) is calculated. This is where setting the dynamic barriers becomes important because then the routing constraints can be set. On line 33 in the code you will see an await delay command. This causes a coroutine to be created that will be executed at the end of the delay. This allows for other events at the same time to occur before finishing the custom code lines. In particular the TE will have calculated its path so the constraints can be removed from the control points.

0 Likes 0 ·



markus.cueva contributed to this article

Related Articles