Skip to content

docs: add draft for maps service - #2672

Draft
TomCools wants to merge 2 commits into
TimefoldAI:mainfrom
TomCools:docs/map-service
Draft

TomCools wants to merge 2 commits into
TimefoldAI:mainfrom
TomCools:docs/map-service

Conversation

@TomCools

Copy link
Copy Markdown
Contributor

@rsynek, need your help pulling this over the finish line.

  • I left a few open TODOs or QUESTION's in the doc. If you could have a look and elaborate please?
  • I find myself switching between "maps extension" and "maps service". I have my own opinion, but I value yours.

@rsynek rsynek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @TomCools ! Sharing some initial feedback inline.

Comment thread docs/src/modules/ROOT/pages/running-timefold-solver/service/map-service.adoc Outdated
Comment thread docs/src/modules/ROOT/pages/running-timefold-solver/service/map-service.adoc Outdated
Comment thread docs/src/modules/ROOT/pages/running-timefold-solver/service/map-service.adoc Outdated
Comment on lines +368 to +384
Build the matrix yourself in the test fixture, using the same Haversine provider the platform uses
for its local computation:

[source,java]
----
import ai.timefold.solver.service.maps.haversine.impl.HaversineTravelTimeAndDistanceMatrixProvider;
import ai.timefold.solver.service.maps.service.test.api.TestDistanceCalculator;

private static final HaversineTravelTimeAndDistanceMatrixProvider PROVIDER =
new HaversineTravelTimeAndDistanceMatrixProvider(new ObjectMapper());

public static VehicleRoutePlan initDistanceMap(VehicleRoutePlan plan) {
TestDistanceCalculator.initDistanceMaps(plan.getLocations(), // <1>
PROVIDER::calculateDistance,
PROVIDER::calculateTravelTime);
return plan;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates the impression that you need both the Haversine and the TestDistanceCalculator together.

You don't and specifically for tests, I would advise against that: in tests, pretty, easily verifiable numbers are preferred. The TestDistanceCalculator is a stub that returns what you want:

https://github.com/TimefoldAI/timefold-field-service-routing/blob/main/src/test/java/ai/timefold/model/fieldservicerouting/solver/SolverTest.java#L113

https://github.com/TimefoldAI/timefold-field-service-routing/blob/main/src/test/java/ai/timefold/model/fieldservicerouting/solver/SolverRegressionTest.java#L76

This branch was successfully deployed

2 active deployments
documentation (preview) — d23e4754 Deployed Sep 23, 2026 by TomCools via Build Documentation #707
internal — d23e4754 Deployed Sep 23, 2026 by TomCools via approval_required #707
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants