Docs
  • Solver
  • Models
    • Field Service Routing
    • Employee Shift Scheduling
    • Pick-up and Delivery Routing
  • Platform
Try models
  • Pick-up and Delivery Routing
  • User guide
  • Input datasets
  • Model configuration

Pick-up and Delivery Routing

    • Introduction
    • Getting started: Hello world
    • User guide
      • Terminology
      • Use case guide
      • Planning AI concepts
      • Integration
      • Constraints
      • Understanding the API
      • Demo datasets
      • Input datasets
        • Model configuration
        • Model input
        • Planning window
      • Input validation
      • Output datasets
        • Metadata
        • Model output
        • Input metrics
        • Key performance indicators (KPIs)
      • Routing with Timefold’s maps service
      • Metrics and optimization goals
    • Driver resource constraints
      • Lunch breaks and personal appointments
      • Route optimization
      • Shift hours and overtime
    • Job service constraints
      • Time windows and opening hours
      • Skills
      • Movable stops and multi-day schedules
      • Dependencies between stops
      • Priority jobs and optional jobs
      • Stop service level agreement (SLA)
      • Job requirements and tags
        • Job required drivers
        • Job pooling
        • Prohibit job combinations
        • Maximum time burden
        • Driver capacity
        • Tags
    • Recommendations
      • Job time window recommendations
      • Stop time window recommendations
    • Real-time planning
      • Real-time planning: pinning stops
    • Changelog
    • Upgrading to the latest versions
    • Feature requests

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.

  • spentLimit sets the maximum duration (in ISO 8601 duration format) for solving a dataset.

  • unimprovedSpentLimit sets 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, stepCountLimit must be empty. Warning: using this option will disable the default diminished returns termination which is recommended for most use cases

  • stepCountLimit sets 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, unimprovedSpentLimit must 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,
        "maximumTimeBurden": "P1D"
      }
    }
  }
}
Replace exampleConstraintWeight with the constraint weights you want to configure.

For information about configuring constraint weights, see the Constraints documentation.

maximumTimeBurden limits how much time a job can take between stops above the optimum for the route. See Maximum time burden for more details.

Next

  • See the full API spec or try the online API.

  • Learn about the Model input.

  • Learn about configuration parameters and profiles.

  • © 2026 Timefold BV
  • Timefold.ai
  • Documentation
  • Changelog
  • Send feedback
  • Privacy
  • Legal
    • Light mode
    • Dark mode
    • System default