colregs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +34 -0
  2. package/PROVENANCE.md +65 -0
  3. package/README.md +50 -0
  4. package/data/applicability.json +1108 -0
  5. package/data/facts.json +308 -0
  6. package/data/geometry.json +372 -0
  7. package/data/images.json +876 -0
  8. package/data/lights.json +229 -0
  9. package/data/rules.json +843 -0
  10. package/fixtures/applicability-fixtures.json +412 -0
  11. package/images/NRHB_23_Intl_dii.png +0 -0
  12. package/images/NRHB_23_a.png +0 -0
  13. package/images/NRHB_23_aii.png +0 -0
  14. package/images/NRHB_23_b.png +0 -0
  15. package/images/NRHB_23_di.png +0 -0
  16. package/images/NRHB_23_e.png +0 -0
  17. package/images/NRHB_24_a.png +0 -0
  18. package/images/NRHB_24_av.png +0 -0
  19. package/images/NRHB_24_d.png +0 -0
  20. package/images/NRHB_24_e.png +0 -0
  21. package/images/NRHB_24_eiii.png +0 -0
  22. package/images/NRHB_24_f.png +0 -0
  23. package/images/NRHB_24_j.png +0 -0
  24. package/images/NRHB_25_a.png +0 -0
  25. package/images/NRHB_25_b.png +0 -0
  26. package/images/NRHB_25_c.png +0 -0
  27. package/images/NRHB_25_d.png +0 -0
  28. package/images/NRHB_25_dii.png +0 -0
  29. package/images/NRHB_25_e.png +0 -0
  30. package/images/NRHB_26_b.png +0 -0
  31. package/images/NRHB_26_biii.png +0 -0
  32. package/images/NRHB_26_ciii.png +0 -0
  33. package/images/NRHB_27_a.png +0 -0
  34. package/images/NRHB_27_aiii.png +0 -0
  35. package/images/NRHB_27_biii.png +0 -0
  36. package/images/NRHB_27_biv.png +0 -0
  37. package/images/NRHB_27_c.png +0 -0
  38. package/images/NRHB_27_d.png +0 -0
  39. package/images/NRHB_27_diii.png +0 -0
  40. package/images/NRHB_27_ei.png +0 -0
  41. package/images/NRHB_27_eii.png +0 -0
  42. package/images/NRHB_27_f.png +0 -0
  43. package/images/NRHB_28.png +0 -0
  44. package/images/NRHB_29_a.png +0 -0
  45. package/images/NRHB_29_aiii.png +0 -0
  46. package/images/NRHB_30_a.png +0 -0
  47. package/images/NRHB_30_d.png +0 -0
  48. package/images/NRHB_30_dii.png +0 -0
  49. package/images/mastheadarc.gif +0 -0
  50. package/images/portarc.gif +0 -0
  51. package/images/stbdarc.gif +0 -0
  52. package/images/sternarc.gif +0 -0
  53. package/images/towingarc.gif +0 -0
  54. package/package.json +12 -0
