-
Notifications
You must be signed in to change notification settings - Fork 2
/
api-reference-modal.html
301 lines (286 loc) · 10.2 KB
/
api-reference-modal.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
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
<div class="modal-header">
<h3 class="modal-title top-shadow">
<span class="glyphicon glyphicon-paperclip"></span>
T-Wolrd API Reference
<button class="btn btn-danger glyphicon glyphicon-remove pull-right margin-10" ng-click="close()"></button>
</h3>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-2 text-right margin-10" style="border-right: rgb(231, 224, 224) solid;">
<h4 class="sett-item cursor-pointer" ng-class="{active:isPerceptTab()}" ng-click="setPerceptTab()">Percept</h4>
<h4 class="sett-item cursor-pointer" ng-class="{active:isConstantsTab()}" ng-click="setConstantsTab()">Types, Constants & Variables</h4>
<h4 class="sett-item cursor-pointer" ng-class="{active:isFunctionsTab()}" ng-click="setFunctionsTab()">Functions</h4>
</div>
<div class="col-md-9 animate-only-show-3d-left margin-left-10" ng-show="isPerceptTab()">
<div class="row"><h4><b>Percept Object Structure</b></h4></div>
<p>
<b>Note:</b> click on a percept field to unfold it.
</p>
<span class="text-red text-bold" style="margin-left:-10px">percept</span>
<ul class="tree text-red text-bold">
<li>
<div ng-click="setPerceptField(0)" class="cursor-pointer hover blue">environment</div>
<ul ng-show="isPerceptField(0)" class="animate-show-3d-top">
<li>
grid:<span>"Row-Major Order" matrix, rows are numbered by the first index and columns by the second index</span>
</li>
<li>time</li>
<li>
battery_chargers: <span>Array of</span>
<ul>
<li>row</li>
<li>column</li>
</ul>
</li>
<li>
agents: <span>Array of</span>
<ul>
<li>id</li>
<li>team_id</li>
<li>
location
<ul>
<li>row</li>
<li>column</li>
</ul>
</li>
<li>score</li>
<li>battery</li>
</ul>
</li>
<li>
holes: <span>Array of</span>
<ul>
<li>id</li>
<li>
cells: <span>Array of</span>
<ul>
<li>row</li>
<li>column</li>
</ul>
</li>
<li>size</li>
<li>value</li>
<li>time_elapsed</li>
<li>lifetime_left</li>
</ul>
</li>
<li>
tiles: <span>Array of</span>
<ul>
<li>id</li>
<li>row</li>
<li>column</li>
<li>time_elapsed</li>
<li>lifetime_left</li>
</ul>
</li>
<li>
obstacles: <span>Array of</span>
<ul>
<li>id</li>
<li>row</li>
<li>column</li>
<li>time_elapsed</li>
<li>lifetime_left</li>
</ul>
</li>
<li>
stats:
<ul>
<li>time: <span>real time elapsed since simulation started (milliseconds)</span></li>
<li>game_result: <span>when the simulation ends this field stores the result (see _GAME_RESULT constant)</li>
<li>total_cells</li>
<li>total_holes</li>
<li>total_score</li>
</ul>
</li>
</ul>
</li>
<li>
<div ng-click="setPerceptField(1)" class="cursor-pointer hover blue">agent</div>
<ul ng-show="isPerceptField(1)" class="animate-show-3d-top">
<li>id</li>
<li>team_id</li>
<li>
location
<ul>
<li>row</li>
<li>column</li>
</ul>
</li>
<li>score</li>
<li>battery</li>
<li>
stats
<ul>
<li>good_moves</li>
<li>bad_moves</li>
<li>filled_cells</li>
<li>filled_holes</li>
<li>battery_used</li>
<li>battery_recharge</li>
<li>battery_restore</li>
<li>total_score</li>
</ul>
</li>
</ul>
</li>
<li>
<div ng-click="setPerceptField(2)" class="cursor-pointer hover blue">builtin_knowledge</div>
<ul ng-show="isPerceptField(2)" class="animate-show-3d-top">
<li>grid_total_rows</li>
<li>grid_total_columns</li>
<li>
teams: <span>Array of</span>
<ul>
<li>id</li>
<li>leader</li>
<li>members: <span>Array of integer (agents id)</span></li>
</ul>
</li>
<li>
end
<ul>
<li>
neutral: <span>Conditions Object</span>
<ul>
<li>time</li>
<li>good_moves</li>
<li>agents_location: <span>Array of Pairs</span></li>
<li>filled_holes</li>
<li>filled_cells</li>
<li>score</li>
<li>bad_moves</li>
<li>battery_used</li>
<li>battery_recharge</li>
<li>battery_restore</li>
</ul>
</li>
<li>success: <span>Conditions Object</span></li>
<li>failure: <span>Conditions Object</span></li>
</ul>
</li>
<li>
costs
<ul>
<li>good_move</li>
<li>bad_move</li>
<li>filled_hole</li>
<li>
battery
<ul>
<li>bad_move</li>
<li>good_move</li>
<li>slide_tile</li>
</ul>
</li>
</ul>
</li>
<li>
probability
<ul>
<li>
holes_size: <span>RangeProb Object</span>
<ul>
<li>range: <span>Array of 2 integers</span></li>
<li>prob: <span>Array of float</span></li>
</ul>
</li>
<li>num_holes: <span>RangeProb Object</span></li>
<li>num_obstacles: <span>RangeProb Object</span></li>
<li>difficulty: <span>RangeProb Object</span></li>
<li>dynamism: <span>RangeProb Object</span></li>
<li>hostility: <span>RangeProb Object</span></li>
<li>
model_of_action
<ul>
<li>intended</li>
<li>left</li>
<li>right</li>
<li>backward</li>
<li>refuses</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="col-md-9 animate-only-show-3d-left margin-left-10" ng-show="isConstantsTab()">
<div class="row"><h4><b>Built-in Constants</b></h4></div>
<p>
<b>Note:</b> click on a constant name for details.
</p>
<dl class="dl-horizontal">
<dt ng-repeat-start="c in constants" class="width-214">
<code ng-click="setConstant(c.name)" class="cursor-pointer hover blue">
{{c.name}}
</code>
</dt>
<dd class="margin-left-214 margin-bot-10" ng-repeat-end>
<div>
<b>= </b><span class="text-orange">{{c.value}}</span>
</div>
<span ng-show="isConstant(c.name)" class="animate-show-3d-top">
<blockquote>
<small class="text-justify">{{c.desc}}</small>
</blockquote>
</span>
</dd>
</dl>
<div class="row" style="border-top: rgb(231, 224, 224) solid;"><h4><b>Built-in Variables</b></h4></div>
<br>
<dl class="dl-horizontal">
<dt ng-repeat-start="v in variables" class="width-214">
<code ng-click="setConstant(v.name)" class="cursor-pointer hover blue">
{{v.name}}
</code>
</dt>
<dd class="margin-left-214 margin-bot-10" ng-repeat-end>
<br>
<span ng-show="isConstant(v.name)" class="animate-show-3d-top">
<blockquote>
<small class="text-justify">{{v.desc}}</small>
</blockquote>
</span>
</dd>
</dl>
</div>
<div class="col-md-9 animate-only-show-3d-left margin-left-10" ng-show="isFunctionsTab()">
<div class="row"><h4><b>Built-in Functions</b></h4></div>
<p>
In addition to all <a href="http://www.w3schools.com/jsref/default.asp" target="_blank">standard JavaScript functions</a>, T-World also provides this set of built-in functions
to help you to develop your agent programs. <b>Note:</b> click on a function name for details.
</p>
<dl class="dl-horizontal">
<dt ng-repeat-start="f in functions" class="width-214">
<code ng-click="setFunction(f.name)" class="cursor-pointer hover blue">
{{f.name}}
</code>
</dt>
<dd class="margin-left-214 margin-bot-10" ng-repeat-end>
<div>
<b>(</b>
<span ng-repeat="p in f.params">
<span ng-if="!$first">, </span>
<span class="text-blue" tooltip="{{p.t.desc}}">{{p.t.name}}</span>
<span>{{p.i}}</span>
</span>
<b>)</b>
</div>
<span ng-show="isFunction(f.name)" class="animate-show-3d-top">
<blockquote>
<small class="text-justify">{{f.desc}}</small>
</blockquote>
</span>
</dd>
</dl>
</div>
</div>
</div>
<div class="modal-footer" ng-class="{'treadonly': $loading}">
<button class="btn btn-default" ng-click="close()">Close</button>
</div>