Model configuration
The model configuration config object of the input dataset includes the run and model objects.
1. Run
In the run object you can specify a name for the dataset, the termination settings to be applied to the dataset, the maxThreadCount, and tags to be applied to the dataset:
{
"config": {
"run": {
"name": "Dataset name",
"termination": {
"spentLimit": "PT30M",
"unimprovedSpentLimit": "PT3M",
"stepCountLimit": 0
},
"maxThreadCount": 1,
"tags": [
"Control"
]
}
}
}
Termination settings can be specified per dataset to override the termination settings in the configuration profile.
-
spentLimitsets the maximum duration (in ISO 8601 duration format) for solving a dataset. -
unimprovedSpentLimitsets the maximum duration (in ISO 8601 duration format) for a solving a dataset since the dataset score improved. If no value is provided, the default diminished returns termination will apply. If set,stepCountLimitmust be empty. Warning: using this option will disable the default diminished returns termination which is recommended for most use cases -
stepCountLimitsets the maximum solver step count for solving a dataset. The solver will stop solving after a pre-determined amount of steps. Use when you require results independently of the hardware resources performance. Use this termination if you want to benchmark your models, not recommended for production use. If set,unimprovedSpentLimitmust be empty. Warning: using this option will disable the default diminished returns termination which is recommended for most use cases.
| Diminished returns terminates the solver early if expected improvements are minimal, saving on CPU costs. This termination is desirable since it terminates based on the relative rate of improvement, and behaves similarly on different hardware and different problem instances. You can find more details in the documentation. |
Learn more about termination settings.
Thread Count: The default number of threads used for solving is 1.
maxThreadCount can be used to specify a maximum number of threads to use.
| The maximum number of available threads is determined by the model and by the tenant plan. |
Tags are applied to the dataset and allow you to filter your datasets in the Timefold Platform UI based on tags. Tags are helpful for organizing your datasets to represent different segments of your data, for instance, different regions or departments.
Learn more about tags and searching and categorizing datasets for auditability.
2. Model
The model object contains configuration overrides for individual (soft) constraints weights and additional global model configuration attributes:
{
"config": {
"model": {
"overrides": {
"exampleConstraintWeight": 0
}
}
}
}
Replace exampleConstraintWeight with the constraint weights you want to configure.
|
For information about configuring constraint weights, see the Constraints documentation.
Next
-
See the full API spec or try the online API.
-
Learn more about employee shift scheduling from our YouTube playlist.
-
Learn about the Model input.
-
Learn about configuration parameters and profiles.