JSPLib (cpmpy.tools.io.jsplib)

Loader for the JSPLib format.

More can be read about it here:

List of functions

load_jsplib

Loader for JSPLib format.

cpmpy.tools.io.jsplib.load_jsplib(jsp: str | PathLike | TextIO, open: Callable = <built-in function open>) Model[source]

Loader for JSPLib format. Loads an instance and returns its matching CPMpy model.

Parameters:
  • jsp (str or os.PathLike or TextIO) –

    • A file path to a JSPlib file, or

    • A string containing the JSPLib content directly, or

    • A TextIO object already open for reading

  • open (Callable) – If jsp is the path to a file, a callable to “open” that file (default=python standard library’s ‘open’).

Returns:

The CPMpy model of the JSPLib instance.

Return type:

cp.Model