Skip to content

Arrays

An array is a grid of values that belongs to the whole model, for when a single variable is not enough: a table of setup times, a matrix of travel distances between locations, a price list by product number. Like a variable an array is global; unlike a variable it holds many values that you reach by position.

Define arrays in the Logic Builder on the Arrays tab.

The Arrays tab in the Logic Builder

  • Name: prefixed r_, for example r_SetupTime.
  • Type: Integer, Real, Date, or Descriptive.
  • Dimensions: an array can be one, two, or three dimensional. Set the size of each dimension you use and leave the others at zero: a single row of ten is 10, a ten-by-five grid is 10 × 5.
  • Initial: a starting value applied to every cell.
  • Statistics: track how the cells change during the run for the Arrays report.

You can also import an array’s contents from a file (Excel or CSV) instead of typing them in, which is the easy way to load a large lookup table.

Read or write a cell by its position in logic and expressions, for example a setup time looked up by the product number. After a run, the Arrays report shows each array’s size, how many cells were used, and its value range, with a drill-down into the contents and their changes.