-
Notifications
You must be signed in to change notification settings - Fork 1
/
ko_bus_set.pnml
179 lines (159 loc) · 5.72 KB
/
ko_bus_set.pnml
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
/*------------------------------------------------------------------------------
* 한국 버스 세트(Korean Bus Set)
* https://github.com/KoreanGRF/KoreanBusSet
------------------------------------------------------------------------------*/
// GRF definition
grf {
grfid: "TK\02\02";
name: string(STR_GRF_NAME_WITH_VER);
desc: string(STR_GRF_DESC);
url: string(STR_GRF_URL);
version: 601;
min_compatible_version : 37;
// Speed coefficient
param 0 {
coeff_speed {
type: int;
name: string(STR_PARAM_SPEED_NAME);
desc: string(STR_PARAM_SPEED_DESC);
min_value: 1;
max_value: 100;
def_value: 10;
}
}
// Cost coefficient
param 6 {
coeff_cost {
type: int;
name: string(STR_PARAM_FACTOR_COST_NAME);
desc: string(STR_PARAM_FACTOR_COST_DESC);
min_value: 0;
max_value: 10;
def_value: 3;
names: {
0: string(STR_PARAM_OPT_FACTOR_BY_1_8);
1: string(STR_PARAM_OPT_FACTOR_BY_1_4);
2: string(STR_PARAM_OPT_FACTOR_BY_1_2);
3: string(STR_PARAM_OPT_FACTOR_BY_1_DEFAULT);
4: string(STR_PARAM_OPT_FACTOR_BY_2);
5: string(STR_PARAM_OPT_FACTOR_BY_4);
6: string(STR_PARAM_OPT_FACTOR_BY_8);
7: string(STR_PARAM_OPT_FACTOR_BY_16);
8: string(STR_PARAM_OPT_FACTOR_BY_32);
9: string(STR_PARAM_OPT_FACTOR_BY_64);
10: string(STR_PARAM_OPT_FACTOR_BY_128);
};
}
}
// Running cost coefficient
param 7 {
coeff_running_cost {
type: int;
name: string(STR_PARAM_FACTOR_RUNNING_COST_NAME);
desc: string(STR_PARAM_FACTOR_RUNNING_COST_DESC);
min_value: 0;
max_value: 12;
def_value: 5;
names: {
0: string(STR_PARAM_OPT_FACTOR_BY_1_32);
1: string(STR_PARAM_OPT_FACTOR_BY_1_16);
2: string(STR_PARAM_OPT_FACTOR_BY_1_8);
3: string(STR_PARAM_OPT_FACTOR_BY_1_4);
4: string(STR_PARAM_OPT_FACTOR_BY_1_2);
5: string(STR_PARAM_OPT_FACTOR_BY_1_DEFAULT);
6: string(STR_PARAM_OPT_FACTOR_BY_2);
7: string(STR_PARAM_OPT_FACTOR_BY_4);
8: string(STR_PARAM_OPT_FACTOR_BY_8);
9: string(STR_PARAM_OPT_FACTOR_BY_16);
10: string(STR_PARAM_OPT_FACTOR_BY_32);
11: string(STR_PARAM_OPT_FACTOR_BY_64);
12: string(STR_PARAM_OPT_FACTOR_BY_128);
};
}
}
// Capacity coefficient
param 8 {
coeff_cargo_capacity {
type: int;
name: string(STR_PARAM_FACTOR_CARGO_CAPACITY_NAME);
desc: string(STR_PARAM_FACTOR_CARGO_CAPACITY_DESC);
min_value: 0;
max_value: 8;
def_value: 0;
names: {
0: string(STR_PARAM_OPT_FACTOR_BY_1_2_DEFAULT);
1: string(STR_PARAM_OPT_FACTOR_BY_1);
2: string(STR_PARAM_OPT_FACTOR_BY_2);
3: string(STR_PARAM_OPT_FACTOR_BY_4);
4: string(STR_PARAM_OPT_FACTOR_BY_8);
5: string(STR_PARAM_OPT_FACTOR_BY_16);
6: string(STR_PARAM_OPT_FACTOR_BY_32);
7: string(STR_PARAM_OPT_FACTOR_BY_64);
8: string(STR_PARAM_OPT_FACTOR_BY_128);
};
}
}
// Loading speed coefficient
param 9 {
coeff_loading_speed {
type: int;
name: string(STR_PARAM_FACTOR_LOADING_SPEED_NAME);
desc: string(STR_PARAM_FACTOR_LOADING_SPEED_DESC);
min_value: 0;
max_value: 5;
def_value: 0;
names: {
0: string(STR_PARAM_OPT_FACTOR_BY_1_DEFAULT);
1: string(STR_PARAM_OPT_FACTOR_BY_2);
2: string(STR_PARAM_OPT_FACTOR_BY_4);
3: string(STR_PARAM_OPT_FACTOR_BY_8);
4: string(STR_PARAM_OPT_FACTOR_BY_16);
5: string(STR_PARAM_OPT_FACTOR_BY_32);
};
}
}
// Boolean
param 10 {
// Legacy bus
bool_use_legacy_bus {
type: bool;
name: string(STR_PARAM_USE_LEGACY_BUS_NAME);
desc: string(STR_PARAM_USE_LEGACY_BUS_DESC);
bit: 1;
def_value: 0;
}
}
}
// Roadtypetable
roadtypetable {
ROAD
}
// Cargotable
cargotable {
PASS
}
// Cost, running cost, capacity, loading speed coefficients
sw_cost_factor = 1 << max(0, min(coeff_cost, 10));
sw_running_cost_factor = 1 << max(0, min(coeff_running_cost, 12));
sw_cargo_capacity_factor = 1 << (max(1, min(coeff_cargo_capacity, 8)) - 1);
sw_loading_speed_factor = 1 << max(0, min(coeff_loading_speed, 3));
// Macro
#include "src/macro.pnml"
// Load spec
#include "generated/spec.pnml"
// Templates
#include "src/template/purchase.pnml"
#include "src/template/hyundai.pnml"
// Items
#include "./src/hyundai/super_aerocity_low_floor/item.pnml"
#include "./src/hyundai/universe/item.pnml"
#include "./src/hyundai/COUNTY_LONG/item.pnml"
#include "./src/hyundai/COUNTY_XLONG/item.pnml"
#include "./src/daewoo/NEW_BS110_LF/item.pnml"
#include "./src/legacy/item.pnml"
// Legacy bus
if(!bool_use_legacy_bus) {
disable_item(FEAT_ROADVEHS, 5001, 5008);
}
// Sort
#include "./src/sort.pnml"