![]() |
Google OR-Tools v9.14
a fast and portable software suite for combinatorial optimization
|
Conversion functions for MathOpt protos. Provides several conversion functions to transform from/to protos exposed in the Operations Research API to the internal protos in /ortools/math_opt/.*.proto.
Functions | |
| optimization_pb2.SolveMathOptModelRequest | convert_request (rpc_pb2.SolveRequest request) |
| rpc_pb2.SolveResponse | convert_response (optimization_pb2.SolveMathOptModelResponse api_response) |
Variables | |
| tuple | _UNSUPPORTED_SOLVER_SPECIFIC_PARAMETERS |
| optimization_pb2.SolveMathOptModelRequest ortools.math_opt.python.ipc.proto_converter.convert_request | ( | rpc_pb2.SolveRequest | request | ) |
Converts a `SolveRequest` to a `SolveMathOptModelRequest`.
Args:
request: A `SolveRequest` request built from a MathOpt model.
Returns:
A `SolveMathOptModelRequest` for the Operations Research API.
Raises:
ValueError: If a field that is not supported in the expernal proto is
present in the request or if the request can't be parsed to a
`SolveMathOptModelRequest`.
Definition at line 37 of file proto_converter.py.
| rpc_pb2.SolveResponse ortools.math_opt.python.ipc.proto_converter.convert_response | ( | optimization_pb2.SolveMathOptModelResponse | api_response | ) |
Converts a `SolveMathOptModelResponse` to a `SolveResponse`.
Args:
api_response: A `SolveMathOptModelResponse` response built from a MathOpt
model.
Returns:
A `SolveResponse` response built from a MathOpt model.
Definition at line 69 of file proto_converter.py.
|
protected |
Definition at line 26 of file proto_converter.py.