FICO
FICO Xpress Optimization Examples Repository
FICO Optimization Community FICO Xpress Optimization Home
Back to examples browserPrevious exampleNext example

Working with records

Description
  • defining records and arrays of records
  • accessing record fields
  • assigning values to record fields
  • initialization with data from file
  • defining records of records (recorddef2.mos)
  • selecting record fields in initializations (recorddef2.mos)
Further explanation of this example: 'Mosel User Guide', Section 8.6 Records


Source Files
By clicking on a file name, a preview is opened at the bottom of this page.
recorddef.mos[download]
recorddef2.mos[download]

Data Files





recorddef2.dat

! Data file for 'recorddef2.mos'

B: [(1) ['A1' [(2) 2 (3) 3 (4) 4] ] 
    (3) ['A3' [(3) 6 (6) 9] ]
    (4) ['A4' [5 6 7 8] ]
    (7) ['A7']               ! Define just the first field
    (6) [* [(6) 6] ]         ! Skip the first field
   ] 

C: [(1) 1 (2) 2 (3) 3 (4) 4 (5) 5 (6) 6 (7) 7 (8) 8]

D: [(1) 'A1' (2) 'A2' (3) 'A3' (8) 'A8']

E: [(2) 11 12 13 14 15 16 17]

F: [(2) [(4) 21 22 23 24 25]]

Back to examples browserPrevious exampleNext example