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

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
objectivesObjectiveDB[] required— unresolved $ref
constraintsConstraintDB[] nullable required— unresolved $ref
extra_funcsExtraFunctionDB[] nullable required— unresolved $ref
simulatorsSimulatorDB[] nullable required— unresolved $ref

Changes