question

Sebastian Hemmann avatar image
1 Like"
Sebastian Hemmann asked Sebastian Hemmann commented

Performance question

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?

FlexSim 23.1.3
agvnetworkagv pathperformance
· 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.

Joerg Vogel avatar image Joerg Vogel commented ·
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 0 ·
Jason Lightfoot avatar image
1 Like"
Jason Lightfoot answered Sebastian Hemmann commented

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


· 7
5 |100000

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

Jason Lightfoot avatar image Jason Lightfoot ♦♦ commented ·

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 0 ·
Sebastian Hemmann avatar image Sebastian Hemmann Jason Lightfoot ♦♦ commented ·

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 0 ·
Jason Lightfoot avatar image Jason Lightfoot ♦♦ Sebastian Hemmann commented ·
How is it when you add a plane and use that as the viewfocus while drawing your arc? (Right-click ->View->Down)
0 Likes 0 ·
Show more comments
Show more comments
Jordan Johnson avatar image
2 Likes"
Jordan Johnson answered

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.

5 |100000

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