MATSIM
VehicleDepartsAtFacilityEvent.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * VehicleArrivesAtFacilityEvent.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2009 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
21 package org.matsim.core.api.experimental.events;
22 
23 import org.matsim.api.core.v01.Id;
26 import org.matsim.vehicles.Vehicle;
27 
28 import java.util.Map;
29 
36 public final class VehicleDepartsAtFacilityEvent extends Event {
37 
38 
39  public static final String EVENT_TYPE = "VehicleDepartsAtFacility";
40  public static final String ATTRIBUTE_VEHICLE = "vehicle";
41  public static final String ATTRIBUTE_FACILITY = "facility";
42  public static final String ATTRIBUTE_DELAY = "delay";
43 
44  private final Id<Vehicle> vehicleId;
46  private double delay;
47 
48  public VehicleDepartsAtFacilityEvent(final double time, final Id<Vehicle> vehicleId,
49  final Id<TransitStopFacility> facilityId, double delay) {
50  super(time);
51  this.vehicleId = vehicleId;
52  this.facilityId = facilityId;
53  this.delay = delay;
54  }
55 
56  public double getDelay() {
57  return this.delay;
58  }
59 
60  public void setDelay(double delay) {
61  this.delay = delay;
62  }
63 
65  return this.facilityId;
66  }
67 
69  return this.vehicleId;
70  }
71 
72  @Override
73  public String getEventType() {
74  return EVENT_TYPE;
75  }
76 
77  @Override
78  public Map<String, String> getAttributes() {
79  Map<String, String> attributes = super.getAttributes();
80  attributes.put(ATTRIBUTE_VEHICLE, this.vehicleId.toString());
81  attributes.put(ATTRIBUTE_FACILITY, this.facilityId.toString());
82  attributes.put(ATTRIBUTE_DELAY, Double.toString(this.delay));
83  return attributes;
84  }
85 }
VehicleDepartsAtFacilityEvent(final double time, final Id< Vehicle > vehicleId, final Id< TransitStopFacility > facilityId, double delay)