Skip to content

Commit

Permalink
rename/move packages: ....contrib.freight.* -> ....freight.carriers.*
Browse files Browse the repository at this point in the history
  • Loading branch information
kt86 committed Oct 12, 2023
1 parent 4f84a77 commit f3c2efb
Show file tree
Hide file tree
Showing 292 changed files with 2,238 additions and 1,637 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
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.contrib.freight.FreightConfigGroup;
import org.matsim.contrib.freight.carrier.*;
import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.freight.carriers.FreightConfigGroup;
import org.matsim.freight.carriers.carrier.*;
import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.core.utils.geometry.CoordinateTransformation;
import org.matsim.vehicles.Vehicle;
import org.matsim.vehicles.VehicleType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.Population;
import org.matsim.contrib.freight.carrier.*;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.freight.carriers.carrier.*;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.core.network.NetworkUtils;
import org.matsim.core.utils.geometry.CoordinateTransformation;
import org.matsim.core.utils.geometry.geotools.MGC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
import org.matsim.api.core.v01.population.Population;
import org.matsim.application.MATSimAppCommand;
import org.matsim.application.options.ShpOptions;
import org.matsim.contrib.freight.FreightConfigGroup;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.CarrierPlanWriter;
import org.matsim.contrib.freight.carrier.Carriers;
import org.matsim.contrib.freight.controler.CarrierModule;
import org.matsim.contrib.freight.controler.CarrierScoringFunctionFactory;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.contrib.freight.usecases.chessboard.CarrierScoringFunctionFactoryImpl;
import org.matsim.freight.carriers.FreightConfigGroup;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.CarrierPlanWriter;
import org.matsim.freight.carriers.carrier.Carriers;
import org.matsim.freight.carriers.controler.CarrierModule;
import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.freight.carriers.usecases.chessboard.CarrierScoringFunctionFactoryImpl;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.config.groups.ControllerConfigGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.population.*;
import org.matsim.application.options.ShpOptions;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.CarrierService;
import org.matsim.contrib.freight.carrier.CarrierShipment;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.CarrierService;
import org.matsim.freight.carriers.carrier.CarrierShipment;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.core.controler.Controler;
import org.matsim.core.utils.geometry.CoordinateTransformation;
import org.matsim.core.utils.geometry.geotools.MGC;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@
import org.matsim.application.MATSimAppCommand;
import org.matsim.application.options.ShpOptions;
import org.matsim.application.options.ShpOptions.Index;
import org.matsim.contrib.freight.FreightConfigGroup;
import org.matsim.contrib.freight.carrier.*;
import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize;
import org.matsim.contrib.freight.controler.*;
import org.matsim.contrib.freight.usecases.chessboard.CarrierTravelDisutilities;
import org.matsim.freight.carriers.FreightConfigGroup;
import org.matsim.freight.carriers.carrier.*;
import org.matsim.freight.carriers.controler.*;
import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize;
import org.matsim.freight.carriers.usecases.chessboard.CarrierTravelDisutilities;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.config.groups.ControllerConfigGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@
import org.matsim.api.core.v01.population.*;
import org.matsim.application.options.ShpOptions;
import org.matsim.application.options.ShpOptions.Index;
import org.matsim.contrib.freight.carrier.*;
import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize;
import org.matsim.contrib.freight.carrier.Tour.Pickup;
import org.matsim.contrib.freight.carrier.Tour.ServiceActivity;
import org.matsim.contrib.freight.carrier.Tour.TourElement;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.contrib.freight.jsprit.MatsimJspritFactory;
import org.matsim.freight.carriers.carrier.*;
import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize;
import org.matsim.freight.carriers.carrier.Tour.Pickup;
import org.matsim.freight.carriers.carrier.Tour.ServiceActivity;
import org.matsim.freight.carriers.carrier.Tour.TourElement;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.freight.carriers.jsprit.MatsimJspritFactory;
import org.matsim.core.gbl.MatsimRandom;
import org.matsim.core.network.NetworkUtils;
import org.matsim.core.population.PopulationUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@
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.contrib.freight.carrier.*;
import org.matsim.contrib.freight.carrier.Tour.Pickup;
import org.matsim.contrib.freight.carrier.Tour.ServiceActivity;
import org.matsim.contrib.freight.carrier.Tour.TourElement;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.freight.carriers.carrier.*;
import org.matsim.freight.carriers.carrier.Tour.Pickup;
import org.matsim.freight.carriers.carrier.Tour.ServiceActivity;
import org.matsim.freight.carriers.carrier.Tour.TourElement;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.core.gbl.MatsimRandom;
import org.matsim.core.utils.io.IOUtils;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.application.options.ShpOptions;
import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts;
import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts;
import org.matsim.core.utils.io.IOUtils;
import org.matsim.core.utils.io.UncheckedIOException;
import org.matsim.vehicles.VehicleType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.network.Network;
import org.matsim.application.options.ShpOptions;
import org.matsim.contrib.freight.FreightConfigGroup;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize;
import org.matsim.contrib.freight.carrier.CarrierUtils;
import org.matsim.contrib.freight.carrier.CarrierVehicle;
import org.matsim.freight.carriers.FreightConfigGroup;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize;
import org.matsim.freight.carriers.carrier.CarrierUtils;
import org.matsim.freight.carriers.carrier.CarrierVehicle;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.network.NetworkUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.Population;
import org.matsim.application.options.ShpOptions;
import org.matsim.contrib.freight.FreightConfigGroup;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.CarrierService;
import org.matsim.contrib.freight.carrier.CarrierShipment;
import org.matsim.contrib.freight.carrier.TimeWindow;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.freight.carriers.FreightConfigGroup;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.CarrierService;
import org.matsim.freight.carriers.carrier.CarrierShipment;
import org.matsim.freight.carriers.carrier.TimeWindow;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.network.NetworkUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.Population;
import org.matsim.contrib.freight.FreightConfigGroup;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.freight.carriers.FreightConfigGroup;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.population.PopulationUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.network.Link;
import org.matsim.application.options.ShpOptions;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.CarrierCapabilities.FleetSize;
import org.matsim.contrib.freight.carrier.CarrierUtils;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.CarrierCapabilities.FleetSize;
import org.matsim.freight.carriers.carrier.CarrierUtils;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.scenario.ScenarioUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@

