CP-SAT - Schema Viewer

Problem: inspect the protobuf schemas embedded in the WebAssembly package so raw model structures are easier to understand.

Show code
import { CpSat } from 'or-tools-wasm/cp-sat';

const schemas = await CpSat.getSchemas();
console.log(schemas.cp_model);
console.log(schemas.sat_parameters);

This demo calls the WASM exports that expose the embedded cp_model.proto and sat_parameters.proto schemas and prints their contents.

Model

  • The schemas describe the protobuf messages accepted by the low-level CP-SAT APIs.
  • CpModelProto defines variables, constraints, objectives, and search hints.
  • SatParameters defines solver configuration such as time limits and workers.
  • The viewer helps inspect the raw proto surface used by playground and fixture code.

CpModelProto

SatParameters