@feasbl/sdk
v1.0.0
Published
JavaScript builders and client utilities for Feasbl optimization models.
Readme
Feasbl JavaScript SDK
@feasbl/sdk provides JavaScript builders for Feasbl optimization inputs:
.jiamodels for CP and LP workflows- PDDL domain/problem files for planning workflows
- a small direct-submit client for the Feasbl API
Install
npm install git+ssh://[email protected]/Feasbl/feasbl-js.gitUse
import * as feasbl from "@feasbl/sdk";
const lp = feasbl.lp("production");
const chairs = lp.real("chairs", { min: 0 });
const tables = lp.real("tables", { min: 0 });
lp.maximize(lp.add(lp.mul(45, chairs), lp.mul(80, tables)));
lp.constraint("wood", lp.le(lp.add(lp.mul(2, chairs), lp.mul(4, tables)), 120));
console.log(lp.toJia());See examples/ for CP, LP, and planning examples.
Test
npm testCoverage
Coverage uses Node's built-in test runner with c8 instrumentation.
npm run coverageSmoketest
Submit a small model to the live API:
npm run smoketest -- <fsbl_api_key>The target can be overridden with FEASBL_API_BASE_URL,
FEASBL_COMPUTE_TIER_ID, or FEASBL_TIME_LIMIT_S.
