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

Burglar - Data source access from Mosel models

Description
  • burglar.mos - data in the model, integer indices
  • burglari.mos - data in the model, string indices
  • burglar2.mos, burglar.dat - reading data from a text file
  • burglar2o.mos, burglar.mdb, burglar.sqlite - reading data with mmodbc.odbc
  • burglar2sql.mos, burglar.sqlite - reading data from SQLite, using SQL or ODBC
  • burglar2e.mos, burglar.xls - reading data with mmsheet.excel (Windows only)
  • burglar2dd.mos, burglardd.dat - reading data with mmetc.diskdata
  • burglar2ff.mos, burglarff.dat - reading data in free format
  • burglar2x.mos, burglar.xml - reading data in XML format
  • burglar2j.mos, burglar.json - reading data in JSON format
Further explanation of this example: Whitepaper 'Generalized file handling in Mosel', Sections 3 Example problem and 4 Data source access from Mosel models

burgdatamos.zip[download all files]

Source Files

Data Files





burglar.json

{
  "Item": [
    {"Name":"camera",   "Value": 15, "Weight": 2},
    {"Name":"necklace", "Value":100, "Weight":20},
    {"Name":"vase",     "Value": 90, "Weight":20},
    {"Name":"picture",  "Value": 60, "Weight":30},
    {"Name":"tv",       "Value": 40, "Weight":40},
    {"Name":"video",    "Value": 15, "Weight":30},
    {"Name":"chest",    "Value": 10, "Weight":60},
    {"Name":"brick",    "Value":  1, "Weight":10} ]
}

Back to examples browserPrevious exampleNext example