-
Notifications
You must be signed in to change notification settings - Fork 0
/
LK-neu.html
271 lines (266 loc) · 10.9 KB
/
LK-neu.html
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
<!DOCTYPE html>
<html>
<head>
<title>The Programming Language of Euler</title>
<style type="text/css">
body {
width : 700px;
font-family: arial, sans-serif;
font-size: 10pt;
margin: 20px;
margin-left: 100px;
}
pre {
font-family : "Courier New", monospace;
background: #EEE;
padding: 10px;
margin-left: 15%;
}
pre.output {
background:none;
margin-left: 5%;
}
pre.udf {
margin-left: 0;
}
pre.prompt {
margin-left: 0;
}
pre.comment {
background: none;
margin-left: 7%;
}
p.comment {
margin-left: 5%;
margin-right: 5%;
}
p.indentedcomment {
margin-left: 10%;
}
h1.title {
font-family : arial, sans-serif;
text-align : right;
font-size : 24pt;
padding-bottom: 5pt;
}
h1.comment, h1.comment a {
font-family : arial, sans-serif;
text-align : right;
font-size : 16pt;
}
h2.comment, h2.comment a {
font-family : arial, sans-serif;
text-align : right;
font-size : 12pt;
}
h1.title, h1.comment, h2.comment {
border-bottom: 2px solid;
}
ul.comment {
font-family : arial, sans-serif;
font-size : 10pt;
margin-left: 10%;
margin-right: 10%;
padding-left:0;
}
img.euler { }
p.image {
text-align:center; margin-left:50px;
}
a:link {
font-weight:bolder;
text-decoration:none;
}
a:visited {
font-weight:bolder;
text-decoration:none;
}
</style>
</head>
<body>
<h1 class="title">LK-neu</h1>
<pre class="prompt">>load "LK.e";
>{Mt,clb,tk,rlb}=readtable("ABC.dat",>clabs,>rlabs);
>writetable(Mt[,[1:6]],wc=8,labc=clb[1:6],labr=rlb);
</pre>
<pre class="output"> ST SK BS AS PR LR
Nuno_131 79 247 447 51 241 556
Nuno_4626 910 0 921 839 1259 555
AngelEye_0035 1564 981 2480 992 2445 5199
AngelEye_0039 584 159 1836 597 3019 2408
</pre>
<pre class="prompt">>s=4; Df:=Mt[s], At:=round(1*[0,3090,4228,0,0,3089],0)
</pre>
<pre class="output">[584, 159, 1836, 597, 3019, 2408, 0, 673, 466, 0, 0, 0]
[0, 3090, 4228, 0, 0, 3089]
</pre>
<pre class="prompt">>rD:=1.2*Mt[1:4].(Def_DSpez)+8000;
>writetable(rD/sum(rD),labr=rlb,labc=lKL)
</pre>
<pre class="output"> I A K
Nuno_131 0.35 0.34 0.31
Nuno_4626 0.36 0.35 0.3
AngelEye_0035 0.34 0.36 0.3
AngelEye_0039 0.32 0.4 0.28
</pre>
<pre class="prompt">>rDg:=rD/sum(rD)*[1,1,1.0];
>x=A\rD'; t:=x'/sum(x');
>writetable(round(x',0)|t,labc=clb[[2,3,6,2,3,6]],labr=rlb,wc=8)
</pre>
<pre class="output"> SK BS LR SK BS LR
Nuno_131 934 1011 812 0.34 0.37 0.29
Nuno_4626 2838 3922 2859 0.3 0.41 0.3
AngelEye_0035 7100 9965 8411 0.28 0.39 0.33
AngelEye_0039 2758 5684 6470 0.18 0.38 0.43
</pre>
<pre class="prompt">>c=rDg[s], b=rD[s]';
</pre>
<pre class="output">[0.31976, 0.396909, 0.28333]
</pre>
<pre class="prompt">>startlpsolve; {x2,obj,duals}:=ilpsolve(A,b,c,<max,eq=1); x2'
</pre>
<pre class="output">[2754, 5685, 6474]
</pre>
<pre class="prompt">>c=(rD[s]'/(A.x2))'
</pre>
<pre class="output">[0.999991, 0.999644, 0.999998]
</pre>
<pre class="prompt">>X=floor(x)'.U2; rlb[s]
</pre>
<pre class="output">AngelEye_0039
</pre>
<pre class="prompt">>bat(X[s],rD[s])
</pre>
<pre class="output"> I A K sum
x 2757 5684 6470 14911
loss 2757 5684 6470 14911
rA 726615 901960 643825 2.2724e+006
rD 726690 902019 643898 2.27261e+006
rA-rD -74.6 -59.2 -73 -206.8
Schaden 1 1 1 3
Verlust 1 1 1 3
[1.0001, 1.00007, 1.00011]
</pre>
<pre class="prompt">>bat(x2'.U2,rD[s])
</pre>
<pre class="output"> I A K sum
x 2754 5685 6474 14913
loss 2754 5683 6474 14911
rA 726696 902340 643899 2.27294e+006
rD 726690 902019 643898 2.27261e+006
rA-rD 6.4 320.8 1 328.2
Schaden 1 1 1 3
Verlust 1 1 1 3
[0.999991, 0.999644, 0.999998]
</pre>
<pre class="prompt">>bat(At,rD[s])
</pre>
<pre class="output"> I A K sum
x 3090 4228 3089 10407
loss 3090 4228 3089 10407
rA 523122 510057 435785 1.46896e+006
rD 726690 902019 643898 2.27261e+006
rA-rD -203568 -391962 -208113 -803643
Schaden 0.72 0.57 0.68 1.96
Verlust 1.39 1.77 1.48 4.64
[1.38914, 1.76847, 1.47756]
</pre>
<h1 class="comment"><a name="Varianten">Varianten</a></h1>
<pre class="prompt">>fight2(floor(X[s]),Mt[s][1:6]);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 2757 5684 0 0 6470 14911
1 0 1502 3008 0 0 3396 7906
2 0 850 1652 0 0 1856 4358
3 0 507 960 0 0 1074 2541
4 0 323 601 0 0 668 1592
5 0 222 409 0 0 448 1079
6 0 162 299 0 0 320 781
Rnd ST SK BS AS PR LR Sum
0 584 159 1836 597 3019 2408 8603
1 292 79 918 298 1509 1204 4300
2 146 39 459 149 754 602 2149
3 73 19 229 74 377 301 1073
4 36 9 114 37 188 150 534
5 18 4 57 18 94 75 266
6 9 2 28 9 47 37 132
</pre>
<pre class="prompt">>fight2(x2'.U2,Mt[s][1:6]);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 2754 5685 0 0 6474 14913
1 0 1500 3009 0 0 3398 7907
2 0 849 1653 0 0 1857 4359
3 0 506 961 0 0 1075 2542
4 0 323 602 0 0 668 1593
5 0 222 409 0 0 448 1079
6 0 162 299 0 0 320 781
Rnd ST SK BS AS PR LR Sum
0 584 159 1836 597 3019 2408 8603
1 292 79 918 298 1509 1204 4300
2 146 39 459 149 754 602 2149
3 73 19 229 74 377 301 1073
4 36 9 114 37 188 150 534
5 18 4 57 18 94 75 266
6 9 2 28 9 47 37 132
</pre>
<pre class="prompt">>fight2(At,Mt[s][1:6]);
</pre>
<pre class="output"> Rnd ST SK BS AS PR LR Sum
0 0 3090 4228 0 0 3089 10407
1 0 1545 2114 0 0 1544 5203
2 0 772 1057 0 0 772 2601
3 0 386 528 0 0 386 1300
4 0 193 264 0 0 193 650
5 0 96 132 0 0 96 324
6 0 48 66 0 0 48 162
Rnd ST SK BS AS PR LR Sum
0 584 159 1836 597 3019 2408 8603
1 353 96 1284 417 1943 1550 5643
2 248 67 990 321 1411 1125 4162
3 199 53 836 271 1148 915 3422
4 175 46 757 245 1018 811 3052
5 163 42 717 232 953 759 2866
6 157 40 696 225 921 733 2772
</pre>
<pre class="prompt">>Silber(8300,[2,40,38])
</pre>
<pre class="output"> Stadt Festung Burg Total
Anz 2 40 38 0
Kapaz/Habitat 1600 200 20 0
Fassvermögen 3200 8000 760 11960
Fassung [%] 26.8 66.9 6.4 100
Silber 7200 1440 288 8300
Ideal [%] 9.2 57.4 67 69.4
Stadt 147.2 18.4 1.8 1110.4
Festung 917.7 114.7 11.5 138.8
Burg 1071.8 134 13.4 13.9
[0.0919732, 0.573579, 0.6699, 0.69398]
</pre>
<pre class="prompt">>k0:=1000*(A\[1,1,1]'); K:=Def.inv(A); writetable(K'|k0,labr=lTR[[2,3,6]],labc=lTR+"k0")
</pre>
<pre class="output"> ST SK BS AS PR LR k0
SK 0.32 0.21 0.49 2.07 1.95 0.83 9.02
BS 0.76 0.34 -0.51 -1.38 0.42 0.15 6.12
LR 0.56 0.6 0.97 2.35 -0.55 -0.18 5.79
</pre>
<pre class="prompt">>writetable(Off|Def,wc=9,labr=lTR,labc=lSK)
</pre>
<pre class="output"> oI oA oK dI dA dK
ST 8 6 13 69 44 130
SK 43 26 63 56 28 83
BS 66 22 11 69 32 23
AS 23 17 10 201 132 72
PR 17 26 23 60 132 81
LR 36 109 63 28 56 35
</pre>
<pre class="prompt">>ms:=[2500,3125,2650,3625,2450,1975]
</pre>
<pre class="output">[2500, 3125, 2650, 3625, 2450, 1975]
</pre>
<pre class="prompt">>ms.Def
</pre>
<pre class="output">[1.46128e+006, 1.1948e+006, 1.1739e+006]
</pre>
</body>
</html>