@@ -0,0 +1,412 @@
1
+ {
2
+ "note": "Fact records and the applicability entry ids that apply to each, under the International rules at night. An implementation in any language that consumes data/applicability.json should reproduce these exactly, using the predicate semantics in README.md.",
3
+ "ruleset": "international",
4
+ "cases": [
5
+ {
6
+ "name": "sailing yacht 11.6 m under sail",
7
+ "facts": {
8
+ "propulsion": "sail",
9
+ "activity": "none",
10
+ "position": "underway",
11
+ "length_m": 11.6
12
+ },
13
+ "expect": [
14
+ "25a",
15
+ "25b",
16
+ "25c"
17
+ ]
18
+ },
19
+ {
20
+ "name": "same yacht motoring",
21
+ "facts": {
22
+ "propulsion": "power",
23
+ "activity": "none",
24
+ "position": "underway",
25
+ "length_m": 11.6
26
+ },
27
+ "expect": [
28
+ "23a1",
29
+ "23a2",
30
+ "23a34",
31
+ "23d1"
32
+ ]
33
+ },
34
+ {
35
+ "name": "power vessel 15 m underway",
36
+ "facts": {
37
+ "propulsion": "power",
38
+ "activity": "none",
39
+ "position": "underway",
40
+ "length_m": 15
41
+ },
42
+ "expect": [
43
+ "23a1",
44
+ "23a2",
45
+ "23a34"
46
+ ]
47
+ },
48
+ {
49
+ "name": "power vessel 55 m underway",
50
+ "facts": {
51
+ "propulsion": "power",
52
+ "activity": "none",
53
+ "position": "underway",
54
+ "length_m": 55
55
+ },
56
+ "expect": [
57
+ "23a1",
58
+ "23a2",
59
+ "23a34"
60
+ ]
61
+ },
62
+ {
63
+ "name": "6 m outboard, max speed 6 kn",
64
+ "facts": {
65
+ "propulsion": "power",
66
+ "activity": "none",
67
+ "position": "underway",
68
+ "length_m": 6,
69
+ "max_speed_kn": 6
70
+ },
71
+ "expect": [
72
+ "23a1",
73
+ "23a2",
74
+ "23a34",
75
+ "23d1",
76
+ "23d2"
77
+ ]
78
+ },
79
+ {
80
+ "name": "6 m outboard, max speed 20 kn",
81
+ "facts": {
82
+ "propulsion": "power",
83
+ "activity": "none",
84
+ "position": "underway",
85
+ "length_m": 6,
86
+ "max_speed_kn": 20
87
+ },
88
+ "expect": [
89
+ "23a1",
90
+ "23a2",
91
+ "23a34",
92
+ "23d1"
93
+ ]
94
+ },
95
+ {
96
+ "name": "dinghy under sail, 3.5 m",
97
+ "facts": {
98
+ "propulsion": "sail",
99
+ "activity": "none",
100
+ "position": "underway",
101
+ "length_m": 3.5
102
+ },
103
+ "expect": [
104
+ "25a",
105
+ "25b",
106
+ "25c",
107
+ "25d1"
108
+ ]
109
+ },
110
+ {
111
+ "name": "10 m vessel under oars",
112
+ "facts": {
113
+ "propulsion": "oars",
114
+ "activity": "none",
115
+ "position": "underway",
116
+ "length_m": 10
117
+ },
118
+ "expect": [
119
+ "25d2"
120
+ ]
121
+ },
122
+ {
123
+ "name": "motoring but drifting in neutral, 11.6 m",
124
+ "facts": {
125
+ "propulsion": "power",
126
+ "activity": "none",
127
+ "position": "underway",
128
+ "making_way": false,
129
+ "length_m": 11.6
130
+ },
131
+ "expect": [
132
+ "23a1",
133
+ "23a2",
134
+ "23a34",
135
+ "23d1"
136
+ ]
137
+ },
138
+ {
139
+ "name": "anchored, 11.6 m",
140
+ "facts": {
141
+ "propulsion": "sail",
142
+ "activity": "none",
143
+ "position": "anchored",
144
+ "length_m": 11.6
145
+ },
146
+ "expect": [
147
+ "30a",
148
+ "30b",
149
+ "30c"
150
+ ]
151
+ },
152
+ {
153
+ "name": "anchored, 6 m, clear of the channel",
154
+ "facts": {
155
+ "propulsion": "power",
156
+ "activity": "none",
157
+ "position": "anchored",
158
+ "length_m": 6,
159
+ "near_channel": false
160
+ },
161
+ "expect": [
162
+ "30a",
163
+ "30b",
164
+ "30c",
165
+ "30e"
166
+ ]
167
+ },
168
+ {
169
+ "name": "aground, 15 m",
170
+ "facts": {
171
+ "propulsion": "power",
172
+ "activity": "none",
173
+ "position": "aground",
174
+ "length_m": 15
175
+ },
176
+ "expect": [
177
+ "30d"
178
+ ]
179
+ },
180
+ {
181
+ "name": "aground, 10 m (30(f) relief)",
182
+ "facts": {
183
+ "propulsion": "power",
184
+ "activity": "none",
185
+ "position": "aground",
186
+ "length_m": 10
187
+ },
188
+ "expect": []
189
+ },
190
+ {
191
+ "name": "trawler 30 m making way",
192
+ "facts": {
193
+ "propulsion": "power",
194
+ "activity": "trawling",
195
+ "position": "underway",
196
+ "making_way": true,
197
+ "length_m": 30
198
+ },
199
+ "expect": [
200
+ "26b-id",
201
+ "26b-mast",
202
+ "26b-mw"
203
+ ]
204
+ },
205
+ {
206
+ "name": "trawler 30 m drifting",
207
+ "facts": {
208
+ "propulsion": "power",
209
+ "activity": "trawling",
210
+ "position": "underway",
211
+ "making_way": false,
212
+ "length_m": 30
213
+ },
214
+ "expect": [
215
+ "26b-id",
216
+ "26b-mast"
217
+ ]
218
+ },
219
+ {
220
+ "name": "fishing other than trawling, gear out 200 m, not making way",
221
+ "facts": {
222
+ "propulsion": "power",
223
+ "activity": "fishing",
224
+ "position": "underway",
225
+ "making_way": false,
226
+ "length_m": 12,
227
+ "gear_extent_m": 200
228
+ },
229
+ "expect": [
230
+ "26c-id",
231
+ "26c-gear"
232
+ ]
233
+ },
234
+ {
235
+ "name": "not under command, making way",
236
+ "facts": {
237
+ "propulsion": "power",
238
+ "activity": "nuc",
239
+ "position": "underway",
240
+ "making_way": true,
241
+ "length_m": 40
242
+ },
243
+ "expect": [
244
+ "27a-id",
245
+ "27a-mw"
246
+ ]
247
+ },
248
+ {
249
+ "name": "not under command, drifting",
250
+ "facts": {
251
+ "propulsion": "power",
252
+ "activity": "nuc",
253
+ "position": "underway",
254
+ "making_way": false,
255
+ "length_m": 40
256
+ },
257
+ "expect": [
258
+ "27a-id"
259
+ ]
260
+ },
261
+ {
262
+ "name": "restricted in ability to maneuver, at anchor",
263
+ "facts": {
264
+ "propulsion": "power",
265
+ "activity": "ram",
266
+ "position": "anchored",
267
+ "length_m": 60
268
+ },
269
+ "expect": [
270
+ "27b-id",
271
+ "27b-anc",
272
+ "30a",
273
+ "30c"
274
+ ]
275
+ },
276
+ {
277
+ "name": "dredger, restricted, obstruction to port, making way",
278
+ "facts": {
279
+ "propulsion": "power",
280
+ "activity": "ram_underwater",
281
+ "position": "underway",
282
+ "making_way": true,
283
+ "length_m": 45,
284
+ "obstruction_exists": true,
285
+ "obstruction_side": "port"
286
+ },
287
+ "expect": [
288
+ "27b-id",
289
+ "27b-mw",
290
+ "27d"
291
+ ]
292
+ },
293
+ {
294
+ "name": "towing astern, tow 150 m",
295
+ "facts": {
296
+ "propulsion": "power",
297
+ "activity": "towing",
298
+ "position": "underway",
299
+ "length_m": 40,
300
+ "tow_length_m": 150
301
+ },
302
+ "expect": [
303
+ "24a-m2",
304
+ "24a-rest"
305
+ ]
306
+ },
307
+ {
308
+ "name": "towing astern, tow 300 m",
309
+ "facts": {
310
+ "propulsion": "power",
311
+ "activity": "towing",
312
+ "position": "underway",
313
+ "length_m": 40,
314
+ "tow_length_m": 300
315
+ },
316
+ "expect": [
317
+ "24a-m3",
318
+ "24a-rest"
319
+ ]
320
+ },
321
+ {
322
+ "name": "pushing ahead, composite unit",
323
+ "facts": {
324
+ "propulsion": "power",
325
+ "activity": "pushing",
326
+ "position": "underway",
327
+ "length_m": 30,
328
+ "composite_unit": true
329
+ },
330
+ "expect": [
331
+ "24b"
332
+ ]
333
+ },
334
+ {
335
+ "name": "pushing ahead, not a composite unit",
336
+ "facts": {
337
+ "propulsion": "power",
338
+ "activity": "pushing",
339
+ "position": "underway",
340
+ "length_m": 30,
341
+ "composite_unit": false
342
+ },
343
+ "expect": [
344
+ "24c"
345
+ ]
346
+ },
347
+ {
348
+ "name": "constrained by draft",
349
+ "facts": {
350
+ "propulsion": "power",
351
+ "activity": "cbd",
352
+ "position": "underway",
353
+ "length_m": 200
354
+ },
355
+ "expect": [
356
+ "28"
357
+ ]
358
+ },
359
+ {
360
+ "name": "on pilotage duty, underway",
361
+ "facts": {
362
+ "propulsion": "power",
363
+ "activity": "pilot",
364
+ "position": "underway",
365
+ "length_m": 20
366
+ },
367
+ "expect": [
368
+ "29a"
369
+ ]
370
+ },
371
+ {
372
+ "name": "mine clearance, underway",
373
+ "facts": {
374
+ "propulsion": "power",
375
+ "activity": "mine",
376
+ "position": "underway",
377
+ "length_m": 60
378
+ },
379
+ "expect": [
380
+ "27f"
381
+ ]
382
+ },
383
+ {
384
+ "name": "diving operations from a small vessel",
385
+ "facts": {
386
+ "propulsion": "power",
387
+ "activity": "diving",
388
+ "position": "underway",
389
+ "length_m": 9
390
+ },
391
+ "expect": [
392
+ "27e"
393
+ ]
394
+ },
395
+ {
396
+ "name": "air-cushion vessel in non-displacement mode",
397
+ "facts": {
398
+ "propulsion": "power",
399
+ "activity": "none",
400
+ "position": "underway",
401
+ "length_m": 25,
402
+ "non_displacement": true
403
+ },
404
+ "expect": [
405
+ "23a1",
406
+ "23a2",
407
+ "23a34",
408
+ "23b"
409
+ ]
410
+ }
411
+ ]
412
+ }
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json ADDED
@@ -0,0 +1,12 @@
1
+ {
2
+ "name": "colregs",
3
+ "version": "0.1.0",
4
+ "description": "COLREGS 72 navigation light rules and USCG diagrams as language-neutral JSON, with cross-implementation fixtures",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/mark-brannan/colregs.git"
9
+ },
10
+ "scripts": { "test": "node --test test/*.mjs" },
11
+ "files": ["data", "images", "fixtures", "PROVENANCE.md"]
12
+ }