1 package org.opentrafficsim.water.network.infra;
2
3 import org.djunits.value.vdouble.scalar.Duration;
4 import org.djunits.value.vdouble.scalar.Length;
5 import org.opentrafficsim.water.network.Waterway;
6 import org.opentrafficsim.water.network.WaterwayLocation;
7
8 import nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface;
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 public class MovableBridge extends FixedBridge implements OperatedObstacle
26 {
27
28 private static final long serialVersionUID = 1L;
29
30
31 private DEVSSimulatorInterface.TimeDoubleUnit simulator;
32
33
34 private int operationHoursPerDay;
35
36
37 private int operationDaysPerWeek;
38
39
40 private Length maxHeightClosed;
41
42
43 private Length maxHeightOpened;
44
45
46 private Duration waitingTime;
47
48
49
50
51
52
53
54
55
56
57 public MovableBridge(final DEVSSimulatorInterface.TimeDoubleUnit simulator, final String name,
58 final WaterwayLocation waterwayLocation, final int operationHoursPerDay, final int operationDaysPerWeek,
59 final Length maxHeightClosed, final Length maxHeightOpened)
60 {
61 super(name, waterwayLocation, maxHeightOpened);
62 this.simulator = simulator;
63 this.operationHoursPerDay = operationHoursPerDay;
64 this.operationDaysPerWeek = operationDaysPerWeek;
65 this.maxHeightClosed = maxHeightClosed;
66 this.maxHeightOpened = maxHeightOpened;
67
68
69
70
71
72
73 }
74
75
76
77
78
79
80
81
82
83
84
85 @SuppressWarnings("checkstyle:parameternumber")
86 public MovableBridge(final DEVSSimulatorInterface.TimeDoubleUnit simulator, final String name, final Waterway waterway,
87 final Length distance, final int operationHoursPerDay, final int operationDaysPerWeek, final Length maxHeightClosed,
88 final Length maxHeightOpened)
89 {
90 this(simulator, name, new WaterwayLocation(waterway, distance), operationHoursPerDay, operationDaysPerWeek,
91 maxHeightClosed, maxHeightOpened);
92 }
93
94
95
96
97 public final Duration estimateOpeningDelay()
98 {
99 return this.waitingTime;
100 }
101
102
103
104
105 public final Duration drawOpeningDelay()
106 {
107 return this.waitingTime;
108 }
109
110
111 @Override
112 public final int getOperationHoursPerDay()
113 {
114 return this.operationHoursPerDay;
115 }
116
117
118 @Override
119 public final int getOperationDaysPerWeek()
120 {
121 return this.operationDaysPerWeek;
122 }
123
124
125
126
127 public final Length getMaxHeightClosed()
128 {
129 return this.maxHeightClosed;
130 }
131
132
133
134
135 public final Length getMaxHeightOpened()
136 {
137 return this.maxHeightOpened;
138 }
139
140
141 @Override
142 public final DEVSSimulatorInterface.TimeDoubleUnit getSimulator()
143 {
144 return this.simulator;
145 }
146
147
148 @Override
149 @SuppressWarnings("checkstyle:designforextension")
150 public String toString()
151 {
152 return "Movable Bridge " + this.getName() + " at " + this.getWaterwayLocation();
153 }
154
155 }