@teamkeel/solver 0.0.0-stage → 0.508.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.
- package/dist/index.cjs +6878 -0
- package/dist/index.d.cts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +6850 -0
- package/dist/internal.cjs +17244 -0
- package/dist/internal.d.cts +1275 -0
- package/dist/internal.d.ts +1275 -0
- package/dist/internal.js +17164 -0
- package/dist/layout-ZQ45Tlkb.d.cts +2111 -0
- package/dist/layout-efr1Ke_2.d.ts +2111 -0
- package/dist/layout.cjs +19 -0
- package/dist/layout.d.cts +2 -0
- package/dist/layout.d.ts +2 -0
- package/dist/layout.js +1 -0
- package/dist/record-results-BWnJIpkK.d.ts +222 -0
- package/dist/record-results-DPczGZWH.d.cts +222 -0
- package/dist/types-DIFPlxBZ.d.cts +1865 -0
- package/dist/types-DIFPlxBZ.d.ts +1865 -0
- package/fixtures/operation/bakery/operation.json +350 -0
- package/fixtures/operation/bakery/plan.json +872 -0
- package/fixtures/operation/bakery/readback.json +114 -0
- package/fixtures/operation/bakery/score.json +1520 -0
- package/fixtures/operation/bakery/timeline.json +2376 -0
- package/fixtures/operation/clinic/operation.json +223 -0
- package/fixtures/operation/clinic/plan.json +383 -0
- package/fixtures/operation/clinic/readback.json +83 -0
- package/fixtures/operation/clinic/score.json +1305 -0
- package/fixtures/operation/clinic/timeline.json +2283 -0
- package/fixtures/operation/field-service/operation.json +194 -0
- package/fixtures/operation/field-service/plan.json +172 -0
- package/fixtures/operation/field-service/readback.json +73 -0
- package/fixtures/operation/field-service/score.json +585 -0
- package/fixtures/operation/field-service/timeline.json +661 -0
- package/fixtures/operation/filling/operation.json +245 -0
- package/fixtures/operation/filling/plan.json +525 -0
- package/fixtures/operation/filling/readback.json +87 -0
- package/fixtures/operation/filling/score.json +756 -0
- package/fixtures/operation/filling/timeline.json +1322 -0
- package/fixtures/operation/shop/operation.json +320 -0
- package/fixtures/operation/shop/plan.json +664 -0
- package/fixtures/operation/shop/readback.json +130 -0
- package/fixtures/operation/shop/score.json +1106 -0
- package/fixtures/operation/shop/timeline.json +2734 -0
- package/fixtures/operation/warehouse-day/operation.json +517 -0
- package/fixtures/operation/warehouse-day/plan.json +477 -0
- package/fixtures/operation/warehouse-day/readback.json +207 -0
- package/fixtures/operation/warehouse-day/score.json +979 -0
- package/fixtures/operation/warehouse-day/timeline.json +1420 -0
- package/package.json +63 -4
- package/README.md +0 -3
|
@@ -0,0 +1,2111 @@
|
|
|
1
|
+
import { T as TableRunCost, W as Weekday, y as Kind, z as WashTimingRecord, E as OptionalRecord, F as ReadyBeforeRecord, G as AsapRecord, H as SkipEmptyRecord, J as CoverRecord, L as DispatchRecord, N as ShortMeasureExpr, Q as NotDoneExpr, V as ShortShipsRecord, X as OverlapAmountFact, Y as QuantityPeriod, t as IrIssue, B as Broken, w as ReadBack, Z as ModelRefusal } from './types-DIFPlxBZ.cjs';
|
|
2
|
+
|
|
3
|
+
/** A record id, resource id, decision key, rule id or step id. Compared as UTF-16 code units. */
|
|
4
|
+
type Id = string;
|
|
5
|
+
/** A whole number of clock units. */
|
|
6
|
+
type Int = number;
|
|
7
|
+
/** The IR schema string this package reads and writes. */
|
|
8
|
+
type IrSchema = "keel.solver.ir/0.2";
|
|
9
|
+
interface Ir {
|
|
10
|
+
/** `keel.solver.ir/<major>.<minor>`; see `IR_SCHEMAS_READ`. */
|
|
11
|
+
schema: IrSchema;
|
|
12
|
+
/** Who wrote this build. Not covered by the build hash. */
|
|
13
|
+
producer?: Producer;
|
|
14
|
+
/** The solver's name as declared in the schema, e.g. `FillingDay`. */
|
|
15
|
+
solver: string;
|
|
16
|
+
clock: Clock;
|
|
17
|
+
/** Sorted by id; each set's items sorted by id. */
|
|
18
|
+
itemSets: ItemSet[];
|
|
19
|
+
/** Sorted by id. */
|
|
20
|
+
resources: Resource[];
|
|
21
|
+
/** In declaration order. Keys unique. */
|
|
22
|
+
decisions: Decision[];
|
|
23
|
+
/** In declaration order. */
|
|
24
|
+
processes: Process[];
|
|
25
|
+
/** Generated rules first (sorted by id), then authored rules in declaration order. */
|
|
26
|
+
rules: Rule[];
|
|
27
|
+
/** In declaration order; each group's rows sorted by id. */
|
|
28
|
+
structure: StructureGroup[];
|
|
29
|
+
/** In declaration order. */
|
|
30
|
+
goals: Goal[];
|
|
31
|
+
/** In declaration order. */
|
|
32
|
+
kpis: Kpi[];
|
|
33
|
+
/** Sorted by id. */
|
|
34
|
+
assumptions: Note[];
|
|
35
|
+
/** Sorted by id. */
|
|
36
|
+
warnings: Note[];
|
|
37
|
+
/** §4.7. Sorted by id; each mode's options in declaration order. */
|
|
38
|
+
modes?: Mode[];
|
|
39
|
+
/** §4.4. Sorted by id; each supply's steps by `at`. */
|
|
40
|
+
supplies?: Supply[];
|
|
41
|
+
/** §4.4. In declaration order. */
|
|
42
|
+
usages?: Usage[];
|
|
43
|
+
/** §4.1. In declaration order; each flow's pairs sorted by (up, down). */
|
|
44
|
+
flows?: Flow[];
|
|
45
|
+
}
|
|
46
|
+
interface Producer {
|
|
47
|
+
sdk: string;
|
|
48
|
+
}
|
|
49
|
+
interface Clock {
|
|
50
|
+
/** ISO 8601 UTC instant for unit 0. */
|
|
51
|
+
from: string;
|
|
52
|
+
/** ISO 8601 UTC instant for unit `horizon`. */
|
|
53
|
+
to: string;
|
|
54
|
+
/** IANA zone the plan is shown in. */
|
|
55
|
+
zone: string;
|
|
56
|
+
unitMs: Int;
|
|
57
|
+
horizon: Int;
|
|
58
|
+
}
|
|
59
|
+
interface ItemSet {
|
|
60
|
+
id: Id;
|
|
61
|
+
label: string;
|
|
62
|
+
items: SetItem[];
|
|
63
|
+
}
|
|
64
|
+
interface Item$1 {
|
|
65
|
+
id: Id;
|
|
66
|
+
label: string;
|
|
67
|
+
}
|
|
68
|
+
/** An item of a set, with what the solver's `describe` says about it. Both fields are omitted when empty. */
|
|
69
|
+
interface SetItem extends Item$1 {
|
|
70
|
+
/** What the item is, in a word or two. */
|
|
71
|
+
title?: string;
|
|
72
|
+
/** In declared order; never empty. */
|
|
73
|
+
facts?: ItemFact[];
|
|
74
|
+
}
|
|
75
|
+
type FactDisplay = "text" | "clock" | "quantity" | "count";
|
|
76
|
+
/** One `describe` fact, formatted once in the clock's zone: the reader shows `text` as it is. */
|
|
77
|
+
interface ItemFact {
|
|
78
|
+
label: string;
|
|
79
|
+
text: string;
|
|
80
|
+
/** An ISO instant for `clock`, a number for `quantity` and `count`, else the text. */
|
|
81
|
+
value: number | string;
|
|
82
|
+
display: FactDisplay;
|
|
83
|
+
}
|
|
84
|
+
type ResourceKind = "machine" | "vessel" | "tank" | "vehicle" | "person" | "area" | "other";
|
|
85
|
+
interface Resource {
|
|
86
|
+
id: Id;
|
|
87
|
+
label: string;
|
|
88
|
+
kind: ResourceKind;
|
|
89
|
+
/** The `s.resources` call it came from, e.g. `lines`. */
|
|
90
|
+
group: string;
|
|
91
|
+
capacity: 1;
|
|
92
|
+
}
|
|
93
|
+
type Decision = TimedDecision | HeldDecision;
|
|
94
|
+
interface DecisionBase {
|
|
95
|
+
/** The key in `plan.values`: the returned name, else `<itemSet>.<step>`. */
|
|
96
|
+
key: Id;
|
|
97
|
+
label: string;
|
|
98
|
+
kind: "schedule";
|
|
99
|
+
itemSet: Id;
|
|
100
|
+
process: {
|
|
101
|
+
process: Id;
|
|
102
|
+
step: Id;
|
|
103
|
+
} | null;
|
|
104
|
+
}
|
|
105
|
+
/** A span per item whose length is its duration. */
|
|
106
|
+
interface TimedDecision extends DecisionBase {
|
|
107
|
+
mode: "timed";
|
|
108
|
+
on: OnNone | OnRows;
|
|
109
|
+
changeover: Changeover | null;
|
|
110
|
+
/** 0.2, §4.3: set-ups, changeovers and cleandowns as spans. `on` is rows; `changeover` is null. */
|
|
111
|
+
service?: Service;
|
|
112
|
+
/**
|
|
113
|
+
* 0.2, §4.7: durations that depend on a mode, option → item → resource → units. `on` is rows,
|
|
114
|
+
* every option gives exactly the pairs `on.duration` gives, and `on.duration` holds the shortest.
|
|
115
|
+
*/
|
|
116
|
+
byMode?: {
|
|
117
|
+
mode: Id;
|
|
118
|
+
duration: Record<Id, Record<Id, Record<Id, Int>>>;
|
|
119
|
+
};
|
|
120
|
+
/** 0.2, §4.7: items that exist under one option only. */
|
|
121
|
+
presence?: Record<Id, ModeOption>;
|
|
122
|
+
/**
|
|
123
|
+
* 0.2, §4.5: durations that depend on the vessel the held decision `decision` takes for the same
|
|
124
|
+
* item, item → vessel → units. `on.duration` holds, for every allowed resource, the shortest.
|
|
125
|
+
* Never with `byMode`.
|
|
126
|
+
*/
|
|
127
|
+
via?: {
|
|
128
|
+
decision: Id;
|
|
129
|
+
duration: Record<Id, Record<Id, Int>>;
|
|
130
|
+
};
|
|
131
|
+
}
|
|
132
|
+
/** No resource: `duration` is item → units. */
|
|
133
|
+
interface OnNone {
|
|
134
|
+
kind: "none";
|
|
135
|
+
duration: Record<Id, Int>;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* One of `resources`: `duration` is item → resource → units. Every item needs a duration on at
|
|
139
|
+
* least one resource; a missing (item, resource) pair means that assignment is not allowed.
|
|
140
|
+
*/
|
|
141
|
+
interface OnRows {
|
|
142
|
+
kind: "rows";
|
|
143
|
+
/** Sorted. */
|
|
144
|
+
resources: Id[];
|
|
145
|
+
duration: Record<Id, Record<Id, Int>>;
|
|
146
|
+
}
|
|
147
|
+
/** A span per item that starts and ends at edges of other decisions (a vessel held from mix to fill). */
|
|
148
|
+
interface HeldDecision extends DecisionBase {
|
|
149
|
+
mode: "held";
|
|
150
|
+
/**
|
|
151
|
+
* Any item may take any of `resources` (sorted), unless `where` (0.2, §4.5) lists, per item,
|
|
152
|
+
* the sorted, non-empty subset it may take.
|
|
153
|
+
*/
|
|
154
|
+
on: {
|
|
155
|
+
kind: "rows";
|
|
156
|
+
resources: Id[];
|
|
157
|
+
where?: Record<Id, Id[]>;
|
|
158
|
+
};
|
|
159
|
+
from: EdgeRef;
|
|
160
|
+
until: EdgeRef;
|
|
161
|
+
/** Units held after `until`. */
|
|
162
|
+
plus: Int;
|
|
163
|
+
/** 0.2, §4.3: cleans between holds on a vessel. */
|
|
164
|
+
service?: Service;
|
|
165
|
+
/** 0.2, §4.5: item → vessel → amount held (scaled), for each vessel the item may take. */
|
|
166
|
+
fill?: Record<Id, Record<Id, Int>>;
|
|
167
|
+
}
|
|
168
|
+
interface EdgeRef {
|
|
169
|
+
decision: Id;
|
|
170
|
+
edge: "start" | "end";
|
|
171
|
+
}
|
|
172
|
+
/** Sequence-dependent gaps between consecutive items on one resource. */
|
|
173
|
+
interface Changeover {
|
|
174
|
+
/** The hard rule whose rows enforce it. */
|
|
175
|
+
rule: Id;
|
|
176
|
+
/** Sorted by id. */
|
|
177
|
+
classes: Item$1[];
|
|
178
|
+
/** item → class id. */
|
|
179
|
+
classOf: Record<Id, Id>;
|
|
180
|
+
/** from class → to class → units; null means the pair may never be consecutive. Complete. */
|
|
181
|
+
table: Record<Id, Record<Id, Int | null>>;
|
|
182
|
+
/** Units before the first item on each resource. */
|
|
183
|
+
beforeFirst: Int;
|
|
184
|
+
/** Cells filled by the `missing` policy. Sorted by (from, to). */
|
|
185
|
+
assumed: {
|
|
186
|
+
from: Id;
|
|
187
|
+
to: Id;
|
|
188
|
+
}[];
|
|
189
|
+
}
|
|
190
|
+
interface Process {
|
|
191
|
+
id: Id;
|
|
192
|
+
label: string;
|
|
193
|
+
itemSet: Id;
|
|
194
|
+
/** In declaration order. */
|
|
195
|
+
steps: ProcessStep[];
|
|
196
|
+
}
|
|
197
|
+
type ProcessStep = {
|
|
198
|
+
kind: "stage";
|
|
199
|
+
id: Id;
|
|
200
|
+
label: string;
|
|
201
|
+
decision: Id;
|
|
202
|
+
after: Id | null;
|
|
203
|
+
} | {
|
|
204
|
+
kind: "occupies";
|
|
205
|
+
id: Id;
|
|
206
|
+
label: string;
|
|
207
|
+
decision: Id;
|
|
208
|
+
from: Id;
|
|
209
|
+
until: Id;
|
|
210
|
+
};
|
|
211
|
+
interface Rule {
|
|
212
|
+
id: Id;
|
|
213
|
+
/** One plain sentence an operator reads. */
|
|
214
|
+
says: string;
|
|
215
|
+
hardness: "hard" | "soft";
|
|
216
|
+
/** Soft rules only. */
|
|
217
|
+
weight: number | null;
|
|
218
|
+
/** Soft rules only; lower is more important. */
|
|
219
|
+
priority: Int | null;
|
|
220
|
+
/** What a broken row's amount counts. */
|
|
221
|
+
unit: string | null;
|
|
222
|
+
/**
|
|
223
|
+
* Soft rules only, and only when the author gave one: what the broken items do, as the words
|
|
224
|
+
* after a count, e.g. `finish late` reads "2 of 8 jobs finish late". Write it for a plural
|
|
225
|
+
* subject: for a count of one the score puts it into the singular, "1 of 8 jobs finishes late".
|
|
226
|
+
*/
|
|
227
|
+
summary?: string;
|
|
228
|
+
from: "generated" | "author";
|
|
229
|
+
/** The 0.2 kinds: `flow` (§4.1) and `supply` (§4.4). */
|
|
230
|
+
kind: "one-at-a-time" | "changeover" | "custom" | "flow" | "supply";
|
|
231
|
+
declared: Declared | null;
|
|
232
|
+
/** Sorted by id. */
|
|
233
|
+
rows: RuleRow[];
|
|
234
|
+
globals: Global[];
|
|
235
|
+
}
|
|
236
|
+
interface Declared {
|
|
237
|
+
/** `of` is a resource, a decision (`changeover`, `decision`), a flow or a usage. */
|
|
238
|
+
what: "resource" | "changeover" | "flow" | "usage" | "decision";
|
|
239
|
+
of: Id;
|
|
240
|
+
label: string;
|
|
241
|
+
}
|
|
242
|
+
interface RuleRow {
|
|
243
|
+
id: Id;
|
|
244
|
+
item: Id | null;
|
|
245
|
+
c: C;
|
|
246
|
+
/** The rule's `explain` output for this row. */
|
|
247
|
+
detail: Record<string, string | number | boolean | null> | null;
|
|
248
|
+
/** 0.2, §4.7: the row holds only when this option is chosen. */
|
|
249
|
+
when?: ModeOption;
|
|
250
|
+
}
|
|
251
|
+
interface StructureGroup {
|
|
252
|
+
id: Id;
|
|
253
|
+
says: string;
|
|
254
|
+
step: Id;
|
|
255
|
+
/** Sorted by id. */
|
|
256
|
+
rows: {
|
|
257
|
+
id: Id;
|
|
258
|
+
item: Id;
|
|
259
|
+
c: C;
|
|
260
|
+
}[];
|
|
261
|
+
}
|
|
262
|
+
interface Goal {
|
|
263
|
+
id: Id;
|
|
264
|
+
says: string;
|
|
265
|
+
direction: "minimize" | "maximize";
|
|
266
|
+
/** Greater than 0; in 0.2, 0 exactly when `hold`. */
|
|
267
|
+
weight: number;
|
|
268
|
+
priority: Int;
|
|
269
|
+
unit: string | null;
|
|
270
|
+
value: N;
|
|
271
|
+
/** 0.2, §5.6: how far from its own level's best the goal may be, in its scaled unit. */
|
|
272
|
+
within?: Int;
|
|
273
|
+
/** 0.2, §5.6: held at its level's value plus `within` (0 when absent), never optimised. Then `weight` is 0. */
|
|
274
|
+
hold?: true;
|
|
275
|
+
/** 0.2: shown as `value / divideBy` in `unit` (a weighted average stored as its numerator). */
|
|
276
|
+
display?: {
|
|
277
|
+
divideBy: Int;
|
|
278
|
+
unit: string;
|
|
279
|
+
};
|
|
280
|
+
}
|
|
281
|
+
type KpiDisplay = "clock" | "hours" | "minutes" | "quantity" | "count" | "percent";
|
|
282
|
+
interface Kpi {
|
|
283
|
+
key: Id;
|
|
284
|
+
label: string;
|
|
285
|
+
unit: string | null;
|
|
286
|
+
display: KpiDisplay;
|
|
287
|
+
value: N;
|
|
288
|
+
}
|
|
289
|
+
interface Note {
|
|
290
|
+
id: Id;
|
|
291
|
+
text: string;
|
|
292
|
+
/** The rule, decision or resource it is about. */
|
|
293
|
+
from: Id | null;
|
|
294
|
+
}
|
|
295
|
+
type VarRef = {
|
|
296
|
+
kind: "start" | "end";
|
|
297
|
+
dec: Id;
|
|
298
|
+
id: Id;
|
|
299
|
+
};
|
|
300
|
+
type N = {
|
|
301
|
+
k: "c";
|
|
302
|
+
v: number;
|
|
303
|
+
}
|
|
304
|
+
/** Σ coef·x + c */
|
|
305
|
+
| {
|
|
306
|
+
k: "lin";
|
|
307
|
+
t: [number, N][];
|
|
308
|
+
c: number;
|
|
309
|
+
} | {
|
|
310
|
+
k: "var";
|
|
311
|
+
ref: VarRef;
|
|
312
|
+
}
|
|
313
|
+
/** max (or min, `neg`) over the terms whose `p` holds; `none` when none does. */
|
|
314
|
+
| {
|
|
315
|
+
k: "max";
|
|
316
|
+
xs: {
|
|
317
|
+
x: N;
|
|
318
|
+
p: C;
|
|
319
|
+
}[];
|
|
320
|
+
none: number | null;
|
|
321
|
+
neg: boolean;
|
|
322
|
+
}
|
|
323
|
+
/** Σ v·[c] + c */
|
|
324
|
+
| {
|
|
325
|
+
k: "sel";
|
|
326
|
+
t: [C, number][];
|
|
327
|
+
c: number;
|
|
328
|
+
};
|
|
329
|
+
type LitRef =
|
|
330
|
+
/** Item `id` of decision `dec` is on resource `v`. */
|
|
331
|
+
{
|
|
332
|
+
kind: "is";
|
|
333
|
+
dec: Id;
|
|
334
|
+
id: Id;
|
|
335
|
+
v: Id;
|
|
336
|
+
}
|
|
337
|
+
/** On `res`, `from` is directly before `to`; `from: null` means `to` is first. */
|
|
338
|
+
| {
|
|
339
|
+
kind: "arc";
|
|
340
|
+
dec: Id;
|
|
341
|
+
res: Id;
|
|
342
|
+
from: Id | null;
|
|
343
|
+
to: Id;
|
|
344
|
+
}
|
|
345
|
+
/** 0.2, §4.7: mode `mode` takes `option`. */
|
|
346
|
+
| {
|
|
347
|
+
kind: "mode";
|
|
348
|
+
mode: Id;
|
|
349
|
+
option: Id;
|
|
350
|
+
}
|
|
351
|
+
/** 0.2, §4.3: `id` is the first item of `dec` on `res`. */
|
|
352
|
+
| {
|
|
353
|
+
kind: "first";
|
|
354
|
+
dec: Id;
|
|
355
|
+
res: Id;
|
|
356
|
+
id: Id;
|
|
357
|
+
}
|
|
358
|
+
/** 0.2, §4.3: `id` is the last item of `dec` on `res`. */
|
|
359
|
+
| {
|
|
360
|
+
kind: "last";
|
|
361
|
+
dec: Id;
|
|
362
|
+
res: Id;
|
|
363
|
+
id: Id;
|
|
364
|
+
};
|
|
365
|
+
type C = {
|
|
366
|
+
k: "t";
|
|
367
|
+
} | {
|
|
368
|
+
k: "f";
|
|
369
|
+
}
|
|
370
|
+
/** lo ≤ x ≤ hi; broken by the distance outside. */
|
|
371
|
+
| {
|
|
372
|
+
k: "cmp";
|
|
373
|
+
x: N;
|
|
374
|
+
lo: number | null;
|
|
375
|
+
hi: number | null;
|
|
376
|
+
} | {
|
|
377
|
+
k: "and";
|
|
378
|
+
xs: C[];
|
|
379
|
+
} | {
|
|
380
|
+
k: "not";
|
|
381
|
+
x: C;
|
|
382
|
+
} | {
|
|
383
|
+
k: "imp";
|
|
384
|
+
a: C;
|
|
385
|
+
b: C;
|
|
386
|
+
} | {
|
|
387
|
+
k: "lit";
|
|
388
|
+
ref: LitRef;
|
|
389
|
+
};
|
|
390
|
+
interface SpanItem {
|
|
391
|
+
id: Id;
|
|
392
|
+
s: N;
|
|
393
|
+
e: N;
|
|
394
|
+
p: C;
|
|
395
|
+
}
|
|
396
|
+
type Global = {
|
|
397
|
+
kind: "noOverlap";
|
|
398
|
+
groups: {
|
|
399
|
+
key: Id;
|
|
400
|
+
items: SpanItem[];
|
|
401
|
+
}[];
|
|
402
|
+
};
|
|
403
|
+
/** A choice of one option of a mode. */
|
|
404
|
+
interface ModeOption {
|
|
405
|
+
mode: Id;
|
|
406
|
+
option: Id;
|
|
407
|
+
}
|
|
408
|
+
/** §4.3: one resource's service table. */
|
|
409
|
+
interface ServiceTable {
|
|
410
|
+
/** from class → to class → units; null means the pair may never be consecutive. Complete. */
|
|
411
|
+
table: Record<Id, Record<Id, Int | null>>;
|
|
412
|
+
/** Units of set-up before the first item. */
|
|
413
|
+
setup?: Int;
|
|
414
|
+
/** Set-up units by item id, complete over the decision's items. Exclusive with `setup`. */
|
|
415
|
+
setupBy?: Readonly<Record<Id, Int>>;
|
|
416
|
+
/** Units of cleandown after the last item. */
|
|
417
|
+
cleandown?: Int;
|
|
418
|
+
/** Cleandown units by item id, complete over the decision's items. Exclusive with `cleandown`. */
|
|
419
|
+
cleandownBy?: Readonly<Record<Id, Int>>;
|
|
420
|
+
}
|
|
421
|
+
/** §4.3: set-ups, changeovers and cleandowns as spans on the decision's resources. */
|
|
422
|
+
interface Service {
|
|
423
|
+
/** The generated hard rule (`kind: "changeover"`) whose rows hold the spans. */
|
|
424
|
+
rule: Id;
|
|
425
|
+
/** Sorted by id. */
|
|
426
|
+
classes: Item$1[];
|
|
427
|
+
/** item → class id. */
|
|
428
|
+
classOf: Record<Id, Id>;
|
|
429
|
+
/** Exactly the decision's resources. */
|
|
430
|
+
byResource: Record<Id, ServiceTable>;
|
|
431
|
+
/** item → the earliest its set-up may start when it is first on its resource. */
|
|
432
|
+
setupNotBefore?: Record<Id, N>;
|
|
433
|
+
/** Every service span takes `amount` (scaled) of usage `usage`. */
|
|
434
|
+
uses?: {
|
|
435
|
+
usage: Id;
|
|
436
|
+
amount: Int;
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* A changeover with time starts the moment the item before it ends, and may end before the next
|
|
440
|
+
* item starts. Set-ups, cleandowns and changeovers of no time are as without it. Absent: a
|
|
441
|
+
* changeover ends as the next item starts.
|
|
442
|
+
*/
|
|
443
|
+
eager?: true;
|
|
444
|
+
}
|
|
445
|
+
/** §4.7: a day-level choice between ways of working. */
|
|
446
|
+
interface Mode {
|
|
447
|
+
id: Id;
|
|
448
|
+
says: string;
|
|
449
|
+
/** At least two, in declaration order. */
|
|
450
|
+
options: Id[];
|
|
451
|
+
}
|
|
452
|
+
/** §4.4: how much of something is on hand over time, such as people on site. */
|
|
453
|
+
interface Supply {
|
|
454
|
+
id: Id;
|
|
455
|
+
unit: string;
|
|
456
|
+
/** Model units per unit: 2 means halves. */
|
|
457
|
+
scale: Int;
|
|
458
|
+
/** From each `at` (clock units) on, `value` (scaled) is on hand; 0 before the first. Sorted by `at`, strictly. */
|
|
459
|
+
steps: {
|
|
460
|
+
at: Int;
|
|
461
|
+
value: Int;
|
|
462
|
+
}[];
|
|
463
|
+
}
|
|
464
|
+
/** §4.4: what draws on a supply. */
|
|
465
|
+
interface Usage {
|
|
466
|
+
id: Id;
|
|
467
|
+
supply: Id;
|
|
468
|
+
/** The generated hard rule (`kind: "supply"`). */
|
|
469
|
+
rule: Id;
|
|
470
|
+
unit: string;
|
|
471
|
+
scale: Int;
|
|
472
|
+
terms: UsageTerm[];
|
|
473
|
+
}
|
|
474
|
+
type UsageTerm =
|
|
475
|
+
/** Each item of `decision` takes `amount[item]` while it runs. */
|
|
476
|
+
{
|
|
477
|
+
k: "step";
|
|
478
|
+
decision: Id;
|
|
479
|
+
amount: Record<Id, Int>;
|
|
480
|
+
}
|
|
481
|
+
/** Each service span of `decision` takes `amount`. */
|
|
482
|
+
| {
|
|
483
|
+
k: "service";
|
|
484
|
+
decision: Id;
|
|
485
|
+
amount: Int;
|
|
486
|
+
}
|
|
487
|
+
/** `amount` from `from` to `to`, in clock units. */
|
|
488
|
+
| {
|
|
489
|
+
k: "fixed";
|
|
490
|
+
from: Int;
|
|
491
|
+
to: Int;
|
|
492
|
+
amount: Int;
|
|
493
|
+
}
|
|
494
|
+
/** `amount` from `from` until the last end of the `until` decisions. */
|
|
495
|
+
| {
|
|
496
|
+
k: "span";
|
|
497
|
+
id: Id;
|
|
498
|
+
from: N;
|
|
499
|
+
until: {
|
|
500
|
+
decision: Id;
|
|
501
|
+
}[];
|
|
502
|
+
amount: Int;
|
|
503
|
+
};
|
|
504
|
+
/** Exact rate, `num / den`. */
|
|
505
|
+
interface Rational {
|
|
506
|
+
num: Int;
|
|
507
|
+
den: Int;
|
|
508
|
+
}
|
|
509
|
+
/** §4.1: one side of a flow: a timed decision. */
|
|
510
|
+
interface FlowEnd {
|
|
511
|
+
decision: Id;
|
|
512
|
+
}
|
|
513
|
+
interface FlowPair {
|
|
514
|
+
/** An item of `from`. */
|
|
515
|
+
up: Id;
|
|
516
|
+
/** An item of `to`. */
|
|
517
|
+
down: Id;
|
|
518
|
+
/** `after` only: the least and most wait from up's end to down's start. */
|
|
519
|
+
atLeast?: Int;
|
|
520
|
+
atMost?: Int;
|
|
521
|
+
/** `alongside` only: down starts at least `lag` after up starts and ends at least `tail` after up ends. */
|
|
522
|
+
lag?: Int;
|
|
523
|
+
tail?: Int;
|
|
524
|
+
/** Through a held vessel: two linear rows on the level held. */
|
|
525
|
+
holding?: {
|
|
526
|
+
decision: Id;
|
|
527
|
+
item: Id;
|
|
528
|
+
upRate: Rational;
|
|
529
|
+
downRate: Rational;
|
|
530
|
+
amount: Int;
|
|
531
|
+
/**
|
|
532
|
+
* Each vessel the held item may take (`where`, else every resource) → what it holds, in the
|
|
533
|
+
* same scaled units as `amount`. Exactly those vessels, each at least 1.
|
|
534
|
+
*/
|
|
535
|
+
capacity: Record<Id, Int>;
|
|
536
|
+
};
|
|
537
|
+
}
|
|
538
|
+
/** §4.1: one step feeds another. `rule` is the flow's generated hard rule, with the flow's id. */
|
|
539
|
+
interface Flow {
|
|
540
|
+
id: Id;
|
|
541
|
+
says: string;
|
|
542
|
+
rule: Id;
|
|
543
|
+
kind: "after" | "alongside";
|
|
544
|
+
from: FlowEnd;
|
|
545
|
+
to: FlowEnd;
|
|
546
|
+
pairs: FlowPair[];
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
interface OpeningMap {
|
|
550
|
+
readonly rows: string;
|
|
551
|
+
readonly row: string;
|
|
552
|
+
readonly amount: string;
|
|
553
|
+
readonly made?: string;
|
|
554
|
+
readonly age?: string;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/** `c.estimate(says, fit)`: how a plan guesses a day's load before the schedule runs. */
|
|
558
|
+
interface EstimateFact {
|
|
559
|
+
readonly says: string;
|
|
560
|
+
readonly perUnit: string;
|
|
561
|
+
readonly scale: number;
|
|
562
|
+
readonly perRun: number | TableRunCost;
|
|
563
|
+
readonly perFamily?: {
|
|
564
|
+
readonly family: string;
|
|
565
|
+
readonly minutes: number;
|
|
566
|
+
};
|
|
567
|
+
readonly perDay: number;
|
|
568
|
+
readonly extraOn: readonly {
|
|
569
|
+
readonly day: Weekday;
|
|
570
|
+
readonly n: number;
|
|
571
|
+
}[];
|
|
572
|
+
readonly perLine: readonly {
|
|
573
|
+
readonly line: string;
|
|
574
|
+
readonly n: number;
|
|
575
|
+
}[];
|
|
576
|
+
}
|
|
577
|
+
|
|
578
|
+
type Fields = Readonly<Record<string, unknown>>;
|
|
579
|
+
/** A row of the prepared data: its fields, and the id every row has. */
|
|
580
|
+
type Item = Fields & {
|
|
581
|
+
readonly id: string;
|
|
582
|
+
readonly name?: string;
|
|
583
|
+
};
|
|
584
|
+
|
|
585
|
+
interface FirstSetupRecord {
|
|
586
|
+
readonly when: "before first";
|
|
587
|
+
readonly time: TimeRecord | null;
|
|
588
|
+
readonly notBefore?: string;
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
type Scalar$1 = string | number | boolean;
|
|
592
|
+
/** A match on rows as written (`where`, an order rule's rows): a field, and its value or values. */
|
|
593
|
+
type RowMatch = Readonly<Record<string, unknown>>;
|
|
594
|
+
/** A time as written: a duration, in minutes, or the rows' field (or the table) that holds it. */
|
|
595
|
+
type TimeRecord = {
|
|
596
|
+
readonly kind: "fn";
|
|
597
|
+
readonly fn: (job: Item, on: Item | undefined) => unknown;
|
|
598
|
+
readonly says: string | null;
|
|
599
|
+
} | {
|
|
600
|
+
readonly kind: "duration";
|
|
601
|
+
readonly text: string;
|
|
602
|
+
readonly minutes: number;
|
|
603
|
+
} | {
|
|
604
|
+
readonly kind: "key";
|
|
605
|
+
readonly key: string;
|
|
606
|
+
}
|
|
607
|
+
/** `op.minutes(path)`: a figure of the rows' result, in minutes. */
|
|
608
|
+
| {
|
|
609
|
+
readonly kind: "figure";
|
|
610
|
+
readonly path: string;
|
|
611
|
+
readonly unit: "min";
|
|
612
|
+
};
|
|
613
|
+
/** A function the model holds. The record is plain data everywhere except here (R20): nothing clones or serialises a ModelRecord. */
|
|
614
|
+
interface HookRecord {
|
|
615
|
+
readonly says: string;
|
|
616
|
+
readonly fn: (...args: never[]) => unknown;
|
|
617
|
+
}
|
|
618
|
+
/** So many of a role: a number, or the rows' field holding it. */
|
|
619
|
+
interface CrewRecord {
|
|
620
|
+
readonly role: string;
|
|
621
|
+
readonly n: Limit;
|
|
622
|
+
}
|
|
623
|
+
interface PersonRecord {
|
|
624
|
+
readonly at: {
|
|
625
|
+
readonly line: number;
|
|
626
|
+
} | null;
|
|
627
|
+
readonly def: "person";
|
|
628
|
+
readonly name: string;
|
|
629
|
+
readonly id: string;
|
|
630
|
+
readonly about: string;
|
|
631
|
+
readonly list: string;
|
|
632
|
+
readonly listWritten: boolean;
|
|
633
|
+
readonly where: RowMatch | null;
|
|
634
|
+
}
|
|
635
|
+
type PieceRecord = EquipmentRecord | PersonRecord;
|
|
636
|
+
type DowntimeTrigger = {
|
|
637
|
+
readonly when: "change";
|
|
638
|
+
readonly key: string;
|
|
639
|
+
} | {
|
|
640
|
+
readonly when: "each use";
|
|
641
|
+
} | FirstSetupRecord | {
|
|
642
|
+
readonly when: "after last";
|
|
643
|
+
readonly time: TimeRecord;
|
|
644
|
+
};
|
|
645
|
+
interface DowntimeRecord extends WashTimingRecord {
|
|
646
|
+
readonly at: {
|
|
647
|
+
readonly line: number;
|
|
648
|
+
} | null;
|
|
649
|
+
readonly travel?: true;
|
|
650
|
+
readonly def: "downtime";
|
|
651
|
+
readonly name: string;
|
|
652
|
+
readonly id: string;
|
|
653
|
+
/** "downtime.<id>" until it's on a piece, then "<the piece's about>.downtime.<id>". */
|
|
654
|
+
readonly about: string;
|
|
655
|
+
/** Which `piece.downtime(...)` call made it, from 1. */
|
|
656
|
+
readonly serial: number;
|
|
657
|
+
readonly triggers: readonly DowntimeTrigger[];
|
|
658
|
+
/** `takes: { pairs }`, in order: a time for every change, or for one pair. */
|
|
659
|
+
readonly takes: readonly {
|
|
660
|
+
readonly time: TimeRecord;
|
|
661
|
+
readonly pair: {
|
|
662
|
+
readonly from: Scalar$1;
|
|
663
|
+
readonly to: Scalar$1;
|
|
664
|
+
} | null;
|
|
665
|
+
}[];
|
|
666
|
+
readonly default: TimeRecord | null;
|
|
667
|
+
readonly asap: boolean;
|
|
668
|
+
/** A function of the pair, with the sentence it's said by. */
|
|
669
|
+
readonly table: HookRecord | null;
|
|
670
|
+
readonly people: readonly CrewRecord[];
|
|
671
|
+
}
|
|
672
|
+
interface UseRecord extends CoverRecord {
|
|
673
|
+
readonly only?: HookRecord;
|
|
674
|
+
readonly inOrder?: true;
|
|
675
|
+
/** The equipment's or person's name, as the step wrote it. */
|
|
676
|
+
readonly on: string;
|
|
677
|
+
/** The step it's kept until, by name. */
|
|
678
|
+
readonly until: string | null;
|
|
679
|
+
}
|
|
680
|
+
interface StepRecord extends ReadyBeforeRecord, AsapRecord, SkipEmptyRecord, StepFlowCalls {
|
|
681
|
+
readonly at: {
|
|
682
|
+
readonly line: number;
|
|
683
|
+
} | null;
|
|
684
|
+
readonly def: "step";
|
|
685
|
+
readonly name: string;
|
|
686
|
+
readonly id: string;
|
|
687
|
+
/** "steps.<id>" until it's in a process, then "processes.<process id>.steps.<id>". */
|
|
688
|
+
readonly about: string;
|
|
689
|
+
readonly uses: readonly UseRecord[];
|
|
690
|
+
readonly takes: {
|
|
691
|
+
readonly time: TimeRecord;
|
|
692
|
+
} | null;
|
|
693
|
+
readonly minWait: {
|
|
694
|
+
readonly time: TimeRecord;
|
|
695
|
+
readonly after: string | null;
|
|
696
|
+
} | null;
|
|
697
|
+
readonly maxWait: {
|
|
698
|
+
readonly time: TimeRecord;
|
|
699
|
+
readonly after: string;
|
|
700
|
+
readonly excluding: readonly string[];
|
|
701
|
+
readonly prefer: boolean;
|
|
702
|
+
} | null;
|
|
703
|
+
readonly people: readonly CrewRecord[];
|
|
704
|
+
}
|
|
705
|
+
interface DemandRecord {
|
|
706
|
+
/** "processes.<id>.ready", ".due" or ".deadline". */
|
|
707
|
+
readonly about: string;
|
|
708
|
+
readonly key: string;
|
|
709
|
+
readonly called: string | null;
|
|
710
|
+
readonly says: string | null;
|
|
711
|
+
readonly at?: "start";
|
|
712
|
+
/** A due's soft bound before it, `.shouldEndBy(key, { maxEarly: "2 h" })`: the time, without "before". Only a due has one. */
|
|
713
|
+
readonly notEarlierThan: Extract<TimeRecord, {
|
|
714
|
+
kind: "duration";
|
|
715
|
+
}> | null;
|
|
716
|
+
}
|
|
717
|
+
interface ProcessRecord extends OptionalRecord, ProcessFlowCalls {
|
|
718
|
+
readonly at: {
|
|
719
|
+
readonly line: number;
|
|
720
|
+
} | null;
|
|
721
|
+
readonly def: "process";
|
|
722
|
+
readonly label?: (row: Item) => string;
|
|
723
|
+
readonly name: string;
|
|
724
|
+
readonly id: string;
|
|
725
|
+
readonly about: string;
|
|
726
|
+
readonly list: string;
|
|
727
|
+
readonly listWritten: boolean;
|
|
728
|
+
readonly steps: readonly StepRecord[];
|
|
729
|
+
readonly ready: DemandRecord | null;
|
|
730
|
+
readonly due: DemandRecord | null;
|
|
731
|
+
readonly deadline: DemandRecord | null;
|
|
732
|
+
readonly where: RowMatch | null;
|
|
733
|
+
readonly scheduleOnly: boolean;
|
|
734
|
+
readonly batched: boolean;
|
|
735
|
+
}
|
|
736
|
+
interface HoursRecord {
|
|
737
|
+
readonly at: {
|
|
738
|
+
readonly line: number;
|
|
739
|
+
} | null;
|
|
740
|
+
readonly def: "hours";
|
|
741
|
+
readonly name: string;
|
|
742
|
+
readonly about: "hours";
|
|
743
|
+
readonly open: readonly string[];
|
|
744
|
+
}
|
|
745
|
+
/** A rule's limit: a number or a row field. */
|
|
746
|
+
type Limit = {
|
|
747
|
+
readonly kind: "number";
|
|
748
|
+
readonly n: number;
|
|
749
|
+
} | {
|
|
750
|
+
readonly kind: "key";
|
|
751
|
+
readonly key: string;
|
|
752
|
+
};
|
|
753
|
+
type MeasureExpr = ShortMeasureExpr | NotDoneExpr | {
|
|
754
|
+
readonly kind: "lateCount" | "lateness";
|
|
755
|
+
readonly process: string | null;
|
|
756
|
+
} | {
|
|
757
|
+
readonly kind: "early";
|
|
758
|
+
readonly process: string;
|
|
759
|
+
} | {
|
|
760
|
+
readonly kind: "finishTime" | "downtimeMinutes";
|
|
761
|
+
} | {
|
|
762
|
+
readonly kind: "wait";
|
|
763
|
+
readonly from: string;
|
|
764
|
+
readonly to: string;
|
|
765
|
+
} | {
|
|
766
|
+
readonly kind: "plus";
|
|
767
|
+
readonly terms: readonly [MeasureExpr, MeasureExpr];
|
|
768
|
+
} | {
|
|
769
|
+
readonly kind: "times";
|
|
770
|
+
readonly term: MeasureExpr;
|
|
771
|
+
readonly by: number;
|
|
772
|
+
};
|
|
773
|
+
interface TierRecord {
|
|
774
|
+
readonly at: {
|
|
775
|
+
readonly line: number;
|
|
776
|
+
} | null;
|
|
777
|
+
readonly tier: "first" | "then" | "hold" | "watch";
|
|
778
|
+
/** The tier's sentence; `null` for a watched measure. */
|
|
779
|
+
readonly says: string | null;
|
|
780
|
+
/** "priorities.<says>", or "priorities.watch.<n>" for the n-th watched measure. */
|
|
781
|
+
readonly about: string;
|
|
782
|
+
readonly tolerance: TimeRecord | null;
|
|
783
|
+
readonly measure: MeasureExpr;
|
|
784
|
+
}
|
|
785
|
+
interface PrioritiesRecord {
|
|
786
|
+
readonly def: "priorities";
|
|
787
|
+
readonly tiers: readonly TierRecord[];
|
|
788
|
+
}
|
|
789
|
+
interface RoleRecord extends DispatchRecord {
|
|
790
|
+
readonly at: {
|
|
791
|
+
readonly line: number;
|
|
792
|
+
} | null;
|
|
793
|
+
readonly def: "role";
|
|
794
|
+
readonly name: string;
|
|
795
|
+
readonly id: string;
|
|
796
|
+
/** "roles.<id>". */
|
|
797
|
+
readonly about: string;
|
|
798
|
+
readonly roster: string | null;
|
|
799
|
+
}
|
|
800
|
+
/** What `op.model(...)` was given, as plain data: what plan 03's compiler walks. */
|
|
801
|
+
interface ModelRecord {
|
|
802
|
+
readonly def: "model";
|
|
803
|
+
readonly site: {
|
|
804
|
+
readonly pieces: readonly PieceRecord[];
|
|
805
|
+
readonly processes: readonly ProcessRecord[];
|
|
806
|
+
readonly roles: readonly RoleRecord[];
|
|
807
|
+
};
|
|
808
|
+
readonly hours: HoursRecord | null;
|
|
809
|
+
readonly priorities: PrioritiesRecord | null;
|
|
810
|
+
}
|
|
811
|
+
/** The document's word groups. */
|
|
812
|
+
declare const WORD_PARTS: readonly ["processes", "downtime", "equipment", "demand"];
|
|
813
|
+
interface EquipmentRecord {
|
|
814
|
+
readonly at: {
|
|
815
|
+
readonly line: number;
|
|
816
|
+
} | null;
|
|
817
|
+
readonly def: "equipment";
|
|
818
|
+
readonly name: string;
|
|
819
|
+
/** `.id(...)`, or the name: what its `about` is keyed by. */
|
|
820
|
+
readonly id: string;
|
|
821
|
+
readonly about: string;
|
|
822
|
+
/** The rows' list, as written or the name's plural. `null` when counted. */
|
|
823
|
+
readonly list: string | null;
|
|
824
|
+
readonly listWritten: boolean;
|
|
825
|
+
/** `{ count: n }`: so many, with no rows. */
|
|
826
|
+
readonly count: number | null;
|
|
827
|
+
readonly where: RowMatch | null;
|
|
828
|
+
readonly kind: Kind | null;
|
|
829
|
+
readonly area: string | null;
|
|
830
|
+
/** `.holds(key, unit)`: how much it holds, from the rows' field. */
|
|
831
|
+
readonly holds: {
|
|
832
|
+
readonly key: string;
|
|
833
|
+
readonly unit: string;
|
|
834
|
+
} | null;
|
|
835
|
+
readonly downtimes: readonly DowntimeRecord[];
|
|
836
|
+
}
|
|
837
|
+
interface ProcessFlowCalls {
|
|
838
|
+
readonly releaseBy?: string;
|
|
839
|
+
readonly leaves?: {
|
|
840
|
+
readonly key: string;
|
|
841
|
+
readonly called: string;
|
|
842
|
+
readonly waits: boolean;
|
|
843
|
+
};
|
|
844
|
+
}
|
|
845
|
+
interface StepFlowCalls {
|
|
846
|
+
readonly afterFlow?: {
|
|
847
|
+
readonly path: string;
|
|
848
|
+
readonly by: string;
|
|
849
|
+
} | {
|
|
850
|
+
readonly path: string;
|
|
851
|
+
readonly match: (theirs: Item, mine: Item) => unknown;
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
declare const OPERATION_SCHEMA_DELIVERIES = "keel.solver.operation/3";
|
|
856
|
+
|
|
857
|
+
/** A stock movement's mapped columns. A delivery may name minimum days of life remaining. */
|
|
858
|
+
|
|
859
|
+
interface MaterialShips extends ShortShipsRecord {
|
|
860
|
+
readonly rows: string;
|
|
861
|
+
readonly row: string;
|
|
862
|
+
readonly date: string;
|
|
863
|
+
readonly amount: string;
|
|
864
|
+
readonly lifeLeft?: string;
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
declare const OPERATION_SCHEMA = "keel.solver.operation/2";
|
|
868
|
+
/** `op.model({ words })`: the operator's own word for a part, where the SDK's isn't theirs. */
|
|
869
|
+
type ModelWords = Partial<Record<(typeof WORD_PARTS)[number], string>>;
|
|
870
|
+
type NounKind = "hours" | "equipment" | "person" | "downtime" | "role" | "shift" | "material" | "process" | "step" | "rule" | "priority" | "plan" | "schedule" | "hook";
|
|
871
|
+
/** The read-back's words for a noun, so the Console does no grammar. `at`: how a step stands to it. */
|
|
872
|
+
interface NounWords {
|
|
873
|
+
readonly one: string;
|
|
874
|
+
readonly many: string;
|
|
875
|
+
readonly at: "on" | "in" | "at" | "with";
|
|
876
|
+
}
|
|
877
|
+
/** A time as the model said it: a duration, in minutes and as written, the rows' field holding it, or the rows' figure `op.minutes(path)` names. */
|
|
878
|
+
type TimeFact = {
|
|
879
|
+
readonly minutes: number;
|
|
880
|
+
readonly text: string;
|
|
881
|
+
} | {
|
|
882
|
+
readonly key: string;
|
|
883
|
+
} | {
|
|
884
|
+
readonly figure: string;
|
|
885
|
+
readonly unit: "min";
|
|
886
|
+
};
|
|
887
|
+
/** An amount as written, or the rows' figure `op.amount(path)` names. */
|
|
888
|
+
type AmountFact = {
|
|
889
|
+
readonly text: string;
|
|
890
|
+
readonly n: number;
|
|
891
|
+
readonly unit: string;
|
|
892
|
+
} | {
|
|
893
|
+
readonly figure: string;
|
|
894
|
+
readonly unit: "amount";
|
|
895
|
+
};
|
|
896
|
+
/** So many: a number, or the rows' field holding it. */
|
|
897
|
+
type LimitFact = {
|
|
898
|
+
readonly n: number;
|
|
899
|
+
} | {
|
|
900
|
+
readonly key: string;
|
|
901
|
+
};
|
|
902
|
+
/** So many of a role; `role` is the role noun's about. */
|
|
903
|
+
interface CrewFact {
|
|
904
|
+
readonly role: string;
|
|
905
|
+
readonly n: LimitFact;
|
|
906
|
+
}
|
|
907
|
+
/** A `startsDuring`'s `once`: a time or an amount. */
|
|
908
|
+
type OnceFact = Exclude<TimeFact, {
|
|
909
|
+
readonly key: string;
|
|
910
|
+
}> | AmountFact | OverlapAmountFact;
|
|
911
|
+
/** A material a process makes, yields or consumes: the material noun's about, and the rows' field. */
|
|
912
|
+
interface MaterialUseFact {
|
|
913
|
+
readonly material: string;
|
|
914
|
+
readonly key: string;
|
|
915
|
+
}
|
|
916
|
+
/** The forms of function a model holds: each is a hook noun of its owner's. */
|
|
917
|
+
declare const HOOK_FORMS: readonly ["table", "custom", "limit", "propose", "batches", "modes", "figure"];
|
|
918
|
+
type HookForm = (typeof HOOK_FORMS)[number];
|
|
919
|
+
declare const RULE_FORMS: readonly ["order", "maximum", "minimum", "custom", "onDays", "campaign", "requires"];
|
|
920
|
+
/** A process's ready, due or deadline: the rows' field, and the call's `called` and `says`. `notEarlier` is a due's `notEarlierThan`; `null` on a ready and a deadline. */
|
|
921
|
+
interface DemandFact {
|
|
922
|
+
readonly key: string;
|
|
923
|
+
readonly called: string | null;
|
|
924
|
+
readonly says: string | null;
|
|
925
|
+
readonly notEarlier: {
|
|
926
|
+
readonly minutes: number;
|
|
927
|
+
readonly text: string;
|
|
928
|
+
} | null;
|
|
929
|
+
}
|
|
930
|
+
/** When a downtime happens. */
|
|
931
|
+
type TriggerFact = {
|
|
932
|
+
readonly when: "change";
|
|
933
|
+
readonly key: string;
|
|
934
|
+
} | {
|
|
935
|
+
readonly when: "each use";
|
|
936
|
+
} | {
|
|
937
|
+
readonly when: "before first";
|
|
938
|
+
readonly time: TimeFact | null;
|
|
939
|
+
} | {
|
|
940
|
+
readonly when: "after last";
|
|
941
|
+
readonly time: TimeFact;
|
|
942
|
+
};
|
|
943
|
+
/** A step's `minWait` or `maxWait`. `after` and `excluding` are steps' abouts; a min wait with no `after` counts from the step before. */
|
|
944
|
+
interface WaitFact {
|
|
945
|
+
readonly kind: "min" | "max";
|
|
946
|
+
readonly time: TimeFact;
|
|
947
|
+
readonly after: string | null;
|
|
948
|
+
readonly excluding: readonly string[];
|
|
949
|
+
readonly prefer: boolean;
|
|
950
|
+
}
|
|
951
|
+
type Scalar = string | number | boolean;
|
|
952
|
+
/** An equipment's `takes(key, "%", { where })`: the rows' field holding the share of the quoted time it takes, and the `where` match (`{ field: value | values[] }`) it's limited to. */
|
|
953
|
+
type TakesFact = {
|
|
954
|
+
readonly key: string;
|
|
955
|
+
readonly unit: "%";
|
|
956
|
+
readonly where: {
|
|
957
|
+
readonly [field: string]: Scalar | readonly Scalar[];
|
|
958
|
+
} | null;
|
|
959
|
+
};
|
|
960
|
+
/** A match on rows, as a fact: `{ field: value | values[] }`. */
|
|
961
|
+
type Where = NonNullable<TakesFact["where"]>;
|
|
962
|
+
/** A plan's `capacity(c => ...)`, with spec 1.3.10's defaults written in. */
|
|
963
|
+
interface CapacityFact {
|
|
964
|
+
/**
|
|
965
|
+
* A check of a function measure writes `measure: "measure"` whatever the function measures, even
|
|
966
|
+
* `m.waste`, `m.stockAge` or a spread over days: measures aren't in the document, and those words
|
|
967
|
+
* reach it only through a priority tier's name.
|
|
968
|
+
*/
|
|
969
|
+
readonly checks: readonly {
|
|
970
|
+
/** "plans.<id>.checkedAgainst.<measure>", or "...checkedAgainst.measure.<n>" for the n-th function of m. */
|
|
971
|
+
readonly about: string;
|
|
972
|
+
/** The schedule's about. */
|
|
973
|
+
readonly schedule: string;
|
|
974
|
+
/** The named measure, or "measure" for a function of m. */
|
|
975
|
+
readonly measure: string;
|
|
976
|
+
readonly tolerance: TimeFact | null;
|
|
977
|
+
}[];
|
|
978
|
+
readonly whenTooFull: string | null;
|
|
979
|
+
/** 4 unless written. */
|
|
980
|
+
readonly rounds: number;
|
|
981
|
+
/** 15 min unless written. */
|
|
982
|
+
readonly timeLimit: TimeFact;
|
|
983
|
+
readonly estimate: EstimateFact | null;
|
|
984
|
+
/** "plans.<id>.capacity". */
|
|
985
|
+
readonly about: string;
|
|
986
|
+
}
|
|
987
|
+
/** What each noun's calls said, in plain fields. A fact a later slice fills is `null` or empty. */
|
|
988
|
+
type NounFacts = {
|
|
989
|
+
readonly kind: "hours";
|
|
990
|
+
readonly open: readonly string[];
|
|
991
|
+
/** `.open(days, range)`, in order. */
|
|
992
|
+
readonly openOn: readonly {
|
|
993
|
+
readonly days: readonly Weekday[];
|
|
994
|
+
readonly range: string;
|
|
995
|
+
}[];
|
|
996
|
+
readonly startUp: TimeFact | null;
|
|
997
|
+
/** `.dayStarts(time)`: the clock time the day starts, "06:00". */
|
|
998
|
+
readonly dayStarts: string | null;
|
|
999
|
+
/** `.open(days)`: open all day on these days. */
|
|
1000
|
+
readonly allDay: readonly {
|
|
1001
|
+
readonly days: readonly Weekday[];
|
|
1002
|
+
}[];
|
|
1003
|
+
/** `.startUp(time, { people, before })`: the crew, and the equipment started up first. */
|
|
1004
|
+
readonly startUpWith: {
|
|
1005
|
+
readonly people: readonly CrewFact[];
|
|
1006
|
+
readonly before: readonly string[];
|
|
1007
|
+
} | null;
|
|
1008
|
+
readonly ends: "at close" | "after clean-down" | null;
|
|
1009
|
+
} | {
|
|
1010
|
+
readonly kind: "equipment";
|
|
1011
|
+
readonly area: string | null;
|
|
1012
|
+
readonly glyph: Kind | null;
|
|
1013
|
+
readonly speed: {
|
|
1014
|
+
readonly key: string;
|
|
1015
|
+
readonly unit: string;
|
|
1016
|
+
readonly per: "person" | null;
|
|
1017
|
+
} | null;
|
|
1018
|
+
/** A list, because each `takes` call adds one. */
|
|
1019
|
+
readonly takes: readonly TakesFact[];
|
|
1020
|
+
/** `.holds(key, unit)`: how much it holds, from the rows' field. */
|
|
1021
|
+
readonly holds: {
|
|
1022
|
+
readonly key: string;
|
|
1023
|
+
readonly unit: string;
|
|
1024
|
+
} | null;
|
|
1025
|
+
/** `{ count: n }`: so many, with no rows. */
|
|
1026
|
+
readonly count: number | null;
|
|
1027
|
+
} | {
|
|
1028
|
+
readonly kind: "person";
|
|
1029
|
+
} | {
|
|
1030
|
+
readonly kind: "downtime";
|
|
1031
|
+
readonly on: string;
|
|
1032
|
+
readonly triggers: readonly TriggerFact[];
|
|
1033
|
+
/** A hook's about: the function of the pair that gives the time. */
|
|
1034
|
+
readonly table: string | null;
|
|
1035
|
+
readonly people: readonly CrewFact[];
|
|
1036
|
+
} | {
|
|
1037
|
+
readonly kind: "process";
|
|
1038
|
+
readonly ready: DemandFact | null;
|
|
1039
|
+
readonly due: DemandFact | null;
|
|
1040
|
+
readonly deadline: DemandFact | null;
|
|
1041
|
+
readonly leaves: null;
|
|
1042
|
+
readonly release: null;
|
|
1043
|
+
/** The rows it's limited to. */
|
|
1044
|
+
readonly where: Where | null;
|
|
1045
|
+
/** The materials it makes, as the material nouns' abouts. */
|
|
1046
|
+
readonly makes: readonly string[];
|
|
1047
|
+
readonly yields: readonly MaterialUseFact[];
|
|
1048
|
+
readonly consumes: readonly MaterialUseFact[];
|
|
1049
|
+
readonly scheduleOnly: boolean;
|
|
1050
|
+
readonly batched: boolean;
|
|
1051
|
+
} | {
|
|
1052
|
+
readonly kind: "step";
|
|
1053
|
+
readonly uses: readonly {
|
|
1054
|
+
readonly on: string;
|
|
1055
|
+
readonly until: string | null;
|
|
1056
|
+
readonly perRun: boolean;
|
|
1057
|
+
readonly only: {
|
|
1058
|
+
readonly because: string;
|
|
1059
|
+
readonly per: "piece" | "job";
|
|
1060
|
+
} | null;
|
|
1061
|
+
}[];
|
|
1062
|
+
readonly crew: readonly CrewFact[];
|
|
1063
|
+
readonly after: readonly never[];
|
|
1064
|
+
readonly waits: readonly WaitFact[];
|
|
1065
|
+
readonly order: number;
|
|
1066
|
+
readonly tone: number;
|
|
1067
|
+
/** Where it takes a batch from, and when: the equipment's about, and the word. */
|
|
1068
|
+
readonly collects: readonly {
|
|
1069
|
+
readonly on: string;
|
|
1070
|
+
readonly when: string;
|
|
1071
|
+
}[];
|
|
1072
|
+
readonly inPortions: boolean;
|
|
1073
|
+
readonly perRun: boolean;
|
|
1074
|
+
/** Starts while another step runs: that step's about (`null` for the step before), and how often. */
|
|
1075
|
+
readonly startsDuring: {
|
|
1076
|
+
readonly after: string | null;
|
|
1077
|
+
readonly once: OnceFact;
|
|
1078
|
+
} | null;
|
|
1079
|
+
} | {
|
|
1080
|
+
readonly kind: "rule";
|
|
1081
|
+
/** What the rule reads, as abouts: the equipment it orders, then each step that uses that equipment, in declared order. A clause's keys are the rows' fields, not nouns, so they aren't here. A maximum or minimum reads none. */
|
|
1082
|
+
readonly reads: readonly string[];
|
|
1083
|
+
readonly form: (typeof RULE_FORMS)[number] | "share";
|
|
1084
|
+
readonly share?: {
|
|
1085
|
+
readonly on: string;
|
|
1086
|
+
readonly of: string;
|
|
1087
|
+
readonly share: number;
|
|
1088
|
+
};
|
|
1089
|
+
/** A maximum's or minimum's limit: a number, or the rows' field holding it. `null` otherwise. */
|
|
1090
|
+
readonly limit: LimitFact | null;
|
|
1091
|
+
readonly per: QuantityPeriod | null;
|
|
1092
|
+
/**
|
|
1093
|
+
* The about of the plan or schedule it belongs to (spec 1.3.10): the level it was handed to, or,
|
|
1094
|
+
* for one given to `op.model`, the schedule for an order and the plan for a quantity rule, or
|
|
1095
|
+
* the only level there is. `null` only in a model with neither.
|
|
1096
|
+
*/
|
|
1097
|
+
readonly level: string | null;
|
|
1098
|
+
/** An `onDays` rule's field: the rows' field that names the days. */
|
|
1099
|
+
readonly days: string | null;
|
|
1100
|
+
readonly campaign: {
|
|
1101
|
+
readonly when: string;
|
|
1102
|
+
readonly amount: string;
|
|
1103
|
+
readonly per: "week" | "fortnight";
|
|
1104
|
+
} | null;
|
|
1105
|
+
readonly requires: {
|
|
1106
|
+
readonly these: Where;
|
|
1107
|
+
readonly those: Where;
|
|
1108
|
+
} | null;
|
|
1109
|
+
/** A custom rule's hook: the hook noun's about. */
|
|
1110
|
+
readonly custom: string | null;
|
|
1111
|
+
} | {
|
|
1112
|
+
readonly kind: "priority";
|
|
1113
|
+
readonly tier: "first" | "then" | "hold" | "watch";
|
|
1114
|
+
readonly tolerance: TimeFact | null;
|
|
1115
|
+
/** The about of the plan or schedule it was handed to; `null` for one given to `op.model`. */
|
|
1116
|
+
readonly level: string | null;
|
|
1117
|
+
} | {
|
|
1118
|
+
readonly kind: "plan";
|
|
1119
|
+
readonly covers: {
|
|
1120
|
+
readonly span: TimeFact;
|
|
1121
|
+
readonly by: "day";
|
|
1122
|
+
} | null;
|
|
1123
|
+
readonly chooses: "quantities" | null;
|
|
1124
|
+
readonly start: {
|
|
1125
|
+
readonly amount: string;
|
|
1126
|
+
readonly on: string;
|
|
1127
|
+
} | null;
|
|
1128
|
+
readonly capacity: CapacityFact | null;
|
|
1129
|
+
/** `.cycle({ warmUpCycles })`. */
|
|
1130
|
+
readonly cycle: {
|
|
1131
|
+
readonly warmUpCycles: number;
|
|
1132
|
+
} | null;
|
|
1133
|
+
/** `.limit(says, on, fn)`: the equipment's about, and the hook that gives the limit. */
|
|
1134
|
+
readonly limits: readonly {
|
|
1135
|
+
readonly on: string;
|
|
1136
|
+
readonly hook: string;
|
|
1137
|
+
}[];
|
|
1138
|
+
/** `.moves(op.moves()...)`: the size of the search's steps, and what it proposes. */
|
|
1139
|
+
readonly moves: {
|
|
1140
|
+
readonly size: {
|
|
1141
|
+
readonly start: AmountFact;
|
|
1142
|
+
readonly min: AmountFact;
|
|
1143
|
+
readonly max: AmountFact;
|
|
1144
|
+
readonly grow: number;
|
|
1145
|
+
} | null;
|
|
1146
|
+
readonly proposes: readonly {
|
|
1147
|
+
readonly hook: string;
|
|
1148
|
+
readonly perRound: number | null;
|
|
1149
|
+
readonly rankBy: "estimate" | null;
|
|
1150
|
+
readonly minGain: {
|
|
1151
|
+
readonly minutes: number;
|
|
1152
|
+
readonly text: string;
|
|
1153
|
+
} | null;
|
|
1154
|
+
}[];
|
|
1155
|
+
} | null;
|
|
1156
|
+
} | {
|
|
1157
|
+
readonly kind: "schedule";
|
|
1158
|
+
/** The about of the plan whose periods it runs. */
|
|
1159
|
+
readonly plan: string | null;
|
|
1160
|
+
/** A hook's about: how the runs are split into batches. */
|
|
1161
|
+
readonly batches: string | null;
|
|
1162
|
+
readonly modes: {
|
|
1163
|
+
readonly says: string;
|
|
1164
|
+
readonly modes: readonly string[];
|
|
1165
|
+
readonly solve: "all" | "first that works";
|
|
1166
|
+
/** A hook's about, when the model chooses the mode. */
|
|
1167
|
+
readonly hook: string | null;
|
|
1168
|
+
} | null;
|
|
1169
|
+
/** Each named figure, and the hook that works it out. */
|
|
1170
|
+
readonly figures: readonly {
|
|
1171
|
+
readonly name: string;
|
|
1172
|
+
readonly hook: string;
|
|
1173
|
+
}[];
|
|
1174
|
+
} | {
|
|
1175
|
+
readonly kind: "role";
|
|
1176
|
+
/** The rows' list the people come from. */
|
|
1177
|
+
readonly roster: string | null;
|
|
1178
|
+
} | {
|
|
1179
|
+
readonly kind: "shift";
|
|
1180
|
+
readonly range: string;
|
|
1181
|
+
} | {
|
|
1182
|
+
readonly kind: "material";
|
|
1183
|
+
readonly list: string;
|
|
1184
|
+
readonly unit: string | null;
|
|
1185
|
+
readonly shipsAfter: TimeFact | null;
|
|
1186
|
+
readonly shelfLife: {
|
|
1187
|
+
readonly key: string;
|
|
1188
|
+
readonly unit: "days" | "hours";
|
|
1189
|
+
} | null;
|
|
1190
|
+
readonly shipsWithin: {
|
|
1191
|
+
readonly key: string;
|
|
1192
|
+
readonly unit: "days" | "hours";
|
|
1193
|
+
} | null;
|
|
1194
|
+
readonly reserve: string | null;
|
|
1195
|
+
readonly ships: MaterialShips | null;
|
|
1196
|
+
readonly opening?: OpeningMap;
|
|
1197
|
+
} | {
|
|
1198
|
+
/** A function the model holds: the document names it, and never holds it. */
|
|
1199
|
+
readonly kind: "hook";
|
|
1200
|
+
readonly form: HookForm;
|
|
1201
|
+
/** The about of the noun it belongs to. */
|
|
1202
|
+
readonly owner: string;
|
|
1203
|
+
};
|
|
1204
|
+
/** One noun: its kind, its `about` ("equipment.machine", "<process about>.steps.<id>"), its name and its words. */
|
|
1205
|
+
type Noun = {
|
|
1206
|
+
readonly at: {
|
|
1207
|
+
readonly line: number;
|
|
1208
|
+
} | null;
|
|
1209
|
+
readonly about: string;
|
|
1210
|
+
readonly name: string;
|
|
1211
|
+
readonly words: NounWords;
|
|
1212
|
+
} & NounFacts;
|
|
1213
|
+
/**
|
|
1214
|
+
* For one level's build: each data-independent IR id the compiler wrote, and what it came from. The
|
|
1215
|
+
* builder's per-row rules (`one-at-a-time:<row id>`) are left out: their ids are the data's, and the
|
|
1216
|
+
* document holding this is one per operation (spec 4.1). A value is the `about` of the noun it came
|
|
1217
|
+
* from. Two read differently: a process's demand lowers to `<process about>.<ready|due|deadline>`
|
|
1218
|
+
* ("<process about>.due"), and a step's wait rule lowers to the step's own `about`.
|
|
1219
|
+
*/
|
|
1220
|
+
interface Lowering {
|
|
1221
|
+
readonly decisions: Readonly<Record<string, string>>;
|
|
1222
|
+
readonly rules: Readonly<Record<string, string>>;
|
|
1223
|
+
readonly goals: Readonly<Record<string, string>>;
|
|
1224
|
+
readonly kpis: Readonly<Record<string, string>>;
|
|
1225
|
+
readonly usages: Readonly<Record<string, string>>;
|
|
1226
|
+
readonly estimates: Readonly<Record<string, string>>;
|
|
1227
|
+
readonly itemSets: Readonly<Record<string, string>>;
|
|
1228
|
+
/**
|
|
1229
|
+
* Each ranked level, by its number as a string ("1"), to the `about` of the priority noun ranked
|
|
1230
|
+
* there (07 K3d), so a level is labelled by its priority's own sentence. A due's level that no
|
|
1231
|
+
* priority names has no entry. Required in /1; a /0 document may have none.
|
|
1232
|
+
*/
|
|
1233
|
+
readonly levels: Readonly<Record<string, string>>;
|
|
1234
|
+
}
|
|
1235
|
+
interface OperationDoc {
|
|
1236
|
+
readonly schema: typeof OPERATION_SCHEMA | typeof OPERATION_SCHEMA_DELIVERIES;
|
|
1237
|
+
/** Of this document, less `hash` and `confirmed`. */
|
|
1238
|
+
readonly hash: string;
|
|
1239
|
+
readonly solver: string;
|
|
1240
|
+
readonly words: ModelWords;
|
|
1241
|
+
/** Every piece, in declared order. */
|
|
1242
|
+
readonly nouns: readonly Noun[];
|
|
1243
|
+
/** Each level's lowering, `null` for a level the build doesn't lower. */
|
|
1244
|
+
readonly lowers: {
|
|
1245
|
+
readonly plan: Lowering | null;
|
|
1246
|
+
readonly schedule: Lowering | null;
|
|
1247
|
+
};
|
|
1248
|
+
/** The deploy's check of `<solver>.readback.txt` (spec 4.3). */
|
|
1249
|
+
readonly confirmed: {
|
|
1250
|
+
readonly matches: boolean;
|
|
1251
|
+
readonly changed: readonly string[];
|
|
1252
|
+
} | null;
|
|
1253
|
+
}
|
|
1254
|
+
/** A document's shape problem, as `validateIrShape` reports an IR's. */
|
|
1255
|
+
interface DocumentIssue {
|
|
1256
|
+
readonly code: "operation-invalid" | "timeline-invalid" | "readback-invalid";
|
|
1257
|
+
readonly path: string;
|
|
1258
|
+
readonly message: string;
|
|
1259
|
+
}
|
|
1260
|
+
/** A11's `Kind`s, as the schema lists a piece of equipment's glyph. */
|
|
1261
|
+
declare const KINDS: readonly ["machine", "line", "tank", "door", "station", "space", "vehicle"];
|
|
1262
|
+
declare const operationJsonSchema: {
|
|
1263
|
+
readonly type: string;
|
|
1264
|
+
readonly additionalProperties: boolean;
|
|
1265
|
+
readonly required: string[];
|
|
1266
|
+
readonly properties: Record<string, object>;
|
|
1267
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
1268
|
+
readonly $id: "https://keel.so/schemas/solver/operation-2.schema.json";
|
|
1269
|
+
readonly title: "Keel solver operation document 2";
|
|
1270
|
+
};
|
|
1271
|
+
/** Shape problems (JSON Schema), at most one: the first the validator meets, in the document's own version. */
|
|
1272
|
+
declare const validateOperationShape: (doc: unknown) => DocumentIssue[];
|
|
1273
|
+
|
|
1274
|
+
/** One item's span in engine output: resource (null when the decision has none) and clock units. */
|
|
1275
|
+
interface SpanValue {
|
|
1276
|
+
on: Id | null;
|
|
1277
|
+
start: number;
|
|
1278
|
+
end: number;
|
|
1279
|
+
}
|
|
1280
|
+
/** 0.2, §4.3: a set-up, changeover or cleandown span the engine placed on a resource. */
|
|
1281
|
+
interface ServiceSpan {
|
|
1282
|
+
kind: "setup" | "changeover" | "cleandown";
|
|
1283
|
+
/** The item before and after; null at the start or end of the resource's day. */
|
|
1284
|
+
before: Id | null;
|
|
1285
|
+
after: Id | null;
|
|
1286
|
+
start: number;
|
|
1287
|
+
end: number;
|
|
1288
|
+
}
|
|
1289
|
+
/** Engine output (spec §3.3). */
|
|
1290
|
+
interface Values02 {
|
|
1291
|
+
decisions: Record<Id, Record<Id, SpanValue>>;
|
|
1292
|
+
/** mode → chosen option. Present exactly when the build has modes. */
|
|
1293
|
+
modes?: Record<Id, Id>;
|
|
1294
|
+
/** decision → resource → spans. Present exactly when a decision has service spans. */
|
|
1295
|
+
service?: Record<Id, Record<Id, ServiceSpan[]>>;
|
|
1296
|
+
}
|
|
1297
|
+
interface EvalEnv {
|
|
1298
|
+
/** The build the values are read against. */
|
|
1299
|
+
ir: Ir;
|
|
1300
|
+
/** The span values, per decision and item. */
|
|
1301
|
+
values: Values02["decisions"];
|
|
1302
|
+
/** decision → resource → item ids in start order (ties by id); absent items left out. */
|
|
1303
|
+
sequence: Record<Id, Record<Id, Id[]>>;
|
|
1304
|
+
/** 0.2: mode → chosen option. Empty when the build has no modes. */
|
|
1305
|
+
modes: Record<Id, Id>;
|
|
1306
|
+
/** 0.2: decision → resource → service spans. Empty when no decision has them. */
|
|
1307
|
+
service: Record<Id, Record<Id, ServiceSpan[]>>;
|
|
1308
|
+
/** 0.2: decision → items absent under the chosen modes, sorted. Only decisions with some. */
|
|
1309
|
+
absent: Record<Id, Id[]>;
|
|
1310
|
+
}
|
|
1311
|
+
/** The per-decision spans from engine output. */
|
|
1312
|
+
declare function decisionValues(values: Values02): Record<Id, Record<Id, SpanValue>>;
|
|
1313
|
+
/**
|
|
1314
|
+
* Build the environment once per plan; `sequence` is what `arc`, `first` and `last` literals
|
|
1315
|
+
* read. Holds `values` to the IR, so a padded or partial plan cannot read as one that keeps its
|
|
1316
|
+
* rules. For every decision: it has values; its items are exactly the decision's item set; each
|
|
1317
|
+
* value is a span; `on` is null when the decision
|
|
1318
|
+
* has no resource and one of its resources when it has. Values for a key that is not a decision
|
|
1319
|
+
* are refused too. In 0.2, `modes` and `service` are present exactly when the build needs them,
|
|
1320
|
+
* and an item absent under the chosen modes has the empty span.
|
|
1321
|
+
*/
|
|
1322
|
+
declare function evalEnv(ir: Ir, values: Values02): EvalEnv;
|
|
1323
|
+
declare function evalN(n: N, env: EvalEnv): number;
|
|
1324
|
+
declare function evalC(c: C, env: EvalEnv): boolean;
|
|
1325
|
+
/** Pairs of live items in a noOverlap group that overlap, in start order. Empty when it holds. */
|
|
1326
|
+
declare function overlaps(g: Global, env: EvalEnv): {
|
|
1327
|
+
key: Id;
|
|
1328
|
+
a: Id;
|
|
1329
|
+
b: Id;
|
|
1330
|
+
}[];
|
|
1331
|
+
/** 0.2, §4.7: whether a rule row applies under the chosen modes; a row with no `when` always does. */
|
|
1332
|
+
declare function rowApplies(row: Pick<RuleRow, "when">, env: EvalEnv): boolean;
|
|
1333
|
+
/**
|
|
1334
|
+
* What a broken soft row counts (00 §10.16): a `cmp` costs its distance outside `[lo, hi]`; an
|
|
1335
|
+
* `imp(a, b)` costs the amount of `b` when `a` holds and 0 otherwise; any other row costs 1 when
|
|
1336
|
+
* broken. A row that holds costs 0, and so does a row that does not apply (`rowApplies`). The
|
|
1337
|
+
* engine and the scorer both use this one definition.
|
|
1338
|
+
*/
|
|
1339
|
+
declare function rowAmount(row: Pick<RuleRow, "c" | "when">, env: EvalEnv): number;
|
|
1340
|
+
|
|
1341
|
+
type RunStatus = "optimal" | "feasible" | "infeasible" | "unknown" | "invalid" | "error";
|
|
1342
|
+
type RunReason = "proved" | "time-limit" | "stopped" | "cancelled" | "invalid-build" | "engine-error"
|
|
1343
|
+
/**
|
|
1344
|
+
* §8: in a deterministic solve, the clock, not the work budget, ended a level or a candidate
|
|
1345
|
+
* re-solve (§6.3a). The plan or its candidates may not reproduce, and a view says so. The
|
|
1346
|
+
* status still describes the plan: `optimal` with `wall-limit` is a proved plan whose
|
|
1347
|
+
* candidates may not reproduce.
|
|
1348
|
+
*/
|
|
1349
|
+
| "wall-limit";
|
|
1350
|
+
/** §5.6: a goal's value in the plan its own level returned, and whether that level was proved. */
|
|
1351
|
+
interface GoalAnchor {
|
|
1352
|
+
value: number;
|
|
1353
|
+
proven: boolean;
|
|
1354
|
+
}
|
|
1355
|
+
/**
|
|
1356
|
+
* §6.3a: one of the K plans a solve returns, in candidate order. Candidate 0 is the solver's own
|
|
1357
|
+
* best, and its `values` are the result's `values`.
|
|
1358
|
+
*/
|
|
1359
|
+
interface EngineCandidate {
|
|
1360
|
+
candidate: number;
|
|
1361
|
+
/** 16 hex digits: a hash of what `distinctBy` compares. */
|
|
1362
|
+
signature: string;
|
|
1363
|
+
values: Values02;
|
|
1364
|
+
objective: {
|
|
1365
|
+
byLevel: number[];
|
|
1366
|
+
};
|
|
1367
|
+
}
|
|
1368
|
+
interface EngineResult {
|
|
1369
|
+
status: RunStatus;
|
|
1370
|
+
reason: RunReason;
|
|
1371
|
+
/**
|
|
1372
|
+
* Absent when there is no plan (`infeasible`, `unknown`, `invalid`, `error`). Read its per-decision spans
|
|
1373
|
+
* with `decisionValues(values)`.
|
|
1374
|
+
*/
|
|
1375
|
+
values?: Values02;
|
|
1376
|
+
/** Points per priority level, most important first, as the engine counted them. */
|
|
1377
|
+
objective?: {
|
|
1378
|
+
mode: "weighted" | "lexicographic";
|
|
1379
|
+
byLevel: number[];
|
|
1380
|
+
bound?: number | null;
|
|
1381
|
+
gap?: number | null;
|
|
1382
|
+
/**
|
|
1383
|
+
* §5.6: goal id → its anchor, for every goal at a level with a tolerance. Absent when no
|
|
1384
|
+
* level has one.
|
|
1385
|
+
*/
|
|
1386
|
+
anchors?: Record<string, GoalAnchor>;
|
|
1387
|
+
};
|
|
1388
|
+
/** §6.3a: present when the run asked for more than one candidate and has a plan. */
|
|
1389
|
+
candidates?: EngineCandidate[];
|
|
1390
|
+
engine?: string;
|
|
1391
|
+
engineWhy?: string;
|
|
1392
|
+
conflicts?: unknown[];
|
|
1393
|
+
timings?: Record<string, number>;
|
|
1394
|
+
/**
|
|
1395
|
+
* R13: deterministic seconds of work the solve used, over its levels and its candidate
|
|
1396
|
+
* re-solves, as the worker reported each (a level that overshot its share counts in full).
|
|
1397
|
+
* 0 when nothing was solved. Absent on a result from an engine before slice 2.
|
|
1398
|
+
*/
|
|
1399
|
+
det?: number;
|
|
1400
|
+
versions?: Record<string, string>;
|
|
1401
|
+
host?: EngineHost;
|
|
1402
|
+
/** On `invalid` only. */
|
|
1403
|
+
issues?: IrIssue[];
|
|
1404
|
+
/** On `error` only: what went wrong in the engine (not the build). */
|
|
1405
|
+
error?: {
|
|
1406
|
+
message: string;
|
|
1407
|
+
};
|
|
1408
|
+
}
|
|
1409
|
+
/** Where the engine ran (B §13): enough to tell whether two runs can give the same plan. */
|
|
1410
|
+
interface EngineHost {
|
|
1411
|
+
arch: "arm64" | "amd64";
|
|
1412
|
+
cpus: number;
|
|
1413
|
+
memoryMb: number;
|
|
1414
|
+
/** CP-SAT workers the search used. */
|
|
1415
|
+
workers: number;
|
|
1416
|
+
/** The random seed in deterministic mode; null in wall-clock mode. */
|
|
1417
|
+
seed: number | null;
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
/** Spec 4.5's causes: each a declared bound that binds a step's start. */
|
|
1421
|
+
declare const CAUSE_KINDS$1: readonly ["step-before", "wait", "equipment-busy", "only", "unavailable", "downtime", "ready", "release", "after", "hours", "shift", "crew", "starts-during", "step-after", "priority", "nothing-binds"];
|
|
1422
|
+
declare const LEVER_KINDS$1: readonly ["figure", "row", "rule", "hours", "roster", "equipment", "priorities"];
|
|
1423
|
+
/** How a period's day was measured (spec section 3's `PeriodEntry.measurement`). */
|
|
1424
|
+
declare const MEASUREMENTS$1: readonly ["measured", "one-sided", "checks failed", "refused", "no schedule", "skipped"];
|
|
1425
|
+
/** Whether a period's day was run new, run again for a change, or reused from an earlier round. */
|
|
1426
|
+
declare const DAY_WHYS$1: readonly ["new", "changed", "reused"];
|
|
1427
|
+
declare const BAND_KINDS$1: readonly ["closed", "start-up", "shift", "break", "unavailable"];
|
|
1428
|
+
declare const BAR_KINDS$1: readonly ["work", "hold", "downtime"];
|
|
1429
|
+
declare const MARK_KINDS$1: readonly ["release", "leaves", "ready", "due", "deadline", "not-before"];
|
|
1430
|
+
/** What a late item is late against. */
|
|
1431
|
+
declare const LATE_AGAINST$1: readonly ["due", "deadline", "leaves"];
|
|
1432
|
+
/** What a round decided about a plan it tried. */
|
|
1433
|
+
declare const PLAN_VERDICTS: readonly ["best", "beaten", "failed", "dropped"];
|
|
1434
|
+
/** Where a crew's points come from: the roster's shifts, or the steps' own crews. */
|
|
1435
|
+
declare const CREW_SOURCES: readonly ["roster", "steps"];
|
|
1436
|
+
type CauseKind$1 = (typeof CAUSE_KINDS$1)[number];
|
|
1437
|
+
type Measurement$1 = (typeof MEASUREMENTS$1)[number];
|
|
1438
|
+
|
|
1439
|
+
/** A priority tier, as `about` and its `says`. */
|
|
1440
|
+
type Reason = {
|
|
1441
|
+
readonly about: string;
|
|
1442
|
+
readonly says: string;
|
|
1443
|
+
};
|
|
1444
|
+
|
|
1445
|
+
declare const TIMELINE_SCHEMA = "keel.solver.timeline/2";
|
|
1446
|
+
/** What the planner can change, and where it lives. A lever names a figure; it doesn't solve again. */
|
|
1447
|
+
interface Lever {
|
|
1448
|
+
readonly kind: (typeof LEVER_KINDS$1)[number];
|
|
1449
|
+
readonly about: string;
|
|
1450
|
+
readonly says: string;
|
|
1451
|
+
}
|
|
1452
|
+
|
|
1453
|
+
type Cause = {
|
|
1454
|
+
readonly kind: CauseKind$1;
|
|
1455
|
+
/** The noun it rests on. */
|
|
1456
|
+
readonly about: string;
|
|
1457
|
+
readonly says: string;
|
|
1458
|
+
readonly short?: string;
|
|
1459
|
+
readonly couldStartFrom?: string;
|
|
1460
|
+
readonly at: string;
|
|
1461
|
+
/** It rests on a default the operator never confirmed (the read-back's `assumed`). */
|
|
1462
|
+
readonly assumed: boolean;
|
|
1463
|
+
readonly refs: {
|
|
1464
|
+
readonly item?: string;
|
|
1465
|
+
readonly row?: string;
|
|
1466
|
+
readonly step?: string;
|
|
1467
|
+
};
|
|
1468
|
+
/** In spec 4.5's table's order: none where the table offers none, two where it offers two. */
|
|
1469
|
+
readonly levers: readonly Lever[];
|
|
1470
|
+
} & ({
|
|
1471
|
+
readonly kind: "equipment-busy";
|
|
1472
|
+
readonly by?: Reason;
|
|
1473
|
+
} | {
|
|
1474
|
+
readonly kind: Exclude<CauseKind$1, "equipment-busy">;
|
|
1475
|
+
readonly by?: never;
|
|
1476
|
+
});
|
|
1477
|
+
|
|
1478
|
+
/** A figure a row or an item carries, as the Console shows it: `about` is the noun or demand it comes from. */
|
|
1479
|
+
interface TimelineFact {
|
|
1480
|
+
readonly about: string;
|
|
1481
|
+
readonly label: string;
|
|
1482
|
+
readonly text: string;
|
|
1483
|
+
}
|
|
1484
|
+
/** How a period's day fits its check of the plan's capacity. */
|
|
1485
|
+
interface TimelineFit {
|
|
1486
|
+
/** The check's about, `plans.<id>.checkedAgainst.<measure>`: the capacity has no noun of its own. */
|
|
1487
|
+
readonly check: string;
|
|
1488
|
+
readonly estimate: number;
|
|
1489
|
+
readonly learned: {
|
|
1490
|
+
readonly offset: number;
|
|
1491
|
+
readonly from: Lineage;
|
|
1492
|
+
} | null;
|
|
1493
|
+
readonly measured: number | null;
|
|
1494
|
+
/** How the day was measured; `null` while it isn't yet (a plan-level run's own timeline). */
|
|
1495
|
+
readonly measurement: Measurement$1 | null;
|
|
1496
|
+
readonly within: boolean | null;
|
|
1497
|
+
/** The check's, in `unit`; 0 for 'exactly'. */
|
|
1498
|
+
readonly tolerance: number;
|
|
1499
|
+
/** The period's open time, in `unit` ('of 8 h'); `null` when it's closed. */
|
|
1500
|
+
readonly open: number | null;
|
|
1501
|
+
readonly unit: string;
|
|
1502
|
+
/** The period panel's sentence (ruling T3). */
|
|
1503
|
+
readonly says: string;
|
|
1504
|
+
}
|
|
1505
|
+
/** A cut in force on a period: cells that may not all be on together. */
|
|
1506
|
+
interface TimelineCut {
|
|
1507
|
+
/** The reason with its round and day, and the plan's `whenTooFull` (ruling T4). */
|
|
1508
|
+
readonly says: string;
|
|
1509
|
+
/** Why the day failed, in words (04 R5). */
|
|
1510
|
+
readonly reason: string;
|
|
1511
|
+
readonly cells: readonly string[];
|
|
1512
|
+
readonly total: number;
|
|
1513
|
+
readonly round: number;
|
|
1514
|
+
}
|
|
1515
|
+
/** A day mode of a period (spec 3.6), as a row of the modes strip. */
|
|
1516
|
+
interface TimelineMode {
|
|
1517
|
+
readonly mode: string;
|
|
1518
|
+
readonly run: string | null;
|
|
1519
|
+
readonly status: RunStatus | null;
|
|
1520
|
+
readonly ok: boolean;
|
|
1521
|
+
readonly reason: string | null;
|
|
1522
|
+
readonly finishTime: number | null;
|
|
1523
|
+
readonly reused: boolean;
|
|
1524
|
+
readonly kept: boolean;
|
|
1525
|
+
}
|
|
1526
|
+
/** A row's amount moved from one period to another by a plan a round tried. */
|
|
1527
|
+
interface TimelineMove {
|
|
1528
|
+
readonly row: string;
|
|
1529
|
+
readonly from: string;
|
|
1530
|
+
readonly to: string;
|
|
1531
|
+
readonly amount: number;
|
|
1532
|
+
}
|
|
1533
|
+
/** What a round tried (spec 3.9), as a chip under the round. */
|
|
1534
|
+
interface TimelinePlanTried {
|
|
1535
|
+
readonly plan: string;
|
|
1536
|
+
readonly kind: PlanKind;
|
|
1537
|
+
readonly verdict: (typeof PLAN_VERDICTS)[number];
|
|
1538
|
+
readonly says: string;
|
|
1539
|
+
readonly moves: readonly TimelineMove[];
|
|
1540
|
+
readonly held: boolean;
|
|
1541
|
+
readonly measured: readonly {
|
|
1542
|
+
readonly about: string;
|
|
1543
|
+
readonly text: string;
|
|
1544
|
+
}[] | null;
|
|
1545
|
+
readonly dropped: string | null;
|
|
1546
|
+
readonly beatenAt: {
|
|
1547
|
+
readonly priority: number;
|
|
1548
|
+
readonly goal: string;
|
|
1549
|
+
readonly by: number;
|
|
1550
|
+
} | null;
|
|
1551
|
+
}
|
|
1552
|
+
/** A material's stock across the periods. */
|
|
1553
|
+
interface TimelineStockRow {
|
|
1554
|
+
/** The material noun's about. */
|
|
1555
|
+
readonly material: string;
|
|
1556
|
+
readonly label: string;
|
|
1557
|
+
readonly unit: string;
|
|
1558
|
+
readonly says: string;
|
|
1559
|
+
readonly cells: readonly {
|
|
1560
|
+
readonly period: string;
|
|
1561
|
+
readonly open: number;
|
|
1562
|
+
readonly in: number;
|
|
1563
|
+
readonly out: number;
|
|
1564
|
+
readonly takes: number | null;
|
|
1565
|
+
readonly close: number;
|
|
1566
|
+
readonly waste: number;
|
|
1567
|
+
}[];
|
|
1568
|
+
}
|
|
1569
|
+
/** The spec's `Period`. */
|
|
1570
|
+
interface TimelinePeriod {
|
|
1571
|
+
readonly id: string;
|
|
1572
|
+
readonly label: string;
|
|
1573
|
+
readonly from: string;
|
|
1574
|
+
readonly to: string;
|
|
1575
|
+
readonly open: boolean;
|
|
1576
|
+
readonly plan: {
|
|
1577
|
+
readonly cells?: readonly {
|
|
1578
|
+
readonly id: string;
|
|
1579
|
+
readonly process: string;
|
|
1580
|
+
readonly row: string;
|
|
1581
|
+
readonly label: string;
|
|
1582
|
+
readonly amount: number;
|
|
1583
|
+
readonly unit: string;
|
|
1584
|
+
readonly changed: number | null;
|
|
1585
|
+
}[];
|
|
1586
|
+
readonly roster?: readonly {
|
|
1587
|
+
readonly role: string;
|
|
1588
|
+
readonly shift: string;
|
|
1589
|
+
readonly people: number;
|
|
1590
|
+
readonly agency: number;
|
|
1591
|
+
readonly overtimeMinutes: number;
|
|
1592
|
+
}[];
|
|
1593
|
+
} | null;
|
|
1594
|
+
/** One per check of the plan's capacity (ruling T2); empty for a schedule-only run and a closed period. */
|
|
1595
|
+
readonly fits: readonly TimelineFit[];
|
|
1596
|
+
readonly day: {
|
|
1597
|
+
readonly run: string;
|
|
1598
|
+
readonly mode: string | null;
|
|
1599
|
+
readonly status: RunStatus | null;
|
|
1600
|
+
readonly why: (typeof DAY_WHYS$1)[number];
|
|
1601
|
+
readonly reusedFrom: PlanRef | null;
|
|
1602
|
+
readonly says: string;
|
|
1603
|
+
/** The day's modes (spec 3.6); empty until 07 fills them. */
|
|
1604
|
+
readonly modes: readonly TimelineMode[];
|
|
1605
|
+
/** The figures the day's hooks wrote; empty until 07 fills them. */
|
|
1606
|
+
readonly figures: readonly {
|
|
1607
|
+
readonly name: string;
|
|
1608
|
+
readonly value: number;
|
|
1609
|
+
}[];
|
|
1610
|
+
} | null;
|
|
1611
|
+
/** The plan's rules with no slack in this period. */
|
|
1612
|
+
readonly tight: readonly {
|
|
1613
|
+
readonly about: string;
|
|
1614
|
+
readonly says: string;
|
|
1615
|
+
}[];
|
|
1616
|
+
readonly cuts: readonly TimelineCut[];
|
|
1617
|
+
}
|
|
1618
|
+
/** The plan level of a run: the plan's about, its run, and the periods the page marks. */
|
|
1619
|
+
interface TimelinePlan {
|
|
1620
|
+
readonly about: string;
|
|
1621
|
+
readonly run: string;
|
|
1622
|
+
readonly status: RunStatus | null;
|
|
1623
|
+
/** The open period with the latest finish, measured where it was, else estimated (ruling T5). */
|
|
1624
|
+
readonly latest: string | null;
|
|
1625
|
+
/** The open periods with work. */
|
|
1626
|
+
readonly spread: readonly string[];
|
|
1627
|
+
/** The plan's capacity about (`plans.<id>.capacity`); `null` where the plan has none. */
|
|
1628
|
+
readonly capacity: string | null;
|
|
1629
|
+
}
|
|
1630
|
+
/** One round of the run, as its chip on the rounds strip. */
|
|
1631
|
+
interface TimelineRound {
|
|
1632
|
+
readonly round: number;
|
|
1633
|
+
readonly plan: string | null;
|
|
1634
|
+
readonly best: PlanRef | null;
|
|
1635
|
+
readonly measures: readonly {
|
|
1636
|
+
readonly about: string;
|
|
1637
|
+
readonly text: string;
|
|
1638
|
+
}[];
|
|
1639
|
+
readonly cuts: number;
|
|
1640
|
+
readonly converged: boolean;
|
|
1641
|
+
readonly problems: readonly string[];
|
|
1642
|
+
readonly kept: boolean;
|
|
1643
|
+
readonly says: string;
|
|
1644
|
+
/** Why the round's best-so-far plan was best (ruling T17); `null` when the round has none. */
|
|
1645
|
+
readonly why: string | null;
|
|
1646
|
+
/** What the round tried (spec 3.9); empty until 07 fills it. */
|
|
1647
|
+
readonly plans: readonly TimelinePlanTried[];
|
|
1648
|
+
/** The round's band size, Σ|Δ| of the cells' amounts, before and after it; `null` until 07 fills it. */
|
|
1649
|
+
readonly band: {
|
|
1650
|
+
readonly before: number;
|
|
1651
|
+
readonly after: number;
|
|
1652
|
+
} | null;
|
|
1653
|
+
/** The cuts the round set aside; empty until 07 fills them. */
|
|
1654
|
+
readonly setAside: readonly TimelineCut[];
|
|
1655
|
+
}
|
|
1656
|
+
/** The run's rounds, and the plan it kept. */
|
|
1657
|
+
interface TimelineRounds {
|
|
1658
|
+
readonly status: PipelineStatus | null;
|
|
1659
|
+
readonly stopped: OperationStopReason | null;
|
|
1660
|
+
readonly kept: PlanRef | null;
|
|
1661
|
+
/** The kept plan and why (ruling T6), or the best so far while the run is live. */
|
|
1662
|
+
readonly says: string;
|
|
1663
|
+
readonly list: readonly TimelineRound[];
|
|
1664
|
+
/** The run this one started from, when it was seeded; `null` until 07. */
|
|
1665
|
+
readonly seededFrom: {
|
|
1666
|
+
readonly run: string;
|
|
1667
|
+
} | null;
|
|
1668
|
+
}
|
|
1669
|
+
/** Present only on a page (ruling T11): this page's key, and every page of the stored document. */
|
|
1670
|
+
interface TimelinePaging {
|
|
1671
|
+
readonly this: string;
|
|
1672
|
+
readonly pages: readonly {
|
|
1673
|
+
readonly key: string;
|
|
1674
|
+
readonly periods: readonly string[];
|
|
1675
|
+
readonly rows: {
|
|
1676
|
+
readonly from: number;
|
|
1677
|
+
readonly to: number;
|
|
1678
|
+
} | null;
|
|
1679
|
+
}[];
|
|
1680
|
+
}
|
|
1681
|
+
/** The spec's `Item`. */
|
|
1682
|
+
interface PlanTimelineItem {
|
|
1683
|
+
readonly id: string;
|
|
1684
|
+
/** The process's `about`. */
|
|
1685
|
+
readonly process: string;
|
|
1686
|
+
readonly label: string;
|
|
1687
|
+
readonly period: string;
|
|
1688
|
+
readonly facts: readonly TimelineFact[];
|
|
1689
|
+
/** Late when its last step ends after its demand, so `minutes` is above 0. `chain`: the walk back from that step, at most three links. */
|
|
1690
|
+
readonly late: {
|
|
1691
|
+
readonly minutes: number;
|
|
1692
|
+
readonly against: (typeof LATE_AGAINST$1)[number];
|
|
1693
|
+
readonly says: string;
|
|
1694
|
+
readonly chain: readonly Cause[];
|
|
1695
|
+
} | null;
|
|
1696
|
+
readonly fulfils: readonly {
|
|
1697
|
+
readonly cell: string;
|
|
1698
|
+
readonly amount: number;
|
|
1699
|
+
}[];
|
|
1700
|
+
readonly steps: readonly {
|
|
1701
|
+
readonly about: string;
|
|
1702
|
+
readonly on: string | null;
|
|
1703
|
+
readonly start: string;
|
|
1704
|
+
readonly end: string;
|
|
1705
|
+
/** At most three. */
|
|
1706
|
+
readonly causes: readonly Cause[];
|
|
1707
|
+
readonly eligible: readonly {
|
|
1708
|
+
readonly on: string;
|
|
1709
|
+
readonly rows: readonly string[];
|
|
1710
|
+
}[];
|
|
1711
|
+
}[];
|
|
1712
|
+
readonly broken: readonly {
|
|
1713
|
+
readonly rule: string;
|
|
1714
|
+
readonly says: string;
|
|
1715
|
+
readonly amount: number;
|
|
1716
|
+
readonly unit: string;
|
|
1717
|
+
}[];
|
|
1718
|
+
/** Minutes early, when the item ends before its not-before; `null` until 07. */
|
|
1719
|
+
readonly early: {
|
|
1720
|
+
readonly minutes: number;
|
|
1721
|
+
readonly says: string;
|
|
1722
|
+
} | null;
|
|
1723
|
+
}
|
|
1724
|
+
interface UndoneEntry {
|
|
1725
|
+
readonly item: string;
|
|
1726
|
+
readonly process: string;
|
|
1727
|
+
readonly label: string;
|
|
1728
|
+
readonly by: Reason | null;
|
|
1729
|
+
readonly says: string;
|
|
1730
|
+
}
|
|
1731
|
+
interface Rung {
|
|
1732
|
+
readonly level: number;
|
|
1733
|
+
readonly about: string | null;
|
|
1734
|
+
readonly name: string | null;
|
|
1735
|
+
readonly points: number;
|
|
1736
|
+
readonly parts: readonly {
|
|
1737
|
+
readonly measure: string;
|
|
1738
|
+
readonly name: string;
|
|
1739
|
+
readonly label?: string;
|
|
1740
|
+
readonly value: number;
|
|
1741
|
+
readonly unit: string | null;
|
|
1742
|
+
readonly weight: number;
|
|
1743
|
+
readonly points: number;
|
|
1744
|
+
}[];
|
|
1745
|
+
}
|
|
1746
|
+
interface Timeline {
|
|
1747
|
+
readonly ladder: readonly Rung[];
|
|
1748
|
+
readonly status: "planned" | "overfull";
|
|
1749
|
+
readonly broken: readonly {
|
|
1750
|
+
readonly item: string;
|
|
1751
|
+
readonly process: string;
|
|
1752
|
+
readonly about: string;
|
|
1753
|
+
readonly limit: Broken["limit"];
|
|
1754
|
+
readonly minutes: number;
|
|
1755
|
+
readonly says: string;
|
|
1756
|
+
}[];
|
|
1757
|
+
readonly schema: typeof TIMELINE_SCHEMA;
|
|
1758
|
+
readonly run: string;
|
|
1759
|
+
/** The operation document's hash. `null` for a low-level solver (the floor), which has no operation document (spec 4.2). */
|
|
1760
|
+
readonly operation: string | null;
|
|
1761
|
+
readonly showing: PlanRef | null;
|
|
1762
|
+
readonly zone: string;
|
|
1763
|
+
readonly from: string;
|
|
1764
|
+
readonly to: string;
|
|
1765
|
+
readonly periods: readonly TimelinePeriod[];
|
|
1766
|
+
/** `noun`: the equipment's or person's `about`, or `null` on the floor, whose rows are the IR's resources. `facts`: the figures its panel shows, such as the share of the quoted time it takes. */
|
|
1767
|
+
readonly rows: readonly {
|
|
1768
|
+
readonly id: string;
|
|
1769
|
+
readonly noun: string | null;
|
|
1770
|
+
readonly label: string;
|
|
1771
|
+
readonly area: string | null;
|
|
1772
|
+
readonly facts: readonly TimelineFact[];
|
|
1773
|
+
}[];
|
|
1774
|
+
readonly crews: readonly {
|
|
1775
|
+
readonly role: string;
|
|
1776
|
+
readonly points: readonly {
|
|
1777
|
+
readonly at: string;
|
|
1778
|
+
readonly needed: number;
|
|
1779
|
+
readonly on: number;
|
|
1780
|
+
}[];
|
|
1781
|
+
/** The role noun's about; `null` where the crew comes from the steps alone. */
|
|
1782
|
+
readonly about: string | null;
|
|
1783
|
+
readonly source: (typeof CREW_SOURCES)[number];
|
|
1784
|
+
readonly says: string;
|
|
1785
|
+
}[];
|
|
1786
|
+
readonly bands: readonly {
|
|
1787
|
+
readonly kind: (typeof BAND_KINDS$1)[number];
|
|
1788
|
+
readonly about: string;
|
|
1789
|
+
readonly from: string;
|
|
1790
|
+
readonly to: string;
|
|
1791
|
+
readonly row?: string;
|
|
1792
|
+
readonly says?: string;
|
|
1793
|
+
}[];
|
|
1794
|
+
readonly bars: readonly {
|
|
1795
|
+
readonly row: string;
|
|
1796
|
+
readonly period: string;
|
|
1797
|
+
readonly item: string | null;
|
|
1798
|
+
readonly kind: (typeof BAR_KINDS$1)[number];
|
|
1799
|
+
/**
|
|
1800
|
+
* The step, downtime or `leaves` it comes from. A downtime bar that stands for several of its
|
|
1801
|
+
* piece's downtimes at once (two after every use, summed) is about the piece; its cause names each.
|
|
1802
|
+
*/
|
|
1803
|
+
readonly about: string;
|
|
1804
|
+
readonly start: string;
|
|
1805
|
+
readonly end: string;
|
|
1806
|
+
readonly holdsFor?: string;
|
|
1807
|
+
readonly reason?: string;
|
|
1808
|
+
/** Minutes late (above 0), on an item's last bar; absent when it isn't late. */
|
|
1809
|
+
readonly late?: number;
|
|
1810
|
+
readonly assumed?: true;
|
|
1811
|
+
/** What a hold bar holds, in the material's unit. */
|
|
1812
|
+
readonly holds?: {
|
|
1813
|
+
readonly amount: number;
|
|
1814
|
+
readonly unit: string;
|
|
1815
|
+
};
|
|
1816
|
+
}[];
|
|
1817
|
+
readonly marks: readonly {
|
|
1818
|
+
readonly kind: (typeof MARK_KINDS$1)[number];
|
|
1819
|
+
readonly about: string;
|
|
1820
|
+
readonly at: string;
|
|
1821
|
+
readonly item?: string;
|
|
1822
|
+
readonly row?: string;
|
|
1823
|
+
/** Minutes late (above 0); absent when it isn't late. */
|
|
1824
|
+
readonly late?: number;
|
|
1825
|
+
/** Whole minutes from the measured step to this limit, when it has not passed. */
|
|
1826
|
+
readonly spare?: number;
|
|
1827
|
+
}[];
|
|
1828
|
+
readonly items: readonly PlanTimelineItem[];
|
|
1829
|
+
readonly undone: readonly UndoneEntry[];
|
|
1830
|
+
readonly setsFinish: readonly {
|
|
1831
|
+
readonly period: string;
|
|
1832
|
+
readonly row: string;
|
|
1833
|
+
readonly says: string;
|
|
1834
|
+
/** The same walk back as a late item's chain: at most three links. */
|
|
1835
|
+
readonly chain: readonly Cause[];
|
|
1836
|
+
}[];
|
|
1837
|
+
/** The plan level; `null` on a one-day run and on the floor. */
|
|
1838
|
+
readonly plan: TimelinePlan | null;
|
|
1839
|
+
/** The rounds; `null` on a one-day run and on the floor. */
|
|
1840
|
+
readonly rounds: TimelineRounds | null;
|
|
1841
|
+
/** Each material's stock across the periods; empty until 07 fills it. */
|
|
1842
|
+
readonly stock: readonly TimelineStockRow[];
|
|
1843
|
+
readonly paging?: TimelinePaging;
|
|
1844
|
+
}
|
|
1845
|
+
declare const timelineJsonSchema: {
|
|
1846
|
+
readonly type: string;
|
|
1847
|
+
readonly additionalProperties: boolean;
|
|
1848
|
+
readonly required: string[];
|
|
1849
|
+
readonly properties: Record<string, object>;
|
|
1850
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
1851
|
+
readonly $id: "https://keel.so/schemas/solver/timeline-2.schema.json";
|
|
1852
|
+
readonly title: "Keel solver timeline 2";
|
|
1853
|
+
};
|
|
1854
|
+
/** Shape problems (JSON Schema), at most one: the first the validator meets, in the timeline's own version. */
|
|
1855
|
+
declare const validateTimelineShape: (doc: unknown) => DocumentIssue[];
|
|
1856
|
+
|
|
1857
|
+
/** Where a calibration value or a cut came from (§6.2). */
|
|
1858
|
+
interface Lineage {
|
|
1859
|
+
round: number;
|
|
1860
|
+
bucket: string;
|
|
1861
|
+
run: string | null;
|
|
1862
|
+
}
|
|
1863
|
+
type PipelineStatus = "fits" | "bestEffort" | "infeasible" | "unknown" | "invalid";
|
|
1864
|
+
type StopReason = "converged" | "maxRounds" | "time" | "cancelled" | "stalled" | "failed";
|
|
1865
|
+
/** A plan of a round: "own", "c1", "c1+c3" (spec section 3). */
|
|
1866
|
+
type PlanRef = {
|
|
1867
|
+
readonly round: number;
|
|
1868
|
+
readonly plan: string;
|
|
1869
|
+
};
|
|
1870
|
+
/** What a round tried: the plan's own, one candidate's moves, or several candidates together. */
|
|
1871
|
+
type PlanKind = "own" | "candidate" | "combined";
|
|
1872
|
+
/** Today's stops, `clock` (the run's wall-clock limit) and `settled` (plan 05's search stop). */
|
|
1873
|
+
type OperationStopReason = StopReason | "clock" | "settled";
|
|
1874
|
+
|
|
1875
|
+
declare const READBACK_SCHEMA = "keel.solver.readback/2";
|
|
1876
|
+
interface ReadBackSentence {
|
|
1877
|
+
readonly about: string;
|
|
1878
|
+
readonly says: string;
|
|
1879
|
+
readonly assumed?: true;
|
|
1880
|
+
readonly plain: string;
|
|
1881
|
+
}
|
|
1882
|
+
/** /2 is /1 plus the zone the sentences are worded in (plan 02 fills it); /1 and /0 are read as stored. */
|
|
1883
|
+
interface ReadBackDoc {
|
|
1884
|
+
readonly schema: typeof READBACK_SCHEMA;
|
|
1885
|
+
readonly zone: string | null;
|
|
1886
|
+
readonly unread: readonly string[];
|
|
1887
|
+
readonly sentences: readonly ReadBackSentence[];
|
|
1888
|
+
readonly refusals: readonly ModelRefusal[];
|
|
1889
|
+
}
|
|
1890
|
+
declare const readBackJsonSchema: {
|
|
1891
|
+
readonly type: string;
|
|
1892
|
+
readonly additionalProperties: boolean;
|
|
1893
|
+
readonly required: string[];
|
|
1894
|
+
readonly properties: Record<string, object>;
|
|
1895
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
1896
|
+
readonly $id: "https://keel.so/schemas/solver/readback-2.schema.json";
|
|
1897
|
+
readonly title: "Keel solver read-back 2";
|
|
1898
|
+
};
|
|
1899
|
+
/** The read-back as stored: /2, each sentence's missing `plain` filled with its `says`. `zone` is null until the caller names the one the sentences are worded in. */
|
|
1900
|
+
declare function readBackDoc(back: Pick<ReadBack, "sentences" | "refusals" | "unread">, zone?: string | null): ReadBackDoc;
|
|
1901
|
+
|
|
1902
|
+
/** Spec 4.5's causes: each a declared bound that binds a step's start. */
|
|
1903
|
+
declare const CAUSE_KINDS: readonly ["step-before", "wait", "equipment-busy", "downtime", "ready", "release", "after", "hours", "shift", "crew", "starts-during", "nothing-binds"];
|
|
1904
|
+
declare const LEVER_KINDS: readonly ["figure", "row", "rule", "hours", "roster", "equipment", "priorities"];
|
|
1905
|
+
/** How a period's day was measured (spec section 3's `PeriodEntry.measurement`). */
|
|
1906
|
+
declare const MEASUREMENTS: readonly ["measured", "one-sided", "checks failed", "refused", "no schedule", "skipped"];
|
|
1907
|
+
/** Whether a period's day was run new, run again for a change, or reused from an earlier round. */
|
|
1908
|
+
declare const DAY_WHYS: readonly ["new", "changed", "reused"];
|
|
1909
|
+
declare const BAND_KINDS: readonly ["closed", "start-up", "shift", "break"];
|
|
1910
|
+
declare const BAR_KINDS: readonly ["work", "hold", "downtime"];
|
|
1911
|
+
declare const MARK_KINDS: readonly ["release", "leaves", "ready", "due", "deadline"];
|
|
1912
|
+
/** What a late item is late against. */
|
|
1913
|
+
declare const LATE_AGAINST: readonly ["due", "deadline", "leaves"];
|
|
1914
|
+
type CauseKind = (typeof CAUSE_KINDS)[number];
|
|
1915
|
+
type Measurement = (typeof MEASUREMENTS)[number];
|
|
1916
|
+
|
|
1917
|
+
declare const TIMELINE_SCHEMA_0 = "keel.solver.timeline/0";
|
|
1918
|
+
/** What the planner can change, and where it lives. A lever names a figure; it doesn't solve again. */
|
|
1919
|
+
interface Lever0 {
|
|
1920
|
+
readonly kind: (typeof LEVER_KINDS)[number];
|
|
1921
|
+
readonly about: string;
|
|
1922
|
+
readonly says: string;
|
|
1923
|
+
}
|
|
1924
|
+
interface Cause0 {
|
|
1925
|
+
readonly kind: CauseKind;
|
|
1926
|
+
/** The noun it rests on. */
|
|
1927
|
+
readonly about: string;
|
|
1928
|
+
readonly says: string;
|
|
1929
|
+
readonly at: string;
|
|
1930
|
+
/** It rests on a default the operator never confirmed (the read-back's `assumed`). */
|
|
1931
|
+
readonly assumed: boolean;
|
|
1932
|
+
readonly refs: {
|
|
1933
|
+
readonly item?: string;
|
|
1934
|
+
readonly row?: string;
|
|
1935
|
+
readonly step?: string;
|
|
1936
|
+
};
|
|
1937
|
+
/** In spec 4.5's table's order: none where the table offers none, two where it offers two. */
|
|
1938
|
+
readonly levers: readonly Lever0[];
|
|
1939
|
+
}
|
|
1940
|
+
/** A figure a row or an item carries, as the Console shows it: `about` is the noun or demand it comes from. */
|
|
1941
|
+
interface TimelineFact0 {
|
|
1942
|
+
readonly about: string;
|
|
1943
|
+
readonly label: string;
|
|
1944
|
+
readonly text: string;
|
|
1945
|
+
}
|
|
1946
|
+
/** The spec's `Period`. */
|
|
1947
|
+
interface TimelinePeriod0 {
|
|
1948
|
+
readonly id: string;
|
|
1949
|
+
readonly label: string;
|
|
1950
|
+
readonly from: string;
|
|
1951
|
+
readonly to: string;
|
|
1952
|
+
readonly open: boolean;
|
|
1953
|
+
readonly plan: {
|
|
1954
|
+
readonly cells?: readonly {
|
|
1955
|
+
readonly id: string;
|
|
1956
|
+
readonly process: string;
|
|
1957
|
+
readonly row: string;
|
|
1958
|
+
readonly label: string;
|
|
1959
|
+
readonly amount: number;
|
|
1960
|
+
readonly unit: string;
|
|
1961
|
+
readonly changed: number | null;
|
|
1962
|
+
}[];
|
|
1963
|
+
readonly roster?: readonly {
|
|
1964
|
+
readonly role: string;
|
|
1965
|
+
readonly shift: string;
|
|
1966
|
+
readonly people: number;
|
|
1967
|
+
readonly agency: number;
|
|
1968
|
+
readonly overtimeMinutes: number;
|
|
1969
|
+
}[];
|
|
1970
|
+
} | null;
|
|
1971
|
+
readonly fit: {
|
|
1972
|
+
readonly estimate: number;
|
|
1973
|
+
readonly learned: {
|
|
1974
|
+
readonly offset: number;
|
|
1975
|
+
readonly from: Lineage;
|
|
1976
|
+
} | null;
|
|
1977
|
+
readonly measured: number | null;
|
|
1978
|
+
readonly measurement: Measurement;
|
|
1979
|
+
readonly within: boolean | null;
|
|
1980
|
+
readonly unit: string;
|
|
1981
|
+
} | null;
|
|
1982
|
+
readonly day: {
|
|
1983
|
+
readonly run: string;
|
|
1984
|
+
readonly mode: string | null;
|
|
1985
|
+
readonly status: RunStatus | null;
|
|
1986
|
+
readonly why: (typeof DAY_WHYS)[number];
|
|
1987
|
+
} | null;
|
|
1988
|
+
/** The plan's rules with no slack in this period. */
|
|
1989
|
+
readonly tight: readonly {
|
|
1990
|
+
readonly about: string;
|
|
1991
|
+
readonly says: string;
|
|
1992
|
+
}[];
|
|
1993
|
+
readonly cut: {
|
|
1994
|
+
readonly says: string;
|
|
1995
|
+
readonly cells: readonly string[];
|
|
1996
|
+
readonly total: number;
|
|
1997
|
+
readonly round: number;
|
|
1998
|
+
} | null;
|
|
1999
|
+
}
|
|
2000
|
+
/** The spec's `Item`. */
|
|
2001
|
+
interface TimelineItem0 {
|
|
2002
|
+
readonly id: string;
|
|
2003
|
+
/** The process's `about`. */
|
|
2004
|
+
readonly process: string;
|
|
2005
|
+
readonly label: string;
|
|
2006
|
+
readonly period: string;
|
|
2007
|
+
readonly facts: readonly TimelineFact0[];
|
|
2008
|
+
/** Late when its last step ends after its demand, so `minutes` is above 0. `chain`: the walk back from that step, at most three links. */
|
|
2009
|
+
readonly late: {
|
|
2010
|
+
readonly minutes: number;
|
|
2011
|
+
readonly against: (typeof LATE_AGAINST)[number];
|
|
2012
|
+
readonly says: string;
|
|
2013
|
+
readonly chain: readonly Cause0[];
|
|
2014
|
+
} | null;
|
|
2015
|
+
readonly fulfils: readonly {
|
|
2016
|
+
readonly cell: string;
|
|
2017
|
+
readonly amount: number;
|
|
2018
|
+
}[];
|
|
2019
|
+
readonly steps: readonly {
|
|
2020
|
+
readonly about: string;
|
|
2021
|
+
readonly on: string | null;
|
|
2022
|
+
readonly start: string;
|
|
2023
|
+
readonly end: string;
|
|
2024
|
+
/** At most three. */
|
|
2025
|
+
readonly causes: readonly Cause0[];
|
|
2026
|
+
}[];
|
|
2027
|
+
readonly broken: readonly {
|
|
2028
|
+
readonly rule: string;
|
|
2029
|
+
readonly says: string;
|
|
2030
|
+
readonly amount: number;
|
|
2031
|
+
readonly unit: string;
|
|
2032
|
+
}[];
|
|
2033
|
+
}
|
|
2034
|
+
interface Timeline0 {
|
|
2035
|
+
readonly schema: typeof TIMELINE_SCHEMA_0;
|
|
2036
|
+
readonly run: string;
|
|
2037
|
+
/** The operation document's hash. `null` for a low-level solver (the floor), which has no operation document (spec 4.2). */
|
|
2038
|
+
readonly operation: string | null;
|
|
2039
|
+
readonly showing: PlanRef | null;
|
|
2040
|
+
readonly zone: string;
|
|
2041
|
+
readonly from: string;
|
|
2042
|
+
readonly to: string;
|
|
2043
|
+
readonly periods: readonly TimelinePeriod0[];
|
|
2044
|
+
/** `noun`: the equipment's or person's `about`, or `null` on the floor, whose rows are the IR's resources. `facts`: the figures its panel shows, such as the share of the quoted time it takes. */
|
|
2045
|
+
readonly rows: readonly {
|
|
2046
|
+
readonly id: string;
|
|
2047
|
+
readonly noun: string | null;
|
|
2048
|
+
readonly label: string;
|
|
2049
|
+
readonly area: string | null;
|
|
2050
|
+
readonly facts: readonly TimelineFact0[];
|
|
2051
|
+
}[];
|
|
2052
|
+
readonly crews: readonly {
|
|
2053
|
+
readonly role: string;
|
|
2054
|
+
readonly points: readonly {
|
|
2055
|
+
readonly at: string;
|
|
2056
|
+
readonly needed: number;
|
|
2057
|
+
readonly on: number;
|
|
2058
|
+
}[];
|
|
2059
|
+
}[];
|
|
2060
|
+
readonly bands: readonly {
|
|
2061
|
+
readonly kind: (typeof BAND_KINDS)[number];
|
|
2062
|
+
readonly about: string;
|
|
2063
|
+
readonly from: string;
|
|
2064
|
+
readonly to: string;
|
|
2065
|
+
}[];
|
|
2066
|
+
readonly bars: readonly {
|
|
2067
|
+
readonly row: string;
|
|
2068
|
+
readonly period: string;
|
|
2069
|
+
readonly item: string | null;
|
|
2070
|
+
readonly kind: (typeof BAR_KINDS)[number];
|
|
2071
|
+
/**
|
|
2072
|
+
* The step, downtime or `leaves` it comes from. A downtime bar that stands for several of its
|
|
2073
|
+
* piece's downtimes at once (two after every use, summed) is about the piece; its cause names each.
|
|
2074
|
+
*/
|
|
2075
|
+
readonly about: string;
|
|
2076
|
+
readonly start: string;
|
|
2077
|
+
readonly end: string;
|
|
2078
|
+
readonly holdsFor?: string;
|
|
2079
|
+
readonly reason?: string;
|
|
2080
|
+
/** Minutes late (above 0), on an item's last bar; absent when it isn't late. */
|
|
2081
|
+
readonly late?: number;
|
|
2082
|
+
}[];
|
|
2083
|
+
readonly marks: readonly {
|
|
2084
|
+
readonly kind: (typeof MARK_KINDS)[number];
|
|
2085
|
+
readonly about: string;
|
|
2086
|
+
readonly at: string;
|
|
2087
|
+
readonly item?: string;
|
|
2088
|
+
readonly row?: string;
|
|
2089
|
+
/** Minutes late (above 0); absent when it isn't late. */
|
|
2090
|
+
readonly late?: number;
|
|
2091
|
+
}[];
|
|
2092
|
+
readonly items: readonly TimelineItem0[];
|
|
2093
|
+
readonly setsFinish: readonly {
|
|
2094
|
+
readonly period: string;
|
|
2095
|
+
readonly row: string;
|
|
2096
|
+
readonly says: string;
|
|
2097
|
+
/** The same walk back as a late item's chain: at most three links. */
|
|
2098
|
+
readonly chain: readonly Cause0[];
|
|
2099
|
+
}[];
|
|
2100
|
+
}
|
|
2101
|
+
declare const timelineJsonSchema0: {
|
|
2102
|
+
readonly type: string;
|
|
2103
|
+
readonly additionalProperties: boolean;
|
|
2104
|
+
readonly required: string[];
|
|
2105
|
+
readonly properties: Record<string, object>;
|
|
2106
|
+
readonly $schema: "https://json-schema.org/draft/2020-12/schema";
|
|
2107
|
+
readonly $id: "https://keel.so/schemas/solver/timeline-0.schema.json";
|
|
2108
|
+
readonly title: "Keel solver timeline 0";
|
|
2109
|
+
};
|
|
2110
|
+
|
|
2111
|
+
export { type TimedDecision as $, type ModeOption as A, BAND_KINDS$1 as B, type C, type Decision as D, type EngineResult as E, type Flow as F, type Goal as G, type HeldDecision as H, type Ir as I, type NounKind as J, type KpiDisplay as K, type LitRef as L, type ModelRecord as M, type N, type OperationDoc as O, type ProcessStep as P, OPERATION_SCHEMA as Q, type RuleRow as R, type SetItem as S, type Timeline as T, type Process as U, type Values02 as V, READBACK_SCHEMA as W, type Service as X, type SpanItem as Y, type SpanValue as Z, TIMELINE_SCHEMA as _, type Id as a, type Usage as a0, decisionValues as a1, evalC as a2, evalEnv as a3, evalN as a4, operationJsonSchema as a5, overlaps as a6, readBackDoc as a7, readBackJsonSchema as a8, rowAmount as a9, type TimelineRounds as aA, type TriggerFact as aB, type WaitFact as aC, rowApplies as aa, timelineJsonSchema as ab, timelineJsonSchema0 as ac, validateOperationShape as ad, validateTimelineShape as ae, type Cause as af, type CauseKind$1 as ag, type DemandFact as ah, type Lever as ai, type Lowering as aj, type ModelWords as ak, type Noun as al, type NounFacts as am, type NounWords as an, type PlanTimelineItem as ao, type ReadBackDoc as ap, type TakesFact as aq, type TimeFact as ar, type Timeline0 as as, type TimelineCut as at, type TimelineFact as au, type TimelineFit as av, type TimelinePaging as aw, type TimelinePeriod as ax, type TimelinePlan as ay, type TimelineRound as az, type Rule as b, type Kpi as c, type Item$1 as d, type Changeover as e, type Note as f, type StructureGroup as g, type Clock as h, type ResourceKind as i, type Producer as j, type RunStatus as k, type RunReason as l, type ServiceSpan as m, type EdgeRef as n, type Declared as o, type DocumentIssue as p, BAR_KINDS$1 as q, CAUSE_KINDS$1 as r, KINDS as s, type EngineHost as t, type Global as u, type GoalAnchor as v, type ItemFact as w, LATE_AGAINST$1 as x, LEVER_KINDS$1 as y, MARK_KINDS$1 as z };
|