Performance question

Performance question

sebastian_hemmannE3JAU
Collaborator Collaborator
207 Views
10 Replies
Message 1 of 11

Performance question

sebastian_hemmannE3JAU
Collaborator
Collaborator

[ FlexSim 23.1.3 ]

Hi,


one of our customers approached us and asked if we could provide any tips on how to improve the performance/responsiveness when building a very large model.

There goal is to simulate a rail yard, including truck traffic. Both the trains and trucks run on AGV networks. The model currently clocks in at just below 10000 objects, mostly AGV paths and control points.

Adding and adjusting additional objects feels very sluggish at this point. Is there anything one can do to improve the responsiveness of such a large model?

One option we tested was moving most objects from the model node into a subnode of the main tree. This does work to improve the model responsiveness and in a quick test we didn't notice any adverse effects from doing this. But we still wanted to ask if we are likely to break something by moving objects out of and into the model like that?

And if you see any other things we could try?

Accepted solutions (1)
208 Views
10 Replies
Replies (10)
Message 2 of 11

jason_lightfootVL7B4
Autodesk
Autodesk
Accepted solution

What hardware are they using? A better graphics card might improve things - maybe Phil can tell us if a Quadro class would help with drawing so many line segments.

I would recommend putting the paths and control points inside a number of planes/containers and then you can set those as the viewfocus and only see the objects inside the plane - allowing you have good draw speed and edit the layout easily. (right click the plane and select View->Down). You can store the container view in Model Views as you would any other viewpoint.


You could also maybe build a number of smaller models containing just sections at the correct locations (based on a large CAD layout that is in the same position in each model) and then merge or reconstruct it in the main model by transferring the definition either through xml model maps and files or using the Properties tables. This way you can disable the drawing of the AGV nework in the main model entirely (except maybe to check the merge/reconstruction worked).

Here's an example of using properties - this works in a small test model, but it should scale well.

To record the definition:

Table.query("SELECT * FROM Objects()").cloneTo(Table("ModelDefinition"));
Table("ModelDefinition").deleteCol(1);  //Object
Table.query("DELETE FROM ModelDefinition WHERE Name='AGVNetwork'");
Table.query("DELETE FROM ModelDefinition WHERE Name='FlexsimModelFloor'");
// maybe remove records of other 'system' objects like the ConveyorSystem etc.

Then after loading the definition table(s) into the main model, build it using:

Table t=Table("ModelDefinition");
string headerString="(";
string comma="";
for (int n=1;n<=t.numCols;n++){
    headerString+=comma+t.getColHeader(n);
    comma=",";
}
headerString+=") ";
Table.query("INSERT INTO Objects() "+headerString+" SELECT * FROM ModelDefinition");

At the moment this doesn't seem to preserve the connection types between control points or to fixed resources, but they could be read into a different table, and reconstructed as part of the script.

Test model attached.

SQLstore_rebuild_model.fsm

Message 3 of 11

JordanLJohnson
Autodesk
Autodesk

Often, sluggishness comes from the draw speed. With lots of objects, the frame rate slows down. Even object selection is a draw operation, since we draw to determine what the mouse is clicking on.

In some cases, the solution is to add groups of objects. Then write scripts that toggle the switch_hideshape and switch_hidecontents values for all the objects in that group. Then you can limit the view to only the parts of the model you want to work on.

.


Jordan Johnson
Principal Software Engineer
>

Message 4 of 11

jason_lightfootVL7B4
Autodesk
Autodesk

I ran this script to generate 2000 paths and 8000 Control points and once it's done it seems to draw okay. How is it for you?

for (int y=2000;y>0;y--){
    Object o=Object.create("AGV::StraightPath");
    o.setProperty("Location.Y",y);
    o.setProperty("Size.X",20);
    for (int x=16;x>0;x-=4){
        Object cp=Object.create("AGV::ControlPoint");
        cp.setProperty("Location",[x,y,0]);
    }
}
0 Likes
Message 5 of 11

sebastian_hemmannE3JAU
Collaborator
Collaborator

Hi @Jason Lightfoot and @Jordan Johnson , thanks for your fast reply.


The hardware question was one topic and we advised the client work on this. The current prefered solution will be to buy a stronger mobile workstation.

But we also tested the model on our PC´s and figured out that it runs a bit faster, but not really fast/ smooth.

This 2 GIFs should show how the handling looks even if we hide the 10.000 objects.

addpathfreshmodel.gif

Empty model

addpath10khiddenobjects.gif

10.000 hidden objects


.

So it seems that showing/ hidding objects is not the only option that has an effect!?

0 Likes
Message 6 of 11

joerg_vogel_HsH
Mentor
Mentor
Hello @Sebastian Hemmann,

I didn’t test it. But as I understand FlexSim correctly you can save portions of a tree in a treenode file. By this you can store not needed structures of a sub-treenode into a file and delete the content in your model tree. Probably this creates errors because coupling structure gets broken. But perhaps you test it yourself. You can restore the structure in the node from your file later.

0 Likes
Message 7 of 11

How is it when you add a plane and use that as the viewfocus while drawing your arc? (Right-click ->View->Down)
0 Likes
Message 8 of 11

sebastian_hemmannE3JAU
Collaborator
Collaborator

Hi Jason,

that does help immensely (model runs as though no other objects were present). Newly added paths from the library are added as subnodes of the AGVNetwork though, so they are not visible at first. But I guess that could be worked around by using a user library with a drop script that moves them into the plane or even adding them through the script console.

Thanks for the tip!

0 Likes
Message 9 of 11

It looks like if you drag them into the plane, rather than draw them you can see them but the handles to position them are not drawn. I think this is an oversight and will send a note into the developers.

There's a similar issue with conveyors but reversed - you can edit them when highlighted but they are not drawn.

0 Likes
Message 10 of 11

JordanLJohnson
Autodesk
Autodesk
I think each draw pass still has to loop over every object to determine whether it should be drawn or not. Another way to speed things up would be to place items in containers, and toggle the visibility of the container. If the container's switch_hidecontents() flag is set, then the draw pass doesn't have to visit any of the subnodes.
.


Jordan Johnson
Principal Software Engineer
>

0 Likes
Message 11 of 11

sebastian_hemmannE3JAU
Collaborator
Collaborator
@Jordan Johnson works perfect, thank you.
0 Likes