Skip to content

Commit

Permalink
Merge pull request #3614 from matsim-org/3513-freight-rename-carrierc…
Browse files Browse the repository at this point in the history
…ontrolerutils

Freight: rename CarrierControler... to CarrierController...
  • Loading branch information
kt86 authored Dec 2, 2024
2 parents 166a09f + 595e040 commit d60c92a
Show file tree
Hide file tree
Showing 176 changed files with 710 additions and 833 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@
import org.matsim.core.scenario.ScenarioUtils;
import org.matsim.core.utils.geometry.CoordinateTransformation;
import org.matsim.freight.carriers.*;
import org.matsim.freight.carriers.controler.CarrierModule;
import org.matsim.freight.carriers.controler.CarrierScoringFunctionFactory;
import org.matsim.freight.carriers.controller.CarrierModule;
import org.matsim.freight.carriers.controller.CarrierScoringFunctionFactory;
import org.matsim.freight.carriers.usecases.chessboard.CarrierScoringFunctionFactoryImpl;
import picocli.CommandLine;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@

package org.matsim.freight.carriers;

import java.util.List;
import java.util.Map;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.population.HasPlansAndId;
import org.matsim.utils.objectattributes.attributable.Attributable;

import java.util.List;
import java.util.Map;

/**
* A carrier.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,11 @@

package org.matsim.freight.carriers;

import java.util.*;
import org.matsim.api.core.v01.Id;
import org.matsim.vehicles.Vehicle;
import org.matsim.vehicles.VehicleType;

import java.util.*;

/**
* This contains the capabilities/resources a carrier has/can deploy.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,13 @@

package org.matsim.freight.carriers;

import org.matsim.api.core.v01.Id;
import org.matsim.utils.objectattributes.attributable.Attributes;
import org.matsim.utils.objectattributes.attributable.AttributesImpl;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import org.matsim.api.core.v01.Id;
import org.matsim.utils.objectattributes.attributable.Attributes;
import org.matsim.utils.objectattributes.attributable.AttributesImpl;

/**
* This is a carrier that has capabilities and resources, jobs and plans to fulfill its obligations.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@

package org.matsim.freight.carriers;

import java.util.Collection;
import org.matsim.api.core.v01.population.BasicPlan;
import org.matsim.utils.objectattributes.attributable.Attributable;
import org.matsim.utils.objectattributes.attributable.Attributes;
import org.matsim.utils.objectattributes.attributable.AttributesImpl;

import java.util.Collection;

/**
*
* A specific plan of a carrier, and its score.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

package org.matsim.freight.carriers;

import java.util.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
Expand All @@ -34,8 +35,6 @@
import org.matsim.vehicles.VehicleType;
import org.xml.sax.Attributes;

import java.util.*;

/**
* A reader that reads carriers and their plans.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@
package org.matsim.freight.carriers;

import com.google.inject.Inject;
import org.matsim.utils.objectattributes.AttributeConverter;

import java.util.Map;
import org.matsim.utils.objectattributes.AttributeConverter;

/**
* @author mrieser / Simunto
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@

package org.matsim.freight.carriers;

import static org.matsim.freight.carriers.CarrierConstants.*;

import com.google.inject.Inject;
import java.util.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
Expand All @@ -40,10 +43,6 @@
import org.matsim.vehicles.VehicleType;
import org.xml.sax.Attributes;

import java.util.*;

import static org.matsim.freight.carriers.CarrierConstants.*;

class CarrierPlanXmlParserV2 extends MatsimXmlParser {

public static final Logger logger = LogManager.getLogger(CarrierPlanXmlParserV2.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@

package org.matsim.freight.carriers;

import static org.matsim.freight.carriers.CarrierConstants.*;

import com.google.inject.Inject;
import java.util.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
Expand All @@ -40,10 +43,6 @@
import org.matsim.vehicles.VehicleType;
import org.xml.sax.Attributes;

import java.util.*;

import static org.matsim.freight.carriers.CarrierConstants.*;

class CarrierPlanXmlParserV2_1 extends MatsimXmlParser {

public static final Logger logger = LogManager.getLogger(CarrierPlanXmlParserV2_1.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,16 @@

package org.matsim.freight.carriers;

import java.io.InputStream;
import java.net.URL;
import java.util.Stack;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.core.api.internal.MatsimReader;
import org.matsim.core.utils.io.MatsimXmlParser;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

import java.io.InputStream;
import java.net.URL;
import java.util.Stack;

/**
* A reader that reads carriers and their plans.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
package org.matsim.freight.carriers;

import com.graphhopper.jsprit.core.problem.job.Shipment;
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
Expand All @@ -30,12 +35,6 @@
import org.matsim.core.utils.io.MatsimXmlWriter;
import org.matsim.core.utils.misc.Time;

import java.io.BufferedWriter;
import java.io.IOException;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;

/**
* A writer that writes carriers and their plans in a xml-file.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
package org.matsim.freight.carriers;

import com.google.inject.Inject;
import java.io.BufferedWriter;
import java.io.IOException;
import java.util.*;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
Expand All @@ -38,10 +41,6 @@
import org.matsim.utils.objectattributes.attributable.AttributesXmlWriterDelegate;
import org.matsim.vehicles.VehicleType;

import java.io.BufferedWriter;
import java.io.IOException;
import java.util.*;

/**
* A writer that writes carriers and their plans in a xml-file.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,16 @@

package org.matsim.freight.carriers;

import static org.matsim.freight.carriers.CarrierConstants.*;

import com.google.inject.Inject;
import java.io.BufferedWriter;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
Expand All @@ -34,16 +43,6 @@
import org.matsim.utils.objectattributes.attributable.AttributesXmlWriterDelegate;
import org.matsim.vehicles.VehicleType;

import java.io.BufferedWriter;
import java.io.IOException;
import java.io.UncheckedIOException;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import java.util.Map;

import static org.matsim.freight.carriers.CarrierConstants.*;

/**
* A writer that writes carriers and their plans in a xml-file.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.matsim.utils.objectattributes.attributable.Attributes;
import org.matsim.utils.objectattributes.attributable.AttributesImpl;


public final class CarrierService implements CarrierJob {

public static class Builder {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@

package org.matsim.freight.carriers;

import java.io.InputStream;
import java.net.URL;
import java.util.Map;
import java.util.Stack;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
Expand All @@ -33,11 +37,6 @@
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

import java.io.InputStream;
import java.net.URL;
import java.util.Map;
import java.util.Stack;

/**
* Reader reading carrierVehicleTypes from a xml-file.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

package org.matsim.freight.carriers;

import java.util.Stack;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
Expand All @@ -33,8 +34,6 @@
import org.matsim.vehicles.VehicleUtils;
import org.xml.sax.Attributes;

import java.util.Stack;

class CarrierVehicleTypeReaderV1 extends MatsimXmlParser {
private static final Logger log = LogManager.getLogger(CarrierVehicleTypeReaderV1.class) ;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@

package org.matsim.freight.carriers;

import java.util.Map;
import org.matsim.api.core.v01.Id;
import org.matsim.core.api.internal.MatsimWriter;
import org.matsim.vehicles.MatsimVehicleWriter;
import org.matsim.vehicles.VehicleType;
import org.matsim.vehicles.VehicleUtils;
import org.matsim.vehicles.Vehicles;

import java.util.Map;

/**
* A writer that writes carriers and their plans in a xml-file.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,15 @@

package org.matsim.freight.carriers;

import java.io.BufferedWriter;
import java.io.IOException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.core.utils.io.MatsimXmlWriter;
import org.matsim.vehicles.CostInformation;
import org.matsim.vehicles.EngineInformation;
import org.matsim.vehicles.VehicleType;

import java.io.BufferedWriter;
import java.io.IOException;

@Deprecated // only there if someone insists on writing V1
public final class CarrierVehicleTypeWriterV1 extends MatsimXmlWriter {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@

package org.matsim.freight.carriers;

import org.matsim.api.core.v01.Id;
import org.matsim.vehicles.VehicleType;

import java.util.HashMap;
import java.util.Map;
import org.matsim.api.core.v01.Id;
import org.matsim.vehicles.VehicleType;

/**
* VehicleTypeContainer mapping all vehicleTypes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,12 @@

package org.matsim.freight.carriers;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;

import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.Map;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;

/**
* A container that maps carriers.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@
import com.graphhopper.jsprit.core.problem.job.Shipment;
import com.graphhopper.jsprit.core.problem.solution.VehicleRoutingProblemSolution;
import com.graphhopper.jsprit.core.util.Solutions;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;
import javax.management.InvalidAttributeValueException;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.matsim.api.core.v01.Id;
Expand All @@ -44,11 +48,6 @@
import org.matsim.vehicles.Vehicle;
import org.matsim.vehicles.VehicleType;

import javax.management.InvalidAttributeValueException;
import java.util.*;
import java.util.concurrent.*;
import java.util.concurrent.atomic.AtomicInteger;

public class CarriersUtils {

static final String CARRIER_VEHICLE = "carrierVehicle";
Expand Down Expand Up @@ -338,7 +337,7 @@ public static Carriers getOrCreateCarriers(Scenario scenario) {

public static Carriers addOrGetCarriers(Scenario scenario) {
// I have separated getOrCreateCarriers and getCarriers, since when the
// controler is started, it is better to fail if the carriers are not found.
// controller is started, it is better to fail if the carriers are not found.
// kai, oct'19
Carriers carriers = (Carriers) scenario.getScenarioElement(CARRIERS);
if (carriers == null) {
Expand Down
Loading

0 comments on commit d60c92a

Please sign in to comment.