Create a solution

post

/fscmRestApi/constraintProblem/solve

Request

There are no request parameters for this operation.

Supported Media Types
Request Body - application/json ()
Root Schema : schema
Type: object
ACT Modeling Language (AML) format constraint problem specification
Show Source
  • input
    Input data default values that are used globally in the problem specification.
  • model
    Declarations that indicate the solver model artifacts, including variables and constraints.
  • Name of the constraint problem.
    Example: NQueens
  • output
    Describes the result of an action. It consists of a set of singleton and collection objects defined on expressions referencing solver attributes. This attribute is a mapping of name and value pairs. The default value is all attributes, organized by the attribute declarations.
  • parameters
    Settings that indicate how the problem is run. Examples include seed, restart fail limit, search fail limit, search options, the number or runs, a search time, and logging information.
  • searchPreferences
    Declarations that indicate the search decisions and attribute or value preferences. The specifications can reference common expressions, static expressions, and attributes that are defined in the model and input attributes.
  • solution
    Describes the action to be performed with the created model. Examples include satisfy(), minimize(obj) and maximize(obj). This attribute is optional. The default action is satisfy().
Example:
{
    "name":"NQueens",
    "input":[
        "int size = 8;"
    ],
    "model":[
        "intVar[size] vars in [1..size];",
        "intVar sum in [1..1000];",
        "constraint allDifferent(vars);",
        "constraint sum == sum(vars);",
        "for i in [0..size-1], j in [0..i-1]  {",
        "  constraint vars[i] != vars[j];",
        "  constraint vars[i] + i != vars[j] + j;",
        "  constraint vars[i] - i != vars[j] - j;",
        "}"
    ],
    "output":[
        "result = vars;"
    ]
}
Nested Schema : input
Type: array
Input data default values that are used globally in the problem specification.
Show Source
Example:
[
    "int size = 8;"
]
Nested Schema : model
Type: array
Declarations that indicate the solver model artifacts, including variables and constraints.
Show Source
Example:
[
    "intVar[size] vars in [1..size];",
    "intVar sum in [1..1000];",
    "constraint allDifferent(vars);",
    "constraint sum == sum(vars);",
    "for i in [0..size-1], j in [0..i-1]  {",
    "  constraint vars[i] != vars[j];",
    "  constraint vars[i] + i != vars[j] + j;",
    "  constraint vars[i] - i != vars[j] - j;",
    "}"
]
Nested Schema : output
Type: array
Describes the result of an action. It consists of a set of singleton and collection objects defined on expressions referencing solver attributes. This attribute is a mapping of name and value pairs. The default value is all attributes, organized by the attribute declarations.
Show Source
Example:
[
    "result = vars;"
]
Nested Schema : parameters
Type: array
Settings that indicate how the problem is run. Examples include seed, restart fail limit, search fail limit, search options, the number or runs, a search time, and logging information.
Show Source
Example:
[
    "<TBD>"
]
Nested Schema : searchPreferences
Type: array
Declarations that indicate the search decisions and attribute or value preferences. The specifications can reference common expressions, static expressions, and attributes that are defined in the model and input attributes.
Show Source
Example:
[
    "order(high, MIN_FIRST);",
    "search(high, FIRST_UNBOUND);",
    "nearest(med, medDayOfMachine);",
    "search(low, FIRST_UNBOUND);",
    "order(low, MAX_FIRST);",
    "search(low, FIRST_UNBOUND);"
]
Nested Schema : solution
Type: array
Describes the action to be performed with the created model. Examples include satisfy(), minimize(obj) and maximize(obj). This attribute is optional. The default action is satisfy().
Show Source
Example:
[
    "satisfy();"
]
Back to Top

Response

Supported Media Types

200 Response

Successful Operation
Body ()
Root Schema : Solution
Type: object
Attribute name and value pair that indicate the status of the action.
Show Source
Example:
{
    "varName":"result",
    "value":[
        "1",
        "5",
        "8",
        "6",
        "3",
        "7",
        "2",
        "4"
    ]
}
Nested Schema : value
Type: object
Value of the attribute.
Show Source

204 Response

No Solution Returned

400 Response

Bad Request
Back to Top