actTypes = new HashSet<>();
diff --git a/src/main/java/playground/amit/analysis/congestion/CausedDelayAnalyzer.java b/src/main/java/playground/amit/analysis/congestion/CausedDelayAnalyzer.java
index 2c9761ab6..b4727ec11 100644
--- a/src/main/java/playground/amit/analysis/congestion/CausedDelayAnalyzer.java
+++ b/src/main/java/playground/amit/analysis/congestion/CausedDelayAnalyzer.java
@@ -18,22 +18,22 @@
* *********************************************************************** */
package playground.amit.analysis.congestion;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedMap;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.population.Person;
import org.matsim.core.api.experimental.events.EventsManager;
import org.matsim.core.events.EventsUtils;
-
import playground.amit.utils.AreaFilter;
import playground.amit.utils.PersonFilter;
import playground.vsp.congestion.events.CongestionEventsReader;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
+
/**
* Calculates the delay caused for each person by reading the marginal congestion events.
* Additionally, returns the link delay and counts which can be used to get the (avg) toll, since a corresponding
@@ -43,7 +43,7 @@
public class CausedDelayAnalyzer {
- private final static Logger LOGGER = Logger.getLogger(CausedDelayAnalyzer.class);
+ private final static Logger LOGGER = LogManager.getLogger(CausedDelayAnalyzer.class);
private final FilteredCausedDelayHandler handler;
private final String eventsFile;
diff --git a/src/main/java/playground/amit/analysis/congestion/ExperiencedDelayAnalyzer.java b/src/main/java/playground/amit/analysis/congestion/ExperiencedDelayAnalyzer.java
index 4e69248e5..11ff5f6dc 100644
--- a/src/main/java/playground/amit/analysis/congestion/ExperiencedDelayAnalyzer.java
+++ b/src/main/java/playground/amit/analysis/congestion/ExperiencedDelayAnalyzer.java
@@ -18,12 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.congestion;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Link;
@@ -37,6 +33,12 @@
import playground.amit.utils.PersonFilter;
import playground.vsp.congestion.handlers.CongestionHandlerImplV3;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
/**
* This analyzer calculates delay from link enter and link leave events and therefore provides only experienced delay.
* In order to get the caused delay for each person, see {@link CausedDelayAnalyzer}
@@ -45,7 +47,7 @@
*/
public class ExperiencedDelayAnalyzer {
- private final static Logger LOGGER = Logger.getLogger(ExperiencedDelayAnalyzer.class);
+ private final static Logger LOGGER = LogManager.getLogger(ExperiencedDelayAnalyzer.class);
private final String eventsFile;
private final FilteredExperienceDelayHandler congestionHandler;
private final Scenario scenario;
diff --git a/src/main/java/playground/amit/analysis/congestion/ExperiencedDelayHandler.java b/src/main/java/playground/amit/analysis/congestion/ExperiencedDelayHandler.java
index 82077556c..20b265416 100644
--- a/src/main/java/playground/amit/analysis/congestion/ExperiencedDelayHandler.java
+++ b/src/main/java/playground/amit/analysis/congestion/ExperiencedDelayHandler.java
@@ -24,8 +24,8 @@
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
@@ -56,7 +56,7 @@
public class ExperiencedDelayHandler implements LinkEnterEventHandler, LinkLeaveEventHandler,
PersonDepartureEventHandler, PersonArrivalEventHandler, VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler, TransitDriverStartsEventHandler {
- public final static Logger LOG = Logger.getLogger(ExperiencedDelayHandler.class);
+ public final static Logger LOG = LogManager.getLogger(ExperiencedDelayHandler.class);
private final Vehicle2DriverEventHandler delegate = new Vehicle2DriverEventHandler();
diff --git a/src/main/java/playground/amit/analysis/congestion/FilteredCausedDelayHandler.java b/src/main/java/playground/amit/analysis/congestion/FilteredCausedDelayHandler.java
index 9017737b2..8aed2eb0f 100644
--- a/src/main/java/playground/amit/analysis/congestion/FilteredCausedDelayHandler.java
+++ b/src/main/java/playground/amit/analysis/congestion/FilteredCausedDelayHandler.java
@@ -19,29 +19,29 @@
package playground.amit.analysis.congestion;
-import java.util.Map;
-import java.util.Set;
-import java.util.SortedMap;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.population.Person;
-
import playground.amit.utils.AreaFilter;
import playground.amit.utils.PersonFilter;
import playground.vsp.congestion.events.CongestionEvent;
import playground.vsp.congestion.handlers.CongestionEventHandler;
+import java.util.Map;
+import java.util.Set;
+import java.util.SortedMap;
+
/**
* @author amit
*/
public class FilteredCausedDelayHandler implements CongestionEventHandler {
- private static final Logger LOGGER = Logger.getLogger(FilteredCausedDelayHandler.class);
+ private static final Logger LOGGER = LogManager.getLogger(FilteredCausedDelayHandler.class);
private final CausedDelayHandler delegate ;
private final PersonFilter pf ;
private final AreaFilter af;
diff --git a/src/main/java/playground/amit/analysis/congestion/FilteredExperienceDelayHandler.java b/src/main/java/playground/amit/analysis/congestion/FilteredExperienceDelayHandler.java
index 7e940e806..39155db6d 100644
--- a/src/main/java/playground/amit/analysis/congestion/FilteredExperienceDelayHandler.java
+++ b/src/main/java/playground/amit/analysis/congestion/FilteredExperienceDelayHandler.java
@@ -19,34 +19,22 @@
package playground.amit.analysis.congestion;
-import java.util.Map;
-import java.util.SortedMap;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
-import org.matsim.api.core.v01.events.LinkEnterEvent;
-import org.matsim.api.core.v01.events.LinkLeaveEvent;
-import org.matsim.api.core.v01.events.PersonArrivalEvent;
-import org.matsim.api.core.v01.events.PersonDepartureEvent;
-import org.matsim.api.core.v01.events.TransitDriverStartsEvent;
-import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent;
-import org.matsim.api.core.v01.events.VehicleLeavesTrafficEvent;
-import org.matsim.api.core.v01.events.handler.LinkEnterEventHandler;
-import org.matsim.api.core.v01.events.handler.LinkLeaveEventHandler;
-import org.matsim.api.core.v01.events.handler.PersonArrivalEventHandler;
-import org.matsim.api.core.v01.events.handler.PersonDepartureEventHandler;
-import org.matsim.api.core.v01.events.handler.TransitDriverStartsEventHandler;
-import org.matsim.api.core.v01.events.handler.VehicleEntersTrafficEventHandler;
-import org.matsim.api.core.v01.events.handler.VehicleLeavesTrafficEventHandler;
+import org.matsim.api.core.v01.events.*;
+import org.matsim.api.core.v01.events.handler.*;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.population.Person;
import org.matsim.core.events.algorithms.Vehicle2DriverEventHandler;
-
import playground.amit.utils.AreaFilter;
import playground.amit.utils.PersonFilter;
+import java.util.Map;
+import java.util.SortedMap;
+
/**
* @author amit
*/
@@ -54,7 +42,7 @@
public class FilteredExperienceDelayHandler implements LinkEnterEventHandler, LinkLeaveEventHandler,
PersonDepartureEventHandler, PersonArrivalEventHandler, VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler, TransitDriverStartsEventHandler {
- private static final Logger LOGGER = Logger.getLogger(FilteredExperienceDelayHandler.class);
+ private static final Logger LOGGER = LogManager.getLogger(FilteredExperienceDelayHandler.class);
private final ExperiencedDelayHandler delegate ;
private final Vehicle2DriverEventHandler veh2DriverDelegate = new Vehicle2DriverEventHandler();
private final PersonFilter pf ;
diff --git a/src/main/java/playground/amit/analysis/emission/AirPollutionExposureAnalysisControlerListener.java b/src/main/java/playground/amit/analysis/emission/AirPollutionExposureAnalysisControlerListener.java
index 5cb0d7d43..7fed5951f 100644
--- a/src/main/java/playground/amit/analysis/emission/AirPollutionExposureAnalysisControlerListener.java
+++ b/src/main/java/playground/amit/analysis/emission/AirPollutionExposureAnalysisControlerListener.java
@@ -19,12 +19,9 @@
package playground.amit.analysis.emission;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.IOException;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
+import com.google.inject.Inject;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.contrib.emissions.events.EmissionEventsReader;
import org.matsim.core.api.experimental.events.EventsManager;
import org.matsim.core.config.groups.ControlerConfigGroup;
@@ -35,22 +32,24 @@
import org.matsim.core.events.EventsUtils;
import org.matsim.core.events.MatsimEventsReader;
import org.matsim.core.utils.io.IOUtils;
-
-import com.google.inject.Inject;
-
import playground.amit.analysis.emission.experienced.ExperiencedEmissionCostHandler;
import playground.amit.utils.MapUtils;
import playground.vsp.airPollution.exposure.GridTools;
import playground.vsp.airPollution.exposure.IntervalHandler;
import playground.vsp.airPollution.exposure.ResponsibilityGridTools;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.IOException;
+import java.util.Map;
+
/**
* Created by amit on 01/12/2016.
*/
public class AirPollutionExposureAnalysisControlerListener implements ShutdownListener {
- private static final Logger LOG = Logger.getLogger(AirPollutionExposureAnalysisControlerListener.class);
+ private static final Logger LOG = LogManager.getLogger(AirPollutionExposureAnalysisControlerListener.class);
@Inject
private OutputDirectoryHierarchy controlerIO;
diff --git a/src/main/java/playground/amit/analysis/emission/EmissionLinkAnalyzer.java b/src/main/java/playground/amit/analysis/emission/EmissionLinkAnalyzer.java
index c4a25631a..63f40d45d 100644
--- a/src/main/java/playground/amit/analysis/emission/EmissionLinkAnalyzer.java
+++ b/src/main/java/playground/amit/analysis/emission/EmissionLinkAnalyzer.java
@@ -18,7 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.emission;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Link;
@@ -49,7 +50,7 @@
//TODO :clean it.
public class EmissionLinkAnalyzer extends AbstractAnalysisModule {
- private static final Logger LOG = Logger.getLogger(EmissionLinkAnalyzer.class);
+ private static final Logger LOG = LogManager.getLogger(EmissionLinkAnalyzer.class);
private final String emissionEventsFile;
private final FilteredWarmEmissionHandler warmHandler;
private final FilteredColdEmissionHandler coldHandler;
diff --git a/src/main/java/playground/amit/analysis/emission/EmissionsPerLinkColdEventHandler.java b/src/main/java/playground/amit/analysis/emission/EmissionsPerLinkColdEventHandler.java
index db6a13159..27040997d 100644
--- a/src/main/java/playground/amit/analysis/emission/EmissionsPerLinkColdEventHandler.java
+++ b/src/main/java/playground/amit/analysis/emission/EmissionsPerLinkColdEventHandler.java
@@ -19,7 +19,8 @@
* *********************************************************************** */
package playground.amit.analysis.emission;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.network.Link;
import org.matsim.contrib.emissions.Pollutant;
@@ -37,8 +38,7 @@
*/
public class EmissionsPerLinkColdEventHandler implements
ColdEmissionEventHandler {
- private static final Logger logger = Logger
- .getLogger(EmissionsPerLinkColdEventHandler.class);
+ private static final Logger logger = LogManager.getLogger(EmissionsPerLinkColdEventHandler.class);
Map, Map>> time2coldEmissionsTotal = new HashMap<>();
diff --git a/src/main/java/playground/amit/analysis/emission/EmissionsPerLinkWarmEventHandler.java b/src/main/java/playground/amit/analysis/emission/EmissionsPerLinkWarmEventHandler.java
index d25caf844..f95c63d00 100644
--- a/src/main/java/playground/amit/analysis/emission/EmissionsPerLinkWarmEventHandler.java
+++ b/src/main/java/playground/amit/analysis/emission/EmissionsPerLinkWarmEventHandler.java
@@ -19,7 +19,8 @@
* *********************************************************************** */
package playground.amit.analysis.emission;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.network.Link;
import org.matsim.contrib.emissions.Pollutant;
@@ -35,7 +36,7 @@
*
*/
public class EmissionsPerLinkWarmEventHandler implements WarmEmissionEventHandler{
- private static final Logger logger = Logger.getLogger(EmissionsPerLinkWarmEventHandler.class);
+ private static final Logger logger = LogManager.getLogger(EmissionsPerLinkWarmEventHandler.class);
Map, Map>> time2warmEmissionsTotal = new HashMap<>();
Map, Double>> time2linkIdLeaveCount = new HashMap<>();
diff --git a/src/main/java/playground/amit/analysis/emission/caused/CausedEmissionCostHandler.java b/src/main/java/playground/amit/analysis/emission/caused/CausedEmissionCostHandler.java
index 0c06d865d..95df9a908 100644
--- a/src/main/java/playground/amit/analysis/emission/caused/CausedEmissionCostHandler.java
+++ b/src/main/java/playground/amit/analysis/emission/caused/CausedEmissionCostHandler.java
@@ -18,10 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.emission.caused;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.stream.Collectors;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent;
import org.matsim.api.core.v01.events.VehicleLeavesTrafficEvent;
@@ -39,6 +37,10 @@
import playground.amit.utils.PersonFilter;
import playground.vsp.airPollution.flatEmissions.EmissionCostModule;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.stream.Collectors;
+
/**
* Emission costs (flat emission cost module is used).
*
@@ -47,7 +49,7 @@
public class CausedEmissionCostHandler implements VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler, WarmEmissionEventHandler, ColdEmissionEventHandler, EmissionCostHandler{
- private static final Logger LOG = Logger.getLogger(CausedEmissionCostHandler.class);
+ private static final Logger LOG = LogManager.getLogger(CausedEmissionCostHandler.class);
private final EmissionCostModule emissionCostModule;
private final Map, Double> vehicleId2ColdEmissCosts = new HashMap<>();
diff --git a/src/main/java/playground/amit/analysis/emission/experienced/ExperiencedEmissionCostHandler.java b/src/main/java/playground/amit/analysis/emission/experienced/ExperiencedEmissionCostHandler.java
index 0f5fddc7b..93467a132 100644
--- a/src/main/java/playground/amit/analysis/emission/experienced/ExperiencedEmissionCostHandler.java
+++ b/src/main/java/playground/amit/analysis/emission/experienced/ExperiencedEmissionCostHandler.java
@@ -23,8 +23,8 @@
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent;
import org.matsim.api.core.v01.events.handler.VehicleEntersTrafficEventHandler;
@@ -51,7 +51,7 @@
public class ExperiencedEmissionCostHandler implements VehicleEntersTrafficEventHandler, WarmEmissionEventHandler, ColdEmissionEventHandler, EmissionCostHandler{
- private static final Logger LOG = Logger.getLogger(ExperiencedEmissionCostHandler.class);
+ private static final Logger LOG = LogManager.getLogger(ExperiencedEmissionCostHandler.class);
private final Map, Double>> vehicleId2ColdEmissCosts = new HashMap<>();
private final Map, Double>> vehicleId2WarmEmissCosts = new HashMap<>();
diff --git a/src/main/java/playground/amit/analysis/emission/filtering/FilteredColdEmissionHandler.java b/src/main/java/playground/amit/analysis/emission/filtering/FilteredColdEmissionHandler.java
index 7288a3c97..8592db5bd 100644
--- a/src/main/java/playground/amit/analysis/emission/filtering/FilteredColdEmissionHandler.java
+++ b/src/main/java/playground/amit/analysis/emission/filtering/FilteredColdEmissionHandler.java
@@ -18,9 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.emission.filtering;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent;
import org.matsim.api.core.v01.events.VehicleLeavesTrafficEvent;
@@ -38,12 +37,15 @@
import playground.amit.utils.AreaFilter;
import playground.amit.utils.PersonFilter;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author amit
*/
public class FilteredColdEmissionHandler implements VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler, ColdEmissionEventHandler{
- private static final Logger LOGGER = Logger.getLogger(FilteredColdEmissionHandler.class.getName());
+ private static final Logger LOGGER = LogManager.getLogger(FilteredColdEmissionHandler.class.getName());
private final EmissionsPerLinkColdEventHandler delegate;
private final PersonFilter pf ;
diff --git a/src/main/java/playground/amit/analysis/emission/filtering/FilteredEmissionPersonEventHandler.java b/src/main/java/playground/amit/analysis/emission/filtering/FilteredEmissionPersonEventHandler.java
index d27cde93a..8df55cc80 100644
--- a/src/main/java/playground/amit/analysis/emission/filtering/FilteredEmissionPersonEventHandler.java
+++ b/src/main/java/playground/amit/analysis/emission/filtering/FilteredEmissionPersonEventHandler.java
@@ -18,11 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.emission.filtering;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent;
import org.matsim.api.core.v01.events.VehicleLeavesTrafficEvent;
@@ -36,17 +33,20 @@
import org.matsim.contrib.emissions.events.WarmEmissionEvent;
import org.matsim.contrib.emissions.events.WarmEmissionEventHandler;
import org.matsim.vehicles.Vehicle;
-
import playground.amit.analysis.emission.EmissionPersonEventHandler;
import playground.amit.utils.AreaFilter;
import playground.amit.utils.PersonFilter;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.stream.Collectors;
+
/**
* @author amit
*/
public class FilteredEmissionPersonEventHandler implements ColdEmissionEventHandler, WarmEmissionEventHandler, VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler {
- private static final Logger LOGGER = Logger.getLogger(FilteredEmissionPersonEventHandler.class.getName());
+ private static final Logger LOGGER = LogManager.getLogger(FilteredEmissionPersonEventHandler.class.getName());
private final Map, Id> vehicleId2PersonId2 = new HashMap<>();
private final EmissionPersonEventHandler delegate;
diff --git a/src/main/java/playground/amit/analysis/emission/filtering/FilteredWarmEmissionHandler.java b/src/main/java/playground/amit/analysis/emission/filtering/FilteredWarmEmissionHandler.java
index 6aaa8c41b..0168138a8 100644
--- a/src/main/java/playground/amit/analysis/emission/filtering/FilteredWarmEmissionHandler.java
+++ b/src/main/java/playground/amit/analysis/emission/filtering/FilteredWarmEmissionHandler.java
@@ -18,9 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.emission.filtering;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent;
import org.matsim.api.core.v01.events.VehicleLeavesTrafficEvent;
@@ -38,12 +37,15 @@
import playground.amit.utils.AreaFilter;
import playground.amit.utils.PersonFilter;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author amit
*/
public class FilteredWarmEmissionHandler implements VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler, WarmEmissionEventHandler {
- private static final Logger LOGGER = Logger.getLogger(FilteredWarmEmissionHandler.class.getName());
+ private static final Logger LOGGER = LogManager.getLogger(FilteredWarmEmissionHandler.class.getName());
private final EmissionsPerLinkWarmEventHandler delegate;
private final PersonFilter pf ;
diff --git a/src/main/java/playground/amit/analysis/linkVolume/FilteredLinkVolumeHandler.java b/src/main/java/playground/amit/analysis/linkVolume/FilteredLinkVolumeHandler.java
index 18b666792..65e2f5325 100644
--- a/src/main/java/playground/amit/analysis/linkVolume/FilteredLinkVolumeHandler.java
+++ b/src/main/java/playground/amit/analysis/linkVolume/FilteredLinkVolumeHandler.java
@@ -19,9 +19,8 @@
package playground.amit.analysis.linkVolume;
-import java.util.List;
-import java.util.Map;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.LinkLeaveEvent;
import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent;
@@ -35,6 +34,9 @@
import org.matsim.vehicles.Vehicle;
import playground.amit.utils.PersonFilter;
+import java.util.List;
+import java.util.Map;
+
/**
* Created by amit on 02/01/2017.
*/
@@ -42,7 +44,7 @@
public class FilteredLinkVolumeHandler implements LinkLeaveEventHandler, VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler {
- private static final Logger LOGGER = Logger.getLogger(FilteredLinkVolumeHandler.class);
+ private static final Logger LOGGER = LogManager.getLogger(FilteredLinkVolumeHandler.class);
private final LinkVolumeHandler delegate;
private final Vehicle2DriverEventHandler veh2DriverDelegate = new Vehicle2DriverEventHandler();
diff --git a/src/main/java/playground/amit/analysis/linkVolume/LinkVolumeHandler.java b/src/main/java/playground/amit/analysis/linkVolume/LinkVolumeHandler.java
index b7c4c67a9..31c78306e 100644
--- a/src/main/java/playground/amit/analysis/linkVolume/LinkVolumeHandler.java
+++ b/src/main/java/playground/amit/analysis/linkVolume/LinkVolumeHandler.java
@@ -18,12 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.linkVolume;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.LinkLeaveEvent;
import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent;
@@ -41,12 +37,17 @@
import playground.amit.mixedTraffic.MixedTrafficVehiclesUtils;
import playground.amit.utils.PersonFilter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
/**
* @author amit
*/
public class LinkVolumeHandler implements LinkLeaveEventHandler, VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler {
- private static final Logger LOG = Logger.getLogger(LinkVolumeHandler.class);
+ private static final Logger LOG = LogManager.getLogger(LinkVolumeHandler.class);
private final Map, Map> linkId2Time2Count = new HashMap<>();
private final Map, Map> linkId2Time2PCUVol = new HashMap<>();
private final Map, Map>>> linkId2Time2Persons = new HashMap<>();
diff --git a/src/main/java/playground/amit/analysis/modalShare/ModalShareEventHandler.java b/src/main/java/playground/amit/analysis/modalShare/ModalShareEventHandler.java
index 6667f567e..6c4214a98 100644
--- a/src/main/java/playground/amit/analysis/modalShare/ModalShareEventHandler.java
+++ b/src/main/java/playground/amit/analysis/modalShare/ModalShareEventHandler.java
@@ -19,13 +19,7 @@
package playground.amit.analysis.modalShare;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.events.ActivityStartEvent;
@@ -39,6 +33,8 @@
import org.matsim.api.core.v01.population.Person;
import org.matsim.core.router.StageActivityTypeIdentifier;
+import java.util.*;
+
/**
* If someone starts with transit_walk leg, and do not use pt before starting a regular act (home/work/leis/shop); it is walk
* else it is pt mode.
@@ -108,7 +104,7 @@ private void storeMode(String legMode) {
}
private void handleRemainingTransitUsers(){
- Logger.getLogger(ModalShareEventHandler.class).warn("A few transit users are not handle due to stuckAndAbort. Handling them now.");
+ LogManager.getLogger(ModalShareEventHandler.class).warn("A few transit users are not handle due to stuckAndAbort. Handling them now.");
for(Id pId : person2Modes.keySet()){
String legMode = getMainMode(person2Modes.get(pId));
storeMode(legMode);
diff --git a/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitcherInfoCollector.java b/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitcherInfoCollector.java
index 9a97090ca..1d9976c89 100644
--- a/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitcherInfoCollector.java
+++ b/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitcherInfoCollector.java
@@ -18,12 +18,14 @@
* *********************************************************************** */
package playground.amit.analysis.modeSwitcherRetainer;
-import java.util.ArrayList;
-import java.util.List;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.population.Person;
+import java.util.ArrayList;
+import java.util.List;
+
/**
* A class to store all information of mode switchers/retainers
* @author amit
@@ -31,7 +33,7 @@
class ModeSwitcherInfoCollector {
- private static final Logger LOG = Logger.getLogger(ModeSwitcherInfoCollector.class);
+ private static final Logger LOG = LogManager.getLogger(ModeSwitcherInfoCollector.class);
private final List> personIds = new ArrayList<>();
private double firstIterationStat = 0.;
diff --git a/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitchersTripDistance.java b/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitchersTripDistance.java
index 67a2e8a43..df74fad65 100644
--- a/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitchersTripDistance.java
+++ b/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitchersTripDistance.java
@@ -18,15 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.modeSwitcherRetainer;
-import java.io.BufferedWriter;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.population.Person;
@@ -42,6 +35,9 @@
import playground.amit.utils.LoadMyScenarios;
import playground.amit.utils.PersonFilter;
+import java.io.BufferedWriter;
+import java.util.*;
+
/**
* This will first find mode switchers and then returns trip distances in groups.
@@ -51,7 +47,7 @@
public class ModeSwitchersTripDistance {
- private static final Logger LOG = Logger.getLogger(ModeSwitchersTripDistance.class);
+ private static final Logger LOG = LogManager.getLogger(ModeSwitchersTripDistance.class);
public ModeSwitchersTripDistance(){
this(null, null, TripDistanceType.ROUTE_DISTANCE);
diff --git a/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitchersTripTime.java b/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitchersTripTime.java
index a6ee07f94..c958f4db6 100644
--- a/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitchersTripTime.java
+++ b/src/main/java/playground/amit/analysis/modeSwitcherRetainer/ModeSwitchersTripTime.java
@@ -18,9 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.modeSwitcherRetainer;
-import java.io.BufferedWriter;
-import java.util.*;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.population.Person;
@@ -31,6 +30,9 @@
import playground.amit.utils.LoadMyScenarios;
import playground.amit.utils.PersonFilter;
+import java.io.BufferedWriter;
+import java.util.*;
+
/**
*This will first find mode switchers and then returns trip times in groups.
*
@@ -39,7 +41,7 @@
public class ModeSwitchersTripTime {
- private static final Logger LOG = Logger.getLogger(ModeSwitchersTripTime.class);
+ private static final Logger LOG = LogManager.getLogger(ModeSwitchersTripTime.class);
public ModeSwitchersTripTime(){
this(null, null);
diff --git a/src/main/java/playground/amit/analysis/spatial/GeneralGrid.java b/src/main/java/playground/amit/analysis/spatial/GeneralGrid.java
index 9945b4996..25484154f 100644
--- a/src/main/java/playground/amit/analysis/spatial/GeneralGrid.java
+++ b/src/main/java/playground/amit/analysis/spatial/GeneralGrid.java
@@ -26,7 +26,8 @@
import java.util.HashMap;
import java.util.Map;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
@@ -48,7 +49,7 @@
*/
public class GeneralGrid{
- private final static Logger LOG = Logger.getLogger(GeneralGrid.class);
+ private final static Logger LOG = LogManager.getLogger(GeneralGrid.class);
private Geometry geometry;
private QuadTree qt;
diff --git a/src/main/java/playground/amit/analysis/spatial/SpatialDataInputs.java b/src/main/java/playground/amit/analysis/spatial/SpatialDataInputs.java
index f0f29d7bd..0ad8143b3 100644
--- a/src/main/java/playground/amit/analysis/spatial/SpatialDataInputs.java
+++ b/src/main/java/playground/amit/analysis/spatial/SpatialDataInputs.java
@@ -18,13 +18,14 @@
* *********************************************************************** */
package playground.amit.analysis.spatial;
-import java.io.File;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.opengis.referencing.crs.CoordinateReferenceSystem;
-
import playground.amit.analysis.spatial.GeneralGrid.GridType;
import playground.amit.utils.LoadMyScenarios;
+import java.io.File;
+
/**
* All inputs parameters required for spatial analysis are listed and set here.
* @author amit
@@ -34,7 +35,7 @@ public class SpatialDataInputs {
public enum LinkWeightMethod {line, point}
- public final static Logger LOG = Logger.getLogger(SpatialDataInputs.class);
+ public final static Logger LOG = LogManager.getLogger(SpatialDataInputs.class);
private final LinkWeightMethod linkWeigthMethod;
diff --git a/src/main/java/playground/amit/analysis/toll/FilteredTollHandler.java b/src/main/java/playground/amit/analysis/toll/FilteredTollHandler.java
index 1a2e9a185..a01267b12 100644
--- a/src/main/java/playground/amit/analysis/toll/FilteredTollHandler.java
+++ b/src/main/java/playground/amit/analysis/toll/FilteredTollHandler.java
@@ -19,44 +19,32 @@
package playground.amit.analysis.toll;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.SortedMap;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.locationtech.jts.geom.Geometry;
import org.matsim.api.core.v01.Id;
-import org.matsim.api.core.v01.events.LinkLeaveEvent;
-import org.matsim.api.core.v01.events.PersonDepartureEvent;
-import org.matsim.api.core.v01.events.PersonMoneyEvent;
-import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent;
-import org.matsim.api.core.v01.events.VehicleLeavesTrafficEvent;
-import org.matsim.api.core.v01.events.handler.LinkLeaveEventHandler;
-import org.matsim.api.core.v01.events.handler.PersonDepartureEventHandler;
-import org.matsim.api.core.v01.events.handler.PersonMoneyEventHandler;
-import org.matsim.api.core.v01.events.handler.VehicleEntersTrafficEventHandler;
-import org.matsim.api.core.v01.events.handler.VehicleLeavesTrafficEventHandler;
+import org.matsim.api.core.v01.events.*;
+import org.matsim.api.core.v01.events.handler.*;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.population.Person;
import org.matsim.core.events.algorithms.Vehicle2DriverEventHandler;
import org.matsim.core.utils.gis.ShapeFileReader;
import org.opengis.feature.simple.SimpleFeature;
-
import playground.amit.munich.utils.MunichPersonFilter;
import playground.amit.utils.geometry.GeometryUtils;
import playground.vsp.congestion.events.CongestionEvent;
import playground.vsp.congestion.handlers.CongestionEventHandler;
+import java.util.*;
+
/**
* @author amit
*/
public class FilteredTollHandler implements PersonMoneyEventHandler, PersonDepartureEventHandler, LinkLeaveEventHandler, CongestionEventHandler,
VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler {
- private static final Logger LOGGER = Logger.getLogger(FilteredTollHandler.class.getName());
+ private static final Logger LOGGER = LogManager.getLogger(FilteredTollHandler.class.getName());
private final TollInfoHandler delegate;
private final Vehicle2DriverEventHandler veh2DriverDelegate = new Vehicle2DriverEventHandler();
diff --git a/src/main/java/playground/amit/analysis/toll/TollAnalyzer.java b/src/main/java/playground/amit/analysis/toll/TollAnalyzer.java
index c98b2e732..fcd34045f 100644
--- a/src/main/java/playground/amit/analysis/toll/TollAnalyzer.java
+++ b/src/main/java/playground/amit/analysis/toll/TollAnalyzer.java
@@ -18,16 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.toll;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.population.Person;
@@ -36,18 +28,22 @@
import org.matsim.core.events.MatsimEventsReader;
import org.matsim.core.events.handler.EventHandler;
import org.matsim.core.utils.io.IOUtils;
-
import playground.amit.munich.utils.MunichPersonFilter.MunichUserGroup;
import playground.amit.utils.LoadMyScenarios;
import playground.amit.utils.MapUtils;
import playground.vsp.analysis.modules.AbstractAnalysisModule;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+
/**
* @author amit
*/
public class TollAnalyzer extends AbstractAnalysisModule {
- private static final Logger LOG = Logger.getLogger(TollAnalyzer.class);
+ private static final Logger LOG = LogManager.getLogger(TollAnalyzer.class);
private final String eventsFile;
private final FilteredTollHandler handler;
diff --git a/src/main/java/playground/amit/analysis/toll/TripTollHandler.java b/src/main/java/playground/amit/analysis/toll/TripTollHandler.java
index 585c13415..24e1c23a3 100644
--- a/src/main/java/playground/amit/analysis/toll/TripTollHandler.java
+++ b/src/main/java/playground/amit/analysis/toll/TripTollHandler.java
@@ -18,15 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.toll;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.events.PersonArrivalEvent;
@@ -38,12 +31,14 @@
import org.matsim.api.core.v01.population.Person;
import org.matsim.core.gbl.Gbl;
+import java.util.*;
+
/**
* @author amit
*/
public class TripTollHandler implements PersonMoneyEventHandler, PersonDepartureEventHandler, PersonArrivalEventHandler {
- private static final Logger LOG = Logger.getLogger(TripTollHandler.class);
+ private static final Logger LOG = LogManager.getLogger(TripTollHandler.class);
private final double timeBinSize;
private int nonCarWarning= 0;
diff --git a/src/main/java/playground/amit/analysis/tripDistance/FilteredTripRouteDistanceHandler.java b/src/main/java/playground/amit/analysis/tripDistance/FilteredTripRouteDistanceHandler.java
index 4def97753..3dace46bd 100644
--- a/src/main/java/playground/amit/analysis/tripDistance/FilteredTripRouteDistanceHandler.java
+++ b/src/main/java/playground/amit/analysis/tripDistance/FilteredTripRouteDistanceHandler.java
@@ -19,12 +19,8 @@
package playground.amit.analysis.tripDistance;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.*;
import org.matsim.api.core.v01.events.handler.*;
@@ -40,6 +36,12 @@
import playground.amit.utils.LoadMyScenarios;
import playground.amit.utils.PersonFilter;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+
/**
* Created by amit on 31/12/2016.
*/
@@ -47,7 +49,7 @@
public class FilteredTripRouteDistanceHandler implements PersonDepartureEventHandler, LinkLeaveEventHandler,
PersonArrivalEventHandler, VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler {
- private static final Logger LOGGER = Logger.getLogger(FilteredTripRouteDistanceHandler.class);
+ private static final Logger LOGGER = LogManager.getLogger(FilteredTripRouteDistanceHandler.class);
private final Vehicle2DriverEventHandler veh2DriverDelegate = new Vehicle2DriverEventHandler();
private final TripRouteDistanceInTimeBinHandler delegate;
diff --git a/src/main/java/playground/amit/analysis/tripDistance/LegModeBeelineDistanceDistributionFromPlansAnalyzer.java b/src/main/java/playground/amit/analysis/tripDistance/LegModeBeelineDistanceDistributionFromPlansAnalyzer.java
index 5bd3b6637..b625b0cd2 100644
--- a/src/main/java/playground/amit/analysis/tripDistance/LegModeBeelineDistanceDistributionFromPlansAnalyzer.java
+++ b/src/main/java/playground/amit/analysis/tripDistance/LegModeBeelineDistanceDistributionFromPlansAnalyzer.java
@@ -19,29 +19,13 @@
* *********************************************************************** */
package playground.amit.analysis.tripDistance;
-import java.io.BufferedWriter;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.SortedSet;
-import java.util.TreeMap;
-import java.util.TreeSet;
-import java.util.stream.Collectors;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Coord;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
-import org.matsim.api.core.v01.population.Activity;
-import org.matsim.api.core.v01.population.Leg;
-import org.matsim.api.core.v01.population.Person;
-import org.matsim.api.core.v01.population.Plan;
-import org.matsim.api.core.v01.population.PlanElement;
-import org.matsim.api.core.v01.population.Population;
-import org.matsim.api.core.v01.population.Route;
+import org.matsim.api.core.v01.population.*;
import org.matsim.core.events.handler.EventHandler;
import org.matsim.core.population.PopulationUtils;
import org.matsim.core.utils.geometry.CoordUtils;
@@ -50,6 +34,10 @@
import playground.amit.utils.PersonFilter;
import playground.vsp.analysis.modules.AbstractAnalysisModule;
+import java.io.BufferedWriter;
+import java.util.*;
+import java.util.stream.Collectors;
+
/**
* Provides leg mode distance distribution, distances are calculated from routes of selected plans
* unlike playground.vsp.analysis.modules.legModeDistanceDistribution where beeline distance is calculated
@@ -58,7 +46,7 @@
* @author amit
*/
public class LegModeBeelineDistanceDistributionFromPlansAnalyzer extends AbstractAnalysisModule{
- private final static Logger LOG = Logger.getLogger(LegModeBeelineDistanceDistributionFromPlansAnalyzer.class);
+ private final static Logger LOG = LogManager.getLogger(LegModeBeelineDistanceDistributionFromPlansAnalyzer.class);
private Scenario scenario;
private final List distanceClasses;
diff --git a/src/main/java/playground/amit/analysis/tripDistance/LegModeBeelineDistanceDistributionHandler.java b/src/main/java/playground/amit/analysis/tripDistance/LegModeBeelineDistanceDistributionHandler.java
index 41359f0ed..b16f40ef4 100644
--- a/src/main/java/playground/amit/analysis/tripDistance/LegModeBeelineDistanceDistributionHandler.java
+++ b/src/main/java/playground/amit/analysis/tripDistance/LegModeBeelineDistanceDistributionHandler.java
@@ -19,8 +19,8 @@
package playground.amit.analysis.tripDistance;
-import java.util.*;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Coord;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.PersonArrivalEvent;
@@ -31,13 +31,15 @@
import org.matsim.api.core.v01.population.Person;
import org.matsim.core.utils.geometry.CoordUtils;
+import java.util.*;
+
/**
* Created by amit on 20/10/16.
*/
public class LegModeBeelineDistanceDistributionHandler implements PersonDepartureEventHandler, PersonArrivalEventHandler {
- private static final Logger LOG = Logger.getLogger(LegModeBeelineDistanceDistributionHandler.class);
+ private static final Logger LOG = LogManager.getLogger(LegModeBeelineDistanceDistributionHandler.class);
private final SortedMap, List>> mode2PersonId2distances = new TreeMap<>();
diff --git a/src/main/java/playground/amit/analysis/tripDistance/LegModeRouteDistanceDistributionAnalyzer.java b/src/main/java/playground/amit/analysis/tripDistance/LegModeRouteDistanceDistributionAnalyzer.java
index 31444a8cf..0b8bb93e0 100644
--- a/src/main/java/playground/amit/analysis/tripDistance/LegModeRouteDistanceDistributionAnalyzer.java
+++ b/src/main/java/playground/amit/analysis/tripDistance/LegModeRouteDistanceDistributionAnalyzer.java
@@ -18,16 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.tripDistance;
-import java.io.BufferedWriter;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.SortedSet;
-import java.util.TreeMap;
-import java.util.TreeSet;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.population.Person;
@@ -39,6 +31,9 @@
import playground.amit.munich.utils.MunichPersonFilter;
import playground.vsp.analysis.modules.AbstractAnalysisModule;
+import java.io.BufferedWriter;
+import java.util.*;
+
/**
* @author amit
*/
@@ -46,7 +41,7 @@ public class LegModeRouteDistanceDistributionAnalyzer extends AbstractAnalysisMo
private final List distanceClasses;
private SortedSet usedModes;
- private final static Logger LOG = Logger.getLogger(LegModeRouteDistanceDistributionAnalyzer.class);
+ private final static Logger LOG = LogManager.getLogger(LegModeRouteDistanceDistributionAnalyzer.class);
private final SortedMap> mode2DistanceClass2LegCount ;
private SortedMap, List>> mode2PersonId2dist;
diff --git a/src/main/java/playground/amit/analysis/tripDistance/ModeFilterTripDistanceHandler.java b/src/main/java/playground/amit/analysis/tripDistance/ModeFilterTripDistanceHandler.java
index e7641389c..e3ede9f72 100644
--- a/src/main/java/playground/amit/analysis/tripDistance/ModeFilterTripDistanceHandler.java
+++ b/src/main/java/playground/amit/analysis/tripDistance/ModeFilterTripDistanceHandler.java
@@ -19,8 +19,8 @@
package playground.amit.analysis.tripDistance;
-import java.util.*;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.*;
import org.matsim.api.core.v01.events.handler.*;
@@ -28,6 +28,11 @@
import org.matsim.api.core.v01.population.Person;
import org.matsim.core.events.algorithms.Vehicle2DriverEventHandler;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.SortedMap;
+
/**
* Created by amit on 11/10/16.
*/
@@ -36,7 +41,7 @@
public class ModeFilterTripDistanceHandler implements PersonDepartureEventHandler, PersonArrivalEventHandler, LinkLeaveEventHandler,
VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler{
- private static final Logger LOG = Logger.getLogger(ModeFilterTripDistanceHandler.class);
+ private static final Logger LOG = LogManager.getLogger(ModeFilterTripDistanceHandler.class);
private final TripRouteDistanceInTimeBinHandler delegate ;
private final String mode2Consider;
private final Map,String> personId2mode = new HashMap<>(); // person id -- mode
diff --git a/src/main/java/playground/amit/analysis/tripDistance/TravelDistanceHandler.java b/src/main/java/playground/amit/analysis/tripDistance/TravelDistanceHandler.java
index b9acab91e..20e26b671 100644
--- a/src/main/java/playground/amit/analysis/tripDistance/TravelDistanceHandler.java
+++ b/src/main/java/playground/amit/analysis/tripDistance/TravelDistanceHandler.java
@@ -19,13 +19,8 @@
package playground.amit.analysis.tripDistance;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.SortedMap;
-import java.util.TreeMap;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.LinkLeaveEvent;
import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent;
@@ -44,12 +39,19 @@
import playground.amit.munich.utils.MunichPersonFilter;
import playground.amit.utils.*;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
/**
* @author amit
*/
public class TravelDistanceHandler implements LinkLeaveEventHandler, VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler {
- private static final Logger LOGGER = Logger.getLogger(TravelDistanceHandler.class.getName());
+ private static final Logger LOGGER = LogManager.getLogger(TravelDistanceHandler.class.getName());
private final Vehicle2DriverEventHandler veh2DriverDelegate = new Vehicle2DriverEventHandler();
private final PersonFilter pf ;
diff --git a/src/main/java/playground/amit/analysis/tripDistance/TripDistanceHandler.java b/src/main/java/playground/amit/analysis/tripDistance/TripDistanceHandler.java
index 4e43e6c36..db2e82117 100644
--- a/src/main/java/playground/amit/analysis/tripDistance/TripDistanceHandler.java
+++ b/src/main/java/playground/amit/analysis/tripDistance/TripDistanceHandler.java
@@ -28,7 +28,8 @@
import java.util.SortedSet;
import java.util.TreeMap;
import java.util.TreeSet;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
@@ -56,7 +57,7 @@
*/
public class TripDistanceHandler implements PersonDepartureEventHandler, LinkLeaveEventHandler,
PersonArrivalEventHandler, TeleportationArrivalEventHandler, VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler {
- private final static Logger LOG = Logger.getLogger(TripDistanceHandler.class);
+ private final static Logger LOG = LogManager.getLogger(TripDistanceHandler.class);
private final Network network;
private final SortedMap, List>> mode2PersonId2distances = new TreeMap<>();
diff --git a/src/main/java/playground/amit/analysis/tripDistance/TripRouteDistanceInTimeBinHandler.java b/src/main/java/playground/amit/analysis/tripDistance/TripRouteDistanceInTimeBinHandler.java
index eeb4a9cf8..e75b80da8 100644
--- a/src/main/java/playground/amit/analysis/tripDistance/TripRouteDistanceInTimeBinHandler.java
+++ b/src/main/java/playground/amit/analysis/tripDistance/TripRouteDistanceInTimeBinHandler.java
@@ -19,7 +19,8 @@
package playground.amit.analysis.tripDistance;
import java.util.*;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.*;
import org.matsim.api.core.v01.events.handler.*;
@@ -38,7 +39,7 @@
public class TripRouteDistanceInTimeBinHandler implements PersonDepartureEventHandler, PersonArrivalEventHandler, LinkLeaveEventHandler,
VehicleEntersTrafficEventHandler, VehicleLeavesTrafficEventHandler {
- private static final Logger LOG = Logger.getLogger(TripRouteDistanceInTimeBinHandler.class);
+ private static final Logger LOG = LogManager.getLogger(TripRouteDistanceInTimeBinHandler.class);
private final SortedMap,Double> personId2TripDepartTimeBin = new TreeMap<>();
private final SortedMap,Integer>> timeBin2Person2TripsCount = new TreeMap<>();
private final SortedMap,List>> timeBin2Person2TripsDistance = new TreeMap<>();
diff --git a/src/main/java/playground/amit/analysis/tripTime/LegModeTripTimeDistributionAnalyzer.java b/src/main/java/playground/amit/analysis/tripTime/LegModeTripTimeDistributionAnalyzer.java
index bd49806be..6433c46c6 100644
--- a/src/main/java/playground/amit/analysis/tripTime/LegModeTripTimeDistributionAnalyzer.java
+++ b/src/main/java/playground/amit/analysis/tripTime/LegModeTripTimeDistributionAnalyzer.java
@@ -20,7 +20,8 @@
import java.io.BufferedWriter;
import java.util.*;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.population.Person;
import org.matsim.core.api.experimental.events.EventsManager;
@@ -41,7 +42,7 @@ public class LegModeTripTimeDistributionAnalyzer extends AbstractAnalysisModule
private final List timeClasses = new ArrayList<>();
private final SortedSet usedModes = new TreeSet<>();
- private static final Logger LOG = Logger.getLogger(LegModeTripTimeDistributionAnalyzer.class);
+ private static final Logger LOG = LogManager.getLogger(LegModeTripTimeDistributionAnalyzer.class);
private final SortedMap> mode2timeClass2LegCount = new TreeMap<>();
private final SortedMap, List>> mode2PersonId2tripTimes = new TreeMap<>();
diff --git a/src/main/java/playground/amit/analysis/userBenefits/MyUserBenefitsAnalyzer.java b/src/main/java/playground/amit/analysis/userBenefits/MyUserBenefitsAnalyzer.java
index 0815b594b..17b5af2c0 100644
--- a/src/main/java/playground/amit/analysis/userBenefits/MyUserBenefitsAnalyzer.java
+++ b/src/main/java/playground/amit/analysis/userBenefits/MyUserBenefitsAnalyzer.java
@@ -19,12 +19,8 @@
package playground.amit.analysis.userBenefits;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.population.Person;
import org.matsim.core.events.handler.EventHandler;
@@ -35,6 +31,12 @@
import playground.vsp.analysis.modules.userBenefits.UserBenefitsCalculator;
import playground.vsp.analysis.modules.userBenefits.WelfareMeasure;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.util.LinkedList;
+import java.util.List;
+import java.util.Map;
+
/**
* This module calculates the logsum for each user and the sum of all user logsums in monetary units.
* Furthermore, it analyzes users with no valid plan, that are not considered for the logsum calculation.
@@ -44,7 +46,7 @@
*/
public class MyUserBenefitsAnalyzer extends AbstractAnalysisModule{
- private static final Logger LOG = Logger.getLogger(UserBenefitsAnalyzer.class);
+ private static final Logger LOG = LogManager.getLogger(UserBenefitsAnalyzer.class);
private MutableScenario scenario;
private UserBenefitsCalculator userWelfareCalculator;
diff --git a/src/main/java/playground/amit/analysis/userBenefits/UserBenefitsAndTotalWelfare.java b/src/main/java/playground/amit/analysis/userBenefits/UserBenefitsAndTotalWelfare.java
index cd989421e..0195c5762 100644
--- a/src/main/java/playground/amit/analysis/userBenefits/UserBenefitsAndTotalWelfare.java
+++ b/src/main/java/playground/amit/analysis/userBenefits/UserBenefitsAndTotalWelfare.java
@@ -18,12 +18,8 @@
* *********************************************************************** */
package playground.amit.analysis.userBenefits;
-import java.io.BufferedWriter;
-import java.io.IOException;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.population.Person;
@@ -33,17 +29,21 @@
import org.matsim.core.events.handler.EventHandler;
import org.matsim.core.scenario.MutableScenario;
import org.matsim.core.utils.io.IOUtils;
-
import playground.amit.utils.LoadMyScenarios;
import playground.vsp.analysis.modules.monetaryTransferPayments.MonetaryPaymentsAnalyzer;
import playground.vsp.analysis.modules.userBenefits.WelfareMeasure;
+import java.io.BufferedWriter;
+import java.io.IOException;
+import java.util.List;
+import java.util.Map;
+
/**
* @author amit
*/
public class UserBenefitsAndTotalWelfare {
- public static final Logger LOGGER = Logger.getLogger(UserBenefitsAndTotalWelfare.class);
+ public static final Logger LOGGER = LogManager.getLogger(UserBenefitsAndTotalWelfare.class);
private final String outputDir;
private static final WelfareMeasure WM = WelfareMeasure.SELECTED;
private MutableScenario sc;
diff --git a/src/main/java/playground/amit/berlin/berlinBVG09/BerlinEmissionVehicleFromEvents.java b/src/main/java/playground/amit/berlin/berlinBVG09/BerlinEmissionVehicleFromEvents.java
index d9f832c69..157a61d5e 100644
--- a/src/main/java/playground/amit/berlin/berlinBVG09/BerlinEmissionVehicleFromEvents.java
+++ b/src/main/java/playground/amit/berlin/berlinBVG09/BerlinEmissionVehicleFromEvents.java
@@ -20,9 +20,8 @@
package playground.amit.berlin.berlinBVG09;
-import java.util.HashMap;
-import java.util.Map;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.TransitDriverStartsEvent;
import org.matsim.api.core.v01.events.VehicleEntersTrafficEvent;
@@ -36,12 +35,15 @@
import org.matsim.vehicles.*;
import playground.amit.utils.FileUtils;
+import java.util.HashMap;
+import java.util.Map;
+
/**
* @author benjamin
*
*/
public class BerlinEmissionVehicleFromEvents implements VehicleEntersTrafficEventHandler, TransitDriverStartsEventHandler {
- private static final Logger LOGGER = Logger.getLogger(BerlinEmissionVehicleFromEvents.class);
+ private static final Logger LOGGER = LogManager.getLogger(BerlinEmissionVehicleFromEvents.class);
private final BerlinTransitVehicleTypeIdentifier berlinTransitVehicleTypeIdentifier;
private final Map,Id> transitDriver2TransitVehicle = new HashMap<>();
diff --git a/src/main/java/playground/amit/berlin/berlinBVG09/BerlinEmissionVehicleFromPlans.java b/src/main/java/playground/amit/berlin/berlinBVG09/BerlinEmissionVehicleFromPlans.java
index a944ecb11..67b71a391 100644
--- a/src/main/java/playground/amit/berlin/berlinBVG09/BerlinEmissionVehicleFromPlans.java
+++ b/src/main/java/playground/amit/berlin/berlinBVG09/BerlinEmissionVehicleFromPlans.java
@@ -19,8 +19,8 @@
* *********************************************************************** */
package playground.amit.berlin.berlinBVG09;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.population.Person;
@@ -35,7 +35,7 @@
*
*/
public class BerlinEmissionVehicleFromPlans {
- private static final Logger logger = Logger.getLogger(BerlinEmissionVehicleFromEvents.class);
+ private static final Logger logger = LogManager.getLogger(BerlinEmissionVehicleFromEvents.class);
private final String populationFile = FileUtils.RUNS_SVN+"/berlin-bvg09/bvg.run189.10pct/ITERS/it.100/bvg.run189.10pct.100.plans.filtered.selected.xml.gz";
private final String netFile = FileUtils.RUNS_SVN+"/berlin-bvg09/bvg.run189.10pct/emissionsRelatedFiles/rev554B-bvg00-0.1sample.network_withRoadTypes.xml";
diff --git a/src/main/java/playground/amit/berlin/berlinBVG09/BerlinPersonFilter.java b/src/main/java/playground/amit/berlin/berlinBVG09/BerlinPersonFilter.java
index 46bb3fd1c..20b02e100 100644
--- a/src/main/java/playground/amit/berlin/berlinBVG09/BerlinPersonFilter.java
+++ b/src/main/java/playground/amit/berlin/berlinBVG09/BerlinPersonFilter.java
@@ -19,14 +19,16 @@
package playground.amit.berlin.berlinBVG09;
-import java.util.Arrays;
-import java.util.List;
-import java.util.stream.Collectors;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.population.Person;
import playground.amit.utils.PersonFilter;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
/**
* Created by amit on 11.06.17.
*/
@@ -34,7 +36,7 @@
public class BerlinPersonFilter implements PersonFilter {
- private static final Logger LOGGER = Logger.getLogger(BerlinPersonFilter.class);
+ private static final Logger LOGGER = LogManager.getLogger(BerlinPersonFilter.class);
public enum BerlinUserGroup {
carUsers_berlin, carUsers_brandenburger, carUsers_tourists, carUsers_airport,
diff --git a/src/main/java/playground/amit/berlin/berlinBVG09/BerlinTransitVehicleTypeIdentifier.java b/src/main/java/playground/amit/berlin/berlinBVG09/BerlinTransitVehicleTypeIdentifier.java
index 11cbf429a..84c3a667c 100644
--- a/src/main/java/playground/amit/berlin/berlinBVG09/BerlinTransitVehicleTypeIdentifier.java
+++ b/src/main/java/playground/amit/berlin/berlinBVG09/BerlinTransitVehicleTypeIdentifier.java
@@ -23,7 +23,8 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.contrib.emissions.HbefaVehicleCategory;
@@ -44,7 +45,7 @@ public enum BerlinTransitEmissionVehicleType {
BUS_AS_HGV, TRAINS_AS_ZERO_EMISSIONS
}
- private static final Logger LOGGER = Logger.getLogger(BerlinTransitVehicleTypeIdentifier.class);
+ private static final Logger LOGGER = LogManager.getLogger(BerlinTransitVehicleTypeIdentifier.class);
private final Map>> vehicleCategoryToVehicleTypeList = new HashMap<>();
private Vehicles transitVehicles;
private final Map, BerlinTransitEmissionVehicleType> transitVehicleType2BerlinVehicleType = new HashMap<>();
diff --git a/src/main/java/playground/amit/clustering/ClusterAlgorithm.java b/src/main/java/playground/amit/clustering/ClusterAlgorithm.java
index 06bce7343..595d84c0f 100644
--- a/src/main/java/playground/amit/clustering/ClusterAlgorithm.java
+++ b/src/main/java/playground/amit/clustering/ClusterAlgorithm.java
@@ -19,15 +19,17 @@
package playground.amit.clustering;
-import java.awt.*;
-import java.util.*;
-import java.util.List;
-import javax.swing.*;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.jfree.chart.ChartPanel;
import org.matsim.core.utils.charts.XYScatterChart;
import playground.amit.utils.NumberUtils;
+import javax.swing.*;
+import java.awt.*;
+import java.util.List;
+import java.util.*;
+
/**
*
* If weight of all points is 1, it is called as K-Mean cluster algorithm
@@ -53,7 +55,7 @@ public enum ClusterType {
*/
K_MEANS }
- private static final Logger LOGGER = Logger.getLogger(ClusterAlgorithm.class);
+ private static final Logger LOGGER = LogManager.getLogger(ClusterAlgorithm.class);
private final int numberOfClusters;
private final BoundingBox boundingBox;
diff --git a/src/main/java/playground/amit/congestionPricing/testExamples/handlers/CongestionTestExamples.java b/src/main/java/playground/amit/congestionPricing/testExamples/handlers/CongestionTestExamples.java
index 7d5b7b239..482a75831 100644
--- a/src/main/java/playground/amit/congestionPricing/testExamples/handlers/CongestionTestExamples.java
+++ b/src/main/java/playground/amit/congestionPricing/testExamples/handlers/CongestionTestExamples.java
@@ -18,12 +18,7 @@
* *********************************************************************** */
package playground.amit.congestionPricing.testExamples.handlers;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.events.LinkEnterEvent;
@@ -39,12 +34,16 @@
import org.matsim.core.mobsim.qsim.QSim;
import org.matsim.core.mobsim.qsim.QSimBuilder;
import org.matsim.core.utils.collections.Tuple;
-
import playground.vsp.congestion.events.CongestionEvent;
import playground.vsp.congestion.handlers.CongestionEventHandler;
import playground.vsp.congestion.handlers.CongestionHandlerImplV3;
import playground.vsp.congestion.handlers.CongestionHandlerImplV4;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
/**
* @author amit
*/
@@ -153,7 +152,7 @@ public void handleEvent(CongestionEvent event) {
if(congestionPricingImpl.equalsIgnoreCase("v3")) {
events.addHandler(new CongestionHandlerImplV3(events, sc));
- Logger.getLogger(CongestionTestExamples.class).warn("The analysis table is generated using events and thus there are some delays unaccounted in implV3.");
+ LogManager.getLogger(CongestionTestExamples.class).warn("The analysis table is generated using events and thus there are some delays unaccounted in implV3.");
}
else if(congestionPricingImpl.equalsIgnoreCase("v4")) events.addHandler(new CongestionHandlerImplV4(events, sc));
// else if(congestionPricingImpl.equalsIgnoreCase("v6")) events.addHandler(new CongestionHandlerImplV6(events, sc));
diff --git a/src/main/java/playground/amit/congestionPricing/testExamples/handlers/TestNetworkExperiment.java b/src/main/java/playground/amit/congestionPricing/testExamples/handlers/TestNetworkExperiment.java
index ac6ff6495..df1125837 100644
--- a/src/main/java/playground/amit/congestionPricing/testExamples/handlers/TestNetworkExperiment.java
+++ b/src/main/java/playground/amit/congestionPricing/testExamples/handlers/TestNetworkExperiment.java
@@ -27,7 +27,8 @@
import java.util.Map;
import java.util.Set;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Coord;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
@@ -66,7 +67,7 @@
* @author amit
*/
class TestNetworkExperiment {
- final Logger log = Logger.getLogger(TestNetworkExperiment.class);
+ final Logger log = LogManager.getLogger(TestNetworkExperiment.class);
public static void main(String[] args) {
diff --git a/src/main/java/playground/amit/emissions/flatEmissions/EmissionModalTravelDisutilityCalculator.java b/src/main/java/playground/amit/emissions/flatEmissions/EmissionModalTravelDisutilityCalculator.java
index 5b13f6d65..60d3eabe5 100644
--- a/src/main/java/playground/amit/emissions/flatEmissions/EmissionModalTravelDisutilityCalculator.java
+++ b/src/main/java/playground/amit/emissions/flatEmissions/EmissionModalTravelDisutilityCalculator.java
@@ -19,11 +19,8 @@
package playground.amit.emissions.flatEmissions;
-import java.util.Map;
-import java.util.Set;
-import java.util.stream.Collectors;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.population.Person;
@@ -37,16 +34,19 @@
import org.matsim.vehicles.Vehicle;
import org.matsim.vehicles.VehicleUtils;
import org.matsim.vehicles.Vehicles;
-
import playground.vsp.airPollution.flatEmissions.EmissionCostModule;
+import java.util.Map;
+import java.util.Set;
+import java.util.stream.Collectors;
+
/**
* @author benjamin
*
*/
class EmissionModalTravelDisutilityCalculator implements TravelDisutility {
- public static final Logger LOGGER = Logger.getLogger(EmissionModalTravelDisutilityCalculator.class);
+ public static final Logger LOGGER = LogManager.getLogger(EmissionModalTravelDisutilityCalculator.class);
private final TravelDisutility travelDisutility;
private final TravelTime travelTime;
diff --git a/src/main/java/playground/amit/emissions/onRoadExposure/OnRoadExposureCalculator.java b/src/main/java/playground/amit/emissions/onRoadExposure/OnRoadExposureCalculator.java
index 9e856a032..d54545c71 100644
--- a/src/main/java/playground/amit/emissions/onRoadExposure/OnRoadExposureCalculator.java
+++ b/src/main/java/playground/amit/emissions/onRoadExposure/OnRoadExposureCalculator.java
@@ -19,11 +19,13 @@
package playground.amit.emissions.onRoadExposure;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+import org.matsim.contrib.emissions.Pollutant;
+
+import javax.inject.Inject;
import java.util.Map;
import java.util.stream.Collectors;
-import javax.inject.Inject;
-import org.apache.log4j.Logger;
-import org.matsim.contrib.emissions.Pollutant;
/**
* Created by amit on 08.11.17.
@@ -31,7 +33,7 @@
public class OnRoadExposureCalculator {
- private static final Logger LOGGER = Logger.getLogger(OnRoadExposureCalculator.class);
+ private static final Logger LOGGER = LogManager.getLogger(OnRoadExposureCalculator.class);
private final OnRoadExposureConfigGroup config;
diff --git a/src/main/java/playground/amit/emissions/onRoadExposure/OnRoadExposureTable.java b/src/main/java/playground/amit/emissions/onRoadExposure/OnRoadExposureTable.java
index 360e79763..6472e6ee5 100644
--- a/src/main/java/playground/amit/emissions/onRoadExposure/OnRoadExposureTable.java
+++ b/src/main/java/playground/amit/emissions/onRoadExposure/OnRoadExposureTable.java
@@ -22,7 +22,8 @@
import java.util.*;
import java.util.stream.Collectors;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.population.Person;
@@ -34,7 +35,7 @@
public class OnRoadExposureTable {
- private static final Logger LOG = Logger.getLogger(OnRoadExposureTable.class);
+ private static final Logger LOG = LogManager.getLogger(OnRoadExposureTable.class);
private Map, List> personInfo = new HashMap<>();
/**
diff --git a/src/main/java/playground/amit/fundamentalDiagrams/RunFDDataExample.java b/src/main/java/playground/amit/fundamentalDiagrams/RunFDDataExample.java
index 776f3eec0..42900cc42 100644
--- a/src/main/java/playground/amit/fundamentalDiagrams/RunFDDataExample.java
+++ b/src/main/java/playground/amit/fundamentalDiagrams/RunFDDataExample.java
@@ -25,6 +25,7 @@
import org.matsim.core.controler.Controler;
import org.matsim.core.scenario.ScenarioUtils;
import playground.amit.fundamentalDiagrams.core.FDModule;
+import playground.shivam.trafficChar.core.TrafficCharConfigGroup;
/**
* Created by amit on 16/02/2017.
diff --git a/src/main/java/playground/amit/fundamentalDiagrams/RunFDTrafficCharExample.java b/src/main/java/playground/amit/fundamentalDiagrams/RunFDTrafficCharExample.java
index cb57bac8a..596014271 100644
--- a/src/main/java/playground/amit/fundamentalDiagrams/RunFDTrafficCharExample.java
+++ b/src/main/java/playground/amit/fundamentalDiagrams/RunFDTrafficCharExample.java
@@ -22,6 +22,8 @@
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
+import org.matsim.api.core.v01.network.Link;
+import org.matsim.api.core.v01.network.Network;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.config.groups.ChangeModeConfigGroup;
import org.matsim.core.config.groups.QSimConfigGroup;
@@ -60,7 +62,6 @@ public static void main(String[] args) {
String outFolder ="/1lane/";
scenario.getConfig().controler().setOutputDirectory(myDir+outFolder);
-
QSimConfigGroup qsim = scenario.getConfig().qsim();
List mainModes = Arrays.asList("car", "bicycle");
qsim.setMainModes(mainModes);
@@ -84,11 +85,10 @@ public static void main(String[] args) {
trafficCharConfigGroup.addQSimConfigGroup(TrafficCharConfigGroup.ROAD_TYPE_DEFAULT, scenario.getConfig().qsim());
-// scenario.getConfig().getModules().put(TrafficCharConfigGroup.GROUP_NAME, trafficCharConfigGroup);
+ scenario.getConfig().getModules().put(TrafficCharConfigGroup.GROUP_NAME, trafficCharConfigGroup);
Controler controler = new Controler(scenario);
- controler.addOverridingModule(new FDModule(scenario));
+ controler.addOverridingModule(new FDModule(scenario, "PassingQ"));
controler.run();
-
}
}
diff --git a/src/main/java/playground/amit/fundamentalDiagrams/core/FDModule.java b/src/main/java/playground/amit/fundamentalDiagrams/core/FDModule.java
index e79f91cd0..b41bdbec9 100644
--- a/src/main/java/playground/amit/fundamentalDiagrams/core/FDModule.java
+++ b/src/main/java/playground/amit/fundamentalDiagrams/core/FDModule.java
@@ -22,7 +22,8 @@
import java.util.Arrays;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.apache.logging.log4j.Level;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.core.LoggerContext;
@@ -33,6 +34,7 @@
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
+import org.matsim.api.core.v01.network.NetworkFactory;
import org.matsim.api.core.v01.population.PopulationWriter;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.config.ConfigWriter;
@@ -61,7 +63,7 @@
public class FDModule extends AbstractModule {
- public static final Logger LOG = Logger.getLogger(FDModule.class);
+ public static final Logger LOG = LogManager.getLogger(FDModule.class);
public static final double MAX_ACT_END_TIME = 1800.;
@@ -73,15 +75,13 @@ public class FDModule extends AbstractModule {
private String[] travelModes;
private final FDConfigGroup FDConfigGroup;
- public FDModule(final Scenario scenario){
+ public FDModule(final Scenario scenario, String linkDynamics){
FDConfigGroup = ConfigUtils.addOrGetModule(scenario.getConfig(), FDConfigGroup.class);
fdNetworkGenerator = new FDNetworkGenerator(FDConfigGroup);
this.scenario = scenario;
fdNetworkGenerator.createNetwork(this.scenario.getNetwork());
- if (scenario.getConfig().getModules().containsKey(TrafficCharConfigGroup.GROUP_NAME))
- changeLinkDynamicsOnNetwork(this.scenario.getNetwork());
-
+ changeLinkDynamics(scenario.getNetwork(), linkDynamics);
checkForConsistencyAndInitialize();
setUpConfig();
@@ -90,16 +90,27 @@ public FDModule(final Scenario scenario){
new MatsimVehicleWriter(scenario.getVehicles()).writeFile(this.runDir+"/output_vehicles.xml");
new PopulationWriter(scenario.getPopulation()).write(this.runDir + "/output_plans.xml");
}
+ public FDModule(final Scenario scenario){
+ FDConfigGroup = ConfigUtils.addOrGetModule(scenario.getConfig(), FDConfigGroup.class);
+ fdNetworkGenerator = new FDNetworkGenerator(FDConfigGroup);
+ this.scenario = scenario;
+ fdNetworkGenerator.createNetwork(this.scenario.getNetwork());
+ checkForConsistencyAndInitialize();
+ setUpConfig();
- private void changeLinkDynamicsOnNetwork(Network network) {
+ new ConfigWriter(scenario.getConfig()).write(this.runDir+"/output_config.xml");
+ new NetworkWriter(scenario.getNetwork()).write(this.runDir+"/output_network.xml");
+ new MatsimVehicleWriter(scenario.getVehicles()).writeFile(this.runDir+"/output_vehicles.xml");
+ new PopulationWriter(scenario.getPopulation()).write(this.runDir + "/output_plans.xml");
+ }
+ private void changeLinkDynamics(Network network, String linkDynamics) {
for (Link link: network.getLinks().values()) {
if (link.getId().equals(Id.createLinkId("1")) | link.getId().equals(Id.createLinkId("2")))
- link.getAttributes().putAttribute(TrafficCharConfigGroup.ROAD_TYPE, "PassingQ");
+ link.getAttributes().putAttribute(TrafficCharConfigGroup.ROAD_TYPE, linkDynamics);
else
link.getAttributes().putAttribute(TrafficCharConfigGroup.ROAD_TYPE, TrafficCharConfigGroup.ROAD_TYPE_DEFAULT);
}
}
-
private void checkForConsistencyAndInitialize(){
this.runDir = scenario.getConfig().controler().getOutputDirectory();
if(runDir==null) throw new RuntimeException("Location to write data for FD is not set. Aborting...");
@@ -163,7 +174,7 @@ else if (this.travelModes.length==1 && this.travelModes[0].equals("truck"))
//TODO probably, following is not required anymore.
// if ( scenario.getConfig().network().isTimeVariantNetwork() ) {
// Network netImpl = scenario.getNetwork();
-// netImpl.getFactory().setLinkFactory(new VariableIntervalTimeVariantLinkFactory());
+// netImpl.getFactory().(new VariableIntervalTimeVariantLinkFactory());
// }
StrategyConfigGroup.StrategySettings ss = new StrategyConfigGroup.StrategySettings();
diff --git a/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/areaSpeedRatioMethod/RunDynamicPCUExample.java b/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/areaSpeedRatioMethod/RunDynamicPCUExample.java
index e8d0bcbaf..a8d3bd109 100644
--- a/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/areaSpeedRatioMethod/RunDynamicPCUExample.java
+++ b/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/areaSpeedRatioMethod/RunDynamicPCUExample.java
@@ -19,8 +19,6 @@
package playground.amit.fundamentalDiagrams.dynamicPCU.areaSpeedRatioMethod;
-import java.util.Arrays;
-import java.util.List;
import org.apache.commons.lang.StringUtils;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
@@ -41,6 +39,10 @@
import playground.amit.fundamentalDiagrams.dynamicPCU.areaSpeedRatioMethod.estimation.ChandraSikdarPCUUpdator;
import playground.amit.fundamentalDiagrams.dynamicPCU.areaSpeedRatioMethod.projectedArea.VehicleProjectedAreaRatio;
import playground.amit.mixedTraffic.MixedTrafficVehiclesUtils;
+import playground.shivam.trafficChar.core.TrafficCharConfigGroup;
+
+import java.util.Arrays;
+import java.util.List;
/**
* Created by amit on 29.06.17.
@@ -54,9 +56,9 @@ public static void main(String[] args) {
boolean updatePCU = true;
PCUMethod pcuMethod = PCUMethod.SPEED_AREA_RATIO;
- String parentDir = "../../svnit/outputFiles/mixedModes/passing/staticPCU/";
+ String parentDir = "output/staticPCU/";
if(updatePCU) {
- parentDir = "../../svnit/outputFiles/mixedModes/passing/dynamicPCU/"+pcuMethod+"/";
+ parentDir = "output/dynamicPCU/"+pcuMethod+"/";
}
Config config = ConfigUtils.createConfig();
@@ -90,8 +92,18 @@ public static void main(String[] args) {
vehicles.addVehicleType(veh);
}
+ TrafficCharConfigGroup trafficCharConfigGroup = new TrafficCharConfigGroup();
+ QSimConfigGroup qSimConfigGroupPassingQ = new QSimConfigGroup();
+ qSimConfigGroupPassingQ.setLinkDynamics(QSimConfigGroup.LinkDynamics.FIFO);
+ trafficCharConfigGroup.addQSimConfigGroup("FIFO", qSimConfigGroupPassingQ);
+
+ trafficCharConfigGroup.addQSimConfigGroup(TrafficCharConfigGroup.ROAD_TYPE_DEFAULT, scenario.getConfig().qsim());
+
+ scenario.getConfig().getModules().put(TrafficCharConfigGroup.GROUP_NAME, trafficCharConfigGroup);
+
+
Controler controler = new Controler(scenario);
- controler.addOverridingModule(new FDModule(scenario));
+ controler.addOverridingModule(new FDModule(scenario, "FIFO"));
controler.addOverridingModule(new AbstractModule() {
@Override
public void install() {
@@ -107,4 +119,5 @@ public void install() {
FDUtils.cleanOutputDir(scenario.getConfig().controler().getOutputDirectory());
}
+
}
\ No newline at end of file
diff --git a/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/areaSpeedRatioMethod/estimation/ChandraSikdarPCUUpdator.java b/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/areaSpeedRatioMethod/estimation/ChandraSikdarPCUUpdator.java
index 022b52f9c..31bffdc22 100644
--- a/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/areaSpeedRatioMethod/estimation/ChandraSikdarPCUUpdator.java
+++ b/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/areaSpeedRatioMethod/estimation/ChandraSikdarPCUUpdator.java
@@ -83,8 +83,9 @@ public class ChandraSikdarPCUUpdator implements VehicleEntersTrafficEventHandler
private final FDConfigGroup fdConfigGroup;
@Inject
- public ChandraSikdarPCUUpdator(final Scenario scenario, final FDNetworkGenerator fdNetworkGenerator
- , FDDataContainer fdDataContainer, FDStabilityTester fdStabilityTester, FDConfigGroup fdConfigGroup){
+ public ChandraSikdarPCUUpdator(final Scenario scenario, final FDNetworkGenerator fdNetworkGenerator,
+ FDDataContainer fdDataContainer, FDStabilityTester fdStabilityTester,
+ FDConfigGroup fdConfigGroup){
this.scenario = scenario;
this.fdDataContainer = fdDataContainer;
this.fdStabilityTester = fdStabilityTester;
@@ -127,7 +128,7 @@ public void handleEvent(LinkLeaveEvent event) {
addVehicleTypeToPCU(mode, PCUMethod.SPEED_AREA_RATIO, pcu);
}
{
- // AREA_SPEED_RATIO_method
+ // HEADWAY_RATIO_method
double pcu = NumberUtils.round(calculateHeadwayPCU(mode), 3);
addVehicleTypeToPCU(mode, PCUMethod.HEADWAY_RATIO, pcu);
@@ -182,11 +183,11 @@ private double getAreaRatio(String mode){
// if ( EnumUtils.isValidEnum(VehicleProjectedAreaRatio.class, mode) ){
// return VehicleProjectedAreaRatio.getProjectedAreaRatio(mode);
// } else {
- return (double) ( scenario.getVehicles()
- .getVehicleTypes()
- .get(Id.create(mode, VehicleType.class))).getAttributes()
- .getAttribute(
- projected_area_ratio);
+ return (double) (scenario.getVehicles()
+ .getVehicleTypes()
+ .get(Id.create(mode, VehicleType.class))
+ ).getAttributes()
+ .getAttribute(projected_area_ratio);
// }
}
diff --git a/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/surveyData/RunSurveyData.java b/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/surveyData/RunSurveyData.java
index 901263c1a..7a67af382 100644
--- a/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/surveyData/RunSurveyData.java
+++ b/src/main/java/playground/amit/fundamentalDiagrams/dynamicPCU/surveyData/RunSurveyData.java
@@ -19,7 +19,6 @@
package playground.amit.fundamentalDiagrams.dynamicPCU.surveyData;
-import java.util.List;
import com.google.inject.Key;
import com.google.inject.name.Names;
import org.matsim.api.core.v01.Id;
@@ -42,6 +41,8 @@
import playground.amit.fundamentalDiagrams.dynamicPCU.PCUMethod;
import playground.amit.fundamentalDiagrams.dynamicPCU.areaSpeedRatioMethod.estimation.ChandraSikdarPCUUpdator;
+import java.util.List;
+
/**
* Created by amit on 23.05.18.
*/
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/OnRoadExposure/PatnaOnRoadExposure.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/OnRoadExposure/PatnaOnRoadExposure.java
index eb51304e3..4edf98721 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/OnRoadExposure/PatnaOnRoadExposure.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/OnRoadExposure/PatnaOnRoadExposure.java
@@ -19,18 +19,8 @@
package playground.amit.mixedTraffic.patnaIndia.OnRoadExposure;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.IOException;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.TreeSet;
-import java.util.stream.Collectors;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.locationtech.jts.geom.Geometry;
import org.matsim.api.core.v01.Coord;
import org.matsim.api.core.v01.Id;
@@ -49,7 +39,6 @@
import org.matsim.core.utils.gis.ShapeFileReader;
import org.matsim.core.utils.io.IOUtils;
import org.opengis.feature.simple.SimpleFeature;
-
import playground.amit.emissions.onRoadExposure.OnRoadExposureConfigGroup;
import playground.amit.emissions.onRoadExposure.OnRoadExposureHandler;
import playground.amit.emissions.onRoadExposure.OnRoadExposureTable.OnRoadTripExposureInfo;
@@ -59,6 +48,12 @@
import playground.amit.utils.FileUtils;
import playground.amit.utils.LoadMyScenarios;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.IOException;
+import java.util.*;
+import java.util.stream.Collectors;
+
/**
* Created by amit on 17.11.17.
*/
@@ -70,7 +65,7 @@ public class PatnaOnRoadExposure {
private static final CoordinateTransformation ct = TransformationFactory.getCoordinateTransformation(PatnaUtils.EPSG, TransformationFactory.WGS84);
private static final String networkFile = "";
- private static final Logger LOG = Logger.getLogger(PatnaOnRoadExposure.class);
+ private static final Logger LOG = LogManager.getLogger(PatnaOnRoadExposure.class);
private static final boolean writeEmissionEventsFirst = false;
// private static final String data_dates [] = {"none","_22Nov2017","_22Jan2018","_22Mar2018","_22May2018"};
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/OnRoadExposure/PatnaOnlineEmissionsWriter.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/OnRoadExposure/PatnaOnlineEmissionsWriter.java
index f7bd9977e..49b922889 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/OnRoadExposure/PatnaOnlineEmissionsWriter.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/OnRoadExposure/PatnaOnlineEmissionsWriter.java
@@ -71,7 +71,7 @@ public static void main(String[] args) {
config.vspExperimental().setVspDefaultsCheckingLevel(VspExperimentalConfigGroup.VspDefaultsCheckingLevel.warn);
EmissionsConfigGroup ecg = ConfigUtils.addOrGetModule(config, EmissionsConfigGroup.class);
-// ecg.setUsingDetailedEmissionCalculation(false);
+ ecg.setUsingDetailedEmissionCalculationStringSetter(false);
ecg.setUsingVehicleTypeIdAsVehicleDescription(false);
ecg.setAverageColdEmissionFactorsFile(avgColdEmissFile);
ecg.setAverageWarmEmissionFactorsFile(avgWarmEmissFile);
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/analysis/PatnaModalShareSubPop.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/analysis/PatnaModalShareSubPop.java
index b5b2473a3..ae7ac2e15 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/analysis/PatnaModalShareSubPop.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/analysis/PatnaModalShareSubPop.java
@@ -18,27 +18,27 @@
* *********************************************************************** */
package playground.amit.mixedTraffic.patnaIndia.analysis;
-import java.io.BufferedWriter;
-import java.util.SortedMap;
-import java.util.TreeMap;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Scenario;
import org.matsim.core.utils.io.IOUtils;
-
import playground.amit.analysis.modalShare.ModalShareFromEvents;
import playground.amit.analysis.modalShare.ModalShareFromPlans;
import playground.amit.mixedTraffic.patnaIndia.utils.PatnaPersonFilter;
import playground.amit.mixedTraffic.patnaIndia.utils.PatnaPersonFilter.PatnaUserGroup;
import playground.amit.utils.LoadMyScenarios;
+import java.io.BufferedWriter;
+import java.util.SortedMap;
+import java.util.TreeMap;
+
/**
* @author amit
*/
public class PatnaModalShareSubPop {
- private final static Logger LOG = Logger.getLogger(PatnaModalShareSubPop.class);
+ private final static Logger LOG = LogManager.getLogger(PatnaModalShareSubPop.class);
private final SortedMap> userGrp2Mode2Legs = new TreeMap<>();
private final SortedMap> userGrp2ModalSplit = new TreeMap<>();
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/DiscountedPTFareHandler.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/DiscountedPTFareHandler.java
index 89e246225..e906988d1 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/DiscountedPTFareHandler.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/DiscountedPTFareHandler.java
@@ -19,11 +19,9 @@
package playground.amit.mixedTraffic.patnaIndia.covidWork;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
+import com.google.inject.Inject;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.events.Event;
@@ -34,11 +32,12 @@
import org.matsim.core.api.experimental.events.EventsManager;
import org.matsim.core.api.experimental.events.TeleportationArrivalEvent;
import org.matsim.core.api.experimental.events.handler.TeleportationArrivalEventHandler;
-
-import com.google.inject.Inject;
-
import playground.amit.mixedTraffic.patnaIndia.utils.PatnaUtils;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
/**
* The fare calculation is taken from KumarEtc2004PTCost.
*
@@ -47,7 +46,7 @@
public class DiscountedPTFareHandler implements PersonDepartureEventHandler, TeleportationArrivalEventHandler{
- public static final Logger logger = Logger.getLogger(DiscountedPTFareHandler.class);
+ public static final Logger logger = LogManager.getLogger(DiscountedPTFareHandler.class);
private final Map,String> person2mode = new HashMap<>();
//peak is 7 to 10 and 15 to 18; in the form of 1 to 24.
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/FilterDemandBasedOnTripPurpose.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/FilterDemandBasedOnTripPurpose.java
index 4682550eb..a8b182a5e 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/FilterDemandBasedOnTripPurpose.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/FilterDemandBasedOnTripPurpose.java
@@ -1,6 +1,7 @@
package playground.amit.mixedTraffic.patnaIndia.covidWork;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.locationtech.jts.geom.Coordinate;
import org.locationtech.jts.geom.Geometry;
import org.locationtech.jts.geom.GeometryFactory;
@@ -21,7 +22,7 @@
*/
public class FilterDemandBasedOnTripPurpose {
- private final Logger logger = Logger.getLogger(FilterDemandBasedOnTripPurpose.class);
+ private final Logger logger = LogManager.getLogger(FilterDemandBasedOnTripPurpose.class);
private static final Random random = MatsimRandom.getRandom();
private final Collection features;
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/MyChangeTripMode.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/MyChangeTripMode.java
index a7d671d59..9ecea50ed 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/MyChangeTripMode.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/MyChangeTripMode.java
@@ -21,9 +21,9 @@ public class MyChangeTripMode implements Provider {
private final GlobalConfigGroup globalConfigGroup;
private final ChangeModeConfigGroup changeLegModeConfigGroup;
- private Provider tripRouterProvider;
- private ActivityFacilities activityFacilities;
- private TimeInterpretation timeInterpretation;
+ private final Provider tripRouterProvider;
+ private final ActivityFacilities activityFacilities;
+ private final TimeInterpretation timeInterpretation;
@Inject
protected MyChangeTripMode(GlobalConfigGroup globalConfigGroup, ChangeModeConfigGroup changeLegModeConfigGroup, ActivityFacilities activityFacilities, Provider tripRouterProvider, TimeInterpretation timeInterpretation) {
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/PatnaCovidPolicyControler.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/PatnaCovidPolicyControler.java
index c5d32a18d..1ddd2eda7 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/PatnaCovidPolicyControler.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/PatnaCovidPolicyControler.java
@@ -1,6 +1,6 @@
package playground.amit.mixedTraffic.patnaIndia.covidWork;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.core.config.Config;
@@ -44,7 +44,7 @@
public class PatnaCovidPolicyControler {
- public static final Logger logger = Logger.getLogger(PatnaCovidPolicyControler.class);
+ public static final Logger logger = LogManager.getLogger(PatnaCovidPolicyControler.class);
// private static final String wfh_walk = "WFHwalk";
public static void main(String[] args) {
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/PatnaWFHCalibrationControler.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/PatnaWFHCalibrationControler.java
index c69eabe12..268ed3314 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/PatnaWFHCalibrationControler.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/PatnaWFHCalibrationControler.java
@@ -1,6 +1,6 @@
package playground.amit.mixedTraffic.patnaIndia.covidWork.wfh;
-
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
import org.matsim.api.core.v01.population.*;
@@ -33,7 +33,7 @@
public class PatnaWFHCalibrationControler {
- public static final Logger logger = Logger.getLogger(PatnaWFHCalibrationControler.class);
+ public static final Logger logger = LogManager.getLogger(PatnaWFHCalibrationControler.class);
// private static final String wfh_walk = "WFHwalk";
public static void main(String[] args) {
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WFHCounterControlerListner.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WFHCounterControlerListner.java
index a3943caf3..636dc97f8 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WFHCounterControlerListner.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WFHCounterControlerListner.java
@@ -1,6 +1,7 @@
package playground.amit.mixedTraffic.patnaIndia.covidWork.wfh;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.population.*;
import org.matsim.core.config.groups.ControlerConfigGroup;
import org.matsim.core.controler.OutputDirectoryHierarchy;
@@ -22,7 +23,7 @@
*/
public class WFHCounterControlerListner implements IterationEndsListener, ShutdownListener {
- public static final Logger LOGGER = Logger.getLogger(WFHCounterControlerListner.class);
+ public static final Logger LOGGER = LogManager.getLogger(WFHCounterControlerListner.class);
public static final String FILENAME = "workFromHomeStats";
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WFHPricing.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WFHPricing.java
index 1bd719fb1..926f782bb 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WFHPricing.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WFHPricing.java
@@ -1,7 +1,8 @@
package playground.amit.mixedTraffic.patnaIndia.covidWork.wfh;
import com.google.inject.Inject;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.events.*;
import org.matsim.api.core.v01.events.handler.ActivityEndEventHandler;
@@ -28,7 +29,7 @@
*/
public class WFHPricing implements ActivityStartEventHandler, ActivityEndEventHandler, AfterMobsimListener {
- private final static Logger LOGGER = Logger.getLogger(WFHPricing.class);
+ private final static Logger LOGGER = LogManager.getLogger(WFHPricing.class);
private final String TYPE = "PENALTY_WORKING_HOME";
private final String PARTNER = "SELF";
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WorkFromHomeModule.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WorkFromHomeModule.java
index 9c50abc4f..f97949050 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WorkFromHomeModule.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/covidWork/wfh/WorkFromHomeModule.java
@@ -42,14 +42,12 @@ public void install() {
Scenario sc;
@Inject
Provider tripRouterProvider ;
- @Inject
- TimeInterpretation timeInterpretation;
@Override
public PlanStrategy get() {
final PlanStrategyImpl.Builder builder = new PlanStrategyImpl.Builder(new RandomPlanSelector<>());
builder.addStrategyModule(new WorkFromHome(sc.getConfig().global(), actTypes, wfhMode));
- builder.addStrategyModule(new ReRoute(sc, tripRouterProvider, timeInterpretation));
+ builder.addStrategyModule(new ReRoute(sc, tripRouterProvider, TimeInterpretation.create(this.sc.getConfig())));
return builder.build();
}
});
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/evac/EvacuationPatnaScenarioGenerator.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/evac/EvacuationPatnaScenarioGenerator.java
index 7e2c1f045..a26f35d9b 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/evac/EvacuationPatnaScenarioGenerator.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/evac/EvacuationPatnaScenarioGenerator.java
@@ -63,7 +63,6 @@
import org.matsim.core.utils.geometry.geotools.MGC;
import org.matsim.core.utils.geometry.transformations.TransformationFactory;
import org.matsim.core.utils.gis.ShapeFileReader;
-import org.matsim.evacuationgui.utils.ScenarioCRSTransformation;
import org.matsim.facilities.FacilitiesUtils;
import org.matsim.utils.objectattributes.attributable.Attributes;
import org.opengis.feature.simple.SimpleFeature;
@@ -93,7 +92,7 @@ public class EvacuationPatnaScenarioGenerator {
private final Id safeLinkId = Id.createLinkId("safeLink_Patna");
private Scenario scenario;
- private Geometry evavcuationArea;
+ private Geometry evacuationArea;
public static void main(String[] args) {
new EvacuationPatnaScenarioGenerator().run();
@@ -124,7 +123,7 @@ private void createConfig() {
config.global().setCoordinateSystem("EPSG:7759");
- ScenarioCRSTransformation.transform(this.scenario, "EPSG:7759");
+
config.travelTimeCalculator().setTraveltimeBinSize(900);
config.qsim().setSnapshotPeriod(5 * 60);
@@ -229,18 +228,17 @@ public void install() {
private void createEvacNetwork(Scenario sc) {
-
//read shape file and get area
ShapeFileReader reader = new ShapeFileReader();
// String areaShapeFile = "area_epsg24345.shp";
Collection features = reader.readFileAndInitialize("input/evacTest/patna_polygon_7759.shp");
- evavcuationArea = (Geometry) features.iterator().next().getDefaultGeometry();
+ evacuationArea = (Geometry) features.iterator().next().getDefaultGeometry();
// GeometryUtils.getGeometryFromListOfFeatures()
// will create a network connecting with safe node.
// Amit, I added this cast to prevent compilation errors.
// Preferably, evacuationgui needs to be adapted to the more recent version of geotools. michal mar'19
- EvacuationNetworkGenerator net = new EvacuationNetworkGenerator(sc, evavcuationArea, safeLinkId);
+ EvacuationNetworkGenerator net = new EvacuationNetworkGenerator(sc, evacuationArea, safeLinkId);
net.run();
//since the original network is multi-mode, the new links should also allow all modes
@@ -294,7 +292,7 @@ private void createEvacPopulation(Scenario sc) {
//check if the person is in the area shape, if not leave them out
- if (actCoord != null && !evavcuationArea.contains(MGC.coord2Point(actCoord))) {
+ if (actCoord != null && !evacuationArea.contains(MGC.coord2Point(actCoord))) {
continue;
}
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/heat/AverageBicycleDurationCollector.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/heat/AverageBicycleDurationCollector.java
index 490d66465..bb8011481 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/heat/AverageBicycleDurationCollector.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/heat/AverageBicycleDurationCollector.java
@@ -1,6 +1,6 @@
package playground.amit.mixedTraffic.patnaIndia.heat;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
@@ -95,7 +95,7 @@ public void handleEvent(PersonDepartureEvent personDepartureEvent) {
@Override
public void handleEvent(PersonStuckEvent personStuckEvent) {
- Logger.getLogger(AverageBicycleDurationCollector.class).error("Stuck and abort event :"+personStuckEvent.toString());
+ LogManager.getLogger(AverageBicycleDurationCollector.class).error("Stuck and abort event :"+personStuckEvent.toString());
}
private void processData(Scenario scenario){
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/heat/ModalTripDurationTripCountCollector.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/heat/ModalTripDurationTripCountCollector.java
index b4aa8077c..060bc8261 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/heat/ModalTripDurationTripCountCollector.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/heat/ModalTripDurationTripCountCollector.java
@@ -1,6 +1,6 @@
package playground.amit.mixedTraffic.patnaIndia.heat;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.events.PersonArrivalEvent;
@@ -117,7 +117,7 @@ public void reset(int iteration) {
@Override
public void handleEvent(PersonStuckEvent personStuckEvent) {
- Logger.getLogger(ModalTripDurationTripCountCollector.class).error("Stuck and abort event :"+personStuckEvent.toString());
+ LogManager.getLogger(ModalTripDurationTripCountCollector.class).error("Stuck and abort event :"+personStuckEvent.toString());
}
private void processData(Scenario scenario){
diff --git a/src/main/java/playground/amit/mixedTraffic/patnaIndia/input/extDemand/OuterCordonCadytsControler.java b/src/main/java/playground/amit/mixedTraffic/patnaIndia/input/extDemand/OuterCordonCadytsControler.java
index 8a8f633f5..4a6bba62c 100644
--- a/src/main/java/playground/amit/mixedTraffic/patnaIndia/input/extDemand/OuterCordonCadytsControler.java
+++ b/src/main/java/playground/amit/mixedTraffic/patnaIndia/input/extDemand/OuterCordonCadytsControler.java
@@ -18,11 +18,7 @@
* *********************************************************************** */
package playground.amit.mixedTraffic.patnaIndia.input.extDemand;
-import java.io.File;
-import java.util.HashSet;
-import java.util.Map;
-import javax.inject.Inject;
-import org.apache.log4j.Logger;
+import org.apache.logging.log4j.LogManager;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Network;
@@ -47,22 +43,13 @@
import org.matsim.core.scoring.ScoringFunction;
import org.matsim.core.scoring.ScoringFunctionFactory;
import org.matsim.core.scoring.SumScoringFunction;
-import org.matsim.core.scoring.functions.CharyparNagelActivityScoring;
-import org.matsim.core.scoring.functions.CharyparNagelAgentStuckScoring;
-import org.matsim.core.scoring.functions.CharyparNagelLegScoring;
-import org.matsim.core.scoring.functions.ScoringParameters;
-import org.matsim.core.scoring.functions.ScoringParametersForPerson;
-import org.matsim.core.scoring.functions.SubpopulationScoringParameters;
+import org.matsim.core.scoring.functions.*;
import org.matsim.core.utils.collections.CollectionUtils;
import org.matsim.core.utils.io.IOUtils;
import org.matsim.counts.Counts;
import org.matsim.vehicles.VehicleWriterV1;
import org.matsim.vehicles.Vehicles;
-import playground.vsp.analysis.modules.modalAnalyses.modalShare.ModalShareControlerListener;
-import playground.vsp.analysis.modules.modalAnalyses.modalShare.ModalShareEventHandler;
import playground.amit.analysis.modalShare.ModalShareFromEvents;
-import playground.vsp.analysis.modules.modalAnalyses.modalTripTime.ModalTravelTimeControlerListener;
-import playground.vsp.analysis.modules.modalAnalyses.modalTripTime.ModalTripTravelTimeHandler;
import playground.amit.mixedTraffic.counts.CountsInserter;
import playground.amit.mixedTraffic.patnaIndia.input.joint.JointCalibrationControler;
import playground.amit.mixedTraffic.patnaIndia.input.others.PatnaVehiclesGenerator;
@@ -71,10 +58,19 @@
import playground.amit.mixedTraffic.patnaIndia.utils.OuterCordonUtils;
import playground.amit.mixedTraffic.patnaIndia.utils.PatnaUtils;
import playground.amit.utils.plans.SelectedPlansFilter;
+import playground.vsp.analysis.modules.modalAnalyses.modalShare.ModalShareControlerListener;
+import playground.vsp.analysis.modules.modalAnalyses.modalShare.ModalShareEventHandler;
+import playground.vsp.analysis.modules.modalAnalyses.modalTripTime.ModalTravelTimeControlerListener;
+import playground.vsp.analysis.modules.modalAnalyses.modalTripTime.ModalTripTravelTimeHandler;
import playground.vsp.cadyts.multiModeCadyts.ModalCountsCadytsContext;
import playground.vsp.cadyts.multiModeCadyts.ModalCountsLinkIdentifier;
import playground.vsp.cadyts.multiModeCadyts.MultiModalCountsCadytsModule;
+import javax.inject.Inject;
+import java.io.File;
+import java.util.HashSet;
+import java.util.Map;
+
/**
* @author amit
*/
@@ -157,7 +153,7 @@ public void install() {
int lastIt = controler.getConfig().controler().getLastIteration();
for (int index =firstIt+1; index