Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ai.timefold.solver.service.definition.impl.enrichment;

/**
* Stores the resolved map region during the enrichment phase to be sent over to the Platform later.
*/
public final class MapEnrichmentContext {

private String resolvedMapLocation;

public void setResolvedMapLocation(String location) {
resolvedMapLocation = location;
}

public String getResolvedMapLocation() {
return this.resolvedMapLocation;
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package ai.timefold.solver.service.definition.impl.storage;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;
import jakarta.inject.Inject;

Expand All @@ -10,6 +11,7 @@
/**
* Produces StorageObjectMapper instances with storage-specific (de)serialization settings.
*/
@ApplicationScoped
Comment thread
triceo marked this conversation as resolved.
public class StorageObjectMapperProducer {

private ObjectMapper quarkusObjectMapper;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
"extension": "revapi.differences",
"configuration": {
"differences": [

{
"ignore": true,
"code": "java.method.parameterTypeChanged",
"old": "parameter void ai.timefold.solver.service.maps.service.client.api.TravelTimeMatrixEnricher::<init>(ai.timefold.solver.service.maps.service.client.api.MapService, ai.timefold.solver.service.maps.service.client.impl.MapServiceOptionsSupplier, ===ai.timefold.solver.service.definition.internal.MapEnrichmentContext===, java.lang.Boolean)",
"new": "parameter void ai.timefold.solver.service.maps.service.client.api.TravelTimeMatrixEnricher::<init>(ai.timefold.solver.service.maps.service.client.api.MapService, ai.timefold.solver.service.maps.service.client.impl.MapServiceOptionsSupplier, ===ai.timefold.solver.service.definition.impl.enrichment.MapEnrichmentContext===, java.lang.Boolean)",
"parameterIndex": "2",
"justification": "TravelTimeMatrixEnricher constructor does not belong to a public API."
Comment thread
rsynek marked this conversation as resolved.
}
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import jakarta.inject.Inject;

import ai.timefold.solver.service.definition.api.enrichment.SolverModelEnricher;
import ai.timefold.solver.service.definition.internal.MapEnrichmentContext;
import ai.timefold.solver.service.definition.impl.enrichment.MapEnrichmentContext;
import ai.timefold.solver.service.definition.internal.error.ErrorCodes;
import ai.timefold.solver.service.definition.internal.error.TimefoldRuntimeException;
import ai.timefold.solver.service.maps.api.DistanceMatrix;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package ai.timefold.solver.service.maps.service.client.impl.enrichment;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.inject.Produces;

import ai.timefold.solver.service.definition.impl.enrichment.MapEnrichmentContext;

@ApplicationScoped
public class MapEnrichmentContextProducer {

@Produces
@ApplicationScoped
public MapEnrichmentContext produceMapEnrichmentContext() {
return new MapEnrichmentContext();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import jakarta.inject.Inject;

import ai.timefold.solver.service.definition.internal.MapEnrichmentContext;
import ai.timefold.solver.service.definition.impl.enrichment.MapEnrichmentContext;
import ai.timefold.solver.service.maps.api.model.Location;
import ai.timefold.solver.service.maps.api.model.travel.TravelDistance;
import ai.timefold.solver.service.maps.api.model.travel.TravelTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

import ai.timefold.solver.core.api.domain.solution.ConstraintWeightOverrides;
import ai.timefold.solver.core.api.score.HardSoftScore;
import ai.timefold.solver.service.definition.internal.MapEnrichmentContext;
import ai.timefold.solver.service.definition.impl.enrichment.MapEnrichmentContext;
import ai.timefold.solver.service.definition.internal.error.TimefoldRuntimeException;
import ai.timefold.solver.service.maps.api.DistanceMatrix;
import ai.timefold.solver.service.maps.api.model.Location;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
import ai.timefold.solver.service.definition.api.validation.ModelValidator;
import ai.timefold.solver.service.definition.api.validation.ValidationBuilder;
import ai.timefold.solver.service.definition.api.validation.dto.ValidationResult;
import ai.timefold.solver.service.definition.internal.MapEnrichmentContext;
import ai.timefold.solver.service.definition.impl.enrichment.MapEnrichmentContext;
import ai.timefold.solver.service.definition.internal.error.ErrorCodes;
import ai.timefold.solver.service.definition.internal.error.ItemNotFoundException;
import ai.timefold.solver.service.definition.internal.error.TimefoldRuntimeException;
Expand Down Expand Up @@ -183,7 +183,7 @@ public SolverWorker(@ConfigProperty(name = "timefold.model.name") Optional<Strin
ModelConvertorBase modelConvertor,
SolverModelEnricherService enricherService,
SolverModelEnrichmentDirectorService enrichmentDirectorService,
MapEnrichmentContext mapEnrichmentContext,
Instance<MapEnrichmentContext> mapEnrichmentContext,
TerminationService terminationService,
ShutdownExecutor shutdownExecutor,
ShutdownOnTerminate shutdownOnTerminate,
Expand All @@ -210,7 +210,8 @@ public SolverWorker(@ConfigProperty(name = "timefold.model.name") Optional<Strin
this.modelConvertor = (ModelConvertor) modelConvertor;
this.enricherService = enricherService;
this.enrichmentDirectorService = enrichmentDirectorService;
this.mapEnrichmentContext = mapEnrichmentContext;
this.mapEnrichmentContext =
mapEnrichmentContext.isResolvable() ? mapEnrichmentContext.get() : new MapEnrichmentContext();
Comment thread
rsynek marked this conversation as resolved.
this.terminationService = terminationService;
this.shutdownExecutor = shutdownExecutor;
this.shutdownOnTerminate = shutdownOnTerminate;
Expand Down
Loading