Skip to content

Commit

Permalink
language/grammar improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
kt86 committed Dec 3, 2024
1 parent a6b45c1 commit a97c1c3
Show file tree
Hide file tree
Showing 15 changed files with 56 additions and 56 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* In the next steps it will be extended, as follows
* 1) existing common methods of {@link CarrierShipment} and {@link
* CarrierService} where moved up here
* 2) some similiar, but differently named methods of {@link
* 2) some similar, but differently named methods of {@link
* CarrierShipment} and {@link CarrierService} were renamed to the same name and moved up here
* ...
* future) It maybe gets generalized in way, that we only have one job definition with 1 or 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void writeTravelTimeAndDistancePerVehicle(String analysisOutputDirectory, Scenar
void writeTravelTimeAndDistancePerVehicleType(String analysisOutputDirectory, Scenario scenario) throws IOException {
log.info("Writing out Time & Distance & Costs ... perVehicleType");

//----- All VehicleTypes in CarriervehicleTypes container. Used so that even unused vehTypes appear in the output
//----- All VehicleTypes in CarrierVehicleTypes container. Used so that even unused vehTypes appear in the output
TreeMap<Id<VehicleType>, VehicleType> vehicleTypesMap = new TreeMap<>(CarriersUtils.getCarrierVehicleTypes(scenario).getVehicleTypes());
//For the case that there are additional vehicle types found in the events.
for (VehicleType vehicleType : vehicleId2VehicleType.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public void setLspsFile(String lspsFile) {


//---
// Commenting this out, because in a frist step I think it is better/ more streight forward to have the VRP logic in the carriers as an attribute.
// Commenting this out, because in a frist step I think it is better/ more straight forward to have the VRP logic in the carriers as an attribute.
// please see {@link CarrierSchedulerUtils#setVrpLogic(carrier, VRPLogic)} and {@link CarrierSchedulerUtils#getVrpLogic(carrier)}
//---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
/**
* Takes an {@link LspShipment} and normally assigns it to something that belongs to an {@link LSP}.
* <br>
* After changes in fall 2023 (see master thesis of nrichter), the assingment is
* After changes in fall 2023 (see master thesis of nrichter), the assignment is
* there to be done one time initially.
* <br>
* If there are several {@link LogisticChain}s in a {@link LSPPlan}, the {@link LSP} has to assign each {@link
* LspShipment} to the suitable {@link LogisticChain}. For this purpose, each {@link LSPPlan}
* (or only the LSP? - kmt'jan'24), contains a pluggable strategy
* (or only the LSP? - kmt jan'24), contains a pluggable strategy
* that is contained in classes implementing the interface {@link InitialShipmentAssigner}. <br>
* <br>
* During iterations, it can happen that the {@link LspShipment} should be moved to another
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public static boolean isPlanTheSelectedPlan(LSPPlan lspPlan) {
return lspPlan.getLSP().getSelectedPlan() == lspPlan;
}

public static LogisticChainScheduler createForwardLogisiticChainScheduler() {
public static LogisticChainScheduler createForwardLogisticChainScheduler() {
return new ForwardLogisticChainSchedulerImpl();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ private void writePng() {
}

@Override
public void notifyShutdown(final ShutdownEvent controlerShudownEvent) {
public void notifyShutdown(final ShutdownEvent controlerShutdownEvent) {
try {
this.out.close();
for (ScoreHist data : this.perLsp.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ private static LSP createInitialLSP(Scenario scenario, SolutionType solutionType
log.error(
"This is totally untested. I can neither say if it will work nor if it will do anything useful - kmt feb22");

// TODO: Habe das vorziehen vor das switch statement rückgängig gemacht, weil es sideeffekte
// TODO: Habe das vorziehen vor das switch statement rückgängig gemacht, weil es sideeffects
// hatte -> Die dürften hier auch sein!!!! (KMT may22)
// Die createLSPPlan_reloading(..) Methoden sind nicht unabhängig voneinander.
// Das liegt wohl am statischen und das dann dort wieder Verknüpfungen gesetzt werden -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* LogisticChainElement}.
*
* <p>2.) all {@link LSPResource}s that were handed over to the SimpleForwardSolutionScheduler
* exogenously, are now scheduled sequentially in an order that was also specified exogenously. This
* exogenous, are now scheduled sequentially in an order that was also specified exogenously. This
* order ensures that each {@link LogisticChain} is traversed from the first to the last {@link
* LogisticChainElement}. During this procedure, the concerned {@link LspShipment}s are taken from
* the collection of incoming shipments, handled by the {@link LSPResource} in charge and then added
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ void testReader() {
handledEvents.addAll(eventHandlerServices.handledEvents);
handledEvents.addAll(eventHandlerShipments.handledEvents);

//Please note: This test is sensitive to the order of events as they are added in carrierEvents (input) and the resukts of the handler...
//Please note: This test is sensitive to the order of events as they are added in carrierEvents (input) and the results of the handler...
Assertions.assertArrayEquals(carrierEvents.toArray(), handledEvents.toArray());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ void testAddAndGetShipmentToCarrier() {
@Test
void testGetSetJspritIteration(){
Carrier carrier = new CarrierImpl(Id.create("carrier", Carrier.class));
//jspirtIterations is not set. should return Integer.Min_Value (null is not possible because returning (int)
//jspritIterations is not set. should return Integer.Min_Value (null is not possible because returning (int)
Assertions.assertEquals(Integer.MIN_VALUE, CarriersUtils.getJspritIterations(carrier) );

CarriersUtils.setJspritIterations(carrier, 125);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void install() {
}

@Test
void testEventFilessAreEqual(){
void testEventFilesAreEqual(){
setUp();
controler.addOverridingModule(new CarrierModule());
controler.addOverridingModule(new AbstractModule() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ final void CarrierSmallBatteryTest_Version1() throws ExecutionException, Interru

Assertions.assertEquals(1,
carrierV1.getSelectedPlan().getScheduledTours().size(),
"Not the correct amout of scheduled tours");
"Not the correct amount of scheduled tours");

VehicleType vehicleType_SmallV1 = vehicleTypes.getVehicleTypes().get(Id.create("SmallBattery_V1", VehicleType.class));
VehicleType vehicleType_LargeV1 = vehicleTypes.getVehicleTypes().get(Id.create("LargeBattery_V1", VehicleType.class));
Expand Down Expand Up @@ -143,7 +143,7 @@ final void CarrierSmallBatteryTest_Version1() throws ExecutionException, Interru
}
Assertions.assertEquals(24000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");
}

/**
Expand Down Expand Up @@ -189,7 +189,7 @@ final void CarrierLargeBatteryTest_Version2() throws ExecutionException, Interru

Assertions.assertEquals(1,
carrierV2.getSelectedPlan().getScheduledTours().size(),
"Not the correct amout of scheduled tours");
"Not the correct amount of scheduled tours");

VehicleType vehicleType_SmallV2 = vehicleTypes.getVehicleTypes().get(Id.create("SmallBattery_V2", VehicleType.class));
VehicleType vehicleType_LargeV2 = vehicleTypes.getVehicleTypes().get(Id.create("LargeBattery_V2", VehicleType.class));
Expand Down Expand Up @@ -220,7 +220,7 @@ final void CarrierLargeBatteryTest_Version2() throws ExecutionException, Interru
}
Assertions.assertEquals(24000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");

}

Expand Down Expand Up @@ -266,7 +266,7 @@ final void Carrier2SmallBatteryTest_Version3() throws ExecutionException, Interr

Assertions.assertEquals(2,
carrierV3.getSelectedPlan().getScheduledTours().size(),
"Not the correct amout of scheduled tours");
"Not the correct amount of scheduled tours");

VehicleType vehicleType_SmallV3 = vehicleTypes.getVehicleTypes().get(Id.create("SmallBattery_V3", VehicleType.class));
VehicleType vehicleType_LargeV3 = vehicleTypes.getVehicleTypes().get(Id.create("LargeBattery_V3", VehicleType.class));
Expand Down Expand Up @@ -300,16 +300,16 @@ final void Carrier2SmallBatteryTest_Version3() throws ExecutionException, Interr
if (distanceTour == 12000)
Assertions.assertEquals(12000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");
else
Assertions.assertEquals(20000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");
}
}

/**
* Option 4: An additional shipment outside the range of both BEVtypes.
* Option 4: An additional shipment outside the range of both BEV types.
* Therefore, one diesel vehicle must be used and one vehicle with a small
* battery.
*
Expand Down Expand Up @@ -385,11 +385,11 @@ final void CarrierWithAdditionalDieselVehicleTest_Version4() throws ExecutionExc
if (thisTypeId.equals("SmallBattery_V4"))
Assertions.assertEquals(24000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");
else if (thisTypeId.equals("DieselVehicle"))
Assertions.assertEquals(36000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");
else
Assertions.fail("Wrong vehicleType used");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ final void CarrierSmallBatteryTest_Version1() throws ExecutionException, Interru

Assertions.assertEquals(1,
carrierV1.getSelectedPlan().getScheduledTours().size(),
"Not the correct amout of scheduled tours");
"Not the correct amount of scheduled tours");

Assertions.assertEquals(vehicleType_SmallV1.getId(), carrierV1.getSelectedPlan().getScheduledTours().iterator().next()
.getVehicle().getType().getId());
Expand Down Expand Up @@ -150,7 +150,7 @@ final void CarrierSmallBatteryTest_Version1() throws ExecutionException, Interru
}
Assertions.assertEquals(24000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");
}

/**
Expand Down Expand Up @@ -205,7 +205,7 @@ final void CarrierLargeBatteryTest_Version2() throws ExecutionException, Interru

Assertions.assertEquals(1,
carrierV2.getSelectedPlan().getScheduledTours().size(),
"Not the correct amout of scheduled tours");
"Not the correct amount of scheduled tours");

Assertions.assertEquals(vehicleType_LargeV2.getId(), carrierV2.getSelectedPlan().getScheduledTours().iterator().next()
.getVehicle().getType().getId());
Expand Down Expand Up @@ -233,7 +233,7 @@ final void CarrierLargeBatteryTest_Version2() throws ExecutionException, Interru
}
Assertions.assertEquals(24000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");

}

Expand Down Expand Up @@ -291,7 +291,7 @@ final void Carrier2SmallBatteryTest_Version3() throws ExecutionException, Interr

Assertions.assertEquals(2,
carrierV3.getSelectedPlan().getScheduledTours().size(),
"Not the correct amout of scheduled tours");
"Not the correct amount of scheduled tours");

double maxDistance_vehicleType_LargeV3 = VehicleUtils.getEnergyCapacity(vehicleType_LargeV3.getEngineInformation())
/ VehicleUtils.getEnergyConsumptionKWhPerMeter(vehicleType_LargeV3.getEngineInformation());
Expand Down Expand Up @@ -322,11 +322,11 @@ final void Carrier2SmallBatteryTest_Version3() throws ExecutionException, Interr
if (distanceTour == 12000)
Assertions.assertEquals(12000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");
else
Assertions.assertEquals(20000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");
}
}

Expand Down Expand Up @@ -390,7 +390,7 @@ final void CarrierWithAdditionalDieselVehicleTest_Version4() throws ExecutionExc

Assertions.assertEquals(2,
carrierV4.getSelectedPlan().getScheduledTours().size(),
"Not the correct amout of scheduled tours");
"Not the correct amount of scheduled tours");

double maxDistance_vehicleType_Large4 = VehicleUtils.getEnergyCapacity(vehicleType_LargeV4.getEngineInformation())
/ VehicleUtils.getEnergyConsumptionKWhPerMeter(vehicleType_LargeV4.getEngineInformation());
Expand Down Expand Up @@ -420,11 +420,11 @@ final void CarrierWithAdditionalDieselVehicleTest_Version4() throws ExecutionExc
if (thisTypeId.equals("SmallBattery_V4"))
Assertions.assertEquals(24000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");
else if (thisTypeId.equals("DieselVehicle"))
Assertions.assertEquals(36000, distanceTour,
MatsimTestUtils.EPSILON,
"The schedulded tour has a non expected distance");
"The scheduled tour has a non expected distance");
else
Assertions.fail("Wrong vehicleType used");
}
Expand Down Expand Up @@ -478,7 +478,7 @@ final void CarrierWithShipmentsMidSizeBatteryTest_Version5() throws ExecutionExc
//We need two tours, due to reloading both shipments must be transported one after the other
Assertions.assertEquals(2,
carrierV5.getSelectedPlan().getScheduledTours().size(),
"Not the correct amout of scheduled tours");
"Not the correct amount of scheduled tours");

Assertions.assertEquals(vehicleType_MidSizeV5.getId(), carrierV5.getSelectedPlan().getScheduledTours().iterator().next()
.getVehicle().getType().getId());
Expand All @@ -505,9 +505,9 @@ final void CarrierWithShipmentsMidSizeBatteryTest_Version5() throws ExecutionExc

Assertions.assertEquals(2, distancesOfTours.size(), "There must be two entry for tour distances");
//One tour has distance of 12000m
Assertions.assertTrue(distancesOfTours.contains(12000.0), "The schedulded tour has a non expected distance");
Assertions.assertTrue(distancesOfTours.contains(12000.0), "The scheduled tour has a non expected distance");
//The other tour has distance of 20000m
Assertions.assertTrue(distancesOfTours.contains(20000.0), "The schedulded tour has a non expected distance");
Assertions.assertTrue(distancesOfTours.contains(20000.0), "The scheduled tour has a non expected distance");
}

/**
Expand Down Expand Up @@ -559,7 +559,7 @@ final void CarrierWithShipmentsLargeBatteryTest_Version6() throws ExecutionExcep
//We need two tours, due to reloading both shipments must be transported one after the other
Assertions.assertEquals(1,
carrierV5.getSelectedPlan().getScheduledTours().size(),
"Not the correct amout of scheduled tours");
"Not the correct amount of scheduled tours");

Assertions.assertEquals(vehicleType_LargeV5.getId(), carrierV5.getSelectedPlan().getScheduledTours().iterator().next()
.getVehicle().getType().getId());
Expand All @@ -586,7 +586,7 @@ final void CarrierWithShipmentsLargeBatteryTest_Version6() throws ExecutionExcep

Assertions.assertEquals(1, distancesOfTours.size(), "There must be one entry for tour distances");
//This tour has distance of 24000m
Assertions.assertTrue(distancesOfTours.contains(24000.0), "The schedulded tour has a non expected distance");
Assertions.assertTrue(distancesOfTours.contains(24000.0), "The scheduled tour has a non expected distance");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public class CarrierControllerUtilsIT{
public void setUp() {

//Create carrier with services and shipments
Carriers carriersWithServicesAndShpiments = new Carriers();
Carriers carriersWithServicesAndShipments = new Carriers();
carrierWServices = CarriersUtils.createCarrier(CARRIER_SERVICES_ID );
CarrierService service1 = createMatsimService("Service1", "i(3,9)", 2);
CarriersUtils.addService(carrierWServices, service1);
Expand Down Expand Up @@ -110,8 +110,8 @@ public void setUp() {
carrierWShipments.setCarrierCapabilities(ccBuilder.build());

// Add both carriers
carriersWithServicesAndShpiments.addCarrier(carrierWServices);
carriersWithServicesAndShpiments.addCarrier(carrierWShipments);
carriersWithServicesAndShipments.addCarrier(carrierWServices);
carriersWithServicesAndShipments.addCarrier(carrierWShipments);

//load Network and build netbasedCosts for jsprit
Network network = NetworkUtils.createNetwork();
Expand All @@ -120,7 +120,7 @@ public void setUp() {
final NetworkBasedTransportCosts netBasedCosts = netBuilder.build() ;
netBuilder.setTimeSliceWidth(1800) ; // !!!!, otherwise it will not do anything.

for (Carrier carrier : carriersWithServicesAndShpiments.getCarriers().values()) {
for (Carrier carrier : carriersWithServicesAndShipments.getCarriers().values()) {
//Build VRP
VehicleRoutingProblem.Builder vrpBuilder = MatsimJspritFactory.createRoutingProblemBuilder(carrier, network);
vrpBuilder.setRoutingCost(netBasedCosts) ;
Expand All @@ -143,7 +143,7 @@ public void setUp() {

//Convert to jsprit VRP
Carriers carriersWithShipmentsOnly = CarriersUtils.createShipmentVRPCarrierFromServiceVRPSolution(
carriersWithServicesAndShpiments );
carriersWithServicesAndShipments );

for (Carrier carrier : carriersWithShipmentsOnly.getCarriers().values()) {
//Build VRP
Expand Down
Loading

0 comments on commit a97c1c3

Please sign in to comment.