import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.population.Activity;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.Carriers;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.Carriers;
import org.matsim.core.config.groups.GlobalConfigGroup;
import org.matsim.core.gbl.MatsimRandom;
import org.matsim.core.population.algorithms.PlanAlgorithm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.population.Population;
import org.matsim.contrib.freight.carrier.Carriers;
import org.matsim.freight.carriers.carrier.Carriers;
import org.matsim.core.controler.listener.AfterMobsimListener;
import org.matsim.core.controler.listener.BeforeMobsimListener;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@
import org.apache.commons.csv.CSVFormat;
import org.apache.commons.csv.CSVPrinter;
import org.matsim.api.core.v01.Id;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.Carriers;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.Carriers;
import org.matsim.core.controler.MatsimServices;
import org.matsim.core.controler.events.IterationEndsEvent;
import org.matsim.core.controler.listener.IterationEndsListener;
Expand Down Expand Up @@ -77,7 +77,7 @@ public void notifyIterationEnds(IterationEndsEvent event) {
writeIterationCarrierStats(event);
writeJobStats(services.getControlerIO().getIterationFilename(event.getIteration(), "commercialJobStats.csv"));
analyzeCarrierMarketShares(event.getIteration());

firstIteration = false;

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.Plan;
import org.matsim.api.core.v01.population.Population;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.Carriers;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.Carriers;

import java.util.Collection;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@
import org.matsim.api.core.v01.population.Population;
import org.matsim.api.core.v01.population.Route;
import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.CarrierPlanWriter;
import org.matsim.contrib.freight.carrier.CarrierService;
import org.matsim.contrib.freight.carrier.CarrierUtils;
import org.matsim.contrib.freight.carrier.CarrierVehicle;
import org.matsim.contrib.freight.carrier.CarrierVehicleTypes;
import org.matsim.contrib.freight.carrier.Carriers;
import org.matsim.contrib.freight.carrier.CarrierConstants;
import org.matsim.contrib.freight.carrier.ScheduledTour;
import org.matsim.contrib.freight.carrier.TimeWindow;
import org.matsim.contrib.freight.carrier.Tour;
import org.matsim.contrib.freight.jsprit.VRPTransportCostsFactory;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.CarrierPlanWriter;
import org.matsim.freight.carriers.carrier.CarrierService;
import org.matsim.freight.carriers.carrier.CarrierUtils;
import org.matsim.freight.carriers.carrier.CarrierVehicle;
import org.matsim.freight.carriers.carrier.CarrierVehicleTypes;
import org.matsim.freight.carriers.carrier.Carriers;
import org.matsim.freight.carriers.carrier.CarrierConstants;
import org.matsim.freight.carriers.carrier.ScheduledTour;
import org.matsim.freight.carriers.carrier.TimeWindow;
import org.matsim.freight.carriers.carrier.Tour;
import org.matsim.freight.carriers.jsprit.VRPTransportCostsFactory;
import org.matsim.core.config.Config;
import org.matsim.core.config.groups.ReplanningConfigGroup.StrategySettings;
import org.matsim.core.controler.events.AfterMobsimEvent;
Expand Down Expand Up @@ -223,7 +223,7 @@ private Plan createPlainPlanFromTour(Carrier carrier, ScheduledTour scheduledTou
plan.addActivity(startActivity);

for (Tour.TourElement tourElement : scheduledTour.getTour().getTourElements()) {
if (tourElement instanceof org.matsim.contrib.freight.carrier.Tour.Leg) {
if (tourElement instanceof Tour.Leg) {

// Take information from scheduled leg and create a defaultLeg
Tour.Leg tourLeg = (Tour.Leg) tourElement;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@
import org.matsim.contrib.drt.run.MultiModeDrtConfigGroup;
import org.matsim.contrib.drt.run.MultiModeDrtModule;
import org.matsim.contrib.dvrp.run.DvrpModule;
import org.matsim.contrib.freight.carrier.Carriers;
import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCostsFactory;
import org.matsim.contrib.freight.jsprit.VRPTransportCostsFactory;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.freight.carriers.carrier.Carriers;
import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCostsFactory;
import org.matsim.freight.carriers.jsprit.VRPTransportCostsFactory;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.core.config.Config;
import org.matsim.core.controler.AbstractModule;
import org.matsim.core.replanning.PlanStrategy;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
import org.matsim.api.core.v01.population.Activity;
import org.matsim.api.core.v01.population.Person;
import org.matsim.api.core.v01.population.Plan;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.CarrierVehicle;
import org.matsim.contrib.freight.carrier.Carriers;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.CarrierVehicle;
import org.matsim.freight.carriers.carrier.Carriers;

import javax.annotation.Nullable;
import java.util.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Scenario;
import org.matsim.contrib.freight.FreightConfigGroup;
import org.matsim.contrib.freight.controler.FreightUtils;
import org.matsim.freight.carriers.FreightConfigGroup;
import org.matsim.freight.carriers.controler.FreightUtils;
import org.matsim.core.config.Config;
import org.matsim.core.config.ConfigUtils;
import org.matsim.core.config.groups.ScoringConfigGroup;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@
import org.matsim.api.core.v01.events.handler.ActivityStartEventHandler;
import org.matsim.api.core.v01.network.Link;
import org.matsim.api.core.v01.population.*;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.CarrierService;
import org.matsim.contrib.freight.carrier.Carriers;
import org.matsim.contrib.freight.carrier.CarrierConstants;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.CarrierService;
import org.matsim.freight.carriers.carrier.Carriers;
import org.matsim.freight.carriers.carrier.CarrierConstants;
import org.matsim.core.api.experimental.events.EventsManager;

import java.util.*;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import org.matsim.api.core.v01.events.handler.PersonLeavesVehicleEventHandler;
import org.matsim.api.core.v01.network.Network;
import org.matsim.api.core.v01.population.Person;
import org.matsim.contrib.freight.carrier.CarrierConstants;
import org.matsim.freight.carriers.carrier.CarrierConstants;
import org.matsim.core.api.experimental.events.EventsManager;
import org.matsim.vehicles.Vehicle;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,15 @@
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.contrib.freight.carrier.Carrier;
import org.matsim.contrib.freight.carrier.CarrierPlan;
import org.matsim.contrib.freight.carrier.CarrierUtils;
import org.matsim.contrib.freight.carrier.Carriers;
import org.matsim.contrib.freight.jsprit.MatsimJspritFactory;
import org.matsim.contrib.freight.jsprit.NetworkBasedTransportCosts;
import org.matsim.contrib.freight.jsprit.VRPTransportCosts;
import org.matsim.freight.carriers.carrier.Carrier;
import org.matsim.freight.carriers.carrier.CarrierPlan;
import org.matsim.freight.carriers.carrier.CarrierUtils;
import org.matsim.freight.carriers.carrier.Carriers;
import org.matsim.freight.carriers.jsprit.MatsimJspritFactory;
import org.matsim.freight.carriers.jsprit.NetworkBasedTransportCosts;
import org.matsim.freight.carriers.jsprit.VRPTransportCosts;
import org.matsim.core.router.util.TravelTime;
import org.matsim.freight.carriers.jsprit.NetworkRouter;
import org.matsim.vehicles.VehicleType;

import java.util.ArrayList;
Expand Down Expand Up @@ -91,8 +92,8 @@ static void runTourPlanningForCarriers(Carriers carriers, Scenario scenario, VRP
HashMap<Id<Carrier>, Integer> sortedMap = carrierServiceCounterMap.entrySet().stream()
.sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))
.collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2, LinkedHashMap::new));


ArrayList<Id<Carrier>> tempList = new ArrayList<>(sortedMap.keySet());
ForkJoinPool forkJoinPool = new ForkJoinPool(Runtime.getRuntime().availableProcessors());
forkJoinPool.submit(() -> tempList.parallelStream().forEach(carrierId -> {
Expand Down Expand Up @@ -167,7 +168,7 @@ static void runTourPlanningForCarriers(Carriers carriers, Scenario scenario, VRP
CarrierPlan carrierPlan = MatsimJspritFactory.createPlan(carrier, bestSolution);

log.info("routing plan for carrier " + carrier.getId());
org.matsim.contrib.freight.jsprit.NetworkRouter.routePlan(carrierPlan, transportCosts); // we need to route
NetworkRouter.routePlan(carrierPlan, transportCosts); // we need to route
// the plans in
// order to create
// reasonable
Expand Down
Loading

0 comments on commit f3c2efb

Please sign in to comment.