-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.d.ts
81 lines (71 loc) · 1.68 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
export as namespace XCScoring;
import { BRecord, IGCFile } from 'igc-parser';
interface Point {
/** Longitude */
x: number;
/** Latitude */
y: number;
/** GPS fix number in the tracklog */
r: number;
}
interface Leg {
name: string;
/** Scoring distance */
d: number;
start: Point;
finish: Point;
}
interface ClosingPoints {
d: number;
in: Point;
out: Point;
}
interface EndPoints {
start: Point;
finish: Point;
}
interface ScoreInfo {
cp?: ClosingPoints;
ep?: EndPoints;
tp?: Point[];
legs?: Leg[];
/** Distance without penalty applied */
distance: number;
penalty: number;
score: number;
}
interface Scoring {
name: string;
code: string;
multiplier: number;
/** Fixed closing distance that is always accepted */
closingDistanceFixed?: number;
/** Closing distance that does not incur any scoring penalty */
closingDistanceFree?: number;
/** Closing distance that is relative to the full triangle length but incurs a penalty */
closingDistanceRelative?: number;
}
interface Opt {
scoring: Scoring;
flight: IGCFile & {
/** Filtered GPS fixes when invalid=false, GPS fix number is relative to this array */
filtered: BRecord[];
};
/** launch and landing are the indices of the fixes identified as launch and landing **/
launch: number;
landing: number;
config: { [key: string]: any };
}
interface Solution {
bound: number;
currentUpperBound: number;
id: number | string;
opt: Opt;
optimal?: boolean;
processed?: number;
score?: number;
scoreInfo?: ScoreInfo;
time?: number;
}
export function solver(flight: IGCFile, scoringRules: object, config?: { [key: string]: any }) : Iterator<Solution, Solution>;
export const scoringRules: { [key: string]: object[] };