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.core.dsol.OTSDEVSSimulatorInterface;
6 import org.opentrafficsim.water.network.WaterwayLocation;
7
8
9
10
11
12
13
14
15
16
17
18
19 public class Lock extends Obstacle implements OperatedObstacle
20 {
21
22 private static final long serialVersionUID = 1L;
23
24
25 private OTSDEVSSimulatorInterface simulator;
26
27
28 private int operationHoursPerDay;
29
30
31 private int operationDaysPerWeek;
32
33
34 private Length length;
35
36
37 private Length width;
38
39
40 private int numberChambers;
41
42
43 private boolean cargoPriority;
44
45
46 private Duration estimatedAverageLockageTime;
47
48
49
50
51
52
53
54
55
56
57
58
59 @SuppressWarnings("checkstyle:parameternumber")
60 public Lock(final OTSDEVSSimulatorInterface simulator, final String name, final WaterwayLocation waterwayLocation,
61 final int numberChambers, final int operationHoursPerDay, final int operationDaysPerWeek, final Length length,
62 final Length width, final boolean cargoPriority)
63 {
64 super(name, waterwayLocation);
65 this.simulator = simulator;
66 this.operationHoursPerDay = operationHoursPerDay;
67 this.operationDaysPerWeek = operationDaysPerWeek;
68 this.numberChambers = numberChambers;
69 this.length = length;
70 this.width = width;
71 this.cargoPriority = cargoPriority;
72 }
73
74
75
76
77 public final Duration estimateLockageDelay()
78 {
79 return this.estimatedAverageLockageTime;
80 }
81
82
83
84
85 public final Duration drawLockageDelay()
86 {
87 return this.estimatedAverageLockageTime;
88 }
89
90
91 @Override
92 public final int getOperationHoursPerDay()
93 {
94 return this.operationHoursPerDay;
95 }
96
97
98 @Override
99 public final int getOperationDaysPerWeek()
100 {
101 return this.operationDaysPerWeek;
102 }
103
104
105
106
107 public final Length getLength()
108 {
109 return this.length;
110 }
111
112
113
114
115 public final Length getWidth()
116 {
117 return this.width;
118 }
119
120
121
122
123 public final int getNumberChambers()
124 {
125 return this.numberChambers;
126 }
127
128
129
130 public final boolean isCargoPriority()
131 {
132 return this.cargoPriority;
133 }
134
135
136 @Override
137 public final OTSDEVSSimulatorInterface getSimulator()
138 {
139 return this.simulator;
140 }
141
142
143 @Override
144 @SuppressWarnings("checkstyle:designforextension")
145 public String toString()
146 {
147 return "Lock " + this.getName() + " at " + this.getWaterwayLocation();
148 }
149
150 }