diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000000..04281ecd9a7 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,7 @@ +# https://help.github.com/articles/about-codeowners/ +# +# These owners will be the default owners for everything in +# the repo. Unless a later match takes precedence, +# mentioned account names will be requested for +# review when someone opens a pull request. +* @moia-dev/mobility-analytics diff --git a/.github/workflows/code-coverage.yaml b/.github/workflows/code-coverage.yaml index bdf0d7bfcde..8a7054763c5 100644 --- a/.github/workflows/code-coverage.yaml +++ b/.github/workflows/code-coverage.yaml @@ -26,7 +26,7 @@ jobs: run: mvn verify -P jacoco --batch-mode --also-make --projects matsim -Dmaven.test.redirectTestOutputToFile -Dmatsim.preferLocalDtds=true - name: Push coverage to CodeCov - uses: codecov/codecov-action@v3 + uses: codecov/codecov-action@v4 with: files: ./matsim/target/site/jacoco/jacoco.xml diff --git a/contribs/dvrp/src/main/java/org/matsim/contrib/dvrp/passenger/DefaultPassengerEngine.java b/contribs/dvrp/src/main/java/org/matsim/contrib/dvrp/passenger/DefaultPassengerEngine.java index 7e11e5e8dd8..7406ceaa359 100644 --- a/contribs/dvrp/src/main/java/org/matsim/contrib/dvrp/passenger/DefaultPassengerEngine.java +++ b/contribs/dvrp/src/main/java/org/matsim/contrib/dvrp/passenger/DefaultPassengerEngine.java @@ -53,6 +53,8 @@ public final class DefaultPassengerEngine implements PassengerEngine, PassengerRequestRejectedEventHandler { private final String mode; + private final Set departureModes; + private final MobsimTimer mobsimTimer; private final EventsManager eventsManager; @@ -79,9 +81,10 @@ public final class DefaultPassengerEngine implements PassengerEngine, PassengerR private final Map, List> groupDepartureStage = new LinkedHashMap<>(); - DefaultPassengerEngine(String mode, EventsManager eventsManager, MobsimTimer mobsimTimer, PassengerRequestCreator requestCreator, + DefaultPassengerEngine(String mode, Set departureModes, EventsManager eventsManager, MobsimTimer mobsimTimer, PassengerRequestCreator requestCreator, VrpOptimizer optimizer, Network network, PassengerRequestValidator requestValidator, AdvanceRequestProvider advanceRequestProvider, PassengerGroupIdentifier passengerGroupIdentifier) { this.mode = mode; + this.departureModes = departureModes; this.mobsimTimer = mobsimTimer; this.requestCreator = requestCreator; this.optimizer = optimizer; @@ -197,7 +200,7 @@ public void afterSim() { @Override public boolean handleDeparture(double now, MobsimAgent agent, Id fromLinkId) { - if (!agent.getMode().equals(mode)) { + if (!departureModes.contains(agent.getMode())) { return false; } @@ -285,8 +288,12 @@ public void handleEvent(PassengerRequestRejectedEvent event) { rejectedRequestsEvents.add(event); } } - + public static Provider createProvider(String mode) { + return createProvider(mode, Collections.singleton(mode)); + } + + public static Provider createProvider(String mode, Set departureModes) { return new ModalProviders.AbstractProvider<>(mode, DvrpModes::mode) { @Inject private EventsManager eventsManager; @@ -296,7 +303,7 @@ public static Provider createProvider(String mode) { @Override public DefaultPassengerEngine get() { - return new DefaultPassengerEngine(getMode(), eventsManager, mobsimTimer, getModalInstance(PassengerRequestCreator.class), + return new DefaultPassengerEngine(getMode(), departureModes, eventsManager, mobsimTimer, getModalInstance(PassengerRequestCreator.class), getModalInstance(VrpOptimizer.class), getModalInstance(Network.class), getModalInstance(PassengerRequestValidator.class), getModalInstance(AdvanceRequestProvider.class), getModalInstance(PassengerGroupIdentifier.class)); } diff --git a/contribs/ev/src/main/java/org/matsim/contrib/ev/discharging/DriveDischargingHandler.java b/contribs/ev/src/main/java/org/matsim/contrib/ev/discharging/DriveDischargingHandler.java index 1f87d091b7b..cc0b601cdd6 100644 --- a/contribs/ev/src/main/java/org/matsim/contrib/ev/discharging/DriveDischargingHandler.java +++ b/contribs/ev/src/main/java/org/matsim/contrib/ev/discharging/DriveDischargingHandler.java @@ -41,6 +41,7 @@ import org.matsim.core.api.experimental.events.EventsManager; import org.matsim.core.events.MobsimScopeEventHandler; import org.matsim.core.mobsim.qsim.InternalInterface; +import org.matsim.core.mobsim.qsim.QSim; import org.matsim.core.mobsim.qsim.interfaces.MobsimEngine; import org.matsim.vehicles.Vehicle; @@ -77,9 +78,10 @@ private boolean isOnFirstLink() { private final Queue linkLeaveEvents = new ConcurrentLinkedQueue<>(); private final Queue trafficLeaveEvents = new ConcurrentLinkedQueue<>(); - + private final QSim qsim; @Inject - DriveDischargingHandler(ElectricFleet data, Network network, EventsManager eventsManager) { + DriveDischargingHandler(QSim qsim, ElectricFleet data, Network network, EventsManager eventsManager) { + this.qsim = qsim; this.network = network; this.eventsManager = eventsManager; eVehicles = data.getElectricVehicles(); @@ -116,7 +118,7 @@ public void onPrepareSim() { @Override public void afterSim() { // process remaining events - doSimStep(Double.POSITIVE_INFINITY); + doSimStep(this.qsim.getSimTimer().getTimeOfDay()); } @Override diff --git a/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleTest/runTest/output_events.xml.gz b/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleTest/runTest/output_events.xml.gz index 3b1fb60c3eb..305d78e582e 100644 Binary files a/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleTest/runTest/output_events.xml.gz and b/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleTest/runTest/output_events.xml.gz differ diff --git a/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleTest/runTestWithChargingDurationEnforcement/output_events.xml.gz b/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleTest/runTestWithChargingDurationEnforcement/output_events.xml.gz index 8589f8c2b83..c5cee38e5c7 100644 Binary files a/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleTest/runTestWithChargingDurationEnforcement/output_events.xml.gz and b/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleTest/runTestWithChargingDurationEnforcement/output_events.xml.gz differ diff --git a/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleWithLTHConsumptionModelTest/runTest/output_events.xml.gz b/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleWithLTHConsumptionModelTest/runTest/output_events.xml.gz index f93dab62299..ae05badd1be 100644 Binary files a/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleWithLTHConsumptionModelTest/runTest/output_events.xml.gz and b/contribs/ev/test/input/org/matsim/contrib/ev/example/RunEvExampleWithLTHConsumptionModelTest/runTest/output_events.xml.gz differ diff --git a/contribs/hybridsim/pom.xml b/contribs/hybridsim/pom.xml index c29fd00cf58..3ffc35cae01 100644 --- a/contribs/hybridsim/pom.xml +++ b/contribs/hybridsim/pom.xml @@ -11,7 +11,7 @@ 3.25.2 - 1.61.0 + 1.61.1 diff --git a/contribs/vsp/src/test/java/playground/vsp/ev/UrbanEVIT.java b/contribs/vsp/src/test/java/playground/vsp/ev/UrbanEVIT.java index 9f470684027..823fb89bf83 100644 --- a/contribs/vsp/src/test/java/playground/vsp/ev/UrbanEVIT.java +++ b/contribs/vsp/src/test/java/playground/vsp/ev/UrbanEVIT.java @@ -8,13 +8,9 @@ import org.matsim.core.config.ConfigUtils; import org.matsim.core.events.EventsUtils; import org.matsim.core.population.PopulationUtils; -import org.matsim.core.utils.io.IOUtils; -import org.matsim.examples.ExamplesUtils; import org.matsim.testcases.MatsimTestUtils; import org.matsim.utils.eventsfilecomparison.EventsFileComparator; -import java.net.URL; - public class UrbanEVIT { @RegisterExtension private MatsimTestUtils utils = new MatsimTestUtils(); diff --git a/contribs/vsp/test/input/playground/vsp/ev/UrbanEVIT/run/output_events.xml.gz b/contribs/vsp/test/input/playground/vsp/ev/UrbanEVIT/run/output_events.xml.gz index 7c2e5641672..66a3835bc83 100644 Binary files a/contribs/vsp/test/input/playground/vsp/ev/UrbanEVIT/run/output_events.xml.gz and b/contribs/vsp/test/input/playground/vsp/ev/UrbanEVIT/run/output_events.xml.gz differ diff --git a/pom.xml b/pom.xml index 2e604ec64ce..3ad76d1e35e 100644 --- a/pom.xml +++ b/pom.xml @@ -37,7 +37,7 @@ 7.0.0 2.16.1 2.5.0 - 5.10.1 + 5.10.2 @@ -304,7 +304,7 @@ org.assertj assertj-core - 3.25.2 + 3.25.3 test