Skip to content

Commit

Permalink
Merge pull request #265 from msmobility/cllorca_branch
Browse files Browse the repository at this point in the history
cllorca_branch
  • Loading branch information
mergify[bot] authored Dec 2, 2019
2 parents 59334e9 + d69c1aa commit 8f2350e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import de.tum.bgu.msm.data.travelTimes.TravelTimes;
import de.tum.bgu.msm.models.transportModel.TransportModel;
import de.tum.bgu.msm.properties.Properties;
import de.tum.bgu.msm.properties.modules.TransportModelPropertiesModule;
import org.apache.log4j.Logger;
import org.locationtech.jts.geom.Geometry;
import org.matsim.api.core.v01.Coord;
Expand Down Expand Up @@ -148,7 +149,8 @@ private void runTransportModel(int year) {
logger.warn("Running MATSim transport model for year " + year + ".");
Scenario assembledScenario;
TravelTimes travelTimes = dataContainer.getTravelTimes();
if (year == properties.main.baseYear){
if (year == properties.main.baseYear &&
properties.transportModel.transportModelIdentifier == TransportModelPropertiesModule.TransportModelIdentifier.MATSIM){
//if using the SimpleCommuteModeChoiceScenarioAssembler, we need some intial travel times (this will use an unlodaded network)
TravelTime myTravelTime = SiloMatsimUtils.getAnEmptyNetworkTravelTime();
TravelDisutility myTravelDisutility = SiloMatsimUtils.getAnEmptyNetworkTravelDisutility();
Expand Down Expand Up @@ -270,7 +272,9 @@ private void updateTravelTimes(TravelTime travelTime, TravelDisutility disutilit

if (mainTravelTimes != this.internalTravelTimes && mainTravelTimes instanceof SkimTravelTimes) {
((SkimTravelTimes) mainTravelTimes).updateSkimMatrix(internalTravelTimes.getPeakSkim(TransportMode.car), TransportMode.car);
((SkimTravelTimes) mainTravelTimes).updateSkimMatrix(internalTravelTimes.getPeakSkim(TransportMode.pt), TransportMode.pt);
if ((properties.transportModel.transportModelIdentifier == TransportModelPropertiesModule.TransportModelIdentifier.MATSIM)) {
((SkimTravelTimes) mainTravelTimes).updateSkimMatrix(internalTravelTimes.getPeakSkim(TransportMode.pt), TransportMode.pt);
}
((SkimTravelTimes) mainTravelTimes).updateRegionalTravelTimes(dataContainer.getGeoData().getRegions().values(),
dataContainer.getGeoData().getZones().values());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void endSimulation() {
}

private void updateSkims(int year) {
if (properties.transportModel.transportModelIdentifier == TransportModelPropertiesModule.TransportModelIdentifier.NONE) {
if (properties.transportModel.transportModelIdentifier != TransportModelPropertiesModule.TransportModelIdentifier.MATSIM) {
TravelTimeUtil.updateCarSkim((SkimTravelTimes) delegate, year, properties);
TravelTimeUtil.updateTransitSkim((SkimTravelTimes) delegate, year, properties);
((SkimTravelTimes) delegate).updateRegionalTravelTimes(geoData.getRegions().values(), geoData.getZones().values());
Expand Down

0 comments on commit 8f2350e

Please sign in to comment.