Closed GittyGenie closed 4 years ago
I think there's a web friendly version inside of 'src/solver.js'
An example of loading solver.js in the browser without require():
<script src="https://unpkg.com/javascript-lp-solver/prod/solver.js"></script>
<script>
var results,
model = {
optimize: "profit",
opType: "max",
constraints: {
"Costa Rican" : {max: 200},
"Etheopian": {max: 330}
},
variables: {
"Yusip": {"Costa Rican" : 0.5, "Etheopian": 0.5, profit: 3.5},
"Exotic": {"Costa Rican" : 0.25, "Etheopian": 0.75, profit: 4}
}
};
// note that "solver" will be a global variable so you don't need to require() it
results = solver.Solve(model);
console.log(results);
</script>
Hi, can jsLPSolver be used without using Node and just wrapped in a html page? Sorry if this is a dumb question, but the examples on the Readme use "require" not recognized by browser js. Thanks, Hoss