Skip to content
This repository has been archived by the owner on Nov 29, 2024. It is now read-only.

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
kt86 committed Aug 14, 2024
1 parent 908b496 commit 1476110
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,20 +41,20 @@
public abstract class LSPResourceScheduler {

protected LSPResource resource;
protected ArrayList<LspShipment> lspShipmentsToScedule;
protected ArrayList<LspShipment> lspShipmentsToSchedule;

protected LSPPlan lspPlan;

public final void scheduleShipments(LSPPlan lspPlan, LSPResource resource, int bufferTime) {
this.lspPlan = lspPlan;
this.resource = resource;
this.lspShipmentsToScedule = new ArrayList<>();
this.lspShipmentsToSchedule = new ArrayList<>();
initializeValues(resource);
presortIncomingShipments();
scheduleResource();
updateShipments();
switchHandledShipments(bufferTime);
lspShipmentsToScedule.clear();
lspShipmentsToSchedule.clear();
}

/**
Expand All @@ -79,15 +79,15 @@ public final void scheduleShipments(LSPPlan lspPlan, LSPResource resource, int b
protected abstract void updateShipments();

private void presortIncomingShipments() {
this.lspShipmentsToScedule = new ArrayList<>();
this.lspShipmentsToSchedule = new ArrayList<>();
for (LogisticChainElement element : resource.getClientElements()) {
lspShipmentsToScedule.addAll(element.getIncomingShipments().getLspShipmentsWTime());
lspShipmentsToSchedule.addAll(element.getIncomingShipments().getLspShipmentsWTime());
}
lspShipmentsToScedule.sort(Comparator.comparingDouble(LspShipment::getTime));
lspShipmentsToSchedule.sort(Comparator.comparingDouble(LspShipment::getTime));
}

private void switchHandledShipments(int bufferTime) {
for (LspShipment lspShipmentWithTime : lspShipmentsToScedule) {
for (LspShipment lspShipmentWithTime : lspShipmentsToSchedule) {
var shipmentPlan = LspShipmentUtils.getOrCreateShipmentPlan(lspPlan, lspShipmentWithTime.getId());
double endOfTransportTime = shipmentPlan.getMostRecentEntry().getEndTime() + bufferTime;
lspShipmentWithTime.setTime(endOfTransportTime);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public void initializeValues(LSPResource resource) {

@Override
public void scheduleResource() {
for (LspShipment tupleToBeAssigned : lspShipmentsToScedule) {
for (LspShipment tupleToBeAssigned : lspShipmentsToSchedule) {
CarrierService carrierService = convertToCarrierService(tupleToBeAssigned);
carrier.getServices().put(carrierService.getId(), carrierService);
}
Expand All @@ -96,7 +96,7 @@ private CarrierService convertToCarrierService(LspShipment tuple) {

@Override
protected void updateShipments() {
for (LspShipment tuple : lspShipmentsToScedule) {
for (LspShipment tuple : lspShipmentsToSchedule) {
for (ScheduledTour scheduledTour : carrier.getSelectedPlan().getScheduledTours()) {
Tour tour = scheduledTour.getTour();
for (TourElement element : tour.getTourElements()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ protected void scheduleResource() {
int load = 0;
double cumulatedLoadingTime = 0;
double availabilityTimeOfLastShipment = 0;
ArrayList<LspShipment> copyOfAssignedShipments = new ArrayList<>(lspShipmentsToScedule);
ArrayList<LspShipment> copyOfAssignedShipments = new ArrayList<>(lspShipmentsToSchedule);
ArrayList<LspShipment> shipmentsInCurrentTour = new ArrayList<>();
List<CarrierPlan> scheduledPlans = new LinkedList<>();

Expand Down Expand Up @@ -184,7 +184,7 @@ private CarrierService convertToCarrierService(LspShipment tuple) {

@Override
protected void updateShipments() {
for (LspShipment tuple : lspShipmentsToScedule) {
for (LspShipment tuple : lspShipmentsToSchedule) {
for (ScheduledTour scheduledTour : carrier.getSelectedPlan().getScheduledTours()) {
Tour tour = scheduledTour.getTour();
for (TourElement element : tour.getTourElements()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ protected void initializeValues(LSPResource resource) {
@Override
protected void scheduleResource() {
int load = 0;
List<LspShipment> copyOfAssignedShipments = new ArrayList<>(lspShipmentsToScedule);
List<LspShipment> copyOfAssignedShipments = new ArrayList<>(lspShipmentsToSchedule);
copyOfAssignedShipments.sort(Comparator.comparingDouble(LspShipment::getTime));
ArrayList<LspShipment> shipmentsInCurrentTour = new ArrayList<>();
// ArrayList<ScheduledTour> scheduledTours = new ArrayList<>();
Expand Down Expand Up @@ -235,7 +235,7 @@ private CarrierService convertToCarrierService(LspShipment tuple) {

@Override
protected void updateShipments() {
for (LspShipment LspShipment : lspShipmentsToScedule) {
for (LspShipment LspShipment : lspShipmentsToSchedule) {
for (ScheduledTour scheduledTour : carrier.getSelectedPlan().getScheduledTours()) {
Tour tour = scheduledTour.getTour();
for (TourElement element : tour.getTourElements()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
private TransshipmentHubTourEndEventHandler eventHandler;

TransshipmentHubScheduler(TranshipmentHubSchedulerBuilder builder) {
this.lspShipmentsToScedule = new ArrayList<>();
this.lspShipmentsToSchedule = new ArrayList<>();
this.capacityNeedLinear = builder.getCapacityNeedLinear();
this.capacityNeedFixed = builder.getCapacityNeedFixed();
}
Expand All @@ -55,7 +55,7 @@ protected void initializeValues(LSPResource resource) {

@Override
protected void scheduleResource() {
for (LspShipment tupleToBeAssigned : lspShipmentsToScedule) {
for (LspShipment tupleToBeAssigned : lspShipmentsToSchedule) {
updateSchedule(tupleToBeAssigned);
}
}
Expand Down

0 comments on commit 1476110

Please sign in to comment.