Add Problem

Add a newly defined problem to the database.

Args: request (Problem): the JSON representation of the problem. user (Annotated[User, Depends): the current user. session (Annotated[Session, Depends): the database session.

Note: Users with the role 'guest' may not add new problems.

Raises: HTTPException: when any issue with defining the problem arises.

Returns: ProblemInfo: the information about the problem added.

post/problem/add

Request body

namestring required

Name of the problem.

descriptionstring required

Description of the problem.

scenario_keysstring[] nullable

Optional. The scenario keys defined for the problem. Each key will point to a subset of objectives, constraints, extra functions, and scalarization functions that have the same scenario key defined to them.If None, then the problem is assumed to not contain scenarios.

is_convexboolean nullable

Optional. Used to manually indicate if the problem, as a whole, can be considered to be convex. If set to None, this property will be automatically inferred from the respective properties of other attributes.

is_linearboolean nullable

Optional. Used to manually indicate if the problem, as a whole, can be considered to be linear. If set to None, this property will be automatically inferred from the respective properties of other attributes.

is_twice_differentiableboolean nullable

Optional. Used to manually indicate if the problem, as a whole, can be considered to be twice differentiable. If set to None, this property will be automatically inferred from the respective properties of other attributes.

Response

Successful Response

namestring required
descriptionstring required
is_convexboolean nullable required
is_linearboolean nullable required
is_twice_differentiableboolean nullable required
scenario_keysstring[] nullable required
variable_domain'continuous' | 'binary' | 'integer' | 'mixed' required

An enumerator for the possible variable type domains of a problem.

idinteger required
user_idinteger required

Changes