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.xml

<!-- Data file for `burglar2x.mos' -->
<BurgData>
  <Item name="camera">   <Value> 15</Value> <Weight> 2</Weight> </Item>
  <Item name="necklace"> <Value>100</Value> <Weight>20</Weight> </Item>
  <Item name="vase">     <Value> 90</Value> <Weight>20</Weight> </Item>
  <Item name="picture">  <Value> 60</Value> <Weight>30</Weight> </Item>
  <Item name="tv">       <Value> 40</Value> <Weight>40</Weight> </Item>
  <Item name="video">    <Value> 15</Value> <Weight>30</Weight> </Item>
  <Item name="chest">    <Value> 10</Value> <Weight>60</Weight> </Item>
  <Item name="brick">    <Value>  1</Value> <Weight>10</Weight> </Item>
</BurgData>

Back to examples browserPrevious exampleNext example