Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Freight events reader test AND adaptions/fixes on carrierFreightXXXEventHandlers #2876

Merged
merged 24 commits into from
Oct 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
235fe65
added converters for missing freight events
nixlaos Jul 12, 2023
4af03ef
Merge remote-tracking branch 'origin/master' into nrichter_freightEve…
nixlaos Jul 18, 2023
9be82d4
Merge remote-tracking branch 'origin/master' into nrichter_freightEve…
nixlaos Jul 21, 2023
98213b1
Merge remote-tracking branch 'origin/master' into nrichter_freightEve…
nixlaos Aug 7, 2023
4825cad
Merge remote-tracking branch 'origin/master' into nrichter_freightEve…
nixlaos Aug 8, 2023
2ef2813
added test for reading in carrier events
nixlaos Aug 8, 2023
720c9b4
Merge remote-tracking branch 'origin/master' into nrichter_freightEve…
nixlaos Aug 21, 2023
d573140
Merge remote-tracking branch 'origin/master' into nrichter_freightEve…
nixlaos Sep 16, 2023
1eb12a2
Merge remote-tracking branch 'origin/master' into freight_eventsReade…
nixlaos Oct 5, 2023
5e50d86
added test input, changed filenames in test
nixlaos Oct 5, 2023
32142fc
completing Test for CarrierEventsReaders
nixlaos Oct 16, 2023
2f25c7a
add missing interfaces for freight events, minor renames
nixlaos Oct 16, 2023
cb17bf4
Revert "add missing interfaces for freight events, minor renames"
nixlaos Oct 16, 2023
d1bac61
Merge remote-tracking branch 'origin/master' into freight_eventsReade…
nixlaos Oct 16, 2023
2b6b6ed
fixing error
nixlaos Oct 16, 2023
7751657
moved test input
nixlaos Oct 16, 2023
23d99e6
fix wrong attribute in event convertion
kt86 Oct 19, 2023
1e8be70
add missing events handlers and rename existing one. We have two even…
kt86 Oct 19, 2023
54a353e
Update test (and input). Now it will also (at least) count the number…
kt86 Oct 19, 2023
d888d9a
rename "Freight" eventsHandler to "Carrier" eventsHandler
kt86 Oct 19, 2023
13e5d90
Merge branch 'master' into freight_eventsReaderTest
kt86 Oct 19, 2023
376a7ec
add in-code created test as well. add copyright
kt86 Oct 20, 2023
a12f2ec
Merge branch 'master' into freight_eventsReaderTest
kt86 Oct 20, 2023
05e2387
Merge remote-tracking branch 'origin/freight_eventsReaderTest' into f…
kt86 Oct 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public static CarrierShipmentDeliveryEndEvent convert(GenericEvent event) {
Id<Link> shipmentTo = Id.createLinkId(attributes.get(ATTRIBUTE_LINK));
int size = Integer.parseInt(attributes.get(CarrierEventAttributes.ATTRIBUTE_CAPACITYDEMAND));
CarrierShipment shipment = CarrierShipment.Builder.newInstance(shipmentId, null, shipmentTo, size)
.setDeliveryServiceTime(Double.parseDouble(attributes.get(CarrierEventAttributes.ATTRIBUTE_SERVICE_DURATION)))
.setDeliveryServiceTime(Double.parseDouble(attributes.get(CarrierEventAttributes.ATTRIBUTE_DROPOFF_DURATION)))
.build();
Id<Vehicle> vehicleId = Id.createVehicleId(attributes.get(ATTRIBUTE_VEHICLE));
return new CarrierShipmentDeliveryEndEvent(time, carrierId, shipment, vehicleId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static CarrierShipmentDeliveryStartEvent convert(GenericEvent event) {
Id<Link> shipmentTo = Id.createLinkId(attributes.get(ATTRIBUTE_LINK));
int size = Integer.parseInt(attributes.get(ATTRIBUTE_CAPACITYDEMAND));
CarrierShipment shipment = CarrierShipment.Builder.newInstance(shipmentId, null, shipmentTo, size)
.setDeliveryServiceTime(Double.parseDouble(attributes.get(ATTRIBUTE_SERVICE_DURATION)))
.setDeliveryServiceTime(Double.parseDouble(attributes.get(ATTRIBUTE_DROPOFF_DURATION)))
.build();
Id<Vehicle> vehicleId = Id.createVehicleId(attributes.get(ATTRIBUTE_VEHICLE));
return new CarrierShipmentDeliveryStartEvent(time, carrierId, shipment, vehicleId);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.matsim.core.events.handler.EventHandler;
import org.matsim.freight.carriers.events.CarrierServiceEndEvent;

public interface FreightServiceEndEventHandler extends EventHandler{
public interface CarrierServiceEndEventHandler extends EventHandler{

void handleEvent( CarrierServiceEndEvent event );
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.matsim.freight.carriers.events.CarrierServiceStartEvent;


public interface FreightServiceStartEventHandler extends EventHandler {
public interface CarrierServiceStartEventHandler extends EventHandler {

void handleEvent( CarrierServiceStartEvent event );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @author sschroeder
*
*/
public interface FreightShipmentDeliveryEventHandler extends EventHandler {
public interface CarrierShipmentDeliveryEndEventHandler extends EventHandler {

void handleEvent(CarrierShipmentDeliveryEndEvent event);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* *********************************************************************** *
* project: org.matsim.*
* *********************************************************************** *
* *
* copyright : (C) by the members listed in the COPYING, *
* LICENSE and WARRANTY file. *
* email : info at matsim dot org *
* *
* *********************************************************************** *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* See also COPYING, LICENSE and WARRANTY file *
* *
* ***********************************************************************
*
*/

package org.matsim.freight.carriers.events.eventhandler;

import org.matsim.core.events.handler.EventHandler;
import org.matsim.freight.carriers.events.CarrierShipmentDeliveryStartEvent;

/**
* Interface to listen to shipmentDeliveredEvents.
*
* @author sschroeder
*
*/
public interface CarrierShipmentDeliveryStartEventHandler extends EventHandler {

void handleEvent(CarrierShipmentDeliveryStartEvent event);

}
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
* @author sschroeder
*
*/
public interface FreightShipmentPickupEventHandler extends EventHandler {
public interface CarrierShipmentPickupEndEventHandler extends EventHandler {
void handleEvent(CarrierShipmentPickupEndEvent event);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
* *********************************************************************** *
* project: org.matsim.*
* *********************************************************************** *
* *
* copyright : (C) by the members listed in the COPYING, *
* LICENSE and WARRANTY file. *
* email : info at matsim dot org *
* *
* *********************************************************************** *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* See also COPYING, LICENSE and WARRANTY file *
* *
* ***********************************************************************
*
*/

package org.matsim.freight.carriers.events.eventhandler;

import org.matsim.core.events.handler.EventHandler;
import org.matsim.freight.carriers.events.CarrierShipmentPickupStartEvent;

/**
* Interface to listen to shipmentPickedUpEvents.
*
* @author sschroeder
*
*/
public interface CarrierShipmentPickupStartEventHandler extends EventHandler {
void handleEvent(CarrierShipmentPickupStartEvent event);
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.matsim.freight.carriers.events.CarrierTourEndEvent;


public interface FreightTourEndEventHandler extends EventHandler {
public interface CarrierTourEndEventHandler extends EventHandler {

void handleEvent( CarrierTourEndEvent event );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import org.matsim.freight.carriers.events.CarrierTourStartEvent;


public interface FreightTourStartEventHandler extends EventHandler {
public interface CarrierTourStartEventHandler extends EventHandler {

void handleEvent( CarrierTourStartEvent event );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*
* @author kturner
*/
public final class Vehicle2CarrierEventHandler implements FreightTourStartEventHandler, FreightTourEndEventHandler {
public final class Vehicle2CarrierEventHandler implements CarrierTourStartEventHandler, CarrierTourEndEventHandler {


// Comment from Janek (in https://github.com/matsim-org/matsim-libs/pull/2128)
Expand Down
Loading
Loading