private void initializeOneWayCarsharingCarLeg(Link l, double now) { this.state = MobsimAgent.State.LEG; PlanElement pe = this.getCurrentPlanElement(); Leg leg = (Leg) pe; Network network = scenario.getNetwork(); endStationOW = findClosestAvailableParkingSpace(network.getLinks().get(leg.getRoute().getEndLinkId())); if (endStationOW == null) { this.state = MobsimAgent.State.ABORT; this.simulation .getEventsManager() .processEvent(new NoParkingSpaceEvent(now, leg.getRoute().getEndLinkId(), "ow")); return; } else { startStationOW.freeParkingSpot(); endStationOW.reserveParkingSpot(); Link destinationLink = endStationOW.getLink(); // create route for the car part of the onewaycarsharing trip initializeCSVehicleLeg("onewaycarsharing", now, l, destinationLink); } }