Jump to content

Use for loop to traverse members of a list


GHao

Recommended Posts

  • 7 months later...

You can create a new object reference state variable in vector format then assign object reference to the any row of this array using assign step. When choose your vector type variable Simio will let you enter the row number as well in the assign step as seen in figure below.

When you want to refer to second row of a vector type state variable use the following syntax:
ObjectReferenceState1[2]

When you want to refer to second row and third coloumn of a matrix based variable use the following syntax:
ObjectReferenceState1[2,3]

That is inside the squared brackets, first value indicates row and second value indicates coloumn index of the variable.

Then you can use loop to increment a token based variable and decide step to search a vector type variable. But I suggest creating a table for these objects and using search step as well.

image.png.f80d2c909074b577236f28297448f41a.png

Link to comment
Share on other sites

×
×
  • Create New...