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": "P1D",
"unimprovedSpentLimit": "P1D",
"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,
"visitCompletionRiskMinimalTimeToShiftEnd": "PT4H",
"visitCompletionRiskMinimalPriority": "6",
"travelTimeAdjustment": {
"multiplier": 1,
"extraTime": "P1D"
},
"priorityWeights": [
{
"priority": "string",
"weight": 0
}
],
"defaultTechnicianRating": 0,
"minimizeWaitingTimeWeight": 0,
"minimizeVisitsOutsidePreferredArea": 0
}
}
}
}
Replace exampleConstraintWeight with the constraint weights you want to configure.
|
For information about configuring constraint weights, see the Constraints documentation.
-
visitCompletionRiskMinimalTimeToShiftEndmakes it possible to avoid scheduling high priority visits late in the day to avoid the possibility of having to reschedule the visit if the technician is late finishing other visits. See the Priority visits and optional visits for more details. -
visitCompletionRiskMinimalPrioritysets the minimum priority level to consider for visit completion risk. See the Priority visits and optional visits for more details. -
travelTimeAdjustmentcan be defined to implement a "buffer" to allow for unexpected traffic delays or long parking time when traveling. The travel time adjustment is configured as a function for every route between any two locations as follows:
adjustedTravelTime = multiplier * mapTravelTime + extraTime-
mapTravelTimeis the travel time obtained from a map service, -
multiplierThe coefficient to multiply the original travel time obtained from a map service with. Must be greater than zero (typically will be greater than 1 to make the travel time longer). The default value is 1.0. -
extraTimeThe additional time to add to the original travel time obtained from a map service. Must be positive or zero duration. The default value is "PT0S" (zero duration).
-
-
priorityWeightssets custom priorities for visits. See the Priority visits and optional visits for more details. -
defaultTechnicianRatingsets a default technician rating. See Technician ratings for more details.
Next
-
See the full API spec or try the online API.
-
Learn more about field service routing from our YouTube playlist.
-
Learn about the Model input.
-
Learn about configuration parameters and profiles.