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