-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanual.html
691 lines (682 loc) · 71.4 KB
/
manual.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
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (1.8.0_91) on Sun Apr 02 17:16:02 CEST 2017 -->
<style type="text/css">
body {
background-color:#ffffff;
color:#353833;
font-family:'DejaVu Sans', Arial, Helvetica, sans-serif;
font-size:14px;
margin:0;
}
a:link, a:visited {
text-decoration:none;
color:#4A6782;
}
a:hover, a:focus {
text-decoration:none;
color:#bb7a2a;
}
a:active {
text-decoration:none;
color:#4A6782;
}
a[name] {
color:#353833;
}
a[name]:hover {
text-decoration:none;
color:#353833;
}
pre {
font-family:'DejaVu Sans Mono', monospace;
font-size:14px;
}
h1 {
font-size:20px;
}
h2 {
font-size:18px;
}
h3 {
font-size:16px;
font-style:italic;
}
h4 {
font-size:13px;
}
h5 {
font-size:12px;
}
h6 {
font-size:11px;
}
ul {
list-style-type:disc;
}
code, tt {
font-family:'DejaVu Sans Mono', monospace;
font-size:14px;
padding-top:4px;
margin-top:8px;
line-height:1.4em;
}
dt code {
font-family:'DejaVu Sans Mono', monospace;
font-size:14px;
padding-top:4px;
}
table tr td dt code {
font-family:'DejaVu Sans Mono', monospace;
font-size:14px;
vertical-align:top;
padding-top:4px;
}
sup {
font-size:8px;
}
/*
Document title and Copyright styles
*/
.clear {
clear:both;
height:0px;
overflow:hidden;
}
.aboutLanguage {
float:right;
padding:0px 21px;
font-size:11px;
z-index:200;
margin-top:-9px;
}
.legalCopy {
margin-left:.5em;
}
.bar a, .bar a:link, .bar a:visited, .bar a:active {
color:#FFFFFF;
text-decoration:none;
}
.bar a:hover, .bar a:focus {
color:#bb7a2a;
}
.tab {
background-color:#0066FF;
color:#ffffff;
padding:8px;
width:5em;
font-weight:bold;
}
/*
Navigation bar styles
*/
.bar {
background-color:#4D7A97;
color:#FFFFFF;
padding:.8em .5em .4em .8em;
height:auto;/*height:1.8em;*/
font-size:11px;
margin:0;
}
.topNav {
background-color:#4D7A97;
color:#FFFFFF;
float:left;
padding:0;
width:100%;
clear:right;
height:2.8em;
padding-top:10px;
overflow:hidden;
font-size:12px;
}
.bottomNav {
margin-top:10px;
background-color:#4D7A97;
color:#FFFFFF;
float:left;
padding:0;
width:100%;
clear:right;
height:2.8em;
padding-top:10px;
overflow:hidden;
font-size:12px;
}
.subNav {
background-color:#dee3e9;
float:left;
width:100%;
overflow:hidden;
font-size:12px;
}
.subNav div {
clear:left;
float:left;
padding:0 0 5px 6px;
text-transform:uppercase;
}
ul.navList, ul.subNavList {
float:left;
margin:0 25px 0 0;
padding:0;
}
ul.navList li{
list-style:none;
float:left;
padding: 5px 6px;
text-transform:uppercase;
}
ul.subNavList li{
list-style:none;
float:left;
}
.topNav a:link, .topNav a:active, .topNav a:visited, .bottomNav a:link, .bottomNav a:active, .bottomNav a:visited {
color:#FFFFFF;
text-decoration:none;
text-transform:uppercase;
}
.topNav a:hover, .bottomNav a:hover {
text-decoration:none;
color:#bb7a2a;
text-transform:uppercase;
}
.navBarCell1Rev {
background-color:#F8981D;
color:#253441;
margin: auto 5px;
}
.skipNav {
position:absolute;
top:auto;
left:-9999px;
overflow:hidden;
}
/*
Page header and footer styles
*/
.header, .footer {
clear:both;
margin:0 20px;
padding:5px 0 0 0;
}
.indexHeader {
margin:10px;
position:relative;
}
.indexHeader span{
margin-right:15px;
}
.indexHeader h1 {
font-size:13px;
}
.title {
color:#2c4557;
margin:10px 0;
}
.subTitle {
margin:5px 0 0 0;
}
.header ul {
margin:0 0 15px 0;
padding:0;
}
.footer ul {
margin:20px 0 5px 0;
}
.header ul li, .footer ul li {
list-style:none;
font-size:13px;
}
/*
Heading styles
*/
div.details ul.blockList ul.blockList ul.blockList li.blockList h4, div.details ul.blockList ul.blockList ul.blockListLast li.blockList h4 {
background-color:#dee3e9;
border:1px solid #d0d9e0;
margin:0 0 6px -8px;
padding:7px 5px;
}
ul.blockList ul.blockList ul.blockList li.blockList h3 {
background-color:#dee3e9;
border:1px solid #d0d9e0;
margin:0 0 6px -8px;
padding:7px 5px;
}
ul.blockList ul.blockList li.blockList h3 {
padding:0;
margin:15px 0;
}
ul.blockList li.blockList h2 {
padding:0px 0 20px 0;
}
/*
Page layout container styles
*/
.contentContainer, .sourceContainer, .classUseContainer, .serializedFormContainer, .constantValuesContainer {
clear:both;
padding:10px 20px;
position:relative;
}
.indexContainer {
margin:10px;
position:relative;
font-size:12px;
}
.indexContainer h2 {
font-size:13px;
padding:0 0 3px 0;
}
.indexContainer ul {
margin:0;
padding:0;
}
.indexContainer ul li {
list-style:none;
padding-top:2px;
}
.contentContainer .description dl dt, .contentContainer .details dl dt, .serializedFormContainer dl dt {
font-size:12px;
font-weight:bold;
margin:10px 0 0 0;
color:#4E4E4E;
}
.contentContainer .description dl dd, .contentContainer .details dl dd, .serializedFormContainer dl dd {
margin:5px 0 10px 0px;
font-size:14px;
font-family:'DejaVu Sans Mono',monospace;
}
.serializedFormContainer dl.nameValue dt {
margin-left:1px;
font-size:1.1em;
display:inline;
font-weight:bold;
}
.serializedFormContainer dl.nameValue dd {
margin:0 0 0 1px;
font-size:1.1em;
display:inline;
}
/*
List styles
*/
ul.horizontal li {
display:inline;
font-size:0.9em;
}
ul.inheritance {
margin:0;
padding:0;
}
ul.inheritance li {
display:inline;
list-style:none;
}
ul.inheritance li ul.inheritance {
margin-left:15px;
padding-left:15px;
padding-top:1px;
}
ul.blockList, ul.blockListLast {
margin:10px 0 10px 0;
padding:0;
}
ul.blockList li.blockList, ul.blockListLast li.blockList {
list-style:none;
margin-bottom:15px;
line-height:1.4;
}
ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
padding:0px 20px 5px 10px;
border:1px solid #ededed;
background-color:#f8f8f8;
}
ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
padding:0 0 5px 8px;
background-color:#ffffff;
border:none;
}
ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
margin-left:0;
padding-left:0;
padding-bottom:15px;
border:none;
}
ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
list-style:none;
border-bottom:none;
padding-bottom:0;
}
table tr td dl, table tr td dl dt, table tr td dl dd {
margin-top:0;
margin-bottom:1px;
}
/*
Table styles
*/
.overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary {
width:100%;
border-left:1px solid #EEE;
border-right:1px solid #EEE;
border-bottom:1px solid #EEE;
}
.overviewSummary, .memberSummary {
padding:0px;
}
.overviewSummary caption, .memberSummary caption, .typeSummary caption,
.useSummary caption, .constantsSummary caption, .deprecatedSummary caption {
position:relative;
text-align:left;
background-repeat:no-repeat;
color:#253441;
font-weight:bold;
clear:none;
overflow:hidden;
padding:0px;
padding-top:10px;
padding-left:1px;
margin:0px;
white-space:pre;
}
.overviewSummary caption a:link, .memberSummary caption a:link, .typeSummary caption a:link,
.useSummary caption a:link, .constantsSummary caption a:link, .deprecatedSummary caption a:link,
.overviewSummary caption a:hover, .memberSummary caption a:hover, .typeSummary caption a:hover,
.useSummary caption a:hover, .constantsSummary caption a:hover, .deprecatedSummary caption a:hover,
.overviewSummary caption a:active, .memberSummary caption a:active, .typeSummary caption a:active,
.useSummary caption a:active, .constantsSummary caption a:active, .deprecatedSummary caption a:active,
.overviewSummary caption a:visited, .memberSummary caption a:visited, .typeSummary caption a:visited,
.useSummary caption a:visited, .constantsSummary caption a:visited, .deprecatedSummary caption a:visited {
color:#FFFFFF;
}
.overviewSummary caption span, .memberSummary caption span, .typeSummary caption span,
.useSummary caption span, .constantsSummary caption span, .deprecatedSummary caption span {
white-space:nowrap;
padding-top:5px;
padding-left:12px;
padding-right:12px;
padding-bottom:7px;
display:inline-block;
float:left;
background-color:#F8981D;
border: none;
height:16px;
}
.memberSummary caption span.activeTableTab span {
white-space:nowrap;
padding-top:5px;
padding-left:12px;
padding-right:12px;
margin-right:3px;
display:inline-block;
float:left;
background-color:#F8981D;
height:16px;
}
.memberSummary caption span.tableTab span {
white-space:nowrap;
padding-top:5px;
padding-left:12px;
padding-right:12px;
margin-right:3px;
display:inline-block;
float:left;
background-color:#4D7A97;
height:16px;
}
.memberSummary caption span.tableTab, .memberSummary caption span.activeTableTab {
padding-top:0px;
padding-left:0px;
padding-right:0px;
background-image:none;
float:none;
display:inline;
}
.overviewSummary .tabEnd, .memberSummary .tabEnd, .typeSummary .tabEnd,
.useSummary .tabEnd, .constantsSummary .tabEnd, .deprecatedSummary .tabEnd {
display:none;
width:5px;
position:relative;
float:left;
background-color:#F8981D;
}
.memberSummary .activeTableTab .tabEnd {
display:none;
width:5px;
margin-right:3px;
position:relative;
float:left;
background-color:#F8981D;
}
.memberSummary .tableTab .tabEnd {
display:none;
width:5px;
margin-right:3px;
position:relative;
background-color:#4D7A97;
float:left;
}
.overviewSummary td, .memberSummary td, .typeSummary td,
.useSummary td, .constantsSummary td, .deprecatedSummary td {
text-align:left;
padding:0px 0px 12px 10px;
}
th.colOne, th.colFirst, th.colLast, .useSummary th, .constantsSummary th,
td.colOne, td.colFirst, td.colLast, .useSummary td, .constantsSummary td{
vertical-align:top;
padding-right:0px;
padding-top:8px;
padding-bottom:3px;
}
th.colFirst, th.colLast, th.colOne, .constantsSummary th {
background:#dee3e9;
text-align:left;
padding:8px 3px 3px 7px;
}
td.colFirst, th.colFirst {
white-space:nowrap;
font-size:13px;
}
td.colLast, th.colLast {
font-size:13px;
}
td.colOne, th.colOne {
font-size:13px;
}
.overviewSummary td.colFirst, .overviewSummary th.colFirst,
.useSummary td.colFirst, .useSummary th.colFirst,
.overviewSummary td.colOne, .overviewSummary th.colOne,
.memberSummary td.colFirst, .memberSummary th.colFirst,
.memberSummary td.colOne, .memberSummary th.colOne,
.typeSummary td.colFirst{
width:25%;
vertical-align:top;
}
td.colOne a:link, td.colOne a:active, td.colOne a:visited, td.colOne a:hover, td.colFirst a:link, td.colFirst a:active, td.colFirst a:visited, td.colFirst a:hover, td.colLast a:link, td.colLast a:active, td.colLast a:visited, td.colLast a:hover, .constantValuesContainer td a:link, .constantValuesContainer td a:active, .constantValuesContainer td a:visited, .constantValuesContainer td a:hover {
font-weight:bold;
}
.tableSubHeadingColor {
background-color:#EEEEFF;
}
.altColor {
background-color:#FFFFFF;
}
.rowColor {
background-color:#EEEEEF;
}
/*
Content styles
*/
.description pre {
margin-top:0;
}
.deprecatedContent {
margin:0;
padding:10px 0;
}
.docSummary {
padding:0;
}
ul.blockList ul.blockList ul.blockList li.blockList h3 {
font-style:normal;
}
div.block {
font-size:14px;
font-family:'DejaVu Serif', Georgia, "Times New Roman", Times, serif;
}
td.colLast div {
padding-top:0px;
}
td.colLast a {
padding-bottom:3px;
}
/*
Formatting effect styles
*/
.sourceLineNo {
color:green;
padding:0 30px 0 0;
}
h1.hidden {
visibility:hidden;
overflow:hidden;
font-size:10px;
}
.block {
display:block;
margin:3px 10px 2px 0px;
color:#474747;
}
.deprecatedLabel, .descfrmTypeLabel, .memberNameLabel, .memberNameLink,
.overrideSpecifyLabel, .packageHierarchyLabel, .paramLabel, .returnLabel,
.seeLabel, .simpleTagLabel, .throwsLabel, .typeNameLabel, .typeNameLink {
font-weight:bold;
}
.deprecationComment, .emphasizedPhrase, .interfaceName {
font-style:italic;
}
div.block div.block span.deprecationComment, div.block div.block span.emphasizedPhrase,
div.block div.block span.interfaceName {
font-style:normal;
}
div.contentContainer ul.blockList li.blockList h2{
padding-bottom:0px;
}
</style>
<title>Overview</title>
<meta name="date" content="2017-04-02">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
<script type="text/javascript" src="script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Overview";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li class="navBarCell1Rev">Overview</li>
<li>Package</li>
<li>Class</li>
<li><a href="doc/overview-tree.html">Tree</a></li>
<li><a href="doc/deprecated-list.html">Deprecated</a></li>
<li><a href="doc/index-all.html">Index</a></li>
<li><a href="doc/help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="doc/index.html?overview-summary.html" target="_top">Frames</a></li>
<li><a href="doc/overview-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="doc/allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div>
<span><div style="margin-left:40px;"><span style="font-size: 19px;"><span style="color: rgb(0, 0, 0); font-family: arial, helvetica, verdana, tahoma; font-style: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(250, 250, 250); float: none; display: inline !important;"><b> </b></span></span></div><div style="margin-left:40px;"><span style="font-size: 19px;"><span style="color: rgb(0, 0, 0); font-family: arial, helvetica, verdana, tahoma; font-style: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(250, 250, 250); float: none; display: inline !important;"><b> </b></span></span></div><div style="margin-left:40px;"><b><span style="font-size: 19px;"><span style="font-family: arial, helvetica, verdana, tahoma;"><span style="background-color: rgb(250, 250, 250);"><br/></span></span></span></b></div><div style="margin-left:40px;"><span style="font-size: 19px;"><span style="color: rgb(0, 0, 0); font-family: arial, helvetica, verdana, tahoma; font-style: normal; font-weight: normal; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(250, 250, 250); float: none; display: inline !important;"><b><br><br><br><br> The DEECo Playground Framework</b></span></span></div><div style="margin-left:40px;"><span style="font-size: 19px;"><b><span style="font-family: arial, helvetica, verdana, tahoma;"><span style="background-color: rgb(250, 250, 250);"> A User Manual</span></span></b></span></div><div style="margin-left:40px;"><b><br/></b></div><div style="margin-left:80px;">This document contains a user manual for the DEECo Playground framework. It describes the formats of scenario and configuration XML files in detail. It also provides information on the default fields and methods of the classes, which serve as base classes for entities that can be added to a scenario.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">This file contains hyperlinks to the different classes of the application. These links will work only if the javadoc documentation for this project was generated. You can generate javadoc by executing <span style="font-family: 'Courier New';">ant doc</span> command (if you have Apache Ant installed).</div><div style="margin-left:40px;"><b><br/></b></div><div style="margin-left:40px;"><span style="font-size: 15px;"><b> Contents:</b></span></div><div style="margin-left:40px;"><br/></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>1. How to write a scenario</b></span></div><div style="margin-left:120px;"><span style="font-size: 15px;"><b>1.1. Structure of a scenario file</b></span></div><div style="margin-left:120px;"><span style="font-size: 15px;"><b>1.2. Programming objects</b></span></div><div style="margin-left:120px;"><span style="font-size: 15px;"><b>1.3. Programming robots</b></span></div><div style="margin-left:120px;"><span style="font-size: 15px;"><b>1.4. Programming wheels</b></span></div><div style="margin-left:120px;"><span style="font-size: 15px;"><b>1.5. Programming sensors</b></span></div><div style="margin-left:120px;"><span style="font-size: 15px;"><b>1.6. Programming Ensembles</b></span></div><div style="margin-left:120px;"><span style="font-size: 15px;"><b>1.7. Other features</b></span></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>2. </b><b>How to create a visualization configuration</b></span></div><div style="margin-left:120px;"><span style="font-size: 15px;"><b>2.1. Standard configuration</b></span></div><div style="margin-left:120px;"><span style="font-size: 15px;"><b>2.2. Modifying configuration</b></span></div><div style="margin-left:120px;"><span style="font-size: 15px;"><b>2.3. Additional layers</b></span></div><div style="margin-left:80px;"><b><br/></b></div><div style="margin-left:40px;"><b><br/></b></div><div style="margin-left:40px;"><b> </b></div><div style="margin-left:40px;"><b> <span style="font-size: 15px;">1. How to write a scenario</span></b></div><div style="margin-left:40px;"><span style="font-size: 15px;"><br/></span></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>1.1. Structure of a scenario file</b></span></div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">A scenario has to be described in an XML file that has to have the following structure:</div><div style="margin-left:160px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:120px;"><div><simulation cycles="100" logfile="filename" sizeX="100" sizeY="100" bitmap="bitmapfile" processingTime="1"></div><div> <sensors></div><div> <!-- list of sensors--></div><div> </sensors></div><div> <robots></div><div> <!-- list of robots--></div><div> </robots></div><div> <ensembles></div><div> <!-- list of ensembles--></div><div> </ensembles></div><div> <objects></div><div> <!-- list of objects--></div><div> </objects></div><div></simulation></div></div></div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">This structure is formally described in XML Schema file at <span style="font-family: 'Courier New';">src/resources/Simulation.xsd</span>. Each section (<span style="font-family: 'Courier New';">sensors, robots, ensembles, objects</span>) can be present (in any order) or absent depending on which entities user wants to add to simulation. </div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Root node <span style="font-family: 'Courier New';">simulation</span> must have attributes <span style="font-family: 'Courier New';">cycles</span>, <span style="font-family: 'Courier New';">logfile</span>, and either attribute <span style="font-family: 'Courier New';">bitmap </span>or both attributes <span style="font-family: 'Courier New';">sizeX</span> and <span style="font-family: 'Courier New';">sizeY</span>. Those attributes have the following meaning:</div><ul><li style="display:inline;list-style:none;"><ul><li style="display:inline;list-style:none;"><ul><li><span style="font-family: 'Courier New';">cycles</span> is an integer that represents a number of cycles that have to be simulated. Simulation stops after this number of cycles (you can stop it earlier, see section <b>2.7</b>)</li><li><span style="font-family: 'Courier New';">logfile</span> is a relative or absolute path to a file where simulation logs will be written. After simulation is done, you can supply this file to visualization part of the program.</li><li><span style="font-family: 'Courier New';">bitmap</span> is a relative or absolute path to an image (in JPG, PNG or BMP file format) that shows positions of obstacles on the map. If this attribute is present, attributes <span style="font-family: 'Courier New';">sizeX</span> and <span style="font-family: 'Courier New';">sizeY</span> are ignored and size of the map is determined by size of the image in pixels. Bitmap is interpreted in such a way that only fully black pixels (<font face="Courier New">0,0,0 </font>in RGB) are recognized as obstacles on map and all other pixels are ignored.</li><li><span style="font-family: 'Courier New';">sizeX</span> and <span style="font-family: 'Courier New';">sizeY</span> are integers that determine width and height of the field in case when bitmap is not specified. In that case, map of the environment is empty rectangle without any physical obstacles.</li><li><span style="font-family: 'Courier New';">processingTime</span> is an integer that stands for the length of WAITING phase of simulation cycle (see section <b>3</b>). This attribute is optional, default value is 1.</li></ul></li></ul></li></ul><div style="margin-left:80px;"><b><br/></b></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>1.2. Programming objects</b></span></div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Objects in simulation are non-physical DEECo components that extend class <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/DEECoObject.html">DEECoObject</a>. Instances of this class have the following attributes:</div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div>public Coordinates position;</div><div>public String tag;</div><div>public Double size;</div><div>public final Integer oID;</div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">where <span style="font-family: 'Courier New';">position</span> stands for actual coordinates of the object in the environment, <span style="font-family: 'Courier New';">size</span> for its radius (note that by default in visualization objects have square shape, not circular, but user can change that in his configuration file, see section <b>4.2</b>), and <span style="font-family: 'Courier New';">tag</span> for a string attached to the object. All those values are set in scenario file and can be changed by the object in any of its processes or by knowledge exchange in any ensemble. Each cycle of the simulation, those values are written to the simulation logs. The last attribute, <span style="font-family: 'Courier New';">oID</span>, is a unique identifier of the object and must not be changed in order to preserve integrity of the simulation (note, that even though this attribute is marked as final, in JDEECo it still can be changed by any process or knowledge exchange).</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">In scenario file, each object is represented by a following node:</div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="box-sizing: border-box; padding: 8px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); margin-left: 40px;"><div><span style="font-size: 12px;"><span style="font-family: Monaco, Menlo, Consolas, 'Courier New', monospace;"><span style="color: rgb(51, 51, 51);"><object class="com.package.ObjectClass" posX="10.0" posY="10.0" size="10.0" tag="XYZ" arg="ZYX"/></span></span></span></div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">Where:</div><ul><li style="display:inline;list-style:none;"><ul><li style="display:inline;list-style:none;"><ul><li><span style="font-family: 'Courier New';">class</span> is fully qualified name of object's class. Before running the simulation all classes that will be used should be placed in <span style="font-family: 'Courier New';">src/java</span> directory.</li><li><span style="font-family: 'Courier New';">posX</span> and <span style="font-family: 'Courier New';">posY</span> are double values that represent initial coordinates of the object.</li><li><span style="font-family: 'Courier New';">size</span> is a double value that represents initial radius of the object.</li><li><span style="font-family: 'Courier New';">tag</span> is an initial tag of the object.</li><li><span style="font-family: 'Courier New';">arg</span> is a custom string argument that will be passed to the object during its initialization. User can define how this argument is processed by overriding <span style="font-family: 'Courier New';">processArg(String arg) </span>method.</li></ul></li></ul></li></ul><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Attributes <span style="font-family: 'Courier New';">tag</span> and <span style="font-family: 'Courier New';">arg</span> are optional, all other attributes are required.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Class <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/DEECoObject.html">DEECoObject</a> contains two methods that can be overriden: </div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, 'Courier New', monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902);margin-left:40px;"><div>setParameters(Double x, Double y, String tag, Double size)</div><div>processArg(String arg)</div></div></div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Those methods define how parameters and argument will be interpreted.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Thus, in order to add an object component to simulation, you have to:</div><ol><li style="display:inline;list-style:none;"><ol><li style="display:inline;list-style:none;"><ol><li>Write your own object class. It has to be a valid DEECo Component (have @Component annotation) and to extend <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/DEECoObject.html">DEECoObject</a> class.</li><li>Place this class to <span style="font-family: 'Courier New';">src/java</span> directory.</li><li>Add an object node to the list of objects in your scenario XML file.</li></ol></li></ol></li></ol><div style="margin-left:80px;"><b><br/></b></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>1.3. Programming robots</b></span></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">Robots are "physical" DEECo components that extend class <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/DEECoRobot.html">DEECoRobot</a>. Instances of this class have the following attributes:</div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div>public final Integer rID;</div><div>public SensorySystem sensor;</div><div>public Wheels wheels;</div><div>public String tag;</div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">Where:</div><ul><li style="display:inline;list-style:none;"><ul><li style="display:inline;list-style:none;"><ul><li><span style="font-family: 'Courier New';">rID</span> is a unique identifier of the robot and must not be changed in order to preserve integrity of the simulation (note, that even though this attribute is marked as final, in JDEECo it still can be changed by any process or knowledge exchange).</li><li><span style="font-family: 'Courier New';">sensor</span> is an object that provides access to all the sensors that are present on the robot. Initially contains only collision sensor, additional sensors should be registered in robot's code (usually in constructor). Details on how to add new sensors are descrribed in section <b>2.5</b>.</li><li><span style="font-family: 'Courier New';">wheels</span> is an object that represents robot's actuators. You can write your own implementation of the <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/Wheels.html">Wheels</a> interface for your robots or use one of the existing implementations. Details on programming wheels are described in the next section.</li><li><span style="font-family: 'Courier New';">tag</span> is a string attached to the robot. This value can be changed by the robot in any of its processes or by knowledge exchange in any ensemble.</li></ul></li></ul></li></ul><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">In scenario file, each robot is represented by a following node:</div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div><robot class="com.package.RobotClass" posX="10.0" posY="10.0" angle="90.0" size="4.5" tag="XYZ" arg="ZYX"/></div></div></div><div style="margin-left:40px;"><br/></div><div style="margin-left:80px;">where:</div><ul><li style="display:inline;list-style:none;"><ul><li style="display:inline;list-style:none;"><ul><li><span style="font-family: 'Courier New';">class</span> is fully qualified name of the robot's class. Before running the simulation all classes that will be used should be placed in <span style="font-family: 'Courier New';">src/java</span> directory. This attribute is required.</li><li><span style="font-family: 'Courier New';">posX</span> and <span style="font-family: 'Courier New';">posY</span> are double values that represent initial coordinates of the robot. Those attributes are required. Note, that initial positions of robots shold not contain collisions (neither with each other nor with obstacles on the map). If you will place your robots too close to each other so that their bodies will intersect, you won't be able to start a simulation.</li><li><span style="font-family: 'Courier New';">angle</span> is a rotation angle of the robot on the map relative to the north. It has to be a double value in degrees. This attribute is required.</li><li><span style="font-family: 'Courier New';">size</span> is a double value that represents initial radius of the robot. It cannot be less then <span style="font-family: 'Courier New';">1.0</span>. This attribute is optional, default value is <span style="font-family: 'Courier New';">3.0</span>.</li><li><span style="font-family: 'Courier New';">tag</span> is an initial tag of the robot. This attribute is optional, default value is empty string.</li><li><span style="font-family: 'Courier New';">arg</span> is a custom string argument that will be passed to the robot during its initialization. User can define how this argument is processed by overriding <span style="font-family: 'Courier New';">processArg(String arg)</span> method. This attribute is optional, default value is empty string.</li></ul></li></ul></li></ul><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Class <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/DEECoRobot.html">DEECoRobot</a> contains two methods that can be overriden: </div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div>setParameters(String tag)</div><div>processArg(String arg)</div></div></div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Those methods define how parameters and argument will be interpreted. In most cases, you probably will not need to override the first method, since its function is only to set a tag on the robot. However, the second method does not do anything by default, so if you want your robot to change itself based on argument that you have provided to it before initialization, you will need to override that method. For example, if you want to have different sensors on two robots of a similar type, you can pass names of those sensors to them in <span style="font-family: 'Courier New';">arg</span> attributes of their corresponding nodes and override method <span style="font-family: 'Courier New';">processArg()</span> to register those sensors.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">As you can see, robot itself does not have any information about its own position on the map, and it can't change its position directly. All the information it receives comes either from sensors or from knowledge exchange with other components. And to move through environment, robot has to use its <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/Wheels.html">Wheels</a> to send actions. You can extend both of those parts yourself: by writing your own implementation of Wheels interface and by adding your own sensors. By default, a robot has only a single sensor that receives information about collisions with other objects, but if you need a robot to know its position, you can add a sensor that receives it, see <a href="file:///doc/cz/cuni/mff/d3s/deeco/playground/examples/predator/CoordinatesProcessor.html"><span style="color: rgb(0, 0, 0);">C</span>oordinatesProcessor</a>.</div><div style="margin-left:40px;"><br/></div><div style="margin-left:80px;">Thus, in order to add a robot component to the scenario, you have to:</div><ol><li style="display:inline;list-style:none;"><ol><li style="display:inline;list-style:none;"><ol><li>Write your own robot class. It has to be a valid DEECo Component (have @Component annotation) and to extend <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/DEECoRobot.html">DEECoRobot</a> class. </li><li>You may need to write your own implementation of the <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/Wheels.html">Wheels</a> interface (see next section). Or you can use e.g. <a href="file://doc/cz/cuni/mff/d3s/deeco/playground/examples/basic/SimpleWheels.html">SimpleWheels</a> class.</li><li>Place the robot class into <span style="font-family: 'Courier New';">src/java</span> directory.</li><li>Add a robot node to the list of robots in your scenario XML file.</li></ol></li></ol></li></ol><div style="margin-left:40px;"><br/></div><div style="margin-left:40px;"><br/></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>1.4. Programming wheels</b></span></div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;"><a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/Wheels.html">Wheels</a> is an interface with two methods:</div><div style="margin-left:80px;"><br/></div><div style="box-sizing: border-box; padding: 8px; border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902);margin-left:80px;"><div><span style="font-family: 'Courier New';">Action sendCurrentAction(int cycle);</span></div><div><span style="font-family: 'Courier New';">void setAction(double speed, double angle);</span></div></div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">First method is called by the environment in each cycle of the simulation on each robot to get an <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/Action.html">Action</a> object from that robot. This object represents an actual action that this robot wants to perform in this cycle. Basic action consists of two parameters: speed and rotation angle. Speed can have values from 0.0 to 1.0, it represents a distance this robot will move in this cycle (in the same units as sizes of robots and size of the field) if it will not hit an obstacle. Rotation angle represents an angle this robot will rotate in this cycle before moving (in radians). Based on presence or absence of one or both of these parameters, Action can have the following types: STAY, MOVE, ROTATE, ROTATE_AND_MOVE. This type is determined automatically in Action's constructor.</div><div style="margin-left:80px;"> </div><div style="margin-left:80px;">You can implement wheels in such a way that they send not an Action object, but an instance of its subclass, carrying additional information. That additional information can then be used by your <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/SensoryInputsProcessor.html">SensoryInputProcessor</a>. This way, by extending Action class you can add additional actuators to your robot that will have an effect on the environment. You can find an example of this in Firefighters example scenario.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Method <span style="font-family: 'Courier New';">setAction()</span> can be used to set speed and rotation angle of robot in this cycle. Those two values represent a desired action, and can be supplied directly to Action's constructor. This method exists only for convenience, you can choose to set action in some other way. Unlike <span style="font-family: 'Courier New';">sendCurrentAction()</span>, this method is not used by application, only by your own code.</div><div style="margin-left:80px;"><b><br/></b></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>1.5. Programming sensors</b></span></div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Sensors have two parts: actual sensor on the robot, that receives data of a specific type in each cycle, and sensory input processor (SIP) that computes those inputs for each robot and sends them.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">By default, robot has only a single sensor, which collects information about collisions with other physical bodies (collision sensor). To add your own sensors you have to do the following:</div><div style="margin-left:40px;"><br/></div><div style="margin-left:80px;">1. Write your own subclass of <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/SensoryInputsProcessor.html">SensoryInputProcessor<T></a>. Generic parameter T is a type of input that this SIP sends to robots. In that class you have to write your own implementation of the following method:</div><div style="margin-left:40px;"><br/></div><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:80px;"><div>ArrayList<T> sendInputs(ArrayList<RobotPlacement> robots, ArrayList<ObjectPlacement> objects);</div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">In this method, SIP receives a list of robots and a list of objects that are present in simulation. You can access their parameters through methods defined on <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/RobotPlacement.html">RobotPlacement</a> and <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/ObjectPlacement.html">ObjectPlacement</a> classes. You can also access a map of the environment through <span style="font-family: 'Courier New';">environmentMap</span> field and methods defined on <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/EnvironmentMap.html">EnvironmentMap</a> class. Class RobotPlacement contains a reference to <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/Action.html">Action</a> object that represents an action that this robot performes in this cycle. If you use your own extension of Action class, you can cast this object to your class here to access its additional fields (you can see an example of this in the Firefighters scenario).</div><div style="margin-left:80px;">From this information, you can compute inputs for each robot and return a list of those inputs. Note, that size of this list must be equal to the size of robots list, and an input on i-th position in return list will be sent to i-th robot in robots list.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">2. Add the following node to the list of sensors of your scenario:</div><div style="margin-left:120px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div><sensor name="yoursensorname" processor="com.package.YourSensorName" arg="XYZ" /><br/></div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">Where:</div><ul><li style="display:inline;list-style:none;"><ul><li style="display:inline;list-style:none;"><ul><li><span style="font-family: 'Courier New';">processor</span> is fully qualified name of your sensor's class. Before running the simulation this class should be placed in <span style="font-family: 'Courier New';">src/java</span> directory.</li><li><span style="font-family: 'Courier New';">name</span> is a string that represents this sensor. This string should be unique for each sensor. The default collision sensor has name <span style="font-family: 'Courier New';">"collisions"</span> so you cannot add a sensor with that name.</li><li><span style="font-family: 'Courier New';">arg</span> is a custom string argument that will be passed to your SIP during its initialization. You can define how this argument is processed by overriding <span style="font-family: 'Courier New';">processArg(String arg)</span> method.</li></ul></li></ul></li></ul><div style="margin-left:40px;"><br/></div><div style="margin-left:80px;">3. Register this sensor on each robot that has to carry it using following command:</div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div>sensor.registerSensor("yoursensorname", YourInputType.class);</div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">The first argument of this call is a name that you have chosen for your sensor, the second one is a type of input that your SIP sends (its generic parameter T). The best practice is to register each sensor on each robot in robot's constructor or in the <span style="font-family: 'Courier New';">processArg</span> initialization method . This way, each type of robot in simulation will have those sensors that you will define for them. Robots can access their sensors through method <span style="font-family: 'Courier New';">getInputFromSensor()</span> on <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/SensorySystem.html">SensorySystem</a>:</div><div style="margin-left:120px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div>YourInputType input = sensor.getInputFromSensor("yoursensorname", YourInputType.class);</div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>1.6. Programming Ensembles</b></span></div><div style="margin-left:40px;"><br/></div><div style="margin-left:80px;">To add a DEECo ensemsble to the simulation you have to place its class to <span style="font-family: 'Courier New';">src/java</span> directory and add the following node to the list of ensembles:</div><div style="margin-left:120px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div><ensemble class="com.package.YourEnsemble"/><br/></div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">There are no any special requirements for ensembles, any robots and objects can be connected through them. </div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>1.7. Other features</b></span></div><div style="margin-left:80px;"><b><br/></b></div><div style="margin-left:80px;"><a href="file:doc/cz/cuni/mff/d3s/deeco/playground/simulation/Coordinator.html">Coordinator</a> has two special attributes that you can use in your ensembles:</div><div style="margin-left:120px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div>public Boolean endSignal;</div><div>public String status;</div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">The first attribute is a signal that means that simulation should stop. After you will set it to true, simulation will stop in the next cycle. The second attribute is a status string. It is written to simulation logs every cycle and is visualised at top center of the screen afterwards. You can use it however you want. For example, in Competition Demo, it is used to display current cycle and score.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Also, Coordinator contains another attribute, that you can use only as @In parameter in your knowledge exchange. It must not be changed.</div><div style="margin-left:120px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div>public Integer cycle = 0;</div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">This parameter shows the number of current cycle. All the other attributes of Coordinator should not be changed.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">JDEECo implementation does not enable any incapsulation, so all fields of Coordinator component can participate in any knowledge exchange. However, in order for simulation to stay consistent, you should not use any of those fields except for the ones described above.</div><div style="margin-left:40px;"><br/></div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><b> <span style="font-size: 15px;"> 2. How to create a visualization configuration</span></b></div><div style="margin-left:40px;"><span style="font-size: 15px;"><b><br/></b></span></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>2.1. Standard configuration</b></span></div><div style="margin-left:80px;"><b><br/></b></div><div style="margin-left:80px;">Visualization program receives simulation logs file as its parameter, and visualizes it on the screen. After the start of the visualization, a window appears on the screen where each cycle of simulation is being visualized consecutively. </div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Visualization consists of separate layers that are rendered sequentially. In standard configuration, there are 3 visualization layers: object layer, robot layer and map layer. Robot layer is rendered first, it draws each robot as a red circle. Map layer draws obstacles on map, by default they are black. Object layer is rendered last, it draws objects as yellow squares.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">The visualization process can be controlled with keyboard. The following commands are supported:</div><ul><li style="display:inline;list-style:none;"><ul><li style="display:inline;list-style:none;"><ul><li>Pause/resume (space bar).</li><li>Rewind/fast forward (left/right arrow keys).</li><li>Increase/decrease the speed of visualization (up/down arrow keys).</li><li>Restart visualization from the beginning (enter key).</li></ul></li></ul></li></ul><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>2.2. Modifying configuration</b></span></div><div style="margin-left:80px;"><b><br/></b></div><div style="margin-left:80px;">You can change default configuration by writing your own configuration XML file. This file should be valid against XML Schema at<span style="font-family: 'Courier New';"> src\resources\Visualization.xsd</span>. Cofiguration file describes visualization layers that have to be visualized on the screen. The basic structure of configuration file is the following:</div><div style="margin-left:120px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div><visualization zoom="5" maxCPS="10" fontColor="Green" rewindSpeed="10"></div><div> <!-- list of layers--></div><div></visualization></div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">Where:</div><ul><li style="display:inline;list-style:none;"><ul><li style="display:inline;list-style:none;"><ul><li><span style="font-family: 'Courier New';">zoom</span> is a positive integer that defines the size of the visualization window. Default value is 5, so if you are visualizing a scenario with a bitmap of 100*100 pixels, its size on the screen will be 500*500 pixels.</li><li><span style="font-family: 'Courier New';">maxCPS</span> is a positive integer that defines how many cycles of the simulation will be visualized per second. Note, that this is a maximum number, and if it will be too high, actual visualization will be slower due to hardware limitations. Default value is 15.</li><li><span style="font-family: 'Courier New';">fontColor</span> is a color in which status string will be displayed. Default is black.</li><li><span style="font-family: 'Courier New';">rewindSpeed</span> is the speed of the rewind/fast forward function. Default value is 10.</li></ul></li></ul></li></ul><div style="margin-left:40px;"><br/></div><div style="margin-left:80px;">Colors in configuration file can be specified in two ways. First way is by a keyword; there are 12 colors you can specify in this way, their keywords are: <b>transparent, white, gray, black, red, green, blue, yellow, cyan, magenta, orange, brown</b>. Keywords are case-insensitive. The other way is using RGB or RGBA format. In this format you represent color as a list of 3 (for RGB) or 4 (for RGBA) <u>float</u> values, separated by commas. So, any attribute that represents a color has to be either keyword or a list of 3-4 float values.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">List of layers contains a single element for each visualization layer, and those layers will be rendered in the same order as they are written in the list. Remember, that 3 layers are present in the visualization by default, and if you won't write them explicitly in your list, they will be added to the end of it (in default order, with default settings). </div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">There are 5 types of visualization layers that can be present in configuration file. Three of them were already mentioned in the section above, those are robot layer, object layer and map layer. Your configuration file cannot contain any of those layers more then once (and if you will omit any of those layers, it will still be visualized as described above). Other two types are background layers and additional layers; you can add as many of those layers to visualization as you want.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Map layer is represented with one of the following nodes:</div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div><map texture="path/texture.png"/></div><div><map color="black"/></div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">Where color attribute has a color type described above, and texture attribute is a relative or absolute path to an image file. Note that only one of those attributes can be present. </div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Robot layer is represented with one of the following nodes:</div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div><robots displayNumbers="false" displayTags="true" enableRotation="false" fontColor="Blue"></div><div> <class-based></div><div> <default texture="path/texture.png"/></div><div> <class name="package.Class1" texture="path/robot.png"/></div><div> <class name="package.Class2" color="1,0.5,1"/></div><div> </class-based></div><div></robots></div><div><br/></div><div><robots displayNumbers="false" displayTags="true" enableRotation="false" fontColor="Blue"></div><div> <tag-based></div><div> <default texture="path\robot.png"/></div><div> <tag name="tag1" texture="path\robot2.png"/></div><div> <tag name="tag2" color="white"/></div><div> </tag-based></div><div></robots></div><div><br/></div><div><robots displayNumbers="false" displayTags="true" enableRotation="false" fontColor="Blue"></div><div> <number-based></div><div> <default color="Green"/></div><div> <number number="0" texture="path\robot.png"/></div><div> <number number="2" color="blue"/></div><div> </number-based></div><div></robots></div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">Where:</div><ul><li style="display:inline;list-style:none;"><ul><li style="display:inline;list-style:none;"><ul><li>displayNumbers - displays a robot's number on each robot if true. Optional, default value is false. If displayTags is true, this attribute is ignored.</li><li>displayTags - displays a current robot's tag on each robot if true. Optional, default value is false.</li><li>enablbeRotation - if true, then robots' textures will be rotating according to robots' current directions. Optional, default value is false.</li><li>fontColor - Color in which robots' numbers or tags will be written. Optional, default value is black.</li></ul></li></ul></li></ul><div style="margin-left:40px;"><br/></div><div style="margin-left:80px;">If you won't add anything inside a robots element, then all robots will be visualized with default settings (red color). However, if you want to change settings, you have three options: class-based, tag-based and number-based visualization. In each of those options you can specify default coloring (color or texture), that will apply to all robots whose class/tag/number is not included (this element is optional). Ater default element follows a list of class/tag/number elements. Each element of this list has to contain a fully qualified name of robot's class for class-based option, a tag for tag-based option, and a number for number-based option. Also, each of those elements has to contain either color or texture attribute (with the same meaning as in map node). When robots are visualized, program first tries to find a specific coloring for its class/tag/number (depending on chosen option), and if it is not present, then robot is visualized with default coloring.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Since robots have circular shapes, their textures are automatically rounded.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Rules for defining object layer are almost the same as for robot layer, with only 3 differences:</div><ul><li style="display:inline;list-style:none;"><ul><li style="display:inline;list-style:none;"><ul><li>Main element is named <span style="font-family: 'Courier New';">objects</span> instead o<span style="font-family: 'Courier New';">f robots</span></li><li>Attribute <span style="font-family: 'Courier New';">enableRotation</span> is ignored (since objects have no direction)</li><li>There is an additional attribute <span style="font-family: 'Courier New';">circularShape</span>. It has a boolean value, and if it is set to true, then objects will be displayed as circles, instead of squares, and their textures will be rounded (in the same way as for robots).</li></ul></li></ul></li></ul><div style="margin-left:40px;"><br/></div><div style="margin-left:80px;">By default, objects are represented as yellow squares.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Background layer is represented with one of the following nodes:</div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div><background texture="path/texture.png"/></div><div><background color="white"/></div></div></div><div style="margin-left:80px;"><b><br/></b></div><div style="margin-left:80px;">In the first case, this layer will display a specified texture. It will be stretched to the size of the displayed field. In the second case, all displayed field will be filled with chosen color. You can have as much background layer as you want, though this may be useful only in case of partially-transparent textures.</div><div style="margin-left:80px;"><b><br/></b></div><div style="margin-left:80px;"><span style="font-size: 15px;"><b>2.3. Additional layers</b></span></div><div style="margin-left:80px;"><b><br/></b></div><div style="margin-left:80px;">In addition to 4 types of layers described above, you can write your own visualization layers. This option allows you to add any shapes, textures, labels or even animation to the visualization. You can find an example of using this feature in Firefighters Demo.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Each visualization layer has to extend abstract class <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/visualization/VisualizationLayer.html">VisualizationLayer</a>. There is a one metod in this class that you have to define:</div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div>protected abstract void render(int cycle);</div></div></div><div style="margin-left:120px;"><b><br/></b></div><div style="margin-left:80px;">This method is called in the visualization loop, it has to draw all the elements that belong to this layer. It receives a single parameter that stands for a number of a cycle that is being visualized at the moment. To draw different elements, each <a href="file:doc/cz/cuni/mff/d3s/deeco/playground/visualization/VisualizationLayer.html">VisualizationLayer</a> contains following fields and methods:</div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div>protected ShapeRenderer shapeRenderer;</div><div>protected SpriteBatch spriteBatch;</div><div>protected BitmapFont font;</div><div><br/></div><div>protected void drawText(String text, float centerX, float centerY);</div><div>protected final Sprite loadTexture(String path)</div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">ShapeRenderer allows you to draw shapes on screen, SpriteBatch allows to draw textures. You can learn how to use them in libGDX tutorials.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">Method <span style="font-family: 'Courier New';">drawText()</span> allows you to display any string on the screen. The center of this string will be placed at (centerX, centerY)-coordinate (in pixels). If you want to change color and size of displayed text, use methods <span style="font-family: 'Courier New';">font.setColor(Color color)</span> and <span style="font-family: 'Courier New';">font.getData().setScale(float scale)</span> before calling <span style="font-family: 'Courier New';">drawText()</span>.</div><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;">If you want to add your own visualization layer to the visualization, you have to specify this in your configuration file. You can add as many additional layers as you want. Additional layer is represented by a following node:</div><div style="margin-left:80px;"><br/></div><div style="margin-left:40px;"><div style="-en-codeblock: true; box-sizing: border-box; padding: 8px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; font-size: 12px; color: rgb(51, 51, 51); border-top-left-radius: 4px; border-top-right-radius: 4px; border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; background-color: rgb(251, 250, 248); border: 1px solid rgba(0, 0, 0, 0.14902); background-position: initial initial; background-repeat: initial initial;margin-left:40px;"><div><additional class="cz.cuni.mff.d3s.deeco.playground.examples.firefighters.environment.TemperatureLayer" arg="simulation-logs/firemap.bin"/></div></div></div><div style="margin-left:120px;"><br/></div><div style="margin-left:80px;">Where:</div><ul><li style="display:inline;list-style:none;"><ul><li style="display:inline;list-style:none;"><ul><li><span style="font-family: 'Courier New';">class</span> is a fully qualified name of layer's class. Before running the visualization all classes that will be used should be placed in <span style="font-family: 'Courier New';">src/java</span> directory. This attribute is required.</li><li><span style="font-family: 'Courier New';">arg</span> is a string argument that will be passed to this layer during its initialization. You can define how this argument is interpreted by overriding <span style="font-family: 'Courier New';">processArg()</span> method. This attribute is optional.</li></ul></li></ul></li></ul><div style="margin-left:80px;"><br/></div><div style="margin-left:80px;"><br/></div></span>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li class="navBarCell1Rev">Overview</li>
<li>Package</li>
<li>Class</li>
<li><a href="doc/overview-tree.html">Tree</a></li>
<li><a href="doc/deprecated-list.html">Deprecated</a></li>
<li><a href="doc/index-all.html">Index</a></li>
<li><a href="doc/help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev</li>
<li>Next</li>
</ul>
<ul class="navList">
<li><a href="doc/index.html?overview-summary.html" target="_top">Frames</a></li>
<li><a href="doc/overview-summary.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="doc/allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>