@Override
public void processEvent() {
Event event = null;
if (vehicle.getCurrentLeg().getMode().equals(TransportMode.car) && (vehicle.getCurrentLinkRoute()!=null && vehicle.getCurrentLinkRoute().length!=0)){
event = new LinkEnterEvent(this.getMessageArrivalTime(), Id.create(vehicle.getOwnerPerson().getId().toString(), org.matsim.vehicles.Vehicle.class),
vehicle.getCurrentLinkId());
eventsManager.processEvent(event);
}
Id<org.matsim.vehicles.Vehicle> vehicleId = Id.create( this.vehicle.getOwnerPerson().getId() , org.matsim.vehicles.Vehicle.class ) ;
event = new VehicleLeavesTrafficEvent(this.getMessageArrivalTime(), this.vehicle.getOwnerPerson().getId(), this.vehicle.getCurrentLinkId(),
vehicleId, this.vehicle.getCurrentLeg().getMode(), 1.0 );
eventsManager.processEvent(event);
event = new PersonArrivalEvent(this.getMessageArrivalTime(), this.vehicle.getOwnerPerson().getId(), this.vehicle.getCurrentLinkId(), this.vehicle.getCurrentLeg().getMode());
eventsManager.processEvent(event);
Activity nextAct = this.vehicle.getNextActivity();
double actStartEventTime = nextAct.getStartTime();
if (this.getMessageArrivalTime() > actStartEventTime) {
actStartEventTime = this.getMessageArrivalTime();
}
event = new ActivityStartEvent(actStartEventTime, this.vehicle.getOwnerPerson().getId(), this.vehicle.getCurrentLinkId(), nextAct.getFacilityId(), nextAct.getType());
eventsManager.processEvent(event);
}