Skip to content

Commit

Permalink
Merge branch 'master' into gpkg-support
Browse files Browse the repository at this point in the history
  • Loading branch information
nkuehnel authored Mar 7, 2024
2 parents 18a9893 + f5ba881 commit 3f11a92
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public List<TripCandidate> chooseModes(Person person, List<DiscreteModeChoiceTri
TourCandidate candidate = estimator.estimateTour(person, tourModes, tourTrips, tourCandidates);

if (!Double.isFinite(candidate.getUtility())) {
logger.warn(buildIllegalUtilityMessage(tripIndex, person));
logger.warn(buildIllegalUtilityMessage(tripIndex, person, candidate));
continue;
}

Expand Down Expand Up @@ -173,9 +173,11 @@ private String buildFallbackMessage(int tripIndex, Person person, String appendi
tripIndex, person.getId().toString(), appendix);
}

private String buildIllegalUtilityMessage(int tripIndex, Person person) {
private String buildIllegalUtilityMessage(int tripIndex, Person person, TourCandidate candidate) {
TripCandidate trip = candidate.getTripCandidates().get(tripIndex);

return String.format(
"Received illegal utility for for tour starting at trip %d of agent %s. Continuing with next candidate.",
tripIndex, person.getId().toString());
"Received illegal utility for for tour starting at trip %d (%s) of agent %s. Continuing with next candidate.",
tripIndex, trip.getMode(), person.getId().toString());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public List<TripCandidate> chooseModes(Person person, List<DiscreteModeChoiceTri
TripCandidate candidate = estimator.estimateTrip(person, mode, trip, tripCandidates);

if (!Double.isFinite(candidate.getUtility())) {
logger.warn(buildIllegalUtilityMessage(tripIndex, person));
logger.warn(buildIllegalUtilityMessage(tripIndex, person, candidate));
continue;
}

Expand Down Expand Up @@ -139,8 +139,8 @@ private String buildFallbackMessage(int tripIndex, Person person, String appendi
person.getId().toString(), appendix);
}

private String buildIllegalUtilityMessage(int tripIndex, Person person) {
return String.format("Received illegal utility for trip %d of agent %s. Continuing with next candidate.",
tripIndex, person.getId().toString());
private String buildIllegalUtilityMessage(int tripIndex, Person person, TripCandidate candidate) {
return String.format("Received illegal utility for trip %d (%s) of agent %s. Continuing with next candidate.",
tripIndex, candidate.getMode(), person.getId().toString());
}
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.matsim.utils.objectattributes.attributeconverters;
package org.matsim.utils.objectattributes;

import java.util.LinkedHashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.type.MapType;
import com.fasterxml.jackson.databind.type.TypeFactory;
import org.matsim.utils.objectattributes.StringDoubleMap;

public class StringDoubleMapConverter implements AttributeConverter<StringDoubleMap> {
private static final Logger LOG = LogManager.getLogger(StringDoubleMapConverter.class);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-bom</artifactId>
<version>4.0.4</version>
<version>4.0.5</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down

0 comments on commit 3f11a92

Please sign in to comment.