-
Notifications
You must be signed in to change notification settings - Fork 0
/
example8.html
1242 lines (1131 loc) · 78.2 KB
/
example8.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
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>example8 module — PyMoSim v0.8 Manual</title>
<link href="_static/css/theme.css" rel="stylesheet" />
<link href="_static/css/index.c5995385ac14fb8791e8eb36b4908be2.css" rel="stylesheet" />
<link rel="stylesheet"
href="_static/vendor/fontawesome/5.13.0/css/all.min.css">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="stylesheet" href="_static/basic.css" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/graphviz.css" />
<link rel="preload" as="script" href="_static/js/index.1c5a1a01449ed65a7b51.js">
<script id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.7/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="docsearch:language" content="en" />
</head>
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="80">
<div class="container-fluid" id="banner"></div>
<nav class="navbar navbar-light navbar-expand-lg bg-light fixed-top bd-navbar" id="navbar-main"><div class="container-xl">
<div id="navbar-start">
<a class="navbar-brand" href="index.html">
<img src="_static/icon.png" class="logo" alt="logo">
</a>
</div>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbar-collapsible" aria-controls="navbar-collapsible" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div id="navbar-collapsible" class="col-lg-9 collapse navbar-collapse">
<div id="navbar-center" class="mr-auto">
<div class="navbar-center-item">
<ul id="navbar-main-elements" class="navbar-nav">
<li class="toctree-l1 nav-item">
<a class="reference internal nav-link" href="comm.html">
comm package
</a>
</li>
<li class="toctree-l1 nav-item">
<a class="reference internal nav-link" href="node.html">
node package
</a>
</li>
<li class="toctree-l1 nav-item">
<a class="reference internal nav-link" href="sim.html">
sim package
</a>
</li>
<li class="toctree-l1 nav-item">
<a class="reference internal nav-link" href="map.html">
map package
</a>
</li>
</ul>
</div>
</div>
<div id="navbar-end">
<div class="navbar-end-item">
<form class="bd-search d-flex align-items-center" action="search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form>
</div>
<div class="navbar-end-item">
<ul id="navbar-icon-links" class="navbar-nav" aria-label="Icon Links">
<li class="nav-item">
<a class="nav-link" href="https://github.com/cfoh/pymosim" rel="noopener" target="_blank" title="GitHub">
<span><i class="fab fa-github-square"></i></span>
<label class="sr-only">GitHub</label>
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</nav>
<div class="container-xl">
<div class="row">
<!-- Only show if we have sidebars configured, else just a small margin -->
<div class="col-12 col-md-3 bd-sidebar"><form class="bd-search d-flex align-items-center" action="search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
<div class="bd-toc-item active">
</div>
</nav>
</div>
<div class="d-none d-xl-block col-xl-2 bd-toc">
<div class="toc-item">
<div class="tocsection onthispage pt-5 pb-3">
<i class="fas fa-list"></i> On this page
</div>
<nav id="bd-toc-nav">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#references">
References
</a>
</li>
</ul>
</nav>
</div>
<div class="toc-item">
</div>
</div>
<main class="col-12 col-md-9 col-xl-7 py-md-5 pl-md-5 pr-md-4 bd-content" role="main">
<div>
<div class="section" id="module-example8">
<span id="example8-module"></span><h1>example8 module<a class="headerlink" href="#module-example8" title="Permalink to this headline">¶</a></h1>
<p>This example demonstrates how to implement reconfigurable intelligent
surface (RIS) using <a class="reference internal" href="comm.transceiver.html#comm.transceiver.UserTransceiver" title="comm.transceiver.UserTransceiver"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.transceiver.UserTransceiver</span></code></a>. It also
uses <a class="reference internal" href="comm.signalwave.html#comm.signalwave.QualityBasedSignal" title="comm.signalwave.QualityBasedSignal"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.signalwave.QualityBasedSignal</span></code></a> for transmission. It
illustrates how users can implement multipath signal propagation and
detection logic. The example is an extension of example5.py which shows
how to use <a class="reference internal" href="comm.transceiver.html#comm.transceiver.UserTransceiver" title="comm.transceiver.UserTransceiver"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.transceiver.UserTransceiver</span></code></a>. It is important
to understand example5.py first.</p>
<p>The scenario replicates the experiment of single RIS case presented in <a class="reference internal" href="index.html#r89e13abb20a9-wfy20" id="id1">[WFY20]</a>.
See also Fig. 2 in the paper for the experiment setup and Fig. 3 for the
experiment results.</p>
<div class="section" id="references">
<h2>References<a class="headerlink" href="#references" title="Permalink to this headline">¶</a></h2>
<dl class="citation">
<dt class="label" id="r89e13abb20a9-wfy20"><span class="brackets"><a class="fn-backref" href="#id1">WFY20</a></span></dt>
<dd><p>P. Wang, J. Fang, X. Yuan, Z. Chen, and H. Li, “Intelligent
reflecting surface-assisted millimeter wave communications: Joint
active and passive precoding design,” IEEE Transactions on Vehicular
Technology, vol. 69, no. 12, pp. 14960-14973, 2020.
(link: <a class="reference external" href="https://arxiv.org/pdf/1908.10734.pdf">https://arxiv.org/pdf/1908.10734.pdf</a>)</p>
</dd>
</dl>
<dl class="py function">
<dt id="example8.resolution">
<code class="sig-prename descclassname">example8.</code><code class="sig-name descname">resolution</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#example8.resolution" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="example8.x">
<code class="sig-prename descclassname">example8.</code><code class="sig-name descname">x</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">x_val</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.x" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py function">
<dt id="example8.y">
<code class="sig-prename descclassname">example8.</code><code class="sig-name descname">y</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">y_val</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.y" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py class">
<dt id="example8.Result">
<em class="property">class </em><code class="sig-prename descclassname">example8.</code><code class="sig-name descname">Result</code><a class="headerlink" href="#example8.Result" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <code class="xref py py-class docutils literal notranslate"><span class="pre">object</span></code></p>
<dl class="py method">
<dt id="example8.Result.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#example8.Result.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize self. See help(type(self)) for accurate signature.</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="example8.MyTransceiver">
<em class="property">class </em><code class="sig-prename descclassname">example8.</code><code class="sig-name descname">MyTransceiver</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node</span></em>, <em class="sig-param"><span class="n">azimuth_angle</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">beam_width</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">freq</span><span class="o">=</span><span class="default_value">28</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiver" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="comm.transceiver.html#comm.transceiver.UserTransceiver" title="comm.transceiver.UserTransceiver"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.transceiver.UserTransceiver</span></code></a></p>
<p class="rubric">Methods</p>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">broadcast</span></code>(signal)</p></td>
<td><p>This method allows a node to perform a broadcast on the channel, and the method returns a list of tuple (node,received_signal) that the broadcast signal can be decoded, or None if no node can decode the signal.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#example8.MyTransceiver.can_detect" title="example8.MyTransceiver.can_detect"><code class="xref py py-obj docutils literal notranslate"><span class="pre">can_detect</span></code></a>(the_signal)</p></td>
<td><p>This is the function to perform signal propagation and detection logic.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#example8.MyTransceiver.create_final_multipath_signal" title="example8.MyTransceiver.create_final_multipath_signal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_final_multipath_signal</span></code></a>(tx_power, …)</p></td>
<td><p>Use this method to create a final multipath signal.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#example8.MyTransceiver.create_multipath_signal" title="example8.MyTransceiver.create_multipath_signal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_multipath_signal</span></code></a>(tx_power)</p></td>
<td><p>Use this method to create a signal that is part of a multipath signal.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#example8.MyTransceiver.create_signal" title="example8.MyTransceiver.create_signal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_signal</span></code></a>(tx_power)</p></td>
<td><p>Use this method to create a signal.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_carrier_freq</span></code>()</p></td>
<td><p>Return the carrier frequency used by the channel.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_property</span></code>([property])</p></td>
<td><p>The method returns the property of the transceiver.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_type</span></code>()</p></td>
<td><p>This method returns the type of the transceiver.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">multicast</span></code>(signal, node_list)</p></td>
<td><p>This method allows a node to perform a multicast, and the method returns a list of tuple (node,received_signal) that the multicast signal can be decoded, or None if no node can decode the signal.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_property</span></code>(key, value)</p></td>
<td><p>Set a property to this transceiver.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">unicast</span></code>(signal, node)</p></td>
<td><p>This method allows a node to perform a unicast on the channel, and the method returns a <cite>received_signal</cite> if the signal can be decoded, or None.</p></td>
</tr>
</tbody>
</table>
<table class="table">
<colgroup>
<col style="width: 70%" />
<col style="width: 30%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><strong>is_crossed_obstacle</strong></p></td>
<td></td>
</tr>
<tr class="row-even"><td><p><strong>set_obstacle</strong></p></td>
<td></td>
</tr>
</tbody>
</table>
<dl class="py attribute">
<dt id="example8.MyTransceiver.noise">
<code class="sig-name descname">noise</code><em class="property"> = -90</em><a class="headerlink" href="#example8.MyTransceiver.noise" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py attribute">
<dt id="example8.MyTransceiver.snr_threshold">
<code class="sig-name descname">snr_threshold</code><em class="property"> = 2</em><a class="headerlink" href="#example8.MyTransceiver.snr_threshold" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiver.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node</span></em>, <em class="sig-param"><span class="n">azimuth_angle</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">beam_width</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">freq</span><span class="o">=</span><span class="default_value">28</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiver.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize and customize a transceiver.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>azimuth_angle</strong><span class="classifier">float, optional, default=None</span></dt><dd><p>If it is not None, it specifies the transceiver facing angle.</p>
</dd>
<dt><strong>beam_width</strong><span class="classifier">float, optional, default=None</span></dt><dd><p>If <cite>azimuth_angle</cite> is not None, it specifies supported angle width.
The supported angle is within the range
[azimuth_angle-0.5*beam_width,azimuth_angle+0.5*beam_width].</p>
</dd>
<dt><strong>freq</strong><span class="classifier">float, optional, default=28</span></dt><dd><p>The carrier frequency. Default is 28 (or 28 GHz mmWave).</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiver.create_signal">
<code class="sig-name descname">create_signal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tx_power</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiver.create_signal" title="Permalink to this definition">¶</a></dt>
<dd><p>Use this method to create a signal.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>tx_power</strong><span class="classifier">float</span></dt><dd><p>The transmit power of the signal.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><a class="reference internal" href="comm.signalwave.html#comm.signalwave.QualityBasedSignal" title="comm.signalwave.QualityBasedSignal"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.signalwave.QualityBasedSignal</span></code></a></dt><dd><p>The created signal to be used for transmission.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiver.create_multipath_signal">
<code class="sig-name descname">create_multipath_signal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tx_power</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiver.create_multipath_signal" title="Permalink to this definition">¶</a></dt>
<dd><p>Use this method to create a signal that is part of a multipath
signal. A multipath signal is a signal that consists of many paths
of transmissions. It is meaningless to decode this signal alone, rather
all parts of the multipath signal should be consolidated first before
judging whether the multipath signal is detectable. To decode all parts,
use <cite>create_final_multipath_signal()</cite> with passing all other parts of the
signal when calling.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>tx_power</strong><span class="classifier">float</span></dt><dd><p>The transmit power of the signal.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><a class="reference internal" href="comm.signalwave.html#comm.signalwave.QualityBasedSignal" title="comm.signalwave.QualityBasedSignal"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.signalwave.QualityBasedSignal</span></code></a></dt><dd><p>The created signal to be used for transmission.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiver.create_final_multipath_signal">
<code class="sig-name descname">create_final_multipath_signal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tx_power</span></em>, <em class="sig-param"><span class="n">signal_list</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiver.create_final_multipath_signal" title="Permalink to this definition">¶</a></dt>
<dd><p>Use this method to create a final multipath signal. The receiver
will finally consolidate all parts of the multipath signal and judge
whether the consolidated signal is detectable.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>signal_list</strong><span class="classifier">List of <a class="reference internal" href="comm.signalwave.html#comm.signalwave.QualityBasedSignal" title="comm.signalwave.QualityBasedSignal"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.signalwave.QualityBasedSignal</span></code></a></span></dt><dd><p>The list of all other received parts of the multipath signal to be
consolidated for detection.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiver.set_obstacle">
<code class="sig-name descname">set_obstacle</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">obstacle_list</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiver.set_obstacle" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiver.is_crossed_obstacle">
<code class="sig-name descname">is_crossed_obstacle</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tx_loc</span></em>, <em class="sig-param"><span class="n">rx_loc</span></em><span class="sig-paren">)</span> → bool<a class="headerlink" href="#example8.MyTransceiver.is_crossed_obstacle" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiver.can_detect">
<code class="sig-name descname">can_detect</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">the_signal</span></em><span class="sig-paren">)</span> → bool<a class="headerlink" href="#example8.MyTransceiver.can_detect" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the function to perform signal propagation and
detection logic.</p>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="example8.MyTransceiverBS">
<em class="property">class </em><code class="sig-prename descclassname">example8.</code><code class="sig-name descname">MyTransceiverBS</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiverBS" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#example8.MyTransceiver" title="example8.MyTransceiver"><code class="xref py py-class docutils literal notranslate"><span class="pre">example8.MyTransceiver</span></code></a></p>
<p class="rubric">Methods</p>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">broadcast</span></code>(signal)</p></td>
<td><p>This method allows a node to perform a broadcast on the channel, and the method returns a list of tuple (node,received_signal) that the broadcast signal can be decoded, or None if no node can decode the signal.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">can_detect</span></code>(the_signal)</p></td>
<td><p>This is the function to perform signal propagation and detection logic.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#example8.MyTransceiverBS.create_final_multipath_signal" title="example8.MyTransceiverBS.create_final_multipath_signal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_final_multipath_signal</span></code></a>(signal_list)</p></td>
<td><p>Use this method to create a final multipath signal.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#example8.MyTransceiverBS.create_multipath_signal" title="example8.MyTransceiverBS.create_multipath_signal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_multipath_signal</span></code></a>()</p></td>
<td><p>Use this method to create a signal that is part of a multipath signal.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#example8.MyTransceiverBS.create_signal" title="example8.MyTransceiverBS.create_signal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_signal</span></code></a>()</p></td>
<td><p>Use this method to create a signal.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_carrier_freq</span></code>()</p></td>
<td><p>Return the carrier frequency used by the channel.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_property</span></code>([property])</p></td>
<td><p>The method returns the property of the transceiver.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_type</span></code>()</p></td>
<td><p>This method returns the type of the transceiver.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">multicast</span></code>(signal, node_list)</p></td>
<td><p>This method allows a node to perform a multicast, and the method returns a list of tuple (node,received_signal) that the multicast signal can be decoded, or None if no node can decode the signal.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_property</span></code>(key, value)</p></td>
<td><p>Set a property to this transceiver.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">unicast</span></code>(signal, node)</p></td>
<td><p>This method allows a node to perform a unicast on the channel, and the method returns a <cite>received_signal</cite> if the signal can be decoded, or None.</p></td>
</tr>
</tbody>
</table>
<table class="table">
<colgroup>
<col style="width: 70%" />
<col style="width: 30%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><strong>is_crossed_obstacle</strong></p></td>
<td></td>
</tr>
<tr class="row-even"><td><p><strong>set_obstacle</strong></p></td>
<td></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="example8.MyTransceiverBS.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiverBS.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize and customize a transceiver.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>azimuth_angle</strong><span class="classifier">float, optional, default=None</span></dt><dd><p>If it is not None, it specifies the transceiver facing angle.</p>
</dd>
<dt><strong>beam_width</strong><span class="classifier">float, optional, default=None</span></dt><dd><p>If <cite>azimuth_angle</cite> is not None, it specifies supported angle width.
The supported angle is within the range
[azimuth_angle-0.5*beam_width,azimuth_angle+0.5*beam_width].</p>
</dd>
<dt><strong>freq</strong><span class="classifier">float, optional, default=28</span></dt><dd><p>The carrier frequency. Default is 28 (or 28 GHz mmWave).</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiverBS.create_signal">
<code class="sig-name descname">create_signal</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiverBS.create_signal" title="Permalink to this definition">¶</a></dt>
<dd><p>Use this method to create a signal.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>tx_power</strong><span class="classifier">float</span></dt><dd><p>The transmit power of the signal.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><a class="reference internal" href="comm.signalwave.html#comm.signalwave.QualityBasedSignal" title="comm.signalwave.QualityBasedSignal"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.signalwave.QualityBasedSignal</span></code></a></dt><dd><p>The created signal to be used for transmission.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiverBS.create_multipath_signal">
<code class="sig-name descname">create_multipath_signal</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiverBS.create_multipath_signal" title="Permalink to this definition">¶</a></dt>
<dd><p>Use this method to create a signal that is part of a multipath
signal. A multipath signal is a signal that consists of many paths
of transmissions. It is meaningless to decode this signal alone, rather
all parts of the multipath signal should be consolidated first before
judging whether the multipath signal is detectable. To decode all parts,
use <cite>create_final_multipath_signal()</cite> with passing all other parts of the
signal when calling.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>tx_power</strong><span class="classifier">float</span></dt><dd><p>The transmit power of the signal.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><a class="reference internal" href="comm.signalwave.html#comm.signalwave.QualityBasedSignal" title="comm.signalwave.QualityBasedSignal"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.signalwave.QualityBasedSignal</span></code></a></dt><dd><p>The created signal to be used for transmission.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiverBS.create_final_multipath_signal">
<code class="sig-name descname">create_final_multipath_signal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">signal_list</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiverBS.create_final_multipath_signal" title="Permalink to this definition">¶</a></dt>
<dd><p>Use this method to create a final multipath signal. The receiver
will finally consolidate all parts of the multipath signal and judge
whether the consolidated signal is detectable.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>signal_list</strong><span class="classifier">List of <a class="reference internal" href="comm.signalwave.html#comm.signalwave.QualityBasedSignal" title="comm.signalwave.QualityBasedSignal"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.signalwave.QualityBasedSignal</span></code></a></span></dt><dd><p>The list of all other received parts of the multipath signal to be
consolidated for detection.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="example8.MyTransceiverRIS">
<em class="property">class </em><code class="sig-prename descclassname">example8.</code><code class="sig-name descname">MyTransceiverRIS</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node</span></em>, <em class="sig-param"><span class="n">azimuth_angle</span></em>, <em class="sig-param"><span class="n">beam_width</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiverRIS" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#example8.MyTransceiver" title="example8.MyTransceiver"><code class="xref py py-class docutils literal notranslate"><span class="pre">example8.MyTransceiver</span></code></a></p>
<p class="rubric">Methods</p>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">broadcast</span></code>(signal)</p></td>
<td><p>This method allows a node to perform a broadcast on the channel, and the method returns a list of tuple (node,received_signal) that the broadcast signal can be decoded, or None if no node can decode the signal.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">can_detect</span></code>(the_signal)</p></td>
<td><p>This is the function to perform signal propagation and detection logic.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#example8.MyTransceiverRIS.create_final_multipath_signal" title="example8.MyTransceiverRIS.create_final_multipath_signal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_final_multipath_signal</span></code></a>(signal_list)</p></td>
<td><p>Use this method to create a final multipath signal.</p></td>
</tr>
<tr class="row-even"><td><p><a class="reference internal" href="#example8.MyTransceiverRIS.create_multipath_signal" title="example8.MyTransceiverRIS.create_multipath_signal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_multipath_signal</span></code></a>(tx_power)</p></td>
<td><p>Use this method to create a signal that is part of a multipath signal.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#example8.MyTransceiverRIS.create_signal" title="example8.MyTransceiverRIS.create_signal"><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_signal</span></code></a>()</p></td>
<td><p>Use this method to create a signal.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_carrier_freq</span></code>()</p></td>
<td><p>Return the carrier frequency used by the channel.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_property</span></code>([property])</p></td>
<td><p>The method returns the property of the transceiver.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_type</span></code>()</p></td>
<td><p>This method returns the type of the transceiver.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#example8.MyTransceiverRIS.is_crossed_obstacle" title="example8.MyTransceiverRIS.is_crossed_obstacle"><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_crossed_obstacle</span></code></a>(tx_loc, rx_loc)</p></td>
<td><p>Use this method to ignore obstacle between BS and RIS.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">multicast</span></code>(signal, node_list)</p></td>
<td><p>This method allows a node to perform a multicast, and the method returns a list of tuple (node,received_signal) that the multicast signal can be decoded, or None if no node can decode the signal.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_property</span></code>(key, value)</p></td>
<td><p>Set a property to this transceiver.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">unicast</span></code>(signal, node)</p></td>
<td><p>This method allows a node to perform a unicast on the channel, and the method returns a <cite>received_signal</cite> if the signal can be decoded, or None.</p></td>
</tr>
</tbody>
</table>
<table class="table">
<colgroup>
<col style="width: 62%" />
<col style="width: 38%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><strong>set_obstacle</strong></p></td>
<td></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="example8.MyTransceiverRIS.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node</span></em>, <em class="sig-param"><span class="n">azimuth_angle</span></em>, <em class="sig-param"><span class="n">beam_width</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiverRIS.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>Initialize and customize a transceiver.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>azimuth_angle</strong><span class="classifier">float, optional, default=None</span></dt><dd><p>If it is not None, it specifies the transceiver facing angle.</p>
</dd>
<dt><strong>beam_width</strong><span class="classifier">float, optional, default=None</span></dt><dd><p>If <cite>azimuth_angle</cite> is not None, it specifies supported angle width.
The supported angle is within the range
[azimuth_angle-0.5*beam_width,azimuth_angle+0.5*beam_width].</p>
</dd>
<dt><strong>freq</strong><span class="classifier">float, optional, default=28</span></dt><dd><p>The carrier frequency. Default is 28 (or 28 GHz mmWave).</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiverRIS.is_crossed_obstacle">
<code class="sig-name descname">is_crossed_obstacle</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tx_loc</span></em>, <em class="sig-param"><span class="n">rx_loc</span></em><span class="sig-paren">)</span> → bool<a class="headerlink" href="#example8.MyTransceiverRIS.is_crossed_obstacle" title="Permalink to this definition">¶</a></dt>
<dd><p>Use this method to ignore obstacle between BS and RIS.</p>
</dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiverRIS.create_signal">
<code class="sig-name descname">create_signal</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiverRIS.create_signal" title="Permalink to this definition">¶</a></dt>
<dd><p>Use this method to create a signal.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>tx_power</strong><span class="classifier">float</span></dt><dd><p>The transmit power of the signal.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><a class="reference internal" href="comm.signalwave.html#comm.signalwave.QualityBasedSignal" title="comm.signalwave.QualityBasedSignal"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.signalwave.QualityBasedSignal</span></code></a></dt><dd><p>The created signal to be used for transmission.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiverRIS.create_multipath_signal">
<code class="sig-name descname">create_multipath_signal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">tx_power</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiverRIS.create_multipath_signal" title="Permalink to this definition">¶</a></dt>
<dd><p>Use this method to create a signal that is part of a multipath
signal. A multipath signal is a signal that consists of many paths
of transmissions. It is meaningless to decode this signal alone, rather
all parts of the multipath signal should be consolidated first before
judging whether the multipath signal is detectable. To decode all parts,
use <cite>create_final_multipath_signal()</cite> with passing all other parts of the
signal when calling.</p>
<dl class="field-list simple">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl class="simple">
<dt><strong>tx_power</strong><span class="classifier">float</span></dt><dd><p>The transmit power of the signal.</p>
</dd>
</dl>
</dd>
<dt class="field-even">Returns</dt>
<dd class="field-even"><dl class="simple">
<dt><a class="reference internal" href="comm.signalwave.html#comm.signalwave.QualityBasedSignal" title="comm.signalwave.QualityBasedSignal"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.signalwave.QualityBasedSignal</span></code></a></dt><dd><p>The created signal to be used for transmission.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="example8.MyTransceiverRIS.create_final_multipath_signal">
<code class="sig-name descname">create_final_multipath_signal</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">signal_list</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiverRIS.create_final_multipath_signal" title="Permalink to this definition">¶</a></dt>
<dd><p>Use this method to create a final multipath signal. The receiver
will finally consolidate all parts of the multipath signal and judge
whether the consolidated signal is detectable.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>signal_list</strong><span class="classifier">List of <a class="reference internal" href="comm.signalwave.html#comm.signalwave.QualityBasedSignal" title="comm.signalwave.QualityBasedSignal"><code class="xref py py-class docutils literal notranslate"><span class="pre">comm.signalwave.QualityBasedSignal</span></code></a></span></dt><dd><p>The list of all other received parts of the multipath signal to be
consolidated for detection.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="example8.MyTransceiverVehicle">
<em class="property">class </em><code class="sig-prename descclassname">example8.</code><code class="sig-name descname">MyTransceiverVehicle</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">node</span></em>, <em class="sig-param"><span class="n">azimuth_angle</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">beam_width</span><span class="o">=</span><span class="default_value">None</span></em>, <em class="sig-param"><span class="n">freq</span><span class="o">=</span><span class="default_value">28</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyTransceiverVehicle" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="#example8.MyTransceiver" title="example8.MyTransceiver"><code class="xref py py-class docutils literal notranslate"><span class="pre">example8.MyTransceiver</span></code></a></p>
<p class="rubric">Methods</p>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">broadcast</span></code>(signal)</p></td>
<td><p>This method allows a node to perform a broadcast on the channel, and the method returns a list of tuple (node,received_signal) that the broadcast signal can be decoded, or None if no node can decode the signal.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">can_detect</span></code>(the_signal)</p></td>
<td><p>This is the function to perform signal propagation and detection logic.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_final_multipath_signal</span></code>(tx_power, …)</p></td>
<td><p>Use this method to create a final multipath signal.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_multipath_signal</span></code>(tx_power)</p></td>
<td><p>Use this method to create a signal that is part of a multipath signal.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">create_signal</span></code>(tx_power)</p></td>
<td><p>Use this method to create a signal.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_carrier_freq</span></code>()</p></td>
<td><p>Return the carrier frequency used by the channel.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_property</span></code>([property])</p></td>
<td><p>The method returns the property of the transceiver.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_type</span></code>()</p></td>
<td><p>This method returns the type of the transceiver.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">multicast</span></code>(signal, node_list)</p></td>
<td><p>This method allows a node to perform a multicast, and the method returns a list of tuple (node,received_signal) that the multicast signal can be decoded, or None if no node can decode the signal.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_property</span></code>(key, value)</p></td>
<td><p>Set a property to this transceiver.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">unicast</span></code>(signal, node)</p></td>
<td><p>This method allows a node to perform a unicast on the channel, and the method returns a <cite>received_signal</cite> if the signal can be decoded, or None.</p></td>
</tr>
</tbody>
</table>
<table class="table">
<colgroup>
<col style="width: 70%" />
<col style="width: 30%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><strong>is_crossed_obstacle</strong></p></td>
<td></td>
</tr>
<tr class="row-even"><td><p><strong>set_obstacle</strong></p></td>
<td></td>
</tr>
</tbody>
</table>
</dd></dl>
<dl class="py class">
<dt id="example8.MyBS">
<em class="property">class </em><code class="sig-prename descclassname">example8.</code><code class="sig-name descname">MyBS</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">simworld</span></em>, <em class="sig-param"><span class="n">id</span></em>, <em class="sig-param"><span class="n">loc</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyBS" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="node.node.html#node.node.BaseNode" title="node.node.BaseNode"><code class="xref py py-class docutils literal notranslate"><span class="pre">node.node.BaseNode</span></code></a></p>
<p>MyBS: This is a base station in the VANET sim world implementing
a user-defined transceiver.</p>
<p class="rubric">Methods</p>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">ID</span></code>(id_str)</p></td>
<td><p>The data structure for the node id.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">Type</span></code>(node_type)</p></td>
<td><p>The definition of a node type.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">clear_drawing</span></code>()</p></td>
<td><p>Clear the drawing for this node by removing all drawables associated with this node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">del_circle</span></code>(radius)</p></td>
<td><p>(Deprecated) Remove an earlier added circle for this node.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">del_drawable</span></code>(drawable)</p></td>
<td><p>Remove a specific drawable from the drawing list.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">del_line</span></code>(other_node)</p></td>
<td><p>(Deprecated) Remove an earlier added line for this node.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">del_sector</span></code>(radius, pointing_angle, width_angle)</p></td>
<td><p>(Deprecated) Remove an earlier added sector drawing.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">del_text</span></code>(dx, dy, text)</p></td>
<td><p>(Deprecated) Remove an earlier added text message.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">draw_circle</span></code>(radius[, pen, brush])</p></td>
<td><p>Put a circle around this node where the node is the center of the circle.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">draw_line</span></code>(other_node[, pen, brush])</p></td>
<td><p>Draw a line from this node to <cite>other_node</cite>.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">draw_line_segments</span></code>(points[, pen, brush])</p></td>
<td><p>Draw line segments around this node where (0,0) is the center of the node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">draw_sector</span></code>(radius, pointing_angle, width_angle)</p></td>
<td><p>Draw a sector where its center is at this node, its radius is <cite>radius</cite> its pointing angle is <cite>pointing_angle</cite>, its width (in degree) is specified in <cite>width_angle</cite>.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">draw_text</span></code>(dx, dy, text, font[, foreground, …])</p></td>
<td><p>Draw a text at around this node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get</span></code>(query_str)</p></td>
<td><p>Query the node to retrieve corresponding information.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_color</span></code>()</p></td>
<td><p>Get the color that is used to draw this node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_node_list</span></code>()</p></td>
<td><p>Provide the list of all nodes.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_disabled</span></code>()</p></td>
<td><p>Use this method to check if a node is disabled.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_visible</span></code>()</p></td>
<td><p>Use this method to check if a node is visible.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">lookup</span></code>(id)</p></td>
<td><p>This is a static method for performing a lookup for the node with <cite>id</cite>.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">remove_from_simulation</span></code>()</p></td>
<td><p>This method is used to remove this node from the simulation.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">reset</span></code>()</p></td>
<td><p>Reset the global node list.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">reset_color</span></code>()</p></td>
<td><p>Reset the color for the node to the default color of <cite>wx.BLACK</cite>.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_color</span></code>(color)</p></td>
<td><p>Set the color to draw for this node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_mobility</span></code>(mobility[, direction])</p></td>
<td><p>Set the <cite>mobility</cite> for this instance.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_transceiver</span></code>(transceiver)</p></td>
<td><p>Use this method to set a transceiver for the node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_visible</span></code>([flag])</p></td>
<td><p>Use this method to set the visibility of a node.</p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="example8.MyBS.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">simworld</span></em>, <em class="sig-param"><span class="n">id</span></em>, <em class="sig-param"><span class="n">loc</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyBS.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the constructor. It must be reimplemented and
super() must be called.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>simworld</strong><span class="classifier"><a class="reference internal" href="sim.simulation.html#sim.simulation.World" title="sim.simulation.World"><code class="xref py py-class docutils literal notranslate"><span class="pre">sim.simulation.World</span></code></a></span></dt><dd><p>To provide the container of the node to be initiated.</p>
</dd>
<dt><strong>id</strong><span class="classifier"><a class="reference internal" href="node.node.html#node.node.BaseNode.ID" title="node.node.BaseNode.ID"><code class="xref py py-class docutils literal notranslate"><span class="pre">node.node.BaseNode.ID</span></code></a>, default=None</span></dt><dd><p>To provide the <cite>id</cite> of this node.</p>
</dd>
<dt><strong>type</strong><span class="classifier"><a class="reference internal" href="node.node.html#node.node.BaseNode.Type" title="node.node.BaseNode.Type"><code class="xref py py-class docutils literal notranslate"><span class="pre">node.node.BaseNode.Type</span></code></a>, default=None</span></dt><dd><p>To specify the <cite>type</cite> of this node.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
</dd></dl>
<dl class="py class">
<dt id="example8.MyVehicle">
<em class="property">class </em><code class="sig-prename descclassname">example8.</code><code class="sig-name descname">MyVehicle</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">simworld</span></em>, <em class="sig-param"><span class="n">id</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyVehicle" title="Permalink to this definition">¶</a></dt>
<dd><p>Bases: <a class="reference internal" href="node.node.html#node.node.BaseNode" title="node.node.BaseNode"><code class="xref py py-class docutils literal notranslate"><span class="pre">node.node.BaseNode</span></code></a></p>
<p>MyVehicle: This is a transmitting node in the VANET sim world implementing
a user-defined transceiver.</p>
<p class="rubric">Methods</p>
<table class="longtable table autosummary">
<colgroup>
<col style="width: 10%" />
<col style="width: 90%" />
</colgroup>
<tbody>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">ID</span></code>(id_str)</p></td>
<td><p>The data structure for the node id.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">Type</span></code>(node_type)</p></td>
<td><p>The definition of a node type.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">clear_drawing</span></code>()</p></td>
<td><p>Clear the drawing for this node by removing all drawables associated with this node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">del_circle</span></code>(radius)</p></td>
<td><p>(Deprecated) Remove an earlier added circle for this node.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">del_drawable</span></code>(drawable)</p></td>
<td><p>Remove a specific drawable from the drawing list.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">del_line</span></code>(other_node)</p></td>
<td><p>(Deprecated) Remove an earlier added line for this node.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">del_sector</span></code>(radius, pointing_angle, width_angle)</p></td>
<td><p>(Deprecated) Remove an earlier added sector drawing.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">del_text</span></code>(dx, dy, text)</p></td>
<td><p>(Deprecated) Remove an earlier added text message.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">draw_circle</span></code>(radius[, pen, brush])</p></td>
<td><p>Put a circle around this node where the node is the center of the circle.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">draw_line</span></code>(other_node[, pen, brush])</p></td>
<td><p>Draw a line from this node to <cite>other_node</cite>.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">draw_line_segments</span></code>(points[, pen, brush])</p></td>
<td><p>Draw line segments around this node where (0,0) is the center of the node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">draw_sector</span></code>(radius, pointing_angle, width_angle)</p></td>
<td><p>Draw a sector where its center is at this node, its radius is <cite>radius</cite> its pointing angle is <cite>pointing_angle</cite>, its width (in degree) is specified in <cite>width_angle</cite>.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">draw_text</span></code>(dx, dy, text, font[, foreground, …])</p></td>
<td><p>Draw a text at around this node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get</span></code>(query_str)</p></td>
<td><p>Query the node to retrieve corresponding information.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_color</span></code>()</p></td>
<td><p>Get the color that is used to draw this node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">get_node_list</span></code>()</p></td>
<td><p>Provide the list of all nodes.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_disabled</span></code>()</p></td>
<td><p>Use this method to check if a node is disabled.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">is_visible</span></code>()</p></td>
<td><p>Use this method to check if a node is visible.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">lookup</span></code>(id)</p></td>
<td><p>This is a static method for performing a lookup for the node with <cite>id</cite>.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">remove_from_simulation</span></code>()</p></td>
<td><p>This method is used to remove this node from the simulation.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">reset</span></code>()</p></td>
<td><p>Reset the global node list.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">reset_color</span></code>()</p></td>
<td><p>Reset the color for the node to the default color of <cite>wx.BLACK</cite>.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_color</span></code>(color)</p></td>
<td><p>Set the color to draw for this node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_mobility</span></code>(mobility[, direction])</p></td>
<td><p>Set the <cite>mobility</cite> for this instance.</p></td>
</tr>
<tr class="row-odd"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_transceiver</span></code>(transceiver)</p></td>
<td><p>Use this method to set a transceiver for the node.</p></td>
</tr>
<tr class="row-even"><td><p><code class="xref py py-obj docutils literal notranslate"><span class="pre">set_visible</span></code>([flag])</p></td>
<td><p>Use this method to set the visibility of a node.</p></td>
</tr>
<tr class="row-odd"><td><p><a class="reference internal" href="#example8.MyVehicle.show_connection" title="example8.MyVehicle.show_connection"><code class="xref py py-obj docutils literal notranslate"><span class="pre">show_connection</span></code></a>()</p></td>
<td><p></p></td>
</tr>
</tbody>
</table>
<dl class="py method">
<dt id="example8.MyVehicle.__init__">
<code class="sig-name descname">__init__</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">simworld</span></em>, <em class="sig-param"><span class="n">id</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyVehicle.__init__" title="Permalink to this definition">¶</a></dt>
<dd><p>This is the constructor. It must be reimplemented and
super() must be called.</p>
<dl class="field-list">
<dt class="field-odd">Parameters</dt>
<dd class="field-odd"><dl>
<dt><strong>simworld</strong><span class="classifier"><a class="reference internal" href="sim.simulation.html#sim.simulation.World" title="sim.simulation.World"><code class="xref py py-class docutils literal notranslate"><span class="pre">sim.simulation.World</span></code></a></span></dt><dd><p>To provide the container of the node to be initiated.</p>
</dd>
<dt><strong>id</strong><span class="classifier"><a class="reference internal" href="node.node.html#node.node.BaseNode.ID" title="node.node.BaseNode.ID"><code class="xref py py-class docutils literal notranslate"><span class="pre">node.node.BaseNode.ID</span></code></a>, default=None</span></dt><dd><p>To provide the <cite>id</cite> of this node.</p>
</dd>
<dt><strong>type</strong><span class="classifier"><a class="reference internal" href="node.node.html#node.node.BaseNode.Type" title="node.node.BaseNode.Type"><code class="xref py py-class docutils literal notranslate"><span class="pre">node.node.BaseNode.Type</span></code></a>, default=None</span></dt><dd><p>To specify the <cite>type</cite> of this node.</p>
</dd>
</dl>
</dd>
</dl>
</dd></dl>
<dl class="py method">
<dt id="example8.MyVehicle.show_connection">
<code class="sig-name descname">show_connection</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyVehicle.show_connection" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
</dd></dl>
<dl class="py class">
<dt id="example8.MyRIS">
<em class="property">class </em><code class="sig-prename descclassname">example8.</code><code class="sig-name descname">MyRIS</code><span class="sig-paren">(</span><em class="sig-param"><span class="n">simworld</span></em>, <em class="sig-param"><span class="n">id</span></em>, <em class="sig-param"><span class="n">loc</span></em>, <em class="sig-param"><span class="n">azimuth_angle</span></em><span class="sig-paren">)</span><a class="headerlink" href="#example8.MyRIS" title="Permalink to this definition">¶</a></dt>