Create a solution
post
/fscmRestApi/constraintProblem/solve
Request
There are no request parameters for this operation.
Supported Media Types
- application/json
Root Schema : schema
Type:
object
ACT Modeling Language (AML) format constraint problem specification
Show Source
-
input: array
input
Input data default values that are used globally in the problem specification.
-
model(required): array
model
Declarations that indicate the solver model artifacts, including variables and constraints.
-
name(required): string
Name of the constraint problem.Example:
NQueens
-
output: array
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: array
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: array
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: array
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();"
]
Response
Supported Media Types
- application/json
200 Response
Successful Operation
Root Schema : Solution
Type:
object
Attribute name and value pair that indicate the status of the action.
Show Source
-
value: object
value
Value of the attribute.
-
varName: string
Name of the model attribute.
Example:
{
"varName":"result",
"value":[
1,
5,
8,
6,
3,
7,
2,
4
]
}
204 Response
No Solution Returned
400 Response
Bad Request