Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
rewertvsp committed Jan 2, 2024
1 parent ce55ff2 commit 75c50bb
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -919,7 +919,7 @@ static Map<String, Map<Id<Link>, Link>> filterLinksForZones(Scenario scenario, I
}

/**
* Finds for areas without links the nearest Link, if the area contains any building.
* Finds for areas without links the nearest Link if the area contains any building.
*/
private static void findNearestLinkForZonesWithoutLinks(Network networkToChange, Map<String, Map<Id<Link>, Link>> regionLinksMap,
Index shpZones,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.Point;
import org.matsim.api.core.v01.Coord;
import org.matsim.application.options.ShpOptions;
import org.matsim.application.options.ShpOptions.Index;
import org.matsim.core.utils.geometry.geotools.MGC;
import org.matsim.core.utils.io.IOUtils;
import org.opengis.feature.simple.SimpleFeature;

import java.io.BufferedReader;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardCopyOption;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public class SmallScaleCommercialTrafficUtils {
private static final Joiner JOIN = Joiner.on("\t");

/**
* Creates and return the Index of the zones shape.
* Creates and return the Index of the zone shape.
*
* @return indexZones
*/
Expand All @@ -97,7 +97,7 @@ static Index getIndexLanduse(Path shapeFileLandusePath, String shapeCRS) {
}

/**
* Writes a csv file with result of the distribution per zone of the input data.
* Writes a csv file with the result of the distribution per zone of the input data.
*/
static void writeResultOfDataDistribution(Map<String, Object2DoubleMap<String>> resultingDataPerZone,
Path outputFileInOutputFolder, Map<String, String> zoneIdNameConnection)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ static void reduceDemandBasedOnExistingCarriers(Scenario scenario,
}
}
} else {
if (carrier.getServices().size() != 0) {
if (!carrier.getServices().isEmpty()) {
List<String> possibleStartAreas = new ArrayList<>();
for (CarrierVehicle vehicle : carrier.getCarrierCapabilities().getCarrierVehicles().values()) {
possibleStartAreas
Expand All @@ -341,7 +341,7 @@ static void reduceDemandBasedOnExistingCarriers(Scenario scenario,
+ " is not part of the zones. That's why the traffic volume was not reduces by this service.");
}
}
} else if (carrier.getShipments().size() != 0) {
} else if (!carrier.getShipments().isEmpty()) {
for (CarrierShipment shipment : carrier.getShipments().values()) {
String startZone = SmallScaleCommercialTrafficUtils.findZoneOfLink(shipment.getFrom(),
regionLinksMap);
Expand Down

0 comments on commit 75c50bb

Please sign in to comment.