MATSIM
VehicleAbortsEvent.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * AgentStuckEvent.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2007, 2008 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.api.core.v01.events;
22 
23 import java.util.Map;
24 
25 import org.matsim.api.core.v01.Id;
27 import org.matsim.vehicles.Vehicle;
28 
29 public class VehicleAbortsEvent extends Event implements HasLinkId, HasVehicleId {
30 
31  public static final String EVENT_TYPE = "vehicle aborts";
32 
33  public static final String ATTRIBUTE_LINK = "link";
34  public static final String ATTRIBUTE_VEHICLE = "vehicle";
35 
36  private final Id<Vehicle> vehicleId;
37  private final Id<Link> linkId;
38 
39  public VehicleAbortsEvent(final double time, final Id<Vehicle> vehicleId, final Id<Link> linkId) {
40  super(time);
41  this.vehicleId = vehicleId;
42  this.linkId = linkId;
43  }
44 
46  return this.vehicleId;
47  }
48 
49  public Id<Link> getLinkId() {
50  return this.linkId;
51  }
52 
53  @Override
54  public String getEventType() {
55  return EVENT_TYPE;
56  }
57 
58  @Override
59  public Map<String, String> getAttributes() {
60  Map<String, String> atts = super.getAttributes();
61  // linkId, vehicleId handled by superclass
62  return atts;
63  }
64 
65  @Override
66  public void writeAsXML(StringBuilder out) {
67  writeXMLStart(out);
68  writeXMLEnd(out);
69  }
70 }
final void writeXMLEnd(StringBuilder out)
Definition: Event.java:151
VehicleAbortsEvent(final double time, final Id< Vehicle > vehicleId, final Id< Link > linkId)
final void writeXMLStart(StringBuilder out)
Definition: Event.java:116