Skip to content

Commit

Permalink
rename VehicularDepartureHandler to NetworkModeDepartureHandler. The …
Browse files Browse the repository at this point in the history
…previous name was not wrong, but the new name makes the function more clear.
  • Loading branch information
kainagel committed Jan 25, 2025
1 parent f0be10c commit 3ff10dd
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package org.matsim.core.mobsim.qsim.qnetsimengine;

import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.network.Link;
import org.matsim.core.mobsim.framework.MobsimAgent;
import org.matsim.core.mobsim.qsim.interfaces.DepartureHandler;

public interface VehicularDepartureHandler extends DepartureHandler{
@Override boolean handleDeparture( double now, MobsimAgent agent, Id<Link> linkId );
}
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,11 @@
import org.matsim.core.config.groups.QSimConfigGroup.VehicleBehavior;
import org.matsim.core.mobsim.framework.MobsimAgent;
import org.matsim.core.mobsim.framework.MobsimDriverAgent;
import org.matsim.core.mobsim.qsim.interfaces.DepartureHandler;
import org.matsim.vehicles.Vehicle;

class VehicularDepartureHandler implements DepartureHandler {
class VehicularDepartureHandlerDefaultImpl implements VehicularDepartureHandler{

private static final Logger log = LogManager.getLogger(VehicularDepartureHandler.class);
private static final Logger log = LogManager.getLogger( VehicularDepartureHandlerDefaultImpl.class );

private int cntTeleportVehicle = 0;

Expand All @@ -44,14 +43,13 @@ class VehicularDepartureHandler implements DepartureHandler {

private final Collection<String> transportModes;

VehicularDepartureHandler(QNetsimEngineI qNetsimEngine, VehicleBehavior vehicleBehavior, QSimConfigGroup qsimConfig) {
VehicularDepartureHandlerDefaultImpl( QNetsimEngineI qNetsimEngine, VehicleBehavior vehicleBehavior, QSimConfigGroup qsimConfig ) {
this.qNetsimEngine = qNetsimEngine;
this.vehicleBehavior = vehicleBehavior;
this.transportModes =qsimConfig.getMainModes();
}

@Override
public boolean handleDeparture(double now, MobsimAgent agent, Id<Link> linkId) {
@Override public boolean handleDeparture( double now, MobsimAgent agent, Id<Link> linkId ) {
if (this.transportModes.contains(agent.getMode())) {
if ( agent instanceof MobsimDriverAgent ) {
handleCarDeparture(now, (MobsimDriverAgent)agent, linkId);
Expand Down

0 comments on commit 3ff10dd

Please sign in to comment.