-
Notifications
You must be signed in to change notification settings - Fork 453
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add utility class for ev events reading
- Loading branch information
Showing
8 changed files
with
108 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
contribs/ev/src/main/java/org/matsim/contrib/ev/util/EvEventsReader.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package org.matsim.contrib.ev.util; | ||
|
||
import org.matsim.contrib.ev.charging.*; | ||
import org.matsim.contrib.ev.discharging.DrivingEnergyConsumptionEvent; | ||
import org.matsim.contrib.ev.discharging.IdlingEnergyConsumptionEvent; | ||
import org.matsim.core.api.experimental.events.EventsManager; | ||
import org.matsim.core.events.MatsimEventsReader; | ||
|
||
/** | ||
* @author nkuehnel / MOIA | ||
*/ | ||
public final class EvEventsReader { | ||
|
||
private EvEventsReader(){} | ||
|
||
public static void registerEvEventMappers(MatsimEventsReader reader) { | ||
reader.addCustomEventMapper(DrivingEnergyConsumptionEvent.EVENT_TYPE, DrivingEnergyConsumptionEvent::convert); | ||
reader.addCustomEventMapper(IdlingEnergyConsumptionEvent.EVENT_TYPE, IdlingEnergyConsumptionEvent::convert); | ||
reader.addCustomEventMapper(EnergyChargedEvent.EVENT_TYPE, EnergyChargedEvent::convert); | ||
reader.addCustomEventMapper(ChargingStartEvent.EVENT_TYPE, ChargingStartEvent::convert); | ||
reader.addCustomEventMapper(ChargingEndEvent.EVENT_TYPE, ChargingEndEvent::convert); | ||
reader.addCustomEventMapper(QueuedAtChargerEvent.EVENT_TYPE, QueuedAtChargerEvent::convert); | ||
reader.addCustomEventMapper(QuitQueueAtChargerEvent.EVENT_TYPE, QuitQueueAtChargerEvent::convert); | ||
} | ||
|
||
public static MatsimEventsReader createEvEventsReader(EventsManager eventsManager) { | ||
MatsimEventsReader reader = new MatsimEventsReader(eventsManager); | ||
registerEvEventMappers(reader); | ||
return reader; | ||
} | ||
} |