21 package org.matsim.core.population;
37 final class InteractionActivity
implements Activity {
39 private static final Attributes EMPTY_ATTRIBUTES =
new LazyAllocationAttributes(attributes -> {
40 throw new RuntimeException(
"interaction activities cannot have attributes.");
44 private Coord coord = null;
45 private Id<Link> linkId = null;
46 private Id<ActivityFacility> facilityId = null;
48 InteractionActivity(
final String type) {
49 this.type = type.intern();
53 public OptionalTime getEndTime() {
54 return OptionalTime.undefined();
58 public void setEndTime(
final double endTime) {
59 throw new UnsupportedOperationException(
"Setting duration is not supported for InteractionActivity.");
63 public void setEndTimeUndefined() {
68 public OptionalTime getStartTime() {
69 return OptionalTime.undefined();
73 public void setStartTime(
final double startTime) {
74 throw new UnsupportedOperationException(
"Setting start time is not supported for InteractionActivity.");
78 public void setStartTimeUndefined() {
83 public OptionalTime getMaximumDuration() {
84 return OptionalTime.zeroSeconds();
88 public void setMaximumDuration(
final double dur) {
90 if (dur != 0)
throw new UnsupportedOperationException(
"Setting duration is not supported for InteractionActivity.");
94 public void setMaximumDurationUndefined() {
95 throw new UnsupportedOperationException(
"Setting duration to undefined is not supported for InteractionActivity.");
99 public String getType() {
104 public void setType(
final String type) {
105 this.type = type.intern();
109 public Coord getCoord() {
114 public void setCoord(
final Coord coord) {
119 public Id<Link> getLinkId() {
124 public Id<ActivityFacility> getFacilityId() {
125 return this.facilityId;
129 public void setFacilityId(
final Id<ActivityFacility> facilityId) {
130 this.facilityId = facilityId;
134 public void setLinkId(
final Id<Link> linkId) {
135 this.linkId = linkId;
139 public Attributes getAttributes() {
140 return EMPTY_ATTRIBUTES;
144 public String toString() {
155 + Time.writeTime(getStartTime())
158 + Time.writeTime(getEndTime())
161 + Time.writeTime(getMaximumDuration())
164 + this.facilityId +
"]" ;