problem = {
return {
name: "LP",
objective: {
direction: glpk.GLP_MAX,
name: "obj",
vars: [
{ name: "a", coef: 1.0 },
{ name: "b", coef: r1 }
]
},
subjectTo: [
{
name: "cons0",
vars: [
{ name: "a", coef: 1.0 },
{ name: "b", coef: -1.0 }
],
bnds: { type: glpk.GLP_LO, lb: 0.0 }
},
{
name: "cons1",
vars: [{ name: "a", coef: 1.0 }],
bnds: { type: glpk.GLP_LO, lb: 0.0 }
},
{
name: "cons2",
vars: [{ name: "b", coef: 1.0 }],
bnds: { type: glpk.GLP_LO, lb: 0.0 }
},
{
name: "cons3",
vars: [
{ name: "a", coef: 0.25 },
{ name: "b", coef: 0.14 }
],
bnds: { type: glpk.GLP_UP, ub: 1.0 }
},
{
name: "cons4",
vars: [
{ name: "a", coef: 0.4 },
{ name: "b", coef: 0.12 }
],
bnds: { type: glpk.GLP_UP, ub: 1.0 }
}
]
};
}