Public
Edited
Oct 25, 2023
11 stars
Also listed in…
Operations Research
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
mutable supply = ({
'Seattle': 350,
'San-Diego': 600
})
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
model = sets + supplyDemand + distances + costs + equations
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
listing.solves.length // this will output the number of solves found in our listing file
Insert cell
Insert cell
objective = listing.solves[0].objective // we get the objective value of the 0th position in the solves array
Insert cell
Insert cell
Insert cell
Insert cell
table(
listing
.get('x')
.filter(r => r.level) // only show elements that have a value -> non-zero elements
.map(row => {
return {
'No. of cases': md`**${row.level}**`,
Route: md`**${row.domain.join(' to ')}**`
};
})
)
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
NEOS = require('neos-js@0.1.2/dist/neos.min.js')
Insert cell
Insert cell
gams = require('gams2js@0.0.2/dist/gams2js.min.js')
Insert cell
Insert cell
Chart = {
const Chart = (window.Chart = await require("https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.9.4/Chart.bundle.js"));
await require("https://cdn.jsdelivr.net/npm/chartjs-plugin-dragdata@1.1.3/dist/chartjs-plugin-dragdata.min.js").catch(
() => {}
);

return Chart;
}
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more