merge of the code from the LENA project into ns-3-dev
authorNicola Baldo <nbaldo@cttc.es>
Fri, 11 May 2012 16:42:40 +0200
changeset 87494462ac63d4cf
parent 8748 87a141a38088
parent 8747 2aec19a85c73
child 8750 b3db7d51f260
child 8765 b89660102b63
merge of the code from the LENA project into ns-3-dev
CHANGES.html
RELEASE_NOTES
doc/models/Makefile
doc/models/source/index.rst
src/buildings/doc/Makefile
src/config-store/model/attribute-default-iterator.cc
src/config-store/model/attribute-iterator.cc
src/config-store/model/attribute-iterator.h
src/config-store/model/model-node-creator.cc
src/config-store/model/model-node-creator.h
src/core/model/config.cc
src/core/model/object-map.h
src/core/model/object-ptr-map.cc
src/core/model/object-ptr-map.h
src/core/model/object-ptr-vector.cc
src/core/model/object-ptr-vector.h
src/core/model/object-vector.h
src/core/wscript
src/lte/AUTHORS
src/lte/doc/Makefile
src/lte/doc/lte-transmission.pdf
src/lte/doc/lte-transmission.png
src/lte/doc/lte.rst
src/lte/doc/source/index.rst
src/lte/examples/lte-amc.cc
src/lte/examples/lte-channel-model.cc
src/lte/examples/lte-device.cc
src/lte/examples/lte-multiple-flows.cc
src/lte/examples/lte-phy-downlink.cc
src/lte/examples/lte-phy-uplink.cc
src/lte/model/JakesTraces/multipath_v0_M10.h
src/lte/model/JakesTraces/multipath_v0_M12.h
src/lte/model/JakesTraces/multipath_v0_M6.h
src/lte/model/JakesTraces/multipath_v0_M8.h
src/lte/model/JakesTraces/multipath_v120_M10.h
src/lte/model/JakesTraces/multipath_v120_M12.h
src/lte/model/JakesTraces/multipath_v120_M6.h
src/lte/model/JakesTraces/multipath_v120_M8.h
src/lte/model/JakesTraces/multipath_v30_M10.h
src/lte/model/JakesTraces/multipath_v30_M12.h
src/lte/model/JakesTraces/multipath_v30_M6.h
src/lte/model/JakesTraces/multipath_v30_M8.h
src/lte/model/JakesTraces/multipath_v3_M10.h
src/lte/model/JakesTraces/multipath_v3_M12.h
src/lte/model/JakesTraces/multipath_v3_M6.h
src/lte/model/JakesTraces/multipath_v3_M8.h
src/lte/model/amc-module.cc
src/lte/model/amc-module.h
src/lte/model/bearer-qos-parameters.cc
src/lte/model/bearer-qos-parameters.h
src/lte/model/channel-realization.cc
src/lte/model/channel-realization.h
src/lte/model/discrete-time-loss-model.cc
src/lte/model/discrete-time-loss-model.h
src/lte/model/enb-lte-spectrum-phy.cc
src/lte/model/enb-lte-spectrum-phy.h
src/lte/model/enb-mac-entity.cc
src/lte/model/enb-mac-entity.h
src/lte/model/enb-net-device.cc
src/lte/model/enb-net-device.h
src/lte/model/enb-phy.cc
src/lte/model/enb-phy.h
src/lte/model/jakes-fading-loss-model.cc
src/lte/model/jakes-fading-loss-model.h
src/lte/model/jakes-fading-realizations.h
src/lte/model/lte-mac-header.cc
src/lte/model/lte-mac-header.h
src/lte/model/lte-mac-queue.cc
src/lte/model/lte-mac-queue.h
src/lte/model/lte-propagation-loss-model.cc
src/lte/model/lte-propagation-loss-model.h
src/lte/model/mac-entity.cc
src/lte/model/mac-entity.h
src/lte/model/packet-scheduler.cc
src/lte/model/packet-scheduler.h
src/lte/model/path-loss-model.cc
src/lte/model/path-loss-model.h
src/lte/model/penetration-loss-model.cc
src/lte/model/penetration-loss-model.h
src/lte/model/radio-bearer-instance.cc
src/lte/model/radio-bearer-instance.h
src/lte/model/rlc-entity.cc
src/lte/model/rlc-entity.h
src/lte/model/rrc-entity.cc
src/lte/model/rrc-entity.h
src/lte/model/shadowing-loss-model.cc
src/lte/model/shadowing-loss-model.h
src/lte/model/simple-packet-scheduler.cc
src/lte/model/simple-packet-scheduler.h
src/lte/model/ue-lte-spectrum-phy.cc
src/lte/model/ue-lte-spectrum-phy.h
src/lte/model/ue-mac-entity.cc
src/lte/model/ue-mac-entity.h
src/lte/model/ue-manager.cc
src/lte/model/ue-manager.h
src/lte/model/ue-net-device.cc
src/lte/model/ue-net-device.h
src/lte/model/ue-phy.cc
src/lte/model/ue-phy.h
src/lte/model/ue-record.cc
src/lte/model/ue-record.h
src/lte/test/lte-bearer-test.cc
src/lte/test/lte-device-test.cc
src/lte/test/lte-phy-test.cc
src/lte/test/lte-propagation-loss-model-test.cc
src/lte/test/lte-test-rlc-am-e2e.cc
src/lte/test/lte-test-rlc-um-e2e.cc
utils/print-introspected-doxygen.cc
     1.1 --- a/.hgignore	Fri May 11 14:02:54 2012 +0200
     1.2 +++ b/.hgignore	Fri May 11 16:42:40 2012 +0200
     1.3 @@ -28,7 +28,7 @@
     1.4  ^doc/manual/figures/.*eps
     1.5  ^doc/manual/figures/.*pdf
     1.6  ^doc/manual/figures/.*png
     1.7 -^src/antenna/doc/build
     1.8 +^src/.*/doc/build
     1.9  ^bindings/python/pybindgen/
    1.10  ms_print.*
    1.11  massif.*
     2.1 --- a/CHANGES.html	Fri May 11 14:02:54 2012 +0200
     2.2 +++ b/CHANGES.html	Fri May 11 16:42:40 2012 +0200
     2.3 @@ -50,6 +50,13 @@
     2.4  <ul>
     2.5  <li>The new class AntennaModel provides an API for modeling the radiation pattern of antennas.
     2.6  </li>
     2.7 +<li>The new buildings module introduces an API (classes, helpers, etc)
     2.8 +  to model the presence of buildings in a wireless network topology. 
     2.9 +</li>
    2.10 +<li>The LENA project's implementation of the LTE Mac Scheduler Interface Specification
    2.11 +   standardized by the Small Cell Forum (formerly Femto Forum) is now available for
    2.12 +  use with the LTE module.
    2.13 +</li>
    2.14  </ul>
    2.15  
    2.16  <h2>Changes to existing API:</h2>
    2.17 @@ -101,6 +108,11 @@
    2.18  <li>
    2.19  QueueMode enum from DropTailQueue and RedQueue classes has been unified and moved to Queueu class. Symbols DropTailQueue::PACKETS and DropTailQueue::BYTES are now named Queue::QUEUE_MODE_PACKETS and DropTailQueue::QUEUE_MODE_BYTES. In addition, DropTailQueue and RedQueue class attributes "Mode" have been renamed for consistency from "Packets" and "Bytes" to "QUEUE_MODE_PACKETS" and "QUEUE_MODE_BYTES".
    2.20  </li>
    2.21 +<li>
    2.22 +The API of the LTE module has undergone a significant redesign with
    2.23 +the merge of the code from the LENA project. The new API is not
    2.24 +backwards compatible with the previous version of the LTE module.
    2.25 +</li>
    2.26  </ul>
    2.27  
    2.28  <h2>Changes to build system:</h2>
     3.1 --- a/RELEASE_NOTES	Fri May 11 14:02:54 2012 +0200
     3.2 +++ b/RELEASE_NOTES	Fri May 11 16:42:40 2012 +0200
     3.3 @@ -36,6 +36,13 @@
     3.4  - Longer and more descriptive names are used for error units in RateErrorModel
     3.5    class and queue mode in Queue class. Attributs in those classes are also
     3.6    changed for consistency. See API documentation for details.
     3.7 +- A new buildings module is introduced which allows to model the
     3.8 +  presence of buildings in a wireless network topology.  
     3.9 +- New propagation models (OkumuraHata, ITU-R P.1411, ITU-R P.1238)
    3.10 +  have been added
    3.11 +- The LTE code from the LENA project has been merged, bringin in a
    3.12 +  significant redesign of the LTE module as well as many new features.
    3.13 +
    3.14  
    3.15  Bugs fixed
    3.16  ----------
     4.1 --- a/doc/models/Makefile	Fri May 11 14:02:54 2012 +0200
     4.2 +++ b/doc/models/Makefile	Fri May 11 16:42:40 2012 +0200
     4.3 @@ -24,6 +24,11 @@
     4.4  	$(SRC)/aodv/doc/aodv.rst \
     4.5  	$(SRC)/applications/doc/applications.rst \
     4.6  	$(SRC)/bridge/doc/bridge.rst \
     4.7 +	$(SRC)/buildings/doc/source/buildings.rst \
     4.8 +	$(SRC)/buildings/doc/source/buildings-design.rst \
     4.9 +	$(SRC)/buildings/doc/source/buildings-user.rst \
    4.10 +	$(SRC)/buildings/doc/source/buildings-testing.rst \
    4.11 +	$(SRC)/buildings/doc/source/buildings-references.rst \
    4.12  	$(SRC)/click/doc/click.rst \
    4.13  	$(SRC)/csma/doc/csma.rst \
    4.14  	$(SRC)/dsdv/doc/dsdv.rst \
    4.15 @@ -32,7 +37,12 @@
    4.16  	$(SRC)/emu/doc/emu.rst \
    4.17  	$(SRC)/tap-bridge/doc/tap.rst \
    4.18  	$(SRC)/mesh/doc/mesh.rst \
    4.19 -	$(SRC)/lte/doc/lte.rst \
    4.20 +	$(SRC)/lte/doc/source/lte.rst \
    4.21 +	$(SRC)/lte/doc/source/lte-user.rst \
    4.22 +	$(SRC)/lte/doc/source/lte-design.rst \
    4.23 +	$(SRC)/lte/doc/source/lte-testing.rst \
    4.24 +	$(SRC)/lte/doc/source/lte-profiling.rst \
    4.25 +	$(SRC)/lte/doc/source/lte-references.rst \
    4.26  	$(SRC)/propagation/doc/propagation.rst \
    4.27  	$(SRC)/network/doc/network-overview.rst \
    4.28  	$(SRC)/network/doc/packets.rst \
    4.29 @@ -76,8 +86,63 @@
    4.30  	$(SRC)/wifi/doc/WifiArchitecture.dia \
    4.31  	$(SRC)/wifi/doc/snir.dia \
    4.32  	$(SRC)/wimax/doc/WimaxArchitecture.dia \
    4.33 -	$(SRC)/lte/doc/lte-transmission.png \
    4.34 -	$(SRC)/lte/doc/lte-transmission.pdf \
    4.35 +	$(SRC)/lte/doc/source/figures/ff-mac-saps.dia \
    4.36 +	$(SRC)/lte/doc/source/figures/ff-example.dia \
    4.37 +	$(SRC)/lte/doc/source/figures/lte-enb-architecture.dia \
    4.38 +	$(SRC)/lte/doc/source/figures/lte-ue-architecture.dia \
    4.39 +	$(SRC)/lte/doc/source/figures/epc-profiling-scenario.dia \
    4.40 +	$(SRC)/lte/doc/source/figures/eutran-profiling-scenario.dia \
    4.41 +	$(SRC)/lte/doc/source/figures/lte-interference-test-scenario.dia \
    4.42 +	$(SRC)/lte/doc/source/figures/epc-topology.dia \
    4.43 +	$(SRC)/lte/doc/source/figures/epc-data-flow-dl.dia \
    4.44 +	$(SRC)/lte/doc/source/figures/epc-data-flow-ul.dia \
    4.45 +	$(SRC)/lte/doc/source/figures/lte-arch-data-rrc-pdcp-rlc.dia \
    4.46 +	$(SRC)/lte/doc/source/figures/lte-epc-e2e-data-protocol-stack.dia \
    4.47 +	$(SRC)/lte/doc/source/figures/MCS_2_test.eps \
    4.48 +	$(SRC)/lte/doc/source/figures/MCS_12_test.eps \
    4.49 +	$(SRC)/lte/doc/source/figures/MCS_14_test.eps \
    4.50 +	$(SRC)/lte/doc/source/figures/lena-dual-stripe.eps \
    4.51 +	$(SRC)/lte/doc/source/figures/lte-mcs-index.eps \
    4.52 +	$(SRC)/lte/doc/source/figures/lenaThrTestCase1.eps \
    4.53 +	$(SRC)/lte/doc/source/figures/lenaThrTestCase2.eps \
    4.54 +	$(SRC)/lte/doc/source/figures/runningTime10s.eps \
    4.55 +	$(SRC)/lte/doc/source/figures/epcRunningTime.eps \
    4.56 +	$(SRC)/lte/doc/source/figures/propagationModel.eps \
    4.57 +	$(SRC)/lte/doc/source/figures/simulationTime.eps \
    4.58 +	$(SRC)/lte/doc/source/figures/epcSimulationTime.eps \
    4.59 +	$(SRC)/lte/doc/source/figures/epcEutranRunningTime.eps \
    4.60 +	$(SRC)/lte/doc/source/figures/profiling-memory.eps \
    4.61 +	$(SRC)/lte/doc/source/figures/lte-rlc-implementation-model.eps \
    4.62 +	$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-dl.eps \
    4.63 +	$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-dl.eps \
    4.64 +	$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-ul.eps \
    4.65 +	$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-ul.eps \
    4.66 +	$(SRC)/lte/doc/source/figures/fading_pedestrian.png \
    4.67 +	$(SRC)/lte/doc/source/figures/fading_vehicular.png \
    4.68 +	$(SRC)/lte/doc/source/figures/fading_urban_3kmph.png \
    4.69 +	$(SRC)/lte/doc/source/figures/fading_pedestrian.pdf \
    4.70 +	$(SRC)/lte/doc/source/figures/fading_vehicular.pdf \
    4.71 +	$(SRC)/lte/doc/source/figures/fading_urban_3kmph.pdf \
    4.72 +	$(SRC)/lte/doc/source/figures/MCS_1_4.pdf \
    4.73 +	$(SRC)/lte/doc/source/figures/MCS_1_4.png \
    4.74 +	$(SRC)/lte/doc/source/figures/MCS_5_8.pdf \
    4.75 +	$(SRC)/lte/doc/source/figures/MCS_5_8.png \
    4.76 +	$(SRC)/lte/doc/source/figures/MCS_9_12.pdf \
    4.77 +	$(SRC)/lte/doc/source/figures/MCS_9_12.png \
    4.78 +	$(SRC)/lte/doc/source/figures/MCS_13_16.pdf \
    4.79 +	$(SRC)/lte/doc/source/figures/MCS_13_16.png \
    4.80 +	$(SRC)/lte/doc/source/figures/MCS_17_20.pdf \
    4.81 +	$(SRC)/lte/doc/source/figures/MCS_17_20.png \
    4.82 +	$(SRC)/lte/doc/source/figures/MCS_21_24.pdf \
    4.83 +	$(SRC)/lte/doc/source/figures/MCS_21_24.png \
    4.84 +	$(SRC)/lte/doc/source/figures/MCS_25_27.pdf \
    4.85 +	$(SRC)/lte/doc/source/figures/MCS_25_27.png \
    4.86 +	$(SRC)/lte/doc/source/figures/lte-phy-interference.png \
    4.87 +	$(SRC)/lte/doc/source/figures/lte-phy-interference.pdf \
    4.88 +	$(SRC)/lte/doc/source/figures/helpers.png \
    4.89 +	$(SRC)/lte/doc/source/figures/helpers.pdf \
    4.90 +	$(SRC)/lte/doc/source/figures/miesm_scheme.pdf \
    4.91 +	$(SRC)/lte/doc/source/figures/miesm_scheme.png \
    4.92  	$(SRC)/uan/doc/auvmobility-classes.dia \
    4.93  	$(SRC)/stats/doc/Stat-framework-arch.png \
    4.94  	$(SRC)/stats/doc/Wifi-default.png \
    4.95 @@ -101,6 +166,37 @@
    4.96  	$(FIGURES)/WifiArchitecture.eps \
    4.97  	$(FIGURES)/snir.eps \
    4.98  	$(FIGURES)/WimaxArchitecture.eps \
    4.99 +	$(FIGURES)/ff-mac-saps.eps \
   4.100 +	$(FIGURES)/ff-example.eps \
   4.101 +	$(FIGURES)/lte-enb-architecture.eps \
   4.102 +	$(FIGURES)/lte-ue-architecture.eps \
   4.103 +	$(FIGURES)/epc-profiling-scenario.eps \
   4.104 +	$(FIGURES)/eutran-profiling-scenario.eps \
   4.105 +	$(FIGURES)/lte-interference-test-scenario.eps \
   4.106 +	$(FIGURES)/epc-topology.eps \
   4.107 +	$(FIGURES)/epc-data-flow-dl.eps \
   4.108 +	$(FIGURES)/epc-data-flow-ul.eps \
   4.109 +	$(FIGURES)/lte-arch-data-rrc-pdcp-rlc.eps \
   4.110 +	$(FIGURES)/lte-epc-e2e-data-protocol-stack.eps \
   4.111 +	$(FIGURES)/MCS_2_test.eps \
   4.112 +	$(FIGURES)/MCS_12_test.eps \
   4.113 +	$(FIGURES)/MCS_14_test.eps \
   4.114 +	$(FIGURES)/lena-dual-stripe.eps \
   4.115 +	$(FIGURES)/lte-mcs-index.eps \
   4.116 +	$(FIGURES)/lenaThrTestCase1.eps \
   4.117 +	$(FIGURES)/lenaThrTestCase2.eps \
   4.118 +	$(FIGURES)/runningTime10s.eps \
   4.119 +	$(FIGURES)/epcRunningTime.eps \
   4.120 +	$(FIGURES)/propagationModel.eps \
   4.121 +	$(FIGURES)/simulationTime.eps \
   4.122 +	$(FIGURES)/epcSimulationTime.eps \
   4.123 +	$(FIGURES)/epcEutranRunningTime.eps \
   4.124 +	$(FIGURES)/profiling-memory.eps \
   4.125 +	$(FIGURES)/lte-rlc-implementation-model.eps \
   4.126 +	$(FIGURES)/lte-rlc-data-txon-dl.eps \
   4.127 +	$(FIGURES)/lte-rlc-data-retx-dl.eps \
   4.128 +	$(FIGURES)/lte-rlc-data-txon-ul.eps \
   4.129 +	$(FIGURES)/lte-rlc-data-retx-ul.eps \
   4.130          $(FIGURES)/auvmobility-classes.eps \
   4.131  
   4.132  # rescale pdf figures as necessary
   4.133 @@ -116,7 +212,17 @@
   4.134  $(FIGURES)/routing.pdf_width = 6in
   4.135  $(FIGURES)/routing-specialization.pdf_width = 5in
   4.136  $(FIGURES)/snir.pdf_width = 3in
   4.137 -$(FIGURES)/lte-transmission.pdf_width = 3in
   4.138 +$(FIGURES)/lte-interference-test-scenario.pdf_width = 3in
   4.139 +$(FIGURES)/epc-topology.pdf_width = 4in
   4.140 +$(FIGURES)/lte-arch-data-rrc-pdcp-rlc.pdf_width = 3in
   4.141 +$(FIGURES)/lte-epc-e2e-data-protocol-stack.pdf_width = 15cm
   4.142 +$(FIGURES)/ff-mac-saps.pdf_width = 5in
   4.143 +$(FIGURES)/ff-example.pdf_width = 5in
   4.144 +$(FIGURES)/lte-rlc-implementation-model.pdf_width = 20in
   4.145 +$(FIGURES)/lte-rlc-data-txon-dl.pdf_width = 10cm
   4.146 +$(FIGURES)/lte-rlc-data-txon-ul.pdf_width = 10cm
   4.147 +$(FIGURES)/lte-rlc-data-retx-ul.pdf_width = 10cm
   4.148 +$(FIGURES)/lte-phy-interference.pdf_width = 12cm
   4.149  $(FIGURES)/auvmobility-classes.pdf_width = 10cm
   4.150  
   4.151  IMAGES_PNG = ${IMAGES_EPS:.eps=.png}
     5.1 --- a/doc/models/source/index.rst	Fri May 11 14:02:54 2012 +0200
     5.2 +++ b/doc/models/source/index.rst	Fri May 11 16:42:40 2012 +0200
     5.3 @@ -22,6 +22,7 @@
     5.4     aodv
     5.5     applications
     5.6     bridge
     5.7 +   buildings
     5.8     click
     5.9     csma
    5.10     dsdv
     6.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.2 +++ b/src/buildings/doc/Makefile	Fri May 11 16:42:40 2012 +0200
     6.3 @@ -0,0 +1,173 @@
     6.4 +EPSTOPDF = epstopdf
     6.5 +DIA = dia
     6.6 +CONVERT = convert
     6.7 +
     6.8 +SOURCE = source
     6.9 +FIGURES = $(SOURCE)/figures
    6.10 +
    6.11 +# specify figures from which .png and .pdf figures need to be
    6.12 +# generated (all dia and eps figures)
    6.13 +IMAGES_EPS = 
    6.14 +
    6.15 +# specify figures for build process (all eps figures)
    6.16 +GRAPHS_EPS = 
    6.17 +
    6.18 +# rescale pdf figures as necessary
    6.19 +$(FIGURES)/testbed.pdf_width = 5in
    6.20 +
    6.21 +IMAGES_PNG = ${IMAGES_EPS:.eps=.png}
    6.22 +IMAGES_PDF = ${IMAGES_EPS:.eps=.pdf} 
    6.23 +
    6.24 +IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
    6.25 +
    6.26 +%.eps : %.dia; $(DIA) -t eps $< -e $@
    6.27 +%.png : %.dia; $(DIA) -t png $< -e $@
    6.28 +%.png : %.eps; $(CONVERT) $< $@
    6.29 +%.pdf : %.eps; $(EPSTOPDF) $< -o=$@; if test x$($@_width) != x; then TMPFILE=`mktemp`; ./rescale-pdf.sh $($@_width) $@ $${TMPFILE} && mv $${TMPFILE} $@; fi
    6.30 +
    6.31 +GRAPHS_PNG = ${GRAPHS_EPS:.eps=.png}
    6.32 +GRAPHS_PDF = ${GRAPHS_EPS:.eps=.pdf}
    6.33 +
    6.34 +GRAPHS = $(GRAPHS_EPS) $(GRAPHS_PNG) $(GRAPHS_PDF)
    6.35 +
    6.36 +%.png : %.eps; $(CONVERT) $< $@
    6.37 +%.pdf : %.eps; $(EPSTOPDF) $< -o=$@; if test x$($@_width) != x; then TMPFILE=`mktemp`; ./rescale-pdf.sh $($@_width) $@ $${TMPFILE} && mv $${TMPFILE} $@; fi
    6.38 +
    6.39 +# You can set these variables from the command line.
    6.40 +SPHINXOPTS    =
    6.41 +SPHINXBUILD   = sphinx-build
    6.42 +PAPER         =
    6.43 +BUILDDIR      = build
    6.44 +
    6.45 +# Internal variables.
    6.46 +PAPEROPT_a4     = -D latex_paper_size=a4
    6.47 +PAPEROPT_letter = -D latex_paper_size=letter
    6.48 +ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCE) 
    6.49 +
    6.50 +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
    6.51 +
    6.52 +help:
    6.53 +	@echo "Please use \`make <target>' where <target> is one of"
    6.54 +	@echo "  html       to make standalone HTML files"
    6.55 +	@echo "  dirhtml    to make HTML files named index.html in directories"
    6.56 +	@echo "  singlehtml to make a single large HTML file"
    6.57 +	@echo "  pickle     to make pickle files"
    6.58 +	@echo "  json       to make JSON files"
    6.59 +	@echo "  htmlhelp   to make HTML files and a HTML help project"
    6.60 +	@echo "  qthelp     to make HTML files and a qthelp project"
    6.61 +	@echo "  devhelp    to make HTML files and a Devhelp project"
    6.62 +	@echo "  epub       to make an epub"
    6.63 +	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
    6.64 +	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
    6.65 +	@echo "  text       to make text files"
    6.66 +	@echo "  man        to make manual pages"
    6.67 +	@echo "  changes    to make an overview of all changed/added/deprecated items"
    6.68 +	@echo "  linkcheck  to check all external links for integrity"
    6.69 +	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
    6.70 +
    6.71 +clean:
    6.72 +	-rm -rf $(BUILDDIR)/*
    6.73 +	-rm -f $(IMAGES_PNG)
    6.74 +	-rm -f $(IMAGES_PDF)
    6.75 +	-rm -f $(GRAPHS_PNG)
    6.76 +	-rm -f $(GRAPHS_PDF)
    6.77 +
    6.78 +frag: pickle
    6.79 +	@if test ! -d $(BUILDDIR)/frag; then mkdir $(BUILDDIR)/frag; fi
    6.80 +	pushd $(BUILDDIR)/frag && ../../pickle-to-xml.py ../pickle/index.fpickle  > navigation.xml && popd
    6.81 +	cp -r $(BUILDDIR)/pickle/_images $(BUILDDIR)/frag
    6.82 +
    6.83 +html:  $(IMAGES) ${GRAPHS}
    6.84 +	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
    6.85 +	@echo
    6.86 +	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
    6.87 +
    6.88 +dirhtml:  $(IMAGES)
    6.89 +	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
    6.90 +	@echo
    6.91 +	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
    6.92 +
    6.93 +singlehtml:  $(IMAGES)
    6.94 +	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
    6.95 +	@echo
    6.96 +	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
    6.97 +
    6.98 +pickle:  $(IMAGES)
    6.99 +	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
   6.100 +	@echo
   6.101 +	@echo "Build finished; now you can process the pickle files."
   6.102 +
   6.103 +json:  $(IMAGES)
   6.104 +	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
   6.105 +	@echo
   6.106 +	@echo "Build finished; now you can process the JSON files."
   6.107 +
   6.108 +htmlhelp:  $(IMAGES)
   6.109 +	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
   6.110 +	@echo
   6.111 +	@echo "Build finished; now you can run HTML Help Workshop with the" \
   6.112 +	      ".hhp project file in $(BUILDDIR)/htmlhelp."
   6.113 +
   6.114 +qthelp:  $(IMAGES)
   6.115 +	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
   6.116 +	@echo
   6.117 +	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
   6.118 +	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
   6.119 +	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ns-3.qhcp"
   6.120 +	@echo "To view the help file:"
   6.121 +	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ns-3.qhc"
   6.122 +
   6.123 +devhelp:  $(IMAGES)
   6.124 +	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
   6.125 +	@echo
   6.126 +	@echo "Build finished."
   6.127 +	@echo "To view the help file:"
   6.128 +	@echo "# mkdir -p $$HOME/.local/share/devhelp/ns-3"
   6.129 +	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ns-3"
   6.130 +	@echo "# devhelp"
   6.131 +
   6.132 +epub:  $(IMAGES)
   6.133 +	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
   6.134 +	@echo
   6.135 +	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
   6.136 +
   6.137 +latex:  $(IMAGES) ${GRAPHS}
   6.138 +	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
   6.139 +	@echo
   6.140 +	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
   6.141 +	@echo "Run \`make' in that directory to run these through (pdf)latex" \
   6.142 +	      "(use \`make latexpdf' here to do that automatically)."
   6.143 +
   6.144 +latexpdf:  $(IMAGES) ${GRAPHS}
   6.145 +	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
   6.146 +	@echo "Running LaTeX files through pdflatex..."
   6.147 +	make -C $(BUILDDIR)/latex all-pdf
   6.148 +	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
   6.149 +
   6.150 +text:  $(IMAGES)
   6.151 +	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
   6.152 +	@echo
   6.153 +	@echo "Build finished. The text files are in $(BUILDDIR)/text."
   6.154 +
   6.155 +man:  $(IMAGES)
   6.156 +	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
   6.157 +	@echo
   6.158 +	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
   6.159 +
   6.160 +changes:  $(IMAGES)
   6.161 +	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
   6.162 +	@echo
   6.163 +	@echo "The overview file is in $(BUILDDIR)/changes."
   6.164 +
   6.165 +linkcheck:  $(IMAGEs)
   6.166 +	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
   6.167 +	@echo
   6.168 +	@echo "Link check complete; look for any errors in the above output " \
   6.169 +	      "or in $(BUILDDIR)/linkcheck/output.txt."
   6.170 +
   6.171 +doctest:  $(IMAGES)
   6.172 +	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
   6.173 +	@echo "Testing of doctests in the sources finished, look at the " \
   6.174 +	      "results in $(BUILDDIR)/doctest/output.txt."
   6.175 +
   6.176 +
     7.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.2 +++ b/src/buildings/doc/rescale-pdf.sh	Fri May 11 16:42:40 2012 +0200
     7.3 @@ -0,0 +1,12 @@
     7.4 +#!/usr/bin/env bash
     7.5 +
     7.6 +TMPFILE=`mktemp`
     7.7 +
     7.8 +echo "\documentclass{book}
     7.9 +\usepackage{pdfpages}
    7.10 +\begin{document}
    7.11 +\includepdf[width=${1},fitpaper]{${2}}
    7.12 +\end{document}" >${TMPFILE}.tex
    7.13 +pdflatex -output-directory /tmp ${TMPFILE}.tex >/dev/null 2>/dev/null
    7.14 +cp ${TMPFILE}.pdf ${3}
    7.15 +
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/src/buildings/doc/source/buildings-design.rst	Fri May 11 16:42:40 2012 +0200
     8.3 @@ -0,0 +1,243 @@
     8.4 +cd .. include:: replace.txt
     8.5 +
     8.6 +
     8.7 +++++++++++++++++++++++++++++++++++++++
     8.8 +Design documentation
     8.9 +++++++++++++++++++++++++++++++++++++++
    8.10 +
    8.11 +
    8.12 +Overview
    8.13 +++++++++
    8.14 +
    8.15 +The Buildings module provides:
    8.16 +
    8.17 + #. a new class (``Building``) that models the presence of a building in a simulation scenario;  
    8.18 + #. a new mobility model (``BuildingsMobilityModel``) that allows to specify the location, size and characteristics of buildings present in the simulated area, and allows the placement of nodes inside those buildings;
    8.19 + #. a container class with the definition of the most useful pathloss models and the correspondent variables called ``BuildingsPropagationLossModel``.
    8.20 + #. a new propagation model (``HybridBuildingsPropagationLossModel``) working with the mobility model just introduced, that allows to model the phenomenon of indoor/outdoor propagation in the presence of buildings.
    8.21 + #. a simplified model working only with Okumura Hata (``OhBuildingsPropagationLossModel``) considering the phenomenon of indoor/outdoor propagation in the presence of buildings.
    8.22 +
    8.23 +The models have been designed with LTE in mind, though their implementation is in fact independent from any LTE-specific code, and can be used with other ns-3 wireless technologies as well (e.g., wifi, wimax). 
    8.24 +
    8.25 +The ``HybridBuildingsPropagationLossModel`` pathloss model included is obtained through a combination of several well known pathloss models in order to mimic different environmental scenarios such as urban, suburban and open areas. Moreover, the model considers both outdoor and indoor indoor and outdoor communication has to be included since HeNB might be installed either within building and either outside. In case of indoor communication, the model has to consider also the type of building in outdoor <-> indoor communication according to some general criteria such as the wall penetration losses of the common materials; moreover it includes some general configuration for the internal walls in indoor communications. 
    8.26 +
    8.27 +The ``OhBuildingsPropagationLossModel`` pathloss model has been created for simplifying the previous one removing the thresholds for switching from one model to other. For doing this it has been used only one propagation model from the one available (i.e., the Okumura Hata). The presence of building is still considered in the model; therefore all the considerations of above regarding the building type are still valid. The same consideration can be done for what concern the environmental scenario and frequency since both of them are parameters of the model considered.
    8.28 +
    8.29 +
    8.30 +The Building class
    8.31 +++++++++++++++++++
    8.32 +
    8.33 +The model includes a specific class called ``Building`` which contains a ns3 ``Box`` class for defining the dimension of the building. In order to implements the characteristics of the pathloss models included, the ``Building`` class supports the following attributes:
    8.34 +
    8.35 +  * building type:
    8.36 +
    8.37 +    * Residential (default value)
    8.38 +    * Office
    8.39 +    * Commercial
    8.40 +
    8.41 +  * external walls type
    8.42 +
    8.43 +    * Wood
    8.44 +    * ConcreteWithWindows (default value)
    8.45 +    * ConcreteWithoutWindows
    8.46 +    * StoneBlocks
    8.47 +
    8.48 +  * number of floors (default value 1, which means only ground-floor)
    8.49 +  * number of rooms in x-axis (default value 1)
    8.50 +  * number of rooms in y-axis (default value 1)
    8.51 +
    8.52 +By means of the number of rooms in x and y axis it is possible the definition of buildings where rooms are organized in grids, typical reference scenario for femto-cells in 3GPP called dual-strip.
    8.53 +
    8.54 +The ``Building`` class is included in ``BuildingsMobilityModel`` class, which inherits from the ns3 class ``MobilityModel`` and it is in charge of managing the standard mobility functionalities plus the building ones (e.g., floor and room of the node).
    8.55 +
    8.56 +The class ``BuildingsMobilityModel`` is used by ``BuildingsPropagationLossModel`` class, which inherits from the ns3 class ``PropagationLossModel`` and manages the pathloss computation of the single components and their composition according to the nodes' positions. Moreover, it implements also the shadowing, that is the loss due to obstacles in the main path (i.e., vegetation, buildings, etc.).
    8.57 +
    8.58 +
    8.59 +
    8.60 +
    8.61 +ItuR1238PropagationLossModel
    8.62 +++++++++++++++++++++++++++++
    8.63 +
    8.64 +This class implements a building-dependent indoor propagation loss model based on the ITU P.1238 model, which includes losses due to type of building (i.e., residential, office and commercial).
    8.65 +The analytical expression is given in the following.
    8.66 +
    8.67 +.. math::
    8.68 +
    8.69 +  L_\mathrm{total} = 20\log f + N\log d + L_f(n)- 28 [dB]
    8.70 +
    8.71 +where:
    8.72 +
    8.73 +  :math:`N = \left\{ \begin{array}{lll} 28 & residential \\ 30 & office \\ 22 & commercial\end{array} \right.` : power loss coefficient [dB]
    8.74 +
    8.75 +  :math:`L_f = \left\{ \begin{array}{lll} 4n & residential \\ 15+4(n-1) & office \\ 6+3(n-1) & commercial\end{array} \right.`
    8.76 +
    8.77 +  :math:`n` : number of floors between base station and mobile (:math:`n\ge 1`)
    8.78 +
    8.79 +  :math:`f` : frequency [MHz]
    8.80 +
    8.81 +  :math:`d` : distance (where :math:`d > 1`) [m]
    8.82 +
    8.83 +
    8.84 +
    8.85 +
    8.86 +BuildingsPropagationLossModel
    8.87 ++++++++++++++++++++++++++++++
    8.88 +
    8.89 +The BuildingsPropagationLossModel provides an additional set of building-dependent pathloss model elements that are used to implement different pathloss logics. These pathloss model elements are described in the following subsections.
    8.90 +
    8.91 +
    8.92 +
    8.93 +External Wall Loss (EWL)
    8.94 +-------------------------
    8.95 +
    8.96 +This component models the penetration loss through walls for indoor to outdoor communications and vice-versa. The values are taken from the [cost231]_ model.
    8.97 +
    8.98 +  * Wood ~ 4 dB
    8.99 +  * Concrete with windows (not metallized) ~ 7 dB
   8.100 +  * Concrete without windows ~ 15 dB (spans between 10 and 20 in COST231)
   8.101 +  * Stone blocks ~ 12 dB
   8.102 +
   8.103 +
   8.104 +Internal Walls Loss (IWL)
   8.105 +-------------------------
   8.106 +
   8.107 +This component models the penetration loss occurring in indoor-to-indoor communications within the same building. The total loss is calculated assuming that each single internal wall has a constant penetration loss :math:`L_{siw}`, and approximating the number of walls that are penetrated with the manhattan distance (in number of rooms) between the transmitter and the receiver. In detail, let :math:`x_1`, :math:`y_1`, :math:`x_2`, :math:`y_2` denote the room number along the :math:`x` and :math:`y` axis respectively for user 1 and 2; the total loss :math:`L_{IWL}` is calculated as 
   8.108 +
   8.109 +.. math::
   8.110 +
   8.111 +  L_{IWL} = L_{siw} (|x_1 -x_2| + |y_1 - y_2|)
   8.112 +
   8.113 +  
   8.114 +
   8.115 +
   8.116 +
   8.117 +Height Gain Model (HG)
   8.118 +-----------------------
   8.119 +
   8.120 +This component model the gain due to the fact that the transmitting device is on a floor above the ground. In the literature [turkmani]_ this gain has been evaluated as about 2 dB per floor. This gain can be applied to all the indoor to outdoor communications and vice-versa.
   8.121 +
   8.122 +
   8.123 +Shadowing Model
   8.124 +---------------
   8.125 +
   8.126 +The shadowing is modeled according to a log-normal distribution with variable standard deviation as function of the connection characteristics. In the implementation we considered three main possible scenarios which correspond to three standard deviations (i.e., the mean is always 0), in detail:
   8.127 +
   8.128 + * outdoor (``m_shadowingSigmaOutdoor``, defaul value of 7 dB) :math:`\rightarrow X_\mathrm{O} \sim N(\mu_\mathrm{O}, \sigma_\mathrm{O}^2)`.
   8.129 + * indoor (``m_shadowingSigmaIndoor``, defaul value of 10 dB) :math:`\rightarrow X_\mathrm{I} \sim N(\mu_\mathrm{I}, \sigma_\mathrm{I}^2)`.
   8.130 + * external walls penetration (``m_shadowingSigmaExtWalls``, default value 5 dB) :math:`\rightarrow X_\mathrm{W} \sim N(\mu_\mathrm{W}, \sigma_\mathrm{W}^2)`
   8.131 +
   8.132 +The simulator generates a shadowing value per each active link according to nodes' position the first time the link is used for transmitting. In case of transmissions from outdoor nodes to indoor ones, and vice-versa, the standard deviation (:math:`\sigma_\mathrm{IO}`) has to be calculated as the square root of the sum of the quadratic values of the standard deviatio in case of outdoor nodes and the one for the external walls penetration. This is due to the fact that that the components producing the shadowing are independent of each other; therefore, the variance of a distribution resulting from the sum of two independent normal ones is the sum of the variances. 
   8.133 +
   8.134 +.. math::
   8.135 +  
   8.136 +  X \sim N(\mu,\sigma^2) \mbox{ and } Y \sim N(\nu,\tau^2)
   8.137 +
   8.138 +  Z = X + Y \sim Z (\mu + \nu, \sigma^2 + \tau^2) 
   8.139 +
   8.140 +  \Rightarrow \sigma_\mathrm{IO} = \sqrt{\sigma_\mathrm{O}^2 + \sigma_\mathrm{W}^2}
   8.141 +
   8.142 +
   8.143 +
   8.144 +
   8.145 +
   8.146 +Pathloss logics
   8.147 ++++++++++++++++
   8.148 +
   8.149 +In the following we describe the different pathloss logic that are implemented by inheriting from BuildingsPropagationLossModel.
   8.150 +
   8.151 +
   8.152 +HybridBuildingsPropagationLossModel
   8.153 +-----------------------------------
   8.154 +
   8.155 +The ``HybridBuildingsPropagationLossModel`` pathloss model included is obtained through a combination of several well known pathloss models in order to mimic different outdoor and indoor scenarios, as well as indoor-to-outdoor and outdoor-to-indoor scenarios. In detail, the class ``HybridBuildingsPropagationLossModel`` integrates the following pathloss models:
   8.156 +
   8.157 + * OkumuraHataPropagationLossModel (OH) (at frequencies > 2.3 GHz substituted by Kun2600MhzPropagationLossModel)
   8.158 + * ItuR1411LosPropagationLossModel and ItuR1411NlosOverRooftopPropagationLossModel (I1411)
   8.159 + * ItuR1238PropagationLossModel (I1238)
   8.160 + * the pathloss elements of the BuildingsPropagationLossModel (EWL, HG, IWL)
   8.161 +
   8.162 +The following pseudo-code illustrates how the different pathloss model elements described above are integrated in  ``HybridBuildingsPropagationLossModel``::
   8.163 +
   8.164 +  if (txNode is outdoor)
   8.165 +    then
   8.166 +      if (rxNode is outdoor)
   8.167 +        then
   8.168 +          if (distance > 1 km)
   8.169 +            then
   8.170 +              if (rxNode or txNode is below the rooftop)
   8.171 +                then
   8.172 +                  L = I1411
   8.173 +                else
   8.174 +                  L = OH 
   8.175 +            else
   8.176 +              L = I1411
   8.177 +        else (rxNode is indoor)
   8.178 +          if (distance > 1 km)
   8.179 +            then
   8.180 +              if (rxNode or txNode is below the rooftop)
   8.181 +                L = I1411 + EWL + HG
   8.182 +              else
   8.183 +                L = OH + EWL + HG
   8.184 +            else
   8.185 +              L = I1411 + EWL + HG
   8.186 +  else (txNode is indoor)
   8.187 +    if (rxNode is indoor)
   8.188 +      then
   8.189 +       if (same building)
   8.190 +          then
   8.191 +            L = I1238 + IWL
   8.192 +          else
   8.193 +            L = I1411 + 2*EWL 
   8.194 +     else (rxNode is outdoor)
   8.195 +      if (distance > 1 km)
   8.196 +        then 
   8.197 +          if (rxNode or txNode is below the rooftop)
   8.198 +                then
   8.199 +                  L = I1411 + EWL + HG
   8.200 +                else
   8.201 +                  L = OH + EWL + HG
   8.202 +        else
   8.203 +          L = I1411 + EWL
   8.204 +
   8.205 +
   8.206 +
   8.207 +
   8.208 +We note that, for the case of communication between two nodes below rooftop level with distance is greater then 1 km, we still consider the I1411 model, since OH is specifically designed for macro cells and therefore for antennas above the roof-top level.
   8.209 +
   8.210 +For the ITU-R P.1411 model we consider both the LOS and NLoS versions. In particular, we considers the LoS propagation for distances that are shorted than a tunable threshold (``m_itu1411NlosThreshold``). In case on NLoS propagation, the over the roof-top model is taken in consideration for modeling both macro BS and SC. In case on NLoS several parameters scenario dependent have been included, such as average street width, orientation, etc. The values of such parameters have to be properly set according to the scenario implemented, the model does not calculate natively their values. In case any values is provided, the standard ones are used, apart for the height of the mobile and BS, which instead their integrity is tested directly in the code (i.e., they have to be greater then zero).  In the following we give the expressions of the components of the model.
   8.211 +
   8.212 +We also note that the use of different propagation models (OH, I1411, I1238 with their variants) in HybridBuildingsPropagationLossModel can result in discontinuities of the pathloss with respect to distance. A proper tuning of the attributes (especially the distance threshold attributes) can avoid these discontinuities. However, since the behavior of each model depends on several other parameters (frequency, node heigth, etc), there is no default value of these thresholds that can avoid the discontinuities in all possible configurations. Hence, an appropriate tuning of these parameters is left to the user.
   8.213 +
   8.214 +
   8.215 +OhBuildingsPropagationLossModel
   8.216 +-------------------------------
   8.217 +
   8.218 +The ``OhBuildingsPropagationLossModel`` class has been created as a simple means to solve the discontinuity problems of ``HybridBuildingsPropagationLossModel`` without doing scenario-specific  parameter tuning. The solution is to use only one propagation loss model (i.e., Okumura Hata), while retaining the structure of the pathloss logic for the calculation of other path loss components (such as wall penetration losses). The result is a model that is free of discontinuities (except those due to walls), but that is less realistic overall for a generic scenario with buildings and outdoor/indoor users, e.g., because Okumura Hata is not suitable neither for indoor communications nor for outdoor communications below rooftop level. 
   8.219 +
   8.220 +In detail, the class ``OhBuildingsPropagationLossModel`` integrates the following pathloss models:
   8.221 +
   8.222 + * OkumuraHataPropagationLossModel (OH)
   8.223 + * the pathloss elements of the BuildingsPropagationLossModel (EWL, HG, IWL)
   8.224 +
   8.225 +The following pseudo-code illustrates how the different pathloss model elements described above are integrated in ``OhBuildingsPropagationLossModel``::
   8.226 +
   8.227 +  if (txNode is outdoor)
   8.228 +    then
   8.229 +      if (rxNode is outdoor)
   8.230 +        then
   8.231 +          L = OH 
   8.232 +        else (rxNode is indoor)
   8.233 +          L = OH + EWL
   8.234 +  else (txNode is indoor)
   8.235 +    if (rxNode is indoor)
   8.236 +      then
   8.237 +       if (same building)
   8.238 +          then
   8.239 +            L = OH + IWL
   8.240 +          else
   8.241 +            L = OH + 2*EWL 
   8.242 +     else (rxNode is outdoor)
   8.243 +        L = OH + EWL
   8.244 +      
   8.245 +We note that OhBuildingsPropagationLossModel is a significant simplification with respect to HybridBuildingsPropagationLossModel, due to the fact that OH is used always. While this gives a less accurate model in some scenarios (especially below rooftop and indoor), it effectively avoids the issue of pathloss discontinuities that affects HybridBuildingsPropagationLossModel. 
   8.246 +
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/src/buildings/doc/source/buildings-references.rst	Fri May 11 16:42:40 2012 +0200
     9.3 @@ -0,0 +1,6 @@
     9.4 +.. include:: replace.txt
     9.5 +
     9.6 +
     9.7 +.. [turkmani] Turkmani A.M.D., J.D. Parson and D.G. Lewis, "Radio propagation into buildings at 441, 900 and 1400 MHz",
     9.8 +   in Proc. of 4th Int. Conference on Land Mobile Radio, 1987.
     9.9 +
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/src/buildings/doc/source/buildings-testing.rst	Fri May 11 16:42:40 2012 +0200
    10.3 @@ -0,0 +1,104 @@
    10.4 ++++++++++++++++++++++++++++++++++++++
    10.5 + Testing Documentation
    10.6 ++++++++++++++++++++++++++++++++++++++
    10.7 +
    10.8 +
    10.9 +Overview
   10.10 +********
   10.11 +
   10.12 +To test and validate the ns-3 Building Pathloss module, some test suites is provided which are integrated with the ns-3 test framework. To run them, you need to have configured the build of the simulator in this way::
   10.13 +
   10.14 +    ./waf configure --enable-tests --enable-modules=buildings
   10.15 +    ./test.py
   10.16 +
   10.17 +The above will run not only the test suites belonging to the buildings module, but also those belonging to all the other ns-3 modules on which the buildings module depends. See the ns-3 manual for generic information on the testing framework.
   10.18 +
   10.19 +You can get a more detailed report in HTML format in this way::
   10.20 +
   10.21 +    ./test.py -w results.html
   10.22 +
   10.23 +After the above command has run, you can view the detailed result for each test by opening the file ``results.html`` with a web browser. 
   10.24 +
   10.25 +You can run each test suite separately using this command::
   10.26 +
   10.27 +    ./test.py -s test-suite-name
   10.28 +
   10.29 +For more details about ``test.py`` and the ns-3 testing framework, please refer to the ns-3 manual.
   10.30 +
   10.31 +
   10.32 +
   10.33 +Description of the test suites
   10.34 +******************************
   10.35 +
   10.36 +
   10.37 +BuildingsHelper test
   10.38 +~~~~~~~~~~~~~~~~~~~~
   10.39 +
   10.40 +The test suite ``buildings-helper`` checks that the method ``BuildingsHelper::MakeAllInstancesConsistent ()`` works properly, i.e., that the BuildingsHelper is successful in locating if nodes are outdoor or indoor, and if indoor that they are located in the correct building, room and floor. Several test cases are provided with different buildings (having different size, position, rooms and floors) and different node positions. The test passes if each every node is located correctly.
   10.41 +
   10.42 +
   10.43 +Pathloss tests
   10.44 +~~~~~~~~~~~~~~
   10.45 +
   10.46 +The test suite ``buildings-pathloss-model`` provides different unit tests that compare the expected results of the buildings pathloss module in specific scenarios with pre calculated values obtained offline with an Octave script (test/reference/buildings-pathloss.m). The tests are considered passed if the two values are equal up to a tolerance of 0.1, which is deemed appropriate for the typical usage of pathloss values (which are in dB).
   10.47 +
   10.48 +In the following we detailed the scenarios considered, their selection has been done for covering the wide set of possible pathloss logic combinations. The pathloss logic results therefore implicitly tested.
   10.49 +
   10.50 +Test #1 Okumura Hata
   10.51 +--------------------
   10.52 +
   10.53 +In this test we test the standard Okumura Hata model; therefore both eNB and UE are placed outside at a distance of 2000 m. The frequency used is the E-UTRA band #5, which correspond to 869 MHz (see table 5.5-1 of 36.101). The test includes also the validation of the areas extensions (i.e., urban, suburban and open-areas) and of the city size (small, medium and large).
   10.54 +
   10.55 +Test #2 COST231 Model
   10.56 +---------------------
   10.57 +
   10.58 +This test is aimed at validating the COST231 model. The test is similar to the Okumura Hata one, except that the frequency used is the EUTRA band #1 (2140 MHz) and that the test can be performed only for large and small cities in urban scenarios due to model limitations.
   10.59 +
   10.60 +Test #3 2.6 GHz model
   10.61 +---------------------
   10.62 +
   10.63 +This test validates the 2.6 empirical model [pl26ghz]_. The test is similar to Okumura Hata one except that the frequency is the EUTRA band #7 (2620 MHz) and the test can be performed only in urban scenario.
   10.64 +
   10.65 +Test #4 ITU1411 LoS model
   10.66 +-------------------------
   10.67 +
   10.68 +This test is aimed at validating the ITU1411 model in case of line of sight within street canyons transmissions. In this case the UE is placed at 100 meters far from the eNB, since the threshold for switching between LoS and NLoS is left to default one (i.e., 200 m.).
   10.69 +
   10.70 +Test #5 ITU1411 NLoS model
   10.71 +--------------------------
   10.72 +
   10.73 +This test is aimed at validating the ITU1411 model in case of non line of sight over the rooftop transmissions. In this case the UE is placed at 900 meters far from the eNB, in order to be above the threshold for switching between LoS and NLoS is left to default one (i.e., 200 m.).
   10.74 +
   10.75 +Test #6 ITUP1238 model
   10.76 +----------------------
   10.77 +
   10.78 +This test is aimed at validating the ITUP1238 model in case of indoor transmissions. In this case both the UE and the eNB are placed in a residential building with walls made of concrete with windows. Ue is placed at the second floor and distances 30 meters far from the eNB, which is placed at the first floor.
   10.79 +
   10.80 +Test #7 Outdoor -> Indoor with Okumura Hata model
   10.81 +-------------------------------------------------
   10.82 +
   10.83 +This test validates the outdoor to indoor transmissions for large distances. In this case the UE is placed in a residential building with wall made of concrete with windows and distances 2000 meters from the outdoor eNB.
   10.84 +
   10.85 +Test #8 Outdoor -> Indoor with ITU1411 model
   10.86 +-------------------------------------------------
   10.87 +
   10.88 +This test validates the outdoor to indoor transmissions for short distances. In this case the UE is placed in a residential building with walls made of concrete with windows and distances 100 meters from the outdoor eNB.
   10.89 +
   10.90 +
   10.91 +Test #9 Indoor -> Outdoor with ITU1411 model
   10.92 +-------------------------------------------------
   10.93 +
   10.94 +This test validates the outdoor to indoor transmissions for very short distances. In this case the eNB is placed in the second floor of a residential building with walls made of concrete with windows and distances 100 meters from the outdoor UE (i.e., LoS communication). Therefore the height gain has to be included in the pathloss evaluation.
   10.95 +
   10.96 +Test #10 Indoor -> Outdoor with ITU1411 model
   10.97 +-------------------------------------------------
   10.98 +
   10.99 +This test validates the outdoor to indoor transmissions for short distances. In this case the eNB is placed in the second floor of a residential building with walls made of concrete with windows and distances 500 meters from the outdoor UE (i.e., NLoS communication). Therefore the height gain has to be included in the pathloss evaluation.
  10.100 +
  10.101 +
  10.102 +Shadowing Test
  10.103 +~~~~~~~~~~~~~~
  10.104 +
  10.105 +The test suite ``buildings-shadowing-test`` is a unit test intended to verify the statistics distribution characteristics of the shadowing are the one expected. The shadowing is modeled according to a normal distribution with mean :math:`\mu = 0` and variable standard deviation :math:`\sigma`, according to models commonly used in literature.
  10.106 +The test generates 10,000 samples of shadowing by subtracting the deterministic component from the total loss returned by the ``BuildingPathlossModel``. The mean and variance of the shadowing samples are then used to verify whether the 99% confidence interval is respected by the sequence generated by the simulator.
  10.107 +
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/src/buildings/doc/source/buildings-user.rst	Fri May 11 16:42:40 2012 +0200
    11.3 @@ -0,0 +1,51 @@
    11.4 +.. include:: replace.txt
    11.5 +
    11.6 +
    11.7 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    11.8 +  User Documentation
    11.9 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
   11.10 +
   11.11 +
   11.12 +
   11.13 +Main configurable parameters
   11.14 +----------------------------
   11.15 +
   11.16 +The ``Building`` class has the following configurable parameters:
   11.17 +
   11.18 +* building type: Residential, Office and Commercial.
   11.19 +* external walls type: Wood, ConcreteWithWindows, ConcreteWithoutWindows and StoneBlocks.
   11.20 +* building bounds: a ``Box`` class with the building bounds.
   11.21 +* number of floors.
   11.22 +* number of rooms in x-axis and y-axis (rooms can be placed only in a grid way).
   11.23 +
   11.24 +The ``BuildingMobilityLossModel`` parameter configurable with the ns3 attribute system is represented by the bound (string ``Bounds``) of the simulation area by providing a ``Box`` class with the area bounds. Moreover, by means of its methos the following parameters can be configured:
   11.25 +
   11.26 +* the number of floor the node is placed (default 0).
   11.27 +* the position in the rooms grid.
   11.28 +
   11.29 +
   11.30 +The ``BuildingPropagationLossModel`` class has the following configurable parameters configurable with the attribute system:
   11.31 +
   11.32 +* ``Frequency``: reference frequency (default 2160 MHz), note that by setting the frequency the wavelength is set accordingly automatically and viceversa).
   11.33 +* ``Lambda``: the wavelength (0.139 meters, considering the above frequency).
   11.34 +* ``ShadowSigmaOutdoor``: the standard deviation of the shadowing for outdoor nodes (defaul 7.0).
   11.35 +* ``ShadowSigmaIndoor``: the standard deviation of the shadowing for indoor nodes (default 8.0).
   11.36 +* ``ShadowSigmaExtWalls``: the standard deviation of the shadowing due to external walls penetration for outdoor to indoor communications (default 5.0).
   11.37 +* ``RooftopLevel``: the level of the rooftop of the building in meters (default 20 meters).
   11.38 +* ``Los2NlosThr``: the value of distance of the switching point between line-of-sigth and non-line-of-sight propagation model in meters (default 200 meters).
   11.39 +* ``ITU1411DistanceThr``: the value of distance of the switching point between short range (ITU 1211) communications and long range (Okumura Hata) in meters (default 200 meters).
   11.40 +* ``MinDistance``: the minimum distance in meters between two nodes for evaluating the pathloss (considered neglictible before this threshold) (default 0.5 meters).
   11.41 +* ``Environment``: the environment scenario among Urban, SubUrban and OpenAreas (default Urban).
   11.42 +* ``CitySize``: the dimension of the city among Small, Medium, Large (default Large).
   11.43 +
   11.44 +In order to use the hybrid mode, the class to be used is the ``HybridBuildingMobilityLossModel``, which allows the selection of the proper pathloss model according to the pathloss logic presented in the design chapter. However, this solution has the problem that the pathloss model switching points might present discontinuities due to the different characteristics of the model. This implies that according to the specific scenario, the threshold used for switching have to be properly tuned.
   11.45 +The simple ``OhBuildingMobilityLossModel`` overcome this problem by using only the Okumura Hata model and the wall penetration losses.
   11.46 +
   11.47 +
   11.48 +
   11.49 +
   11.50 +
   11.51 +
   11.52 +
   11.53 +
   11.54 +
    12.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.2 +++ b/src/buildings/doc/source/buildings.rst	Fri May 11 16:42:40 2012 +0200
    12.3 @@ -0,0 +1,18 @@
    12.4 +
    12.5 +#####################################################
    12.6 +Buildings Module
    12.7 +#####################################################
    12.8 +
    12.9 +
   12.10 +
   12.11 +
   12.12 +.. toctree::
   12.13 +
   12.14 +    buildings-design
   12.15 +    buildings-user
   12.16 +    buildings-testing
   12.17 +    buildings-references
   12.18 +
   12.19 +
   12.20 +
   12.21 +
    13.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    13.2 +++ b/src/buildings/doc/source/conf.py	Fri May 11 16:42:40 2012 +0200
    13.3 @@ -0,0 +1,216 @@
    13.4 +# -*- coding: utf-8 -*-
    13.5 +#
    13.6 +# ns-3 documentation build configuration file, created by
    13.7 +# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
    13.8 +#
    13.9 +# This file is execfile()d with the current directory set to its containing dir.
   13.10 +#
   13.11 +# Note that not all possible configuration values are present in this
   13.12 +# autogenerated file.
   13.13 +#
   13.14 +# All configuration values have a default; values that are commented out
   13.15 +# serve to show the default.
   13.16 +
   13.17 +import sys, os
   13.18 +
   13.19 +# If extensions (or modules to document with autodoc) are in another directory,
   13.20 +# add these directories to sys.path here. If the directory is relative to the
   13.21 +# documentation root, use os.path.abspath to make it absolute, like shown here.
   13.22 +#sys.path.insert(0, os.path.abspath('.'))
   13.23 +
   13.24 +# -- General configuration -----------------------------------------------------
   13.25 +
   13.26 +# If your documentation needs a minimal Sphinx version, state it here.
   13.27 +#needs_sphinx = '1.0'
   13.28 +
   13.29 +# Add any Sphinx extension module names here, as strings. They can be extensions
   13.30 +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
   13.31 +extensions = ['sphinx.ext.pngmath', 
   13.32 +              'sphinxcontrib.seqdiag']
   13.33 +
   13.34 +# Add any paths that contain templates here, relative to this directory.
   13.35 +templates_path = ['_templates']
   13.36 +
   13.37 +# The suffix of source filenames.
   13.38 +source_suffix = '.rst'
   13.39 +
   13.40 +# The encoding of source files.
   13.41 +#source_encoding = 'utf-8-sig'
   13.42 +
   13.43 +# The master toctree document.
   13.44 +master_doc = 'index'
   13.45 +
   13.46 +# General information about the project.
   13.47 +project = u'LENA'
   13.48 +copyright = u'2011-2012, CTTC'
   13.49 +
   13.50 +# The version info for the project you're documenting, acts as replacement for
   13.51 +# |version| and |release|, also used in various other places throughout the
   13.52 +# built documents.
   13.53 +#
   13.54 +# The short X.Y version.
   13.55 +version = 'M2'
   13.56 +# The full version, including alpha/beta/rc tags.
   13.57 +release = 'M2'
   13.58 +
   13.59 +# The language for content autogenerated by Sphinx. Refer to documentation
   13.60 +# for a list of supported languages.
   13.61 +#language = None
   13.62 +
   13.63 +# There are two options for replacing |today|: either, you set today to some
   13.64 +# non-false value, then it is used:
   13.65 +#today = ''
   13.66 +# Else, today_fmt is used as the format for a strftime call.
   13.67 +#today_fmt = '%B %d, %Y'
   13.68 +
   13.69 +# List of patterns, relative to source directory, that match files and
   13.70 +# directories to ignore when looking for source files.
   13.71 +exclude_patterns = []
   13.72 +
   13.73 +# The reST default role (used for this markup: `text`) to use for all documents.
   13.74 +#default_role = None
   13.75 +
   13.76 +# If true, '()' will be appended to :func: etc. cross-reference text.
   13.77 +#add_function_parentheses = True
   13.78 +
   13.79 +# If true, the current module name will be prepended to all description
   13.80 +# unit titles (such as .. function::).
   13.81 +#add_module_names = True
   13.82 +
   13.83 +# If true, sectionauthor and moduleauthor directives will be shown in the
   13.84 +# output. They are ignored by default.
   13.85 +#show_authors = False
   13.86 +
   13.87 +# The name of the Pygments (syntax highlighting) style to use.
   13.88 +pygments_style = 'sphinx'
   13.89 +
   13.90 +# A list of ignored prefixes for module index sorting.
   13.91 +#modindex_common_prefix = []
   13.92 +
   13.93 +
   13.94 +# -- Options for HTML output ---------------------------------------------------
   13.95 +
   13.96 +# The theme to use for HTML and HTML Help pages.  See the documentation for
   13.97 +# a list of builtin themes.
   13.98 +html_theme = 'default'
   13.99 +
  13.100 +# Theme options are theme-specific and customize the look and feel of a theme
  13.101 +# further.  For a list of options available for each theme, see the
  13.102 +# documentation.
  13.103 +#html_theme_options = {}
  13.104 +
  13.105 +# Add any paths that contain custom themes here, relative to this directory.
  13.106 +#html_theme_path = []
  13.107 +
  13.108 +# The name for this set of Sphinx documents.  If None, it defaults to
  13.109 +# "<project> v<release> documentation".
  13.110 +#html_title = None
  13.111 +
  13.112 +# A shorter title for the navigation bar.  Default is the same as html_title.
  13.113 +#html_short_title = None
  13.114 +
  13.115 +# The name of an image file (relative to this directory) to place at the top
  13.116 +# of the sidebar.
  13.117 +#html_logo = None
  13.118 +
  13.119 +# The name of an image file (within the static path) to use as favicon of the
  13.120 +# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
  13.121 +# pixels large.
  13.122 +#html_favicon = None
  13.123 +
  13.124 +# Add any paths that contain custom static files (such as style sheets) here,
  13.125 +# relative to this directory. They are copied after the builtin static files,
  13.126 +# so a file named "default.css" will overwrite the builtin "default.css".
  13.127 +#html_static_path = ['_static']
  13.128 +
  13.129 +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
  13.130 +# using the given strftime format.
  13.131 +#html_last_updated_fmt = '%b %d, %Y'
  13.132 +
  13.133 +# If true, SmartyPants will be used to convert quotes and dashes to
  13.134 +# typographically correct entities.
  13.135 +#html_use_smartypants = True
  13.136 +
  13.137 +# Custom sidebar templates, maps document names to template names.
  13.138 +#html_sidebars = {}
  13.139 +
  13.140 +# Additional templates that should be rendered to pages, maps page names to
  13.141 +# template names.
  13.142 +#html_additional_pages = {}
  13.143 +
  13.144 +# If false, no module index is generated.
  13.145 +#html_domain_indices = True
  13.146 +
  13.147 +# If false, no index is generated.
  13.148 +#html_use_index = True
  13.149 +
  13.150 +# If true, the index is split into individual pages for each letter.
  13.151 +#html_split_index = False
  13.152 +
  13.153 +# If true, links to the reST sources are added to the pages.
  13.154 +#html_show_sourcelink = True
  13.155 +
  13.156 +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
  13.157 +#html_show_sphinx = True
  13.158 +
  13.159 +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
  13.160 +#html_show_copyright = True
  13.161 +
  13.162 +# If true, an OpenSearch description file will be output, and all pages will
  13.163 +# contain a <link> tag referring to it.  The value of this option must be the
  13.164 +# base URL from which the finished HTML is served.
  13.165 +#html_use_opensearch = ''
  13.166 +
  13.167 +# This is the file name suffix for HTML files (e.g. ".xhtml").
  13.168 +#html_file_suffix = None
  13.169 +
  13.170 +# Output file base name for HTML help builder.
  13.171 +#htmlhelp_basename = 'ns-3doc'
  13.172 +
  13.173 +
  13.174 +# -- Options for LaTeX output --------------------------------------------------
  13.175 +
  13.176 +# The paper size ('letter' or 'a4').
  13.177 +#latex_paper_size = 'letter'
  13.178 +
  13.179 +# The font size ('10pt', '11pt' or '12pt').
  13.180 +#latex_font_size = '10pt'
  13.181 +
  13.182 +# Grouping the document tree into LaTeX files. List of tuples
  13.183 +# (source start file, target name, title, author, documentclass [howto/manual]).
  13.184 +latex_documents = [
  13.185 +  ('buildings', 'buildings.tex', u'Buildings Module Documentation', u'Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)', 'manual'),
  13.186 +]
  13.187 +
  13.188 +# The name of an image file (relative to this directory) to place at the top of
  13.189 +# the title page.
  13.190 +#latex_logo = None
  13.191 +
  13.192 +# For "manual" documents, if this is true, then toplevel headings are parts,
  13.193 +# not chapters.
  13.194 +#latex_use_parts = False
  13.195 +
  13.196 +# If true, show page references after internal links.
  13.197 +#latex_show_pagerefs = False
  13.198 +
  13.199 +# If true, show URL addresses after external links.
  13.200 +#latex_show_urls = False
  13.201 +
  13.202 +# Additional stuff for the LaTeX preamble.
  13.203 +#latex_preamble = ''
  13.204 +
  13.205 +# Documents to append as an appendix to all manuals.
  13.206 +#latex_appendices = []
  13.207 +
  13.208 +# If false, no module index is generated.
  13.209 +#latex_domain_indices = True
  13.210 +
  13.211 +
  13.212 +# -- Options for manual page output --------------------------------------------
  13.213 +
  13.214 +# One entry per manual page. List of tuples
  13.215 +# (source start file, name, description, authors, manual section).
  13.216 +man_pages = [
  13.217 +    ('index', 'ns-3-model-library', u'ns-3 Model Library',
  13.218 +     [u'ns-3 project'], 1)
  13.219 +]
    14.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.2 +++ b/src/buildings/doc/source/index.rst	Fri May 11 16:42:40 2012 +0200
    14.3 @@ -0,0 +1,17 @@
    14.4 +
    14.5 +#####################################################
    14.6 +Buildings Module
    14.7 +#####################################################
    14.8 +
    14.9 +
   14.10 +
   14.11 +
   14.12 +.. toctree::
   14.13 +
   14.14 +    buildings-design
   14.15 +    buildings-user
   14.16 +    buildings-testing
   14.17 +
   14.18 +
   14.19 +
   14.20 +
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/src/buildings/doc/source/replace.txt	Fri May 11 16:42:40 2012 +0200
    15.3 @@ -0,0 +1,3 @@
    15.4 +.. |ns3| replace:: *ns-3*
    15.5 +
    15.6 +.. |ns2| replace:: *ns-2*
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/src/buildings/examples/buildings-pathloss-profiler.cc	Fri May 11 16:42:40 2012 +0200
    16.3 @@ -0,0 +1,97 @@
    16.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    16.5 +/*
    16.6 +* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    16.7 +*
    16.8 +* This program is free software; you can redistribute it and/or modify
    16.9 +* it under the terms of the GNU General Public License version 2 as
   16.10 +* published by the Free Software Foundation;
   16.11 +*
   16.12 +* This program is distributed in the hope that it will be useful,
   16.13 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
   16.14 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   16.15 +* GNU General Public License for more details.
   16.16 +*
   16.17 +* You should have received a copy of the GNU General Public License
   16.18 +* along with this program; if not, write to the Free Software
   16.19 +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   16.20 +*
   16.21 +* Author: Marco Miozzo <marco.miozzo@cttc.es>
   16.22 +*/
   16.23 +
   16.24 +#include "ns3/core-module.h"
   16.25 +#include "ns3/network-module.h"
   16.26 +#include "ns3/mobility-module.h"
   16.27 +#include "ns3/lte-module.h"
   16.28 +#include "ns3/config-store.h"
   16.29 +#include <ns3/hybrid-buildings-propagation-loss-model.h>
   16.30 +
   16.31 +#include <iomanip>
   16.32 +#include <string>
   16.33 +#include <vector>
   16.34 +
   16.35 +using namespace ns3;
   16.36 +using std::vector;
   16.37 +
   16.38 +int
   16.39 +main (int argc, char *argv[])
   16.40 +{
   16.41 +  
   16.42 +  double hEnb = 30.0;
   16.43 +  double hUe = 1.0;
   16.44 +  bool enbIndoor = false;
   16.45 +  bool ueIndoor = false;
   16.46 +  CommandLine cmd;
   16.47 +  
   16.48 +  cmd.AddValue("hEnb", "Height of the eNB", hEnb);
   16.49 +  cmd.AddValue("hUe", "Height of UE", hUe);
   16.50 +  cmd.AddValue("enbIndoor", "Boolean for eNB Indoor/Outdoor selection",               enbIndoor);
   16.51 +  cmd.AddValue("ueIndoor", "Boolean for UE Indoor/Outdoor selection",               ueIndoor);
   16.52 +  cmd.Parse(argc, argv);
   16.53 +  
   16.54 +  ConfigStore inputConfig;
   16.55 +  inputConfig.ConfigureDefaults ();
   16.56 +  
   16.57 +  
   16.58 +  // parse again so you can override default values from the command line
   16.59 +  cmd.Parse (argc, argv);
   16.60 +  
   16.61 +  
   16.62 +  std::ofstream outFile;
   16.63 +  outFile.open ("buildings-pathloss-profiler.out");
   16.64 +  if (!outFile.is_open ())
   16.65 +  {
   16.66 +    NS_FATAL_ERROR ("Can't open output file");
   16.67 +  }
   16.68 +  
   16.69 +  Ptr<BuildingsMobilityModel> mmEnb = CreateObject<BuildingsMobilityModel> ();
   16.70 +  mmEnb->SetPosition (Vector (0.0, 0.0, hEnb));
   16.71 +  if (enbIndoor)
   16.72 +    {
   16.73 +      Ptr<Building> building1 = Create<Building> (0.0, 10.0, 0.0, 10.0, 0.0, 20.0 /*, 1, 1, 1*/);
   16.74 +      building1->SetBuildingType (Building::Residential);
   16.75 +      building1->SetExtWallsType (Building::ConcreteWithWindows);
   16.76 +      mmEnb->SetIndoor (building1);
   16.77 +    }
   16.78 +  
   16.79 +  Ptr<HybridBuildingsPropagationLossModel> propagationLossModel = CreateObject<HybridBuildingsPropagationLossModel> ();
   16.80 +  // cancel shadowing effect
   16.81 +  propagationLossModel->SetAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
   16.82 +  propagationLossModel->SetAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
   16.83 +  propagationLossModel->SetAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
   16.84 +  
   16.85 +//   propagationLossModel->SetAttribute ("Los2NlosThr", DoubleValue (1550.0));
   16.86 +  
   16.87 +  //for (uint8_t i = 0; i < 23; i++)
   16.88 +  for (uint32_t i = 1; i < 2300; i++)
   16.89 +    {
   16.90 +      Ptr<BuildingsMobilityModel> mmUe = CreateObject<BuildingsMobilityModel> ();
   16.91 +      mmUe->SetPosition (Vector (i, 0.0, hUe));
   16.92 +      double loss = propagationLossModel->GetLoss (mmEnb, mmUe);
   16.93 +      outFile << i << "\t"
   16.94 +              << loss 
   16.95 +              << std::endl;
   16.96 +    }
   16.97 +    
   16.98 +  Simulator::Destroy ();
   16.99 +  
  16.100 +}
    17.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    17.2 +++ b/src/buildings/examples/wscript	Fri May 11 16:42:40 2012 +0200
    17.3 @@ -0,0 +1,6 @@
    17.4 +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
    17.5 +
    17.6 +def build(bld):
    17.7 +    obj = bld.create_ns3_program('buildings-pathloss-profiler',
    17.8 +                                 ['buildings'])
    17.9 +    obj.source = 'buildings-pathloss-profiler.cc'
    18.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.2 +++ b/src/buildings/helper/building-allocator.cc	Fri May 11 16:42:40 2012 +0200
    18.3 @@ -0,0 +1,146 @@
    18.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    18.5 +/*
    18.6 + * Copyright (c) 2007 INRIA
    18.7 + * Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    18.8 + *
    18.9 + * This program is free software; you can redistribute it and/or modify
   18.10 + * it under the terms of the GNU General Public License version 2 as
   18.11 + * published by the Free Software Foundation;
   18.12 + *
   18.13 + * This program is distributed in the hope that it will be useful,
   18.14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   18.15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   18.16 + * GNU General Public License for more details.
   18.17 + *
   18.18 + * You should have received a copy of the GNU General Public License
   18.19 + * along with this program; if not, write to the Free Software
   18.20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   18.21 + *
   18.22 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   18.23 + * Author: Nicola Baldo <nbaldo@cttc.es> (took position-allocator and turned it into building-allocator)
   18.24 + */
   18.25 +#include "building-allocator.h"
   18.26 +#include "ns3/building.h"
   18.27 +#include "ns3/random-variable.h"
   18.28 +#include "ns3/double.h"
   18.29 +#include "ns3/uinteger.h"
   18.30 +#include "ns3/enum.h"
   18.31 +#include "ns3/log.h"
   18.32 +#include <cmath>
   18.33 +
   18.34 +NS_LOG_COMPONENT_DEFINE ("BuildingAllocator");
   18.35 +
   18.36 +namespace ns3 {
   18.37 +
   18.38 +NS_OBJECT_ENSURE_REGISTERED (GridBuildingAllocator);
   18.39 +
   18.40 +GridBuildingAllocator::GridBuildingAllocator ()
   18.41 +  : m_current (0)
   18.42 +{
   18.43 +  m_buildingFactory.SetTypeId ("ns3::Building");
   18.44 +  m_lowerLeftPositionAllocator = CreateObject<GridPositionAllocator> ();
   18.45 +  m_upperRightPositionAllocator = CreateObject<GridPositionAllocator> ();
   18.46 +}
   18.47 +
   18.48 +GridBuildingAllocator::~GridBuildingAllocator ()
   18.49 +{
   18.50 +}
   18.51 +
   18.52 +TypeId 
   18.53 +GridBuildingAllocator::GetTypeId (void)
   18.54 +{
   18.55 +  static TypeId tid = TypeId ("ns3::GridBuildingAllocator")
   18.56 +    .SetParent<Object> ()
   18.57 +    .AddConstructor<GridBuildingAllocator> ()
   18.58 +    .AddAttribute ("GridWidth", "The number of objects layed out on a line.",
   18.59 +                   UintegerValue (10),
   18.60 +                   MakeUintegerAccessor (&GridBuildingAllocator::m_n),
   18.61 +                   MakeUintegerChecker<uint32_t> ())
   18.62 +    .AddAttribute ("MinX", "The x coordinate where the grid starts.",
   18.63 +                   DoubleValue (1.0),
   18.64 +                   MakeDoubleAccessor (&GridBuildingAllocator::m_xMin),
   18.65 +                   MakeDoubleChecker<double> ())
   18.66 +    .AddAttribute ("MinY", "The y coordinate where the grid starts.",
   18.67 +                   DoubleValue (0.0),
   18.68 +                   MakeDoubleAccessor (&GridBuildingAllocator::m_yMin),
   18.69 +                   MakeDoubleChecker<double> ())
   18.70 +    .AddAttribute ("LengthX", " the length of the wall of each building along the X axis.",
   18.71 +                   DoubleValue (1.0),
   18.72 +                   MakeDoubleAccessor (&GridBuildingAllocator::m_lengthX),
   18.73 +                   MakeDoubleChecker<double> ())
   18.74 +    .AddAttribute ("LengthY", " the length of the wall of each building along the X axis.",
   18.75 +                   DoubleValue (1.0),
   18.76 +                   MakeDoubleAccessor (&GridBuildingAllocator::m_lengthY),
   18.77 +                   MakeDoubleChecker<double> ())
   18.78 +    .AddAttribute ("DeltaX", "The x space between buildings.",
   18.79 +                   DoubleValue (1.0),
   18.80 +                   MakeDoubleAccessor (&GridBuildingAllocator::m_deltaX),
   18.81 +                   MakeDoubleChecker<double> ())
   18.82 +    .AddAttribute ("DeltaY", "The y space between buildings.",
   18.83 +                   DoubleValue (1.0),
   18.84 +                   MakeDoubleAccessor (&GridBuildingAllocator::m_deltaY),
   18.85 +                   MakeDoubleChecker<double> ())
   18.86 +    .AddAttribute ("Height", "The height of the building (roof level)",
   18.87 +                   DoubleValue (10),
   18.88 +                   MakeDoubleAccessor (&GridBuildingAllocator::m_height),
   18.89 +                   MakeDoubleChecker<double> ())
   18.90 +    .AddAttribute ("LayoutType", "The type of layout.",
   18.91 +                   EnumValue (GridPositionAllocator::ROW_FIRST),
   18.92 +                   MakeEnumAccessor (&GridBuildingAllocator::m_layoutType),
   18.93 +                   MakeEnumChecker (GridPositionAllocator::ROW_FIRST, "RowFirst",
   18.94 +                                    GridPositionAllocator::COLUMN_FIRST, "ColumnFirst"))
   18.95 +  ;
   18.96 +  return tid;
   18.97 +}
   18.98 +
   18.99 +void
  18.100 +GridBuildingAllocator::SetBuildingAttribute (std::string n, const AttributeValue &v)
  18.101 +{
  18.102 +  NS_LOG_FUNCTION (this);
  18.103 +  m_buildingFactory.Set (n, v);
  18.104 +}
  18.105 +
  18.106 +BuildingContainer
  18.107 +GridBuildingAllocator::Create (uint32_t n) const
  18.108 +{
  18.109 +  NS_LOG_FUNCTION (this);
  18.110 +  PushAttributes ();
  18.111 +  BuildingContainer bc;
  18.112 +  uint32_t limit = n + m_current;
  18.113 +  for (; m_current < limit; ++m_current)
  18.114 +    {
  18.115 +      Vector lowerLeft = m_lowerLeftPositionAllocator->GetNext ();
  18.116 +      Vector upperRight = m_upperRightPositionAllocator->GetNext ();
  18.117 +      Box box (lowerLeft.x, upperRight.x, lowerLeft.y, upperRight.y, 0, m_height);
  18.118 +      NS_LOG_LOGIC ("new building : " <<  box);
  18.119 +      BoxValue boxValue (box);
  18.120 +      m_buildingFactory.Set ("Boundaries", boxValue);
  18.121 +      Ptr<Building> b  = m_buildingFactory.Create<Building> ();
  18.122 +      bc.Add (b);     
  18.123 +    }
  18.124 +  return bc;
  18.125 +}
  18.126 +
  18.127 +void
  18.128 +GridBuildingAllocator::PushAttributes () const
  18.129 +{
  18.130 +  NS_LOG_FUNCTION (this);
  18.131 +  m_lowerLeftPositionAllocator->SetMinX (m_xMin);
  18.132 +  m_upperRightPositionAllocator->SetMinX (m_xMin + m_lengthX);
  18.133 +  m_lowerLeftPositionAllocator->SetDeltaX (m_lengthX + m_deltaX);
  18.134 +  m_upperRightPositionAllocator->SetDeltaX (m_lengthX + m_deltaX);
  18.135 +  
  18.136 +  m_lowerLeftPositionAllocator->SetMinY (m_yMin);
  18.137 +  m_upperRightPositionAllocator->SetMinY (m_yMin + m_lengthY);
  18.138 +  m_lowerLeftPositionAllocator->SetDeltaY (m_lengthY + m_deltaY);
  18.139 +  m_upperRightPositionAllocator->SetDeltaY (m_lengthY + m_deltaY); 
  18.140 +
  18.141 +  m_lowerLeftPositionAllocator->SetLayoutType (m_layoutType);
  18.142 +  m_upperRightPositionAllocator->SetLayoutType (m_layoutType);
  18.143 +
  18.144 +  m_lowerLeftPositionAllocator->SetN (m_n);
  18.145 +  m_upperRightPositionAllocator->SetN (m_n);
  18.146 +}
  18.147 +
  18.148 +
  18.149 +} // namespace ns3 
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/src/buildings/helper/building-allocator.h	Fri May 11 16:42:40 2012 +0200
    19.3 @@ -0,0 +1,93 @@
    19.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    19.5 +/*
    19.6 + * Copyright (c) 2007 INRIA
    19.7 + * Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    19.8 + *
    19.9 + * This program is free software; you can redistribute it and/or modify
   19.10 + * it under the terms of the GNU General Public License version 2 as
   19.11 + * published by the Free Software Foundation;
   19.12 + *
   19.13 + * This program is distributed in the hope that it will be useful,
   19.14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   19.15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   19.16 + * GNU General Public License for more details.
   19.17 + *
   19.18 + * You should have received a copy of the GNU General Public License
   19.19 + * along with this program; if not, write to the Free Software
   19.20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   19.21 + *
   19.22 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
   19.23 + * Author: Nicola Baldo <nbaldo@cttc.es> (took position-allocator and turned it into building-allocator)
   19.24 + */
   19.25 +#ifndef BUILDING_ALLOCATOR_H
   19.26 +#define BUILDING_ALLOCATOR_H
   19.27 +
   19.28 +#include "ns3/object.h"
   19.29 +#include "ns3/object-factory.h"
   19.30 +#include "ns3/random-variable.h"
   19.31 +#include "ns3/vector.h"
   19.32 +#include "ns3/building-container.h"
   19.33 +#include "ns3/position-allocator.h"
   19.34 +
   19.35 +namespace ns3 {
   19.36 +
   19.37 +class Building;
   19.38 +
   19.39 +
   19.40 +/**
   19.41 + * \ingroup buildings
   19.42 + * \brief Allocate buildings on a rectangular 2d grid.
   19.43 + *
   19.44 + * This class allows to create a set of buildings positioned on a
   19.45 + * rectangular 2D grid. Under the hood, this class uses two instances
   19.46 + * of GridPositionAllocator. 
   19.47 + */
   19.48 +class GridBuildingAllocator : public Object
   19.49 +{
   19.50 +public:
   19.51 +  GridBuildingAllocator ();
   19.52 +  virtual ~GridBuildingAllocator ();
   19.53 +
   19.54 +  // inherited from Object
   19.55 +  static TypeId GetTypeId (void);
   19.56 +
   19.57 +  /** 
   19.58 +   * Set an attribute to be used for each new building to be created
   19.59 +   * 
   19.60 +   * \param n attribute name
   19.61 +   * \param v attribute value
   19.62 +   */
   19.63 +  void SetBuildingAttribute (std::string n, const AttributeValue &v);
   19.64 +
   19.65 +  /** 
   19.66 +   * Create a set of buildings allocated on a grid
   19.67 +   * 
   19.68 +   * \param n the number of buildings to create
   19.69 +   * 
   19.70 +   * \return the BuildingContainer that contains the newly created buildings
   19.71 +   */
   19.72 +  BuildingContainer Create (uint32_t n) const;
   19.73 +
   19.74 +private:
   19.75 +
   19.76 +  void PushAttributes () const;
   19.77 +  mutable uint32_t m_current;
   19.78 +  enum GridPositionAllocator::LayoutType m_layoutType;
   19.79 +  double m_xMin;
   19.80 +  double m_yMin;
   19.81 +  uint32_t m_n;
   19.82 +  double m_lengthX;
   19.83 +  double m_lengthY;
   19.84 +  double m_deltaX;
   19.85 +  double m_deltaY;
   19.86 +  double m_height;
   19.87 +
   19.88 +  mutable ObjectFactory m_buildingFactory;
   19.89 +  Ptr<GridPositionAllocator> m_lowerLeftPositionAllocator;
   19.90 +  Ptr<GridPositionAllocator> m_upperRightPositionAllocator;
   19.91 +  
   19.92 +};
   19.93 +
   19.94 +} // namespace ns3
   19.95 +
   19.96 +#endif /* BUILDING_ALLOCATOR_H */
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/src/buildings/helper/building-container.cc	Fri May 11 16:42:40 2012 +0200
    20.3 @@ -0,0 +1,102 @@
    20.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    20.5 +/*
    20.6 + * Copyright (c) 2008 INRIA
    20.7 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    20.8 + *
    20.9 + * This program is free software; you can redistribute it and/or modify
   20.10 + * it under the terms of the GNU General Public License version 2 as
   20.11 + * published by the Free Software Foundation;
   20.12 + *
   20.13 + * This program is distributed in the hope that it will be useful,
   20.14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   20.15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   20.16 + * GNU General Public License for more details.
   20.17 + *
   20.18 + * You should have received a copy of the GNU General Public License
   20.19 + * along with this program; if not, write to the Free Software
   20.20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   20.21 + *
   20.22 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> (original node-container.cc)
   20.23 + *         Nicola Baldo (wrote building-container.cc based on node-container.cc)
   20.24 + */
   20.25 +#include "building-container.h"
   20.26 +#include "ns3/building-list.h"
   20.27 +#include "ns3/names.h"
   20.28 +
   20.29 +namespace ns3 {
   20.30 +
   20.31 +BuildingContainer::BuildingContainer ()
   20.32 +{
   20.33 +}
   20.34 +
   20.35 +BuildingContainer::BuildingContainer (Ptr<Building> building)
   20.36 +{
   20.37 +  m_buildings.push_back (building);
   20.38 +}
   20.39 +BuildingContainer::BuildingContainer (std::string buildingName)
   20.40 +{
   20.41 +  Ptr<Building> building = Names::Find<Building> (buildingName);
   20.42 +  m_buildings.push_back (building);
   20.43 +}
   20.44 +
   20.45 +BuildingContainer::Iterator 
   20.46 +BuildingContainer::Begin (void) const
   20.47 +{
   20.48 +  return m_buildings.begin ();
   20.49 +}
   20.50 +BuildingContainer::Iterator 
   20.51 +BuildingContainer::End (void) const
   20.52 +{
   20.53 +  return m_buildings.end ();
   20.54 +}
   20.55 +
   20.56 +uint32_t 
   20.57 +BuildingContainer::GetN (void) const
   20.58 +{
   20.59 +  return m_buildings.size ();
   20.60 +}
   20.61 +Ptr<Building> 
   20.62 +BuildingContainer::Get (uint32_t i) const
   20.63 +{
   20.64 +  return m_buildings[i];
   20.65 +}
   20.66 +void 
   20.67 +BuildingContainer::Create (uint32_t n)
   20.68 +{
   20.69 +  for (uint32_t i = 0; i < n; i++)
   20.70 +    {
   20.71 +      m_buildings.push_back (CreateObject<Building> ());
   20.72 +    }
   20.73 +}
   20.74 +void 
   20.75 +BuildingContainer::Add (BuildingContainer other)
   20.76 +{
   20.77 +  for (Iterator i = other.Begin (); i != other.End (); i++)
   20.78 +    {
   20.79 +      m_buildings.push_back (*i);
   20.80 +    }
   20.81 +}
   20.82 +void 
   20.83 +BuildingContainer::Add (Ptr<Building> building)
   20.84 +{
   20.85 +  m_buildings.push_back (building);
   20.86 +}
   20.87 +void 
   20.88 +BuildingContainer::Add (std::string buildingName)
   20.89 +{
   20.90 +  Ptr<Building> building = Names::Find<Building> (buildingName);
   20.91 +  m_buildings.push_back (building);
   20.92 +}
   20.93 +
   20.94 +BuildingContainer 
   20.95 +BuildingContainer::GetGlobal (void)
   20.96 +{
   20.97 +  BuildingContainer c;
   20.98 +  for (BuildingList::Iterator i = BuildingList::Begin (); i != BuildingList::End (); ++i)
   20.99 +    {
  20.100 +      c.Add (*i);
  20.101 +    }
  20.102 +  return c;
  20.103 +}
  20.104 +
  20.105 +} // namespace ns3
    21.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.2 +++ b/src/buildings/helper/building-container.h	Fri May 11 16:42:40 2012 +0200
    21.3 @@ -0,0 +1,208 @@
    21.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    21.5 +/*
    21.6 + * Copyright (c) 2008 INRIA
    21.7 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    21.8 + *
    21.9 + * This program is free software; you can redistribute it and/or modify
   21.10 + * it under the terms of the GNU General Public License version 2 as
   21.11 + * published by the Free Software Foundation;
   21.12 + *
   21.13 + * This program is distributed in the hope that it will be useful,
   21.14 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   21.15 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   21.16 + * GNU General Public License for more details.
   21.17 + *
   21.18 + * You should have received a copy of the GNU General Public License
   21.19 + * along with this program; if not, write to the Free Software
   21.20 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   21.21 + *
   21.22 + * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> (original node-container.h)
   21.23 + *         Nicola Baldo (wrote building-container.h based on node-container.h)
   21.24 + */
   21.25 +#ifndef BUILDING_CONTAINER_H
   21.26 +#define BUILDING_CONTAINER_H
   21.27 +
   21.28 +#include <stdint.h>
   21.29 +#include <vector>
   21.30 +#include <ns3/building.h>
   21.31 +
   21.32 +namespace ns3 {
   21.33 +
   21.34 +/**
   21.35 + * \brief keep track of a set of building pointers.
   21.36 + *
   21.37 + * Some ns-3 helpers operate on more than one building at a time.  For example
   21.38 + * a PositionAllocator may want to position nodes on a set of buildings.
   21.39 + * The helper methods will then usually take a BuildingContainer as a
   21.40 + * parameter.  BuildingContainers hold the multiple Ptr<Building> which are used
   21.41 + * to refer to the buildings.
   21.42 + */
   21.43 +class BuildingContainer
   21.44 +{
   21.45 +public:
   21.46 +  typedef std::vector<Ptr<Building> >::const_iterator Iterator;
   21.47 +
   21.48 +  /**
   21.49 +   * Create an empty BuildingContainer.
   21.50 +   */
   21.51 +  BuildingContainer ();
   21.52 +
   21.53 +  /**
   21.54 +   * Create a BuildingContainer with exactly one building which has been previously
   21.55 +   * instantiated.  The single Building is specified by a smart pointer.
   21.56 +   *
   21.57 +   * \param building The Ptr<Building> to add to the container.
   21.58 +   */
   21.59 +  BuildingContainer (Ptr<Building> building);
   21.60 +
   21.61 +  /**
   21.62 +   * Create a BuildingContainer with exactly one building which has been previously 
   21.63 +   * instantiated and assigned a name using the Object Name Service.  This 
   21.64 +   * Building is then specified by its assigned name. 
   21.65 +   *
   21.66 +   * \param buildingName The name of the Building Object to add to the container.
   21.67 +   */
   21.68 +  BuildingContainer (std::string buildingName);
   21.69 +
   21.70 +  /**
   21.71 +   * \brief Get an iterator which refers to the first Building in the 
   21.72 +   * container.
   21.73 +   *
   21.74 +   * Buildings can be retrieved from the container in two ways.  First,
   21.75 +   * directly by an index into the container, and second, using an iterator.
   21.76 +   * This method is used in the iterator method and is typically used in a 
   21.77 +   * for-loop to run through the Buildings
   21.78 +   *
   21.79 +   * \code
   21.80 +   *   BuildingContainer::Iterator i;
   21.81 +   *   for (i = container.Begin (); i != container.End (); ++i)
   21.82 +   *     {
   21.83 +   *       (*i)->method ();  // some Building method
   21.84 +   *     }
   21.85 +   * \endcode
   21.86 +   *
   21.87 +   * \returns an iterator which refers to the first Building in the container.
   21.88 +   */
   21.89 +  Iterator Begin (void) const;
   21.90 +
   21.91 +  /**
   21.92 +   * \brief Get an iterator which indicates past-the-last Building in the 
   21.93 +   * container.
   21.94 +   *
   21.95 +   * Buildings can be retrieved from the container in two ways.  First,
   21.96 +   * directly by an index into the container, and second, using an iterator.
   21.97 +   * This method is used in the iterator method and is typically used in a 
   21.98 +   * for-loop to run through the Buildings
   21.99 +   *
  21.100 +   * \code
  21.101 +   *   BuildingContainer::Iterator i;
  21.102 +   *   for (i = container.Begin (); i != container.End (); ++i)
  21.103 +   *     {
  21.104 +   *       (*i)->method ();  // some Building method
  21.105 +   *     }
  21.106 +   * \endcode
  21.107 +   *
  21.108 +   * \returns an iterator which indicates an ending condition for a loop.
  21.109 +   */
  21.110 +  Iterator End (void) const;
  21.111 +
  21.112 +  /**
  21.113 +   * \brief Get the number of Ptr<Building> stored in this container.
  21.114 +   *
  21.115 +   * Buildings can be retrieved from the container in two ways.  First,
  21.116 +   * directly by an index into the container, and second, using an iterator.
  21.117 +   * This method is used in the direct method and is typically used to
  21.118 +   * define an ending condition in a for-loop that runs through the stored
  21.119 +   * Buildings
  21.120 +   *
  21.121 +   * \code
  21.122 +   *   uint32_t nBuildings = container.GetN ();
  21.123 +   *   for (uint32_t i = 0 i < nBuildings; ++i)
  21.124 +   *     {
  21.125 +   *       Ptr<Building> p = container.Get (i)
  21.126 +   *       i->method ();  // some Building method
  21.127 +   *     }
  21.128 +   * \endcode
  21.129 +   *
  21.130 +   * \returns the number of Ptr<Building> stored in this container.
  21.131 +   */
  21.132 +  uint32_t GetN (void) const;
  21.133 +
  21.134 +  /**
  21.135 +   * \brief Get the Ptr<Building> stored in this container at a given
  21.136 +   * index.
  21.137 +   *
  21.138 +   * Buildings can be retrieved from the container in two ways.  First,
  21.139 +   * directly by an index into the container, and second, using an iterator.
  21.140 +   * This method is used in the direct method and is used to retrieve the
  21.141 +   * indexed Ptr<Appliation>.
  21.142 +   *
  21.143 +   * \code
  21.144 +   *   uint32_t nBuildings = container.GetN ();
  21.145 +   *   for (uint32_t i = 0 i < nBuildings; ++i)
  21.146 +   *     {
  21.147 +   *       Ptr<Building> p = container.Get (i)
  21.148 +   *       i->method ();  // some Building method
  21.149 +   *     }
  21.150 +   * \endcode
  21.151 +   *
  21.152 +   * \param i the index of the requested building pointer.
  21.153 +   * \returns the requested building pointer.
  21.154 +   */
  21.155 +  Ptr<Building> Get (uint32_t i) const;
  21.156 +
  21.157 +  /**
  21.158 +   * \brief Create n buildings and append pointers to them to the end of this 
  21.159 +   * BuildingContainer.
  21.160 +   *
  21.161 +   * Buildings are at the heart of any ns-3 simulation.  One of the first tasks that
  21.162 +   * any simulation needs to do is to create a number of buildings.  This method
  21.163 +   * automates that task.
  21.164 +   *
  21.165 +   * \param n The number of Buildings to create
  21.166 +   */
  21.167 +  void Create (uint32_t n);
  21.168 +
  21.169 +  /**
  21.170 +   * \brief Append the contents of another BuildingContainer to the end of
  21.171 +   * this container.
  21.172 +   *
  21.173 +   * \param other The BuildingContainer to append.
  21.174 +   */
  21.175 +  void Add (BuildingContainer other);
  21.176 +
  21.177 +  /**
  21.178 +   * \brief Append a single Ptr<Building> to this container.
  21.179 +   *
  21.180 +   * \param building The Ptr<Building> to append.
  21.181 +   */
  21.182 +  void Add (Ptr<Building> building);
  21.183 +
  21.184 +  /**
  21.185 +   * \brief Append to this container the single Ptr<Building> referred to
  21.186 +   * via its object name service registered name.
  21.187 +   *
  21.188 +   * \param buildingName The name of the Building Object to add to the container.
  21.189 +   */
  21.190 +  void Add (std::string buildingName);
  21.191 +
  21.192 +  /**
  21.193 +   * \brief Create a BuildingContainer that contains a list of _all_ buildings
  21.194 +   * stored in the ns3::BuildingList.
  21.195 +   *
  21.196 +   * Whenever a Building is created, a Ptr<Building> is added to a global list of all
  21.197 +   * buildings in the system.  It is sometimes useful to be able to get to all
  21.198 +   * buildings in one place.  This method creates a BuildingContainer that is 
  21.199 +   * initialized to contain all of the simulation buildings,
  21.200 +   *
  21.201 +   * \returns a BuildingContainer which contains a list of all Buildings.
  21.202 +   */
  21.203 +  static BuildingContainer GetGlobal (void);
  21.204 +
  21.205 +private:
  21.206 +  std::vector<Ptr<Building> > m_buildings;
  21.207 +};
  21.208 +
  21.209 +} // namespace ns3
  21.210 +
  21.211 +#endif /* BUILDING_CONTAINER_H */
    22.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    22.2 +++ b/src/buildings/helper/building-position-allocator.cc	Fri May 11 16:42:40 2012 +0200
    22.3 @@ -0,0 +1,270 @@
    22.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    22.5 +/*
    22.6 + * Copyright (C)  2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    22.7 + *
    22.8 + * This program is free software; you can redistribute it and/or modify
    22.9 + * it under the terms of the GNU General Public License version 2 as
   22.10 + * published by the Free Software Foundation;
   22.11 + *
   22.12 + * This program is distributed in the hope that it will be useful,
   22.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   22.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   22.15 + * GNU General Public License for more details.
   22.16 + *
   22.17 + * You should have received a copy of the GNU General Public License
   22.18 + * along with this program; if not, write to the Free Software
   22.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   22.20 + *
   22.21 + * Author: Nicola Baldo <nbaldo@cttc.es>
   22.22 + */
   22.23 +#include "building-position-allocator.h"
   22.24 +#include "ns3/buildings-mobility-model.h"
   22.25 +#include "ns3/buildings-helper.h"
   22.26 +#include "ns3/random-variable.h"
   22.27 +#include "ns3/double.h"
   22.28 +#include "ns3/uinteger.h"
   22.29 +#include "ns3/enum.h"
   22.30 +#include "ns3/boolean.h"
   22.31 +#include "ns3/log.h"
   22.32 +#include "ns3/box.h"
   22.33 +#include "ns3/building.h"
   22.34 +#include <cmath>
   22.35 +
   22.36 +#include "ns3/building-list.h"
   22.37 +
   22.38 +NS_LOG_COMPONENT_DEFINE ("BuildingPositionAllocator");
   22.39 +
   22.40 +namespace ns3 {
   22.41 +
   22.42 +NS_OBJECT_ENSURE_REGISTERED (RandomBuildingPositionAllocator);
   22.43 +
   22.44 +
   22.45 +RandomBuildingPositionAllocator::RandomBuildingPositionAllocator ()
   22.46 +{
   22.47 +}
   22.48 +
   22.49 +TypeId
   22.50 +RandomBuildingPositionAllocator::GetTypeId (void)
   22.51 +{
   22.52 +  static TypeId tid = TypeId ("ns3::RandomBuildingPositionAllocator")
   22.53 +    .SetParent<PositionAllocator> ()
   22.54 +    .SetGroupName ("Mobility")
   22.55 +    .AddConstructor<RandomBuildingPositionAllocator> ()
   22.56 +    .AddAttribute ("WithReplacement",
   22.57 +                   "If true, the building will be randomly selected with replacement. "
   22.58 +                   "If false, no replacement will occur, until the list of buildings "
   22.59 +                   "to select becomes empty, at which point it will be filled again "
   22.60 +                   "with the list of all buildings.",
   22.61 +                   BooleanValue (false),
   22.62 +                   MakeBooleanAccessor (&RandomBuildingPositionAllocator::m_withReplacement),
   22.63 +                   MakeBooleanChecker ());
   22.64 +  return tid;
   22.65 +}
   22.66 +
   22.67 +Vector 
   22.68 +RandomBuildingPositionAllocator::GetNext () const
   22.69 +{
   22.70 +  UniformVariable rand;
   22.71 +  NS_ASSERT_MSG (BuildingList::GetNBuildings () > 0, "no building found");
   22.72 +  Ptr<Building> b;
   22.73 +  if (m_withReplacement)
   22.74 +    {
   22.75 +      uint32_t n = rand.GetInteger (0, BuildingList::GetNBuildings () - 1);
   22.76 +      b = BuildingList::GetBuilding (n);
   22.77 +    }
   22.78 +  else
   22.79 +    {
   22.80 +      if (m_buildingListWithoutReplacement.empty ())
   22.81 +        {
   22.82 +            for (BuildingList::Iterator bit = BuildingList::Begin (); bit != BuildingList::End (); ++bit)
   22.83 +              {
   22.84 +                m_buildingListWithoutReplacement.push_back (*bit);
   22.85 +              }
   22.86 +        }
   22.87 +      uint32_t n = rand.GetInteger (0, m_buildingListWithoutReplacement.size () - 1);
   22.88 +      b = m_buildingListWithoutReplacement.at (n);      
   22.89 +      m_buildingListWithoutReplacement.erase (m_buildingListWithoutReplacement.begin () + n);
   22.90 +    }
   22.91 +
   22.92 +  Ptr<RandomBoxPositionAllocator> pa = CreateObject<RandomBoxPositionAllocator> ();
   22.93 +  UniformVariable v;
   22.94 +  BoxValue bv;
   22.95 +  b->GetAttribute ("Boundaries", bv);
   22.96 +  double x = v.GetValue (bv.Get ().xMin, bv.Get ().xMax);
   22.97 +  double y = v.GetValue (bv.Get ().yMin, bv.Get ().yMax);
   22.98 +  double z = v.GetValue (bv.Get ().zMin, bv.Get ().zMax);
   22.99 +  return Vector (x, y, z);
  22.100 +}
  22.101 +
  22.102 +
  22.103 +
  22.104 +
  22.105 +NS_OBJECT_ENSURE_REGISTERED (RandomRoomPositionAllocator);
  22.106 +
  22.107 +
  22.108 +RandomRoomPositionAllocator::RandomRoomPositionAllocator ()
  22.109 +{
  22.110 +}
  22.111 +
  22.112 +TypeId
  22.113 +RandomRoomPositionAllocator::GetTypeId (void)
  22.114 +{
  22.115 +  static TypeId tid = TypeId ("ns3::RandomRoomPositionAllocator")
  22.116 +    .SetParent<PositionAllocator> ()
  22.117 +    .SetGroupName ("Mobility")
  22.118 +    .AddConstructor<RandomRoomPositionAllocator> ();
  22.119 +  return tid;
  22.120 +}
  22.121 +
  22.122 +Vector 
  22.123 +RandomRoomPositionAllocator::GetNext () const
  22.124 +{
  22.125 +  NS_LOG_FUNCTION (this);
  22.126 +  UniformVariable rand;
  22.127 +  NS_ASSERT_MSG (BuildingList::GetNBuildings () > 0, "no building found");
  22.128 + 
  22.129 +  if (m_roomListWithoutReplacement.empty ())
  22.130 +    {
  22.131 +      for (BuildingList::Iterator bit = BuildingList::Begin (); bit != BuildingList::End (); ++bit)
  22.132 +        {
  22.133 +          NS_LOG_LOGIC ("building " << (*bit)->GetId ());
  22.134 +          for (uint32_t rx = 0; rx < (*bit)->GetNRoomsX (); ++rx)
  22.135 +            {
  22.136 +              for (uint32_t ry = 0; ry < (*bit)->GetNRoomsY (); ++ry)
  22.137 +                {
  22.138 +                  for (uint32_t f = 0; f < (*bit)->GetNFloors (); ++f)
  22.139 +                    {
  22.140 +                      RoomInfo i;
  22.141 +                      i.roomx = rx;
  22.142 +                      i.roomy = ry;
  22.143 +                      i.floor = f; 
  22.144 +                      i.b = *bit;
  22.145 +                      NS_LOG_LOGIC ("adding room (" << rx << ", " << ry << ", " << f << ")");
  22.146 +                      m_roomListWithoutReplacement.push_back (i);
  22.147 +                    }
  22.148 +                }
  22.149 +            }
  22.150 +        }
  22.151 +    }
  22.152 +  uint32_t n = rand.GetInteger (0,m_roomListWithoutReplacement.size () - 1);
  22.153 +  RoomInfo r = m_roomListWithoutReplacement.at (n);      
  22.154 +  m_roomListWithoutReplacement.erase (m_roomListWithoutReplacement.begin () + n);  
  22.155 +  NS_LOG_LOGIC ("considering room (" << r.roomx << ", " << r.roomy << ", " << r.floor << ")");
  22.156 +
  22.157 +  Ptr<RandomBoxPositionAllocator> pa = CreateObject<RandomBoxPositionAllocator> ();
  22.158 +  UniformVariable v;
  22.159 +  BoxValue bv;
  22.160 +  r.b->GetAttribute ("Boundaries", bv);
  22.161 +  Box box = bv.Get ();
  22.162 +  double rdx =  (box.xMax - box.xMin) / r.b->GetNRoomsX ();
  22.163 +  double rdy =  (box.yMax - box.yMin) / r.b->GetNRoomsY ();
  22.164 +  double rdz =  (box.zMax - box.zMin) / r.b->GetNFloors ();
  22.165 +  double x1 = box.xMin + rdx * r.roomx;
  22.166 +  double x2 = box.xMin + rdx * (r.roomx + 1);
  22.167 +  double y1 = box.yMin + rdy * r.roomy;
  22.168 +  double y2 = box.yMin + rdy * (r.roomy + 1);
  22.169 +  double z1 = box.zMin + rdz * r.floor;
  22.170 +  double z2 = box.zMin + rdz * (r.floor + 1);
  22.171 +  NS_LOG_LOGIC ("randomly allocating position in "
  22.172 +                << " (" << x1 << "," << x2 << ") "
  22.173 +                << "x (" << y1 << "," << y2 << ") "
  22.174 +                << "x (" << z1 << "," << z2 << ") ");
  22.175 +
  22.176 +  double x = v.GetValue (x1, x2);
  22.177 +  double y = v.GetValue (y1, y2);
  22.178 +  double z = v.GetValue (z1, z2);
  22.179 +  
  22.180 +  return Vector (x, y, z);
  22.181 +}
  22.182 +
  22.183 +
  22.184 +
  22.185 +
  22.186 +
  22.187 +NS_OBJECT_ENSURE_REGISTERED (SameRoomPositionAllocator);
  22.188 +
  22.189 +SameRoomPositionAllocator::SameRoomPositionAllocator ()
  22.190 +{
  22.191 +  NS_FATAL_ERROR (" Constructor \"SameRoomPositionAllocator ()\" should not be used");
  22.192 +}
  22.193 +
  22.194 +
  22.195 +SameRoomPositionAllocator::SameRoomPositionAllocator (NodeContainer c)
  22.196 +  : m_nodes (c)
  22.197 +{
  22.198 +  m_nodeIt = m_nodes.Begin ();
  22.199 +  // this is needed to make sure the building models associated with c have been initialized
  22.200 +  for (NodeContainer::Iterator it = m_nodes.Begin (); it != m_nodes.End (); ++it)
  22.201 +    {
  22.202 +      Ptr<MobilityModel> mm = (*it)->GetObject<MobilityModel> ();
  22.203 +      NS_ASSERT_MSG (mm, "no mobility model aggregated to this node");
  22.204 +      Ptr<BuildingsMobilityModel> bmm = DynamicCast<BuildingsMobilityModel> (mm);
  22.205 +      NS_ASSERT_MSG (bmm, "mobility model aggregated to this node is not a BuildingsMobilityModel");
  22.206 +      BuildingsHelper::MakeConsistent (bmm);
  22.207 +    }
  22.208 +}
  22.209 +
  22.210 +TypeId
  22.211 +SameRoomPositionAllocator::GetTypeId (void)
  22.212 +{
  22.213 +  static TypeId tid = TypeId ("ns3::SameRoomPositionAllocator")
  22.214 +    .SetParent<PositionAllocator> ()
  22.215 +    .SetGroupName ("Mobility")
  22.216 +    .AddConstructor<SameRoomPositionAllocator> ();
  22.217 +  return tid;
  22.218 +}
  22.219 +
  22.220 +Vector 
  22.221 +SameRoomPositionAllocator::GetNext () const
  22.222 +{
  22.223 +  NS_LOG_FUNCTION (this);
  22.224 +  UniformVariable rand;
  22.225 +  if (m_nodeIt == m_nodes.End ())
  22.226 +    {
  22.227 +      m_nodeIt  = m_nodes.Begin ();
  22.228 +    }
  22.229 +  
  22.230 +  NS_ASSERT_MSG (m_nodeIt != m_nodes.End (), "no node in container");
  22.231 +
  22.232 +  NS_LOG_LOGIC ("considering node " << (*m_nodeIt)->GetId ());
  22.233 +  Ptr<MobilityModel> mm = (*m_nodeIt)->GetObject<MobilityModel> ();
  22.234 +  NS_ASSERT_MSG (mm, "no mobility model aggregated to this node");
  22.235 +  Ptr<BuildingsMobilityModel> bmm = DynamicCast<BuildingsMobilityModel> (mm);
  22.236 +  NS_ASSERT_MSG (bmm, "mobility model aggregated to this node is not a BuildingsMobilityModel");
  22.237 +
  22.238 +  ++m_nodeIt;
  22.239 +  uint32_t roomx = bmm->GetRoomNumberX ();
  22.240 +  uint32_t roomy = bmm->GetRoomNumberY ();
  22.241 +  uint32_t floor = bmm->GetFloorNumber ();
  22.242 +  NS_LOG_LOGIC ("considering building " << bmm->GetBuilding ()->GetId () << " room (" << roomx << ", " << roomy << ", " << floor << ")");
  22.243 +
  22.244 +  Ptr<Building> b = bmm->GetBuilding ();
  22.245 +  Ptr<RandomBoxPositionAllocator> pa = CreateObject<RandomBoxPositionAllocator> ();
  22.246 +  UniformVariable v;
  22.247 +  BoxValue bv;
  22.248 +  b->GetAttribute ("Boundaries", bv);
  22.249 +  Box box = bv.Get ();
  22.250 +  double rdx =  (box.xMax - box.xMin) / b->GetNRoomsX ();
  22.251 +  double rdy =  (box.yMax - box.yMin) / b->GetNRoomsY ();
  22.252 +  double rdz =  (box.zMax - box.zMin) / b->GetNFloors ();
  22.253 +  double x1 = box.xMin + rdx * roomx;
  22.254 +  double x2 = box.xMin + rdx * (roomx + 1);
  22.255 +  double y1 = box.yMin + rdy * roomy;
  22.256 +  double y2 = box.yMin + rdy * (roomy + 1);
  22.257 +  double z1 = box.zMin + rdz * floor;
  22.258 +  double z2 = box.zMin + rdz * (floor + 1);
  22.259 +  NS_LOG_LOGIC ("randomly allocating position in "
  22.260 +                << " (" << x1 << "," << x2 << ") "
  22.261 +                << "x (" << y1 << "," << y2 << ") "
  22.262 +                << "x (" << z1 << "," << z2 << ") ");
  22.263 +
  22.264 +  double x = v.GetValue (x1, x2);
  22.265 +  double y = v.GetValue (y1, y2);
  22.266 +  double z = v.GetValue (z1, z2);
  22.267 +  
  22.268 +  return Vector (x, y, z);
  22.269 +}
  22.270 +
  22.271 +
  22.272 +
  22.273 +} // namespace ns3
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/src/buildings/helper/building-position-allocator.h	Fri May 11 16:42:40 2012 +0200
    23.3 @@ -0,0 +1,112 @@
    23.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    23.5 +/*
    23.6 + * Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    23.7 + *
    23.8 + * This program is free software; you can redistribute it and/or modify
    23.9 + * it under the terms of the GNU General Public License version 2 as
   23.10 + * published by the Free Software Foundation;
   23.11 + *
   23.12 + * This program is distributed in the hope that it will be useful,
   23.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   23.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   23.15 + * GNU General Public License for more details.
   23.16 + *
   23.17 + * You should have received a copy of the GNU General Public License
   23.18 + * along with this program; if not, write to the Free Software
   23.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   23.20 + *
   23.21 + * Author: Nicola Baldo <nbaldo@cttc.es>
   23.22 + */
   23.23 +#ifndef BUILDING_POSITION_ALLOCATOR_H
   23.24 +#define BUILDING_POSITION_ALLOCATOR_H
   23.25 +
   23.26 +#include <ns3/ptr.h>
   23.27 +#include <ns3/position-allocator.h>
   23.28 +#include <ns3/node-container.h>
   23.29 +
   23.30 +namespace ns3 {
   23.31 +
   23.32 +class Building;
   23.33 +
   23.34 +
   23.35 +/**
   23.36 + * Allocate each position by randomly chosing a building from the list
   23.37 + * of all buildings, and then randomly chosing a position inside the building.
   23.38 + * 
   23.39 + */
   23.40 +class RandomBuildingPositionAllocator : public PositionAllocator
   23.41 +{
   23.42 +public:
   23.43 +  RandomBuildingPositionAllocator ();
   23.44 +
   23.45 +  // inherited from Object
   23.46 +  static TypeId GetTypeId (void);
   23.47 +
   23.48 +  // inherited from PositionAllocator
   23.49 +  virtual Vector GetNext (void) const;
   23.50 +
   23.51 +private:
   23.52 +  
   23.53 +  bool m_withReplacement;
   23.54 +  mutable std::vector< Ptr<Building> > m_buildingListWithoutReplacement;
   23.55 +};
   23.56 +
   23.57 +
   23.58 +/**
   23.59 + * Allocate each position by randomly chosing a room from the list
   23.60 + * of all buildings, and then randomly chosing a position inside the room.
   23.61 + * The selection of the room is always done without replacement.
   23.62 + * 
   23.63 + */
   23.64 +class RandomRoomPositionAllocator : public PositionAllocator
   23.65 +{
   23.66 +public:
   23.67 +  RandomRoomPositionAllocator ();
   23.68 +
   23.69 +  // inherited from Object
   23.70 +  static TypeId GetTypeId (void);
   23.71 +
   23.72 +  // inherited from PositionAllocator
   23.73 +  virtual Vector GetNext (void) const;
   23.74 +
   23.75 +private:
   23.76 +  
   23.77 +  bool m_withReplacement;
   23.78 +  struct RoomInfo 
   23.79 +  {
   23.80 +    Ptr<Building> b;
   23.81 +    uint32_t roomx;
   23.82 +    uint32_t roomy;
   23.83 +    uint32_t floor;
   23.84 +  };
   23.85 +  mutable std::vector<RoomInfo> m_roomListWithoutReplacement;
   23.86 +};
   23.87 +
   23.88 +
   23.89 +/**
   23.90 + * Walks a given NodeContainer sequentially, and for each node allocate a new
   23.91 + * position randomly in the same room of that node
   23.92 + * 
   23.93 + */
   23.94 +class SameRoomPositionAllocator : public PositionAllocator
   23.95 +{
   23.96 +public:
   23.97 +  SameRoomPositionAllocator ();
   23.98 +  SameRoomPositionAllocator (NodeContainer c);
   23.99 +
  23.100 +  // inherited from Object
  23.101 +  static TypeId GetTypeId (void);
  23.102 +
  23.103 +  // inherited from PositionAllocator
  23.104 +  virtual Vector GetNext (void) const;
  23.105 +
  23.106 +private:
  23.107 +
  23.108 +  NodeContainer m_nodes;
  23.109 +  mutable NodeContainer::Iterator m_nodeIt;
  23.110 +};
  23.111 +
  23.112 +
  23.113 +} // namespace ns3
  23.114 +
  23.115 +#endif /* BUILDING_POSITION_ALLOCATOR_H */
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/src/buildings/helper/buildings-helper.cc	Fri May 11 16:42:40 2012 +0200
    24.3 @@ -0,0 +1,79 @@
    24.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    24.5 +/*
    24.6 + * Copyright (c) 2012 CTTC
    24.7 + *
    24.8 + * This program is free software; you can redistribute it and/or modify
    24.9 + * it under the terms of the GNU General Public License version 2 as
   24.10 + * published by the Free Software Foundation;
   24.11 + *
   24.12 + * This program is distributed in the hope that it will be useful,
   24.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   24.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   24.15 + * GNU General Public License for more details.
   24.16 + *
   24.17 + * You should have received a copy of the GNU General Public License
   24.18 + * along with this program; if not, write to the Free Software
   24.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   24.20 + *
   24.21 + * Author: Nicola Baldo <nbaldo@cttc.es>
   24.22 + */
   24.23 +
   24.24 +#include "buildings-helper.h"
   24.25 +
   24.26 +#include <ns3/node-list.h>
   24.27 +#include <ns3/building.h>
   24.28 +#include <ns3/building-list.h>
   24.29 +#include <ns3/mobility-model.h>
   24.30 +#include <ns3/buildings-mobility-model.h>
   24.31 +#include <ns3/abort.h>
   24.32 +#include <ns3/log.h>
   24.33 +
   24.34 +
   24.35 +NS_LOG_COMPONENT_DEFINE ("BuildingsHelper");
   24.36 +
   24.37 +namespace ns3 {
   24.38 +
   24.39 +void
   24.40 +BuildingsHelper::MakeMobilityModelConsistent ()
   24.41 +{
   24.42 +  NS_LOG_FUNCTION_NOARGS ();
   24.43 +  for (NodeList::Iterator nit = NodeList::Begin (); nit != NodeList::End (); ++nit)
   24.44 +    {
   24.45 +      Ptr<MobilityModel> mm = (*nit)->GetObject<MobilityModel> ();
   24.46 +      if (mm != 0)
   24.47 +        {
   24.48 +          Ptr<BuildingsMobilityModel> bmm = DynamicCast<BuildingsMobilityModel> (mm);
   24.49 +          NS_ABORT_MSG_UNLESS (0 != bmm, "node " << (*nit)->GetId () << " has a MobilityModel but it is not a BuildingsMobilityModel");
   24.50 +          MakeConsistent (bmm);
   24.51 +        }
   24.52 +    }
   24.53 +}
   24.54 +
   24.55 +
   24.56 +void
   24.57 +BuildingsHelper::MakeConsistent (Ptr<BuildingsMobilityModel> bmm)
   24.58 +{
   24.59 +  bool found = false;
   24.60 +  for (BuildingList::Iterator bit = BuildingList::Begin (); bit != BuildingList::End (); ++bit)
   24.61 +    {
   24.62 +      Vector pos = bmm->GetPosition ();
   24.63 +      if ((*bit)->IsInside (pos))
   24.64 +        {
   24.65 +          NS_LOG_LOGIC ("BuildingsMobilityModel " << bmm << " falls inside building " << (*bit)->GetId ());
   24.66 +          NS_ABORT_MSG_UNLESS (found == false, " BuildingsMobilityModel already inside another building!");		
   24.67 +          found = true;
   24.68 +          uint16_t floor = (*bit)->GetFloor (pos);
   24.69 +          uint16_t roomX = (*bit)->GetRoomX (pos);
   24.70 +          uint16_t roomY = (*bit)->GetRoomY (pos);	   
   24.71 +          bmm->SetIndoor (*bit, floor, roomX, roomY);	      
   24.72 +        }		    	  
   24.73 +    }
   24.74 +  if (!found)
   24.75 +    {
   24.76 +      NS_LOG_LOGIC ("BuildingsMobilityModel " << bmm  << " is outdoor");
   24.77 +      bmm->SetOutdoor ();
   24.78 +    }
   24.79 +
   24.80 +}
   24.81 +
   24.82 +} // namespace ns3
    25.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.2 +++ b/src/buildings/helper/buildings-helper.h	Fri May 11 16:42:40 2012 +0200
    25.3 @@ -0,0 +1,46 @@
    25.4 +/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
    25.5 +/*
    25.6 + * Copyright (c) 2012 CTTC
    25.7 + *
    25.8 + * This program is free software; you can redistribute it and/or modify
    25.9 + * it under the terms of the GNU General Public License version 2 as
   25.10 + * published by the Free Software Foundation;
   25.11 + *
   25.12 + * This program is distributed in the hope that it will be useful,
   25.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   25.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   25.15 + * GNU General Public License for more details.
   25.16 + *
   25.17 + * You should have received a copy of the GNU General Public License
   25.18 + * along with this program; if not, write to the Free Software
   25.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   25.20 + *
   25.21 + * Author: Nicola Baldo <nbaldo@cttc.es>
   25.22 + */
   25.23 +
   25.24 +#ifndef BUILDINGS_HELPER_H
   25.25 +#define BUILDINGS_HELPER_H
   25.26 +
   25.27 +#include <string>
   25.28 +#include <ns3/attribute.h>
   25.29 +#include <ns3/object-factory.h>
   25.30 +#include <ns3/node-container.h>
   25.31 +#include <ns3/ptr.h>
   25.32 +
   25.33 +
   25.34 +namespace ns3 {
   25.35 +
   25.36 +class BuildingsMobilityModel;
   25.37 +
   25.38 +class BuildingsHelper
   25.39 +{
   25.40 +public:  
   25.41 +  static void MakeMobilityModelConsistent ();
   25.42 +  static void MakeConsistent (Ptr<BuildingsMobilityModel> bmm);
   25.43 +  
   25.44 +};
   25.45 +
   25.46 +
   25.47 +}
   25.48 +
   25.49 +#endif /* BUILDINGS_HELPER_H */
    26.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    26.2 +++ b/src/buildings/model/building-list.cc	Fri May 11 16:42:40 2012 +0200
    26.3 @@ -0,0 +1,192 @@
    26.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    26.5 +/*
    26.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    26.7 + *
    26.8 + * This program is free software; you can redistribute it and/or modify
    26.9 + * it under the terms of the GNU General Public License version 2 as
   26.10 + * published by the Free Software Foundation;
   26.11 + *
   26.12 + * This program is distributed in the hope that it will be useful,
   26.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   26.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   26.15 + * GNU General Public License for more details.
   26.16 + *
   26.17 + * You should have received a copy of the GNU General Public License
   26.18 + * along with this program; if not, write to the Free Software
   26.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   26.20 + *
   26.21 + * Author: Jaume Nin <jaume.nin@cttc,cat>
   26.22 + * Based on BuildingList implemenation by Mathieu Lacage  <mathieu.lacage@sophia.inria.fr>
   26.23 + *
   26.24 + */
   26.25 +#include "building-list.h"
   26.26 +#include "ns3/simulator.h"
   26.27 +#include "ns3/object-vector.h"
   26.28 +#include "ns3/config.h"
   26.29 +#include "ns3/log.h"
   26.30 +#include "ns3/assert.h"
   26.31 +#include "building-list.h"
   26.32 +#include "building.h"
   26.33 +
   26.34 +namespace ns3 {
   26.35 +
   26.36 +NS_LOG_COMPONENT_DEFINE ("BuildingList");
   26.37 +
   26.38 +/**
   26.39 + * \brief private implementation detail of the BuildingList API.
   26.40 + */
   26.41 +class BuildingListPriv : public Object
   26.42 +{
   26.43 +public:
   26.44 +  static TypeId GetTypeId (void);
   26.45 +  BuildingListPriv ();
   26.46 +  ~BuildingListPriv ();
   26.47 +
   26.48 +  uint32_t Add (Ptr<Building> building);
   26.49 +  BuildingList::Iterator Begin (void) const;
   26.50 +  BuildingList::Iterator End (void) const;
   26.51 +  Ptr<Building> GetBuilding (uint32_t n);
   26.52 +  uint32_t GetNBuildings (void);
   26.53 +
   26.54 +  static Ptr<BuildingListPriv> Get (void);
   26.55 +
   26.56 +private:
   26.57 +  virtual void DoDispose (void);
   26.58 +  static Ptr<BuildingListPriv> *DoGet (void);
   26.59 +  static void Delete (void);
   26.60 +  std::vector<Ptr<Building> > m_buildings;
   26.61 +};
   26.62 +
   26.63 +NS_OBJECT_ENSURE_REGISTERED (BuildingListPriv);
   26.64 +
   26.65 +TypeId
   26.66 +BuildingListPriv::GetTypeId (void)
   26.67 +{
   26.68 +  static TypeId tid = TypeId ("ns3::BuildingListPriv")
   26.69 +    .SetParent<Object> ()
   26.70 +    .AddAttribute ("BuildingList", "The list of all buildings created during the simulation.",
   26.71 +                   ObjectVectorValue (),
   26.72 +                   MakeObjectVectorAccessor (&BuildingListPriv::m_buildings),
   26.73 +                   MakeObjectVectorChecker<Building> ())
   26.74 +  ;
   26.75 +  return tid;
   26.76 +}
   26.77 +
   26.78 +Ptr<BuildingListPriv>
   26.79 +BuildingListPriv::Get (void)
   26.80 +{
   26.81 +  return *DoGet ();
   26.82 +}
   26.83 +Ptr<BuildingListPriv> *
   26.84 +BuildingListPriv::DoGet (void)
   26.85 +{
   26.86 +  static Ptr<BuildingListPriv> ptr = 0;
   26.87 +  if (ptr == 0)
   26.88 +    {
   26.89 +      ptr = CreateObject<BuildingListPriv> ();
   26.90 +      Config::RegisterRootNamespaceObject (ptr);
   26.91 +      Simulator::ScheduleDestroy (&BuildingListPriv::Delete);
   26.92 +    }
   26.93 +  return &ptr;
   26.94 +}
   26.95 +void
   26.96 +BuildingListPriv::Delete (void)
   26.97 +{
   26.98 +  NS_LOG_FUNCTION_NOARGS ();
   26.99 +  Config::UnregisterRootNamespaceObject (Get ());
  26.100 +  (*DoGet ()) = 0;
  26.101 +}
  26.102 +
  26.103 +
  26.104 +BuildingListPriv::BuildingListPriv ()
  26.105 +{
  26.106 +  NS_LOG_FUNCTION_NOARGS ();
  26.107 +}
  26.108 +BuildingListPriv::~BuildingListPriv ()
  26.109 +{
  26.110 +}
  26.111 +void
  26.112 +BuildingListPriv::DoDispose (void)
  26.113 +{
  26.114 +  NS_LOG_FUNCTION_NOARGS ();
  26.115 +  for (std::vector<Ptr<Building> >::iterator i = m_buildings.begin ();
  26.116 +       i != m_buildings.end (); i++)
  26.117 +    {
  26.118 +      Ptr<Building> building = *i;
  26.119 +      building->Dispose ();
  26.120 +      *i = 0;
  26.121 +    }
  26.122 +  m_buildings.erase (m_buildings.begin (), m_buildings.end ());
  26.123 +  Object::DoDispose ();
  26.124 +}
  26.125 +
  26.126 +
  26.127 +uint32_t
  26.128 +BuildingListPriv::Add (Ptr<Building> building)
  26.129 +{
  26.130 +  uint32_t index = m_buildings.size ();
  26.131 +  m_buildings.push_back (building);
  26.132 +  Simulator::ScheduleWithContext (index, TimeStep (0), &Building::Start, building);
  26.133 +  return index;
  26.134 +
  26.135 +}
  26.136 +BuildingList::Iterator
  26.137 +BuildingListPriv::Begin (void) const
  26.138 +{
  26.139 +  return m_buildings.begin ();
  26.140 +}
  26.141 +BuildingList::Iterator
  26.142 +BuildingListPriv::End (void) const
  26.143 +{
  26.144 +  return m_buildings.end ();
  26.145 +}
  26.146 +uint32_t
  26.147 +BuildingListPriv::GetNBuildings (void)
  26.148 +{
  26.149 +  return m_buildings.size ();
  26.150 +}
  26.151 +
  26.152 +Ptr<Building>
  26.153 +BuildingListPriv::GetBuilding (uint32_t n)
  26.154 +{
  26.155 +  NS_ASSERT_MSG (n < m_buildings.size (), "Building index " << n <<
  26.156 +                 " is out of range (only have " << m_buildings.size () << " buildings).");
  26.157 +  return m_buildings.at (n);
  26.158 +}
  26.159 +
  26.160 +}
  26.161 +
  26.162 +/**
  26.163 + * The implementation of the public static-based API
  26.164 + * which calls into the private implementation through
  26.165 + * the simulation singleton.
  26.166 + */
  26.167 +namespace ns3 {
  26.168 +
  26.169 +uint32_t
  26.170 +BuildingList::Add (Ptr<Building> building)
  26.171 +{
  26.172 +  return BuildingListPriv::Get ()->Add (building);
  26.173 +}
  26.174 +BuildingList::Iterator
  26.175 +BuildingList::Begin (void)
  26.176 +{
  26.177 +  return BuildingListPriv::Get ()->Begin ();
  26.178 +}
  26.179 +BuildingList::Iterator
  26.180 +BuildingList::End (void)
  26.181 +{
  26.182 +  return BuildingListPriv::Get ()->End ();
  26.183 +}
  26.184 +Ptr<Building>
  26.185 +BuildingList::GetBuilding (uint32_t n)
  26.186 +{
  26.187 +  return BuildingListPriv::Get ()->GetBuilding (n);
  26.188 +}
  26.189 +uint32_t
  26.190 +BuildingList::GetNBuildings (void)
  26.191 +{
  26.192 +  return BuildingListPriv::Get ()->GetNBuildings ();
  26.193 +}
  26.194 +
  26.195 +} // namespace ns3
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/src/buildings/model/building-list.h	Fri May 11 16:42:40 2012 +0200
    27.3 @@ -0,0 +1,71 @@
    27.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    27.5 +/*
    27.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    27.7 + *
    27.8 + * This program is free software; you can redistribute it and/or modify
    27.9 + * it under the terms of the GNU General Public License version 2 as
   27.10 + * published by the Free Software Foundation;
   27.11 + *
   27.12 + * This program is distributed in the hope that it will be useful,
   27.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   27.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   27.15 + * GNU General Public License for more details.
   27.16 + *
   27.17 + * You should have received a copy of the GNU General Public License
   27.18 + * along with this program; if not, write to the Free Software
   27.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   27.20 + *
   27.21 + * Author: Jaume Nin <jaume.nin@cttc,cat>
   27.22 + * Based on NodeList implementation by Mathieu Lacage  <mathieu.lacage@sophia.inria.fr>
   27.23 + *
   27.24 + */
   27.25 +
   27.26 +#ifndef BUILDING_LIST_H_
   27.27 +#define BUILDING_LIST_H_
   27.28 +
   27.29 +#include <vector>
   27.30 +#include "ns3/ptr.h"
   27.31 +
   27.32 +namespace ns3 {
   27.33 +
   27.34 +class Building;
   27.35 +
   27.36 +class BuildingList
   27.37 +{
   27.38 +public:
   27.39 +  typedef std::vector< Ptr<Building> >::const_iterator Iterator;
   27.40 +
   27.41 +  /**
   27.42 +   * \param building building to add
   27.43 +   * \returns index of building in list.
   27.44 +   *
   27.45 +   * This method is called automatically from Building::Building so
   27.46 +   * the user has little reason to call it himself.
   27.47 +   */
   27.48 +  static uint32_t Add (Ptr<Building> building);
   27.49 +  /**
   27.50 +   * \returns a C++ iterator located at the beginning of this
   27.51 +   *          list.
   27.52 +   */
   27.53 +  static Iterator Begin (void);
   27.54 +  /**
   27.55 +   * \returns a C++ iterator located at the end of this
   27.56 +   *          list.
   27.57 +   */
   27.58 +  static Iterator End (void);
   27.59 +  /**
   27.60 +   * \param n index of requested building.
   27.61 +   * \returns the Building associated to index n.
   27.62 +   */
   27.63 +  static Ptr<Building> GetBuilding (uint32_t n);
   27.64 +  /**
   27.65 +   * \returns the number of buildings currently in the list.
   27.66 +   */
   27.67 +  static uint32_t GetNBuildings (void);
   27.68 +};
   27.69 +
   27.70 +} // namespace ns3
   27.71 +
   27.72 +#endif /* BUILDING_LIST_H_ */
   27.73 +
   27.74 +
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/src/buildings/model/building.cc	Fri May 11 16:42:40 2012 +0200
    28.3 @@ -0,0 +1,288 @@
    28.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    28.5 +/*
    28.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    28.7 + *
    28.8 + * This program is free software; you can redistribute it and/or modify
    28.9 + * it under the terms of the GNU General Public License version 2 as
   28.10 + * published by the Free Software Foundation;
   28.11 + *
   28.12 + * This program is distributed in the hope that it will be useful,
   28.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   28.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   28.15 + * GNU General Public License for more details.
   28.16 + *
   28.17 + * You should have received a copy of the GNU General Public License
   28.18 + * along with this program; if not, write to the Free Software
   28.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   28.20 + *
   28.21 + * Authors: Marco Miozzo  <marco.miozzo@cttc.es>
   28.22 + *          Nicola Baldo <nbaldo@cttc.es>
   28.23 + * 
   28.24 + */
   28.25 +
   28.26 +#include "building.h"
   28.27 +#include "building-list.h"
   28.28 +
   28.29 +#include <ns3/enum.h>
   28.30 +#include <ns3/uinteger.h>
   28.31 +#include <ns3/log.h>
   28.32 +#include <ns3/assert.h>
   28.33 +#include <math.h>
   28.34 +
   28.35 +NS_LOG_COMPONENT_DEFINE ("Building");
   28.36 +
   28.37 +namespace ns3 {
   28.38 +
   28.39 +
   28.40 +NS_OBJECT_ENSURE_REGISTERED (Building);
   28.41 +
   28.42 +TypeId
   28.43 +Building::GetTypeId (void)
   28.44 +{
   28.45 +  static TypeId tid = TypeId ("ns3::Building")
   28.46 +    .SetParent<Object> ()
   28.47 +    .AddConstructor<Building> ()
   28.48 +    .AddAttribute ("NRoomsX", "The number of rooms in the X axis.",
   28.49 +                   UintegerValue (1),
   28.50 +                   MakeUintegerAccessor (&Building::GetNRoomsX, &Building::SetNRoomsX),
   28.51 +                   MakeUintegerChecker<uint32_t> ())
   28.52 +    .AddAttribute ("NRoomsY", "The number of rooms in the Y axis.",
   28.53 +                   UintegerValue (1),
   28.54 +                   MakeUintegerAccessor (&Building::GetNRoomsY, &Building::SetNRoomsY),
   28.55 +                   MakeUintegerChecker<uint32_t> ())
   28.56 +    .AddAttribute ("NFloors", "The number of floors of this building.",
   28.57 +                   UintegerValue (1),
   28.58 +                   MakeUintegerAccessor (&Building::GetNFloors, &Building::SetNFloors),
   28.59 +                   MakeUintegerChecker<uint32_t> ())
   28.60 +    .AddAttribute ("Id", "The id (unique integer) of this Building.",
   28.61 +                   UintegerValue (0),
   28.62 +                   MakeUintegerAccessor (&Building::GetId),
   28.63 +                   MakeUintegerChecker<uint32_t> ())
   28.64 +    .AddAttribute ("Boundaries", "The boundaries of this Building as a value of type ns3::Box",
   28.65 +                   BoxValue (Box ()),
   28.66 +                   MakeBoxAccessor (&Building::GetBoundaries, &Building::SetBoundaries),
   28.67 +                   MakeBoxChecker ())
   28.68 +    .AddAttribute ("Type",
   28.69 +                   "The type of building",
   28.70 +                   EnumValue (Building::Residential),
   28.71 +                   MakeEnumAccessor (&Building::GetBuildingType, &Building::SetBuildingType),
   28.72 +                   MakeEnumChecker (Building::Residential, "Residential",
   28.73 +                                    Building::Office, "Office",
   28.74 +                                    Building::Commercial, "Commercial"))
   28.75 +    .AddAttribute ("ExternalWallsType",
   28.76 +                   "The type of material of which the external walls are made",
   28.77 +                   EnumValue (Building::ConcreteWithWindows),
   28.78 +                   MakeEnumAccessor (&Building::GetExtWallsType, &Building::SetExtWallsType),
   28.79 +                   MakeEnumChecker (Building::Wood, "Wood",
   28.80 +                                    Building::ConcreteWithWindows, "ConcreteWithWindows",
   28.81 +                                    Building::ConcreteWithoutWindows, "ConcreteWithoutWindows",
   28.82 +                                    Building::StoneBlocks, "StoneBlocks"))
   28.83 +  ;
   28.84 +  return tid;
   28.85 +}
   28.86 +
   28.87 +Building::Building (double xMin, 
   28.88 +                    double xMax,
   28.89 +                    double yMin, 
   28.90 +                    double yMax,
   28.91 +                    double zMin, 
   28.92 +                    double zMax)
   28.93 +{
   28.94 +  NS_FATAL_ERROR (std::endl << "this function is not supported any more:" << std::endl
   28.95 +                  << " Building::Building (double xMin, double xMax, double yMin, " << std::endl
   28.96 +                  << "                     double yMax, double zMin, double zMax)\n" << std::endl
   28.97 +                  << "so you can't do any more stuff like:" << std::endl
   28.98 +                  << "Ptr<Building> b = CreateObject<Building> (" 
   28.99 +                  << xMin << ", "
  28.100 +                  << xMax << ", "
  28.101 +                  << yMin << ", "
  28.102 +                  << yMax << ", "
  28.103 +                  << zMin << ", "
  28.104 +                  << zMax << ")\n" << std::endl
  28.105 +                  << "Please use instead something like this:" << std::endl
  28.106 +                  << " Ptr<Building> b = CreateObject<Building> ();" << std::endl
  28.107 +                  << " b->SetBoundaries (Box ("
  28.108 +                  << xMin << ", "
  28.109 +                  << xMax << ", "
  28.110 +                  << yMin << ", "
  28.111 +                  << yMax << ", "
  28.112 +                  << zMin << ", "
  28.113 +                  << zMax << "));" << std::endl <<std::endl);
  28.114 +}
  28.115 +
  28.116 +
  28.117 +Building::Building () 
  28.118 +{
  28.119 +  NS_LOG_FUNCTION (this);
  28.120 +  m_buildingId = BuildingList::Add(this);
  28.121 +}
  28.122 +
  28.123 +Building::~Building () 
  28.124 +{
  28.125 +  NS_LOG_FUNCTION (this);
  28.126 +}
  28.127 +
  28.128 +void
  28.129 +Building::DoDispose () 
  28.130 +{
  28.131 +  NS_LOG_FUNCTION (this);
  28.132 +}
  28.133 +
  28.134 +uint32_t
  28.135 +Building::GetId (void) const
  28.136 +{
  28.137 +  NS_LOG_FUNCTION (this);
  28.138 +  return m_buildingId;
  28.139 +}
  28.140 +
  28.141 +void
  28.142 +Building::SetBoundaries (Box boundaries)
  28.143 +{
  28.144 +  NS_LOG_FUNCTION (this << boundaries);
  28.145 +  m_buildingBounds = boundaries;
  28.146 +}
  28.147 +
  28.148 +void
  28.149 +Building::SetBuildingType (Building::BuildingType_t t)
  28.150 +{
  28.151 +  NS_LOG_FUNCTION (this << t);
  28.152 +  m_buildingType = t;
  28.153 +}
  28.154 +
  28.155 +void 
  28.156 +Building::SetExtWallsType (Building::ExtWallsType_t t)
  28.157 +{
  28.158 +  NS_LOG_FUNCTION (this << t);
  28.159 +  m_externalWalls = t;
  28.160 +}
  28.161 +
  28.162 +void
  28.163 +Building::SetNFloors (uint16_t nfloors)
  28.164 +{
  28.165 +  NS_LOG_FUNCTION (this << nfloors);
  28.166 +  m_floors = nfloors;
  28.167 +}
  28.168 +
  28.169 +void
  28.170 +Building::SetNRoomsX (uint16_t nroomx)
  28.171 +{
  28.172 +  NS_LOG_FUNCTION (this << nroomx);
  28.173 +  m_roomsX = nroomx;
  28.174 +}
  28.175 +
  28.176 +void
  28.177 +Building::SetNRoomsY (uint16_t nroomy)
  28.178 +{
  28.179 +  NS_LOG_FUNCTION (this << nroomy);
  28.180 +  m_roomsY = nroomy;
  28.181 +}
  28.182 +
  28.183 +Box
  28.184 +Building::GetBoundaries () const
  28.185 +{
  28.186 +  NS_LOG_FUNCTION (this);
  28.187 +  return m_buildingBounds;
  28.188 +}
  28.189 +
  28.190 +Building::BuildingType_t 
  28.191 +Building::GetBuildingType () const
  28.192 +{
  28.193 +  return (m_buildingType);
  28.194 +}
  28.195 +
  28.196 +Building::ExtWallsType_t
  28.197 +Building::GetExtWallsType () const
  28.198 +{
  28.199 +  return (m_externalWalls);
  28.200 +}
  28.201 +
  28.202 +uint16_t 
  28.203 +Building::GetNFloors () const
  28.204 +{
  28.205 +  return (m_floors);
  28.206 +}
  28.207 +
  28.208 +uint16_t 
  28.209 +Building::GetNRoomsX () const
  28.210 +{
  28.211 +  return (m_roomsX);
  28.212 +}
  28.213 +
  28.214 +uint16_t 
  28.215 +Building::GetNRoomsY () const
  28.216 +{
  28.217 +  return (m_roomsY);
  28.218 +}
  28.219 +
  28.220 +bool 
  28.221 +Building::IsInside (Vector position) const
  28.222 +{
  28.223 +  return m_buildingBounds.IsInside (position);
  28.224 +}
  28.225 +
  28.226 +
  28.227 +uint16_t 
  28.228 +Building::GetRoomX (Vector position) const
  28.229 +{
  28.230 +  NS_ASSERT (IsInside (position));
  28.231 +  uint16_t n;
  28.232 +
  28.233 +  if (position.x ==  m_buildingBounds.xMax)
  28.234 +    {
  28.235 +      n = m_roomsX;
  28.236 +    }                                                                   
  28.237 +  else
  28.238 +    {
  28.239 +      double xLength = m_buildingBounds.xMax - m_buildingBounds.xMin;
  28.240 +      double x = position.x - m_buildingBounds.xMin;
  28.241 +      n = floor (m_roomsX * x/xLength) + 1;
  28.242 +      NS_LOG_LOGIC ("xLength=" << xLength << ", x=" << x << ", m_roomsX=" << m_roomsX);
  28.243 +    }
  28.244 +  NS_LOG_LOGIC ("RoomX: " << n);
  28.245 +  return n;
  28.246 +}
  28.247 +
  28.248 +uint16_t 
  28.249 +Building::GetRoomY (Vector position) const
  28.250 +{
  28.251 +  NS_ASSERT (IsInside (position));
  28.252 +  uint16_t n;
  28.253 +
  28.254 +  if (position.y ==  m_buildingBounds.yMax)
  28.255 +    {
  28.256 +      n = m_roomsY;
  28.257 +    }                                                                   
  28.258 +  else
  28.259 +    {
  28.260 +      double yLength = m_buildingBounds.yMax - m_buildingBounds.yMin;
  28.261 +      double y = position.y - m_buildingBounds.yMin;
  28.262 +      n = floor (m_roomsY * y/yLength) + 1;
  28.263 +      NS_LOG_LOGIC ("yLength=" << yLength << ", y=" << y << ", m_roomsY=" << m_roomsY);
  28.264 +    }
  28.265 +  NS_LOG_LOGIC ("RoomY: " << n);
  28.266 +  return n;
  28.267 +}
  28.268 +
  28.269 +uint16_t 
  28.270 +Building::GetFloor (Vector position) const
  28.271 +{
  28.272 +  NS_ASSERT (IsInside (position));
  28.273 +  uint16_t n;
  28.274 +
  28.275 +  if (position.z ==  m_buildingBounds.zMax)
  28.276 +    {
  28.277 +      n = m_floors;
  28.278 +    }                                                                   
  28.279 +  else
  28.280 +    {
  28.281 +      double zLength = m_buildingBounds.zMax - m_buildingBounds.zMin;
  28.282 +      double z = position.z - m_buildingBounds.zMin;
  28.283 +      n = floor (m_floors * z/zLength) + 1;
  28.284 +      NS_LOG_LOGIC ("zLength=" << zLength << ", z=" << z << ", m_floors=" << m_floors);
  28.285 +    }
  28.286 +  NS_LOG_LOGIC ("floor: " << n);
  28.287 +  return n;
  28.288 +}
  28.289 +
  28.290 +
  28.291 +} // namespace ns3
    29.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.2 +++ b/src/buildings/model/building.h	Fri May 11 16:42:40 2012 +0200
    29.3 @@ -0,0 +1,227 @@
    29.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    29.5 +/*
    29.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    29.7 + *
    29.8 + * This program is free software; you can redistribute it and/or modify
    29.9 + * it under the terms of the GNU General Public License version 2 as
   29.10 + * published by the Free Software Foundation;
   29.11 + *
   29.12 + * This program is distributed in the hope that it will be useful,
   29.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   29.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   29.15 + * GNU General Public License for more details.
   29.16 + *
   29.17 + * You should have received a copy of the GNU General Public License
   29.18 + * along with this program; if not, write to the Free Software
   29.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   29.20 + *
   29.21 + * Author: Marco Miozzo  <marco.miozzo@cttc.es>
   29.22 + * 
   29.23 + */
   29.24 +#ifndef BUILDING_H
   29.25 +#define BUILDING_H
   29.26 +
   29.27 +#include <ns3/attribute.h>
   29.28 +#include <ns3/attribute-helper.h>
   29.29 +#include <ns3/vector.h>
   29.30 +#include <ns3/box.h>
   29.31 +#include <ns3/simple-ref-count.h>
   29.32 +#include <ns3/object.h>
   29.33 +
   29.34 +namespace ns3 {
   29.35 +
   29.36 +/**
   29.37 + * \ingroup mobility
   29.38 + * \brief a 3d building block
   29.39 + */
   29.40 +class Building : public Object
   29.41 +{
   29.42 +public:
   29.43 +
   29.44 +  // inherited from Object
   29.45 +  static TypeId GetTypeId (void);
   29.46 +  virtual void DoDispose ();
   29.47 +
   29.48 +
   29.49 +  enum BuildingType_t
   29.50 +    {
   29.51 +      Residential, Office, Commercial
   29.52 +    };
   29.53 +  enum ExtWallsType_t
   29.54 +    {
   29.55 +      Wood, ConcreteWithWindows, ConcreteWithoutWindows, StoneBlocks
   29.56 +    };
   29.57 +  
   29.58 +  /**
   29.59 +   * Construct a simple building with 1 room and 1 floor
   29.60 +   * 
   29.61 +   * \param xMin x coordinates of left boundary.
   29.62 +   * \param xMax x coordinates of right boundary.
   29.63 +   * \param yMin y coordinates of bottom boundary.
   29.64 +   * \param yMax y coordinates of top boundary.
   29.65 +   * \param zMin z coordinates of down boundary.
   29.66 +   * \param zMax z coordinates of up boundary.
   29.67 +   *
   29.68 +   */
   29.69 +  Building (double xMin, 
   29.70 +            double xMax,
   29.71 +            double yMin, 
   29.72 +            double yMax,
   29.73 +            double zMin, 
   29.74 +            double zMax);
   29.75 +
   29.76 +  /**
   29.77 +   * Create a zero-sized building located at coordinates (0.0,0.0,0.0)
   29.78 +   * and with 1 floors and 1 room.
   29.79 +   */
   29.80 +  Building ();
   29.81 +
   29.82 +  /** 
   29.83 +   * Destructor
   29.84 +   * 
   29.85 +   */
   29.86 +  virtual ~Building ();
   29.87 +
   29.88 +  /**
   29.89 +   * \return the unique id of this Building. This unique id happens to
   29.90 +   * be also the index of the Building into the BuildingList. 
   29.91 +   */
   29.92 +  uint32_t GetId (void) const;
   29.93 +
   29.94 +  /** 
   29.95 +   * Set the boundaries of the building
   29.96 +   * 
   29.97 +   * \param box the Box defining the boundaries of the building
   29.98 +   */
   29.99 +  void SetBoundaries (Box box);
  29.100 +
  29.101 +  /**
  29.102 +   * \param t the type of building (i.e., Residential, Office, Commercial)
  29.103 +   *
  29.104 +   * This method allows to set building type (default is Residential)
  29.105 +   */
  29.106 +  void SetBuildingType (Building::BuildingType_t t);
  29.107 +
  29.108 +  /**
  29.109 +   * \param t the type of external walls (i.e., Wood, ConcreteWithWindows,
  29.110 +   * ConcreteWithoutWindows and StoneBlocks), used for evaluating the loss
  29.111 +   * due to the penetration of external walls in outdoor <-> indoor comm.
  29.112 +   *
  29.113 +   * This method allows to set external walls type (default is Residential)
  29.114 +   */
  29.115 +  void SetExtWallsType (Building::ExtWallsType_t t);
  29.116 +
  29.117 +  /**
  29.118 +   * \param nfloors the number of floors in the building
  29.119 +   *
  29.120 +   * This method allows to set the number of floors in the building
  29.121 +   * (default is 1)
  29.122 +   */
  29.123 +  void SetNFloors (uint16_t nfloors);
  29.124 +
  29.125 +  /**
  29.126 +   * \param nroomx the number of rooms along the x axis
  29.127 +   *
  29.128 +   * This method allows to set the number of rooms along the x-axis
  29.129 +   */
  29.130 +  void SetNRoomsX (uint16_t nroomx);
  29.131 +
  29.132 +  /**
  29.133 +   * \param nroomy the number of floors in the building
  29.134 +   *
  29.135 +   * This method allows to set the number of rooms along the y-axis
  29.136 +   */
  29.137 +  void SetNRoomsY (uint16_t nroomy);
  29.138 +
  29.139 +  /** 
  29.140 +   * 
  29.141 +   * \return the boundaries of the building
  29.142 +   */
  29.143 +  Box GetBoundaries () const;
  29.144 +
  29.145 +  /**
  29.146 +   * \return the type of building
  29.147 +   */
  29.148 +  BuildingType_t GetBuildingType () const;
  29.149 +
  29.150 +  /**
  29.151 +   * \return the type of external walls of the building
  29.152 +   */
  29.153 +  ExtWallsType_t GetExtWallsType () const;
  29.154 +
  29.155 +  /**
  29.156 +   * \return the number of floors of the building
  29.157 +   */
  29.158 +  uint16_t GetNFloors () const;
  29.159 +
  29.160 +  /**
  29.161 +   * \return the number of rooms along the x-axis of the building
  29.162 +   */
  29.163 +  uint16_t GetNRoomsX () const;
  29.164 +
  29.165 +  /**
  29.166 +   * \return the number of rooms along the y-axis
  29.167 +   */
  29.168 +  uint16_t GetNRoomsY () const;
  29.169 +  
  29.170 +  /** 
  29.171 +   * 
  29.172 +   * 
  29.173 +   * \param position some position
  29.174 +   * 
  29.175 +   * \return true if the position fall inside the building, false otherwise
  29.176 +   */
  29.177 +  bool IsInside (Vector position) const;
  29.178 + 
  29.179 +  /** 
  29.180 +   * 
  29.181 +   * 
  29.182 +   * \param position a position inside the building
  29.183 +   * 
  29.184 +   * \return the number of the room along the X axis where the
  29.185 +   * position falls
  29.186 +   */
  29.187 +  uint16_t GetRoomX (Vector position) const;
  29.188 +
  29.189 +  /** 
  29.190 +   * 
  29.191 +   * 
  29.192 +   * \param position a position inside the building
  29.193 +   * 
  29.194 +   * \return  the number of the room along the Y axis where the
  29.195 +   * position falls
  29.196 +   */
  29.197 +  uint16_t GetRoomY (Vector position) const;
  29.198 +
  29.199 +  /** 
  29.200 +   * 
  29.201 +   * \param position a position inside the building 
  29.202 +   * 
  29.203 +   * \return  the floor where the position falls
  29.204 +   */
  29.205 +  uint16_t GetFloor (Vector position) const;
  29.206 +
  29.207 +
  29.208 +
  29.209 +
  29.210 +private:
  29.211 +
  29.212 +  Box m_buildingBounds;
  29.213 +
  29.214 +  /**
  29.215 +   * number of floors, must be greater than 0, and 1 means only one floor
  29.216 +   * (i.e., groundfloor)
  29.217 +   */
  29.218 +  uint16_t m_floors;
  29.219 +  uint16_t m_roomsX;
  29.220 +  uint16_t m_roomsY;
  29.221 +
  29.222 +  uint32_t m_buildingId;
  29.223 +  BuildingType_t m_buildingType;
  29.224 +  ExtWallsType_t m_externalWalls;
  29.225 +
  29.226 +};
  29.227 +
  29.228 +} // namespace ns3
  29.229 +
  29.230 +#endif /* BUILDING_H */
    30.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    30.2 +++ b/src/buildings/model/buildings-mobility-model.cc	Fri May 11 16:42:40 2012 +0200
    30.3 @@ -0,0 +1,178 @@
    30.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    30.5 +/*
    30.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    30.7 + *
    30.8 + * This program is free software; you can redistribute it and/or modify
    30.9 + * it under the terms of the GNU General Public License version 2 as
   30.10 + * published by the Free Software Foundation;
   30.11 + *
   30.12 + * This program is distributed in the hope that it will be useful,
   30.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   30.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   30.15 + * GNU General Public License for more details.
   30.16 + *
   30.17 + * You should have received a copy of the GNU General Public License
   30.18 + * along with this program; if not, write to the Free Software
   30.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   30.20 + *
   30.21 + * Author: Marco Miozzo  <marco.miozzo@cttc.es>
   30.22 + * 
   30.23 + */
   30.24 +
   30.25 +#include <ns3/simulator.h>
   30.26 +#include <ns3/position-allocator.h>
   30.27 +#include <ns3/buildings-mobility-model.h>
   30.28 +#include <ns3/pointer.h>
   30.29 +#include <ns3/log.h>
   30.30 +
   30.31 +NS_LOG_COMPONENT_DEFINE ("BuildingsMobilityModel");
   30.32 +
   30.33 +namespace ns3 {
   30.34 +
   30.35 +NS_OBJECT_ENSURE_REGISTERED (BuildingsMobilityModel);
   30.36 +
   30.37 +TypeId
   30.38 +BuildingsMobilityModel::GetTypeId (void)
   30.39 +{
   30.40 +  static TypeId tid = TypeId ("ns3::BuildingsMobilityModel")
   30.41 +    .SetParent<MobilityModel> ()
   30.42 +    .SetGroupName ("Mobility")
   30.43 +    .AddConstructor<BuildingsMobilityModel> ();
   30.44 +
   30.45 +  return tid;
   30.46 +}
   30.47 +
   30.48 +
   30.49 +BuildingsMobilityModel::BuildingsMobilityModel ()
   30.50 +{
   30.51 +  NS_LOG_FUNCTION (this);
   30.52 +  m_indoor = false;
   30.53 +  m_nFloor = 0;
   30.54 +  m_roomX = 1;
   30.55 +  m_roomY = 1;
   30.56 +}
   30.57 +
   30.58 +void
   30.59 +BuildingsMobilityModel::DoDispose (void)
   30.60 +{
   30.61 +  NS_LOG_FUNCTION (this);
   30.62 +  MobilityModel::DoDispose ();
   30.63 +}
   30.64 +
   30.65 +Vector
   30.66 +BuildingsMobilityModel::DoGetPosition (void) const
   30.67 +{
   30.68 +  NS_LOG_FUNCTION (this);
   30.69 +  m_helper.Update ();
   30.70 +  return m_helper.GetCurrentPosition ();
   30.71 +}
   30.72 +void 
   30.73 +BuildingsMobilityModel::DoSetPosition (const Vector &position)
   30.74 +{
   30.75 +  NS_LOG_FUNCTION (this);
   30.76 +  m_helper.SetPosition (position);
   30.77 +}
   30.78 +Vector
   30.79 +BuildingsMobilityModel::DoGetVelocity (void) const
   30.80 +{
   30.81 +  NS_LOG_FUNCTION (this);
   30.82 +  return m_helper.GetVelocity ();
   30.83 +}
   30.84 +
   30.85 +bool
   30.86 +BuildingsMobilityModel::IsIndoor (void)
   30.87 +{
   30.88 +  NS_LOG_FUNCTION (this);
   30.89 +  return (m_indoor);
   30.90 +}
   30.91 +
   30.92 +bool
   30.93 +BuildingsMobilityModel::IsOutdoor (void)
   30.94 +{
   30.95 +  NS_LOG_FUNCTION (this);
   30.96 +  return (!m_indoor);
   30.97 +}
   30.98 +
   30.99 +void
  30.100 +BuildingsMobilityModel::SetIndoor (Ptr<Building> building)
  30.101 +{
  30.102 +  NS_LOG_FUNCTION (this);
  30.103 +  m_indoor = true;
  30.104 +  m_myBuilding = building;
  30.105 +}
  30.106 +
  30.107 +void
  30.108 +BuildingsMobilityModel::SetIndoor (Ptr<Building> building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy)
  30.109 +{
  30.110 +  NS_LOG_FUNCTION (this);
  30.111 +  m_indoor = true;
  30.112 +  m_myBuilding = building;
  30.113 +  m_nFloor = nfloor;
  30.114 +  m_roomX = nroomx;
  30.115 +  m_roomY = nroomy;
  30.116 +  
  30.117 +  if (!building->IsInside (m_helper.GetCurrentPosition ()))
  30.118 +    {
  30.119 +      NS_FATAL_ERROR ("Position of the node is inconsistent with building bounds");
  30.120 +    }
  30.121 +}
  30.122 +
  30.123 +
  30.124 +void
  30.125 +BuildingsMobilityModel::SetOutdoor (void)
  30.126 +{
  30.127 +  NS_LOG_FUNCTION (this);
  30.128 +  m_indoor = false;
  30.129 +}
  30.130 +
  30.131 +void
  30.132 +BuildingsMobilityModel::SetFloorNumber (uint8_t nfloor)
  30.133 +{
  30.134 +  NS_LOG_FUNCTION (this);
  30.135 +  m_nFloor = nfloor;
  30.136 +}
  30.137 +
  30.138 +void
  30.139 +BuildingsMobilityModel::SetRoomNumberX (uint8_t nroomx)
  30.140 +{
  30.141 +  m_roomX = nroomx;
  30.142 +}
  30.143 +
  30.144 +void
  30.145 +BuildingsMobilityModel::SetRoomNumberY (uint8_t nroomy)
  30.146 +{
  30.147 +  NS_LOG_FUNCTION (this);
  30.148 +  m_roomY = nroomy;
  30.149 +}
  30.150 +
  30.151 +uint8_t
  30.152 +BuildingsMobilityModel::GetFloorNumber (void)
  30.153 +{
  30.154 +  NS_LOG_FUNCTION (this);
  30.155 +  return (m_nFloor);
  30.156 +}
  30.157 +
  30.158 +uint8_t
  30.159 +BuildingsMobilityModel::GetRoomNumberX (void)
  30.160 +{
  30.161 +  NS_LOG_FUNCTION (this);
  30.162 +  return (m_roomX);
  30.163 +}
  30.164 +
  30.165 +uint8_t
  30.166 +BuildingsMobilityModel::GetRoomNumberY (void)
  30.167 +{
  30.168 +  NS_LOG_FUNCTION (this);
  30.169 +  return (m_roomY);
  30.170 +}
  30.171 +
  30.172 +
  30.173 +Ptr<Building>
  30.174 +BuildingsMobilityModel::GetBuilding ()
  30.175 +{
  30.176 +  NS_LOG_FUNCTION (this);
  30.177 +  return (m_myBuilding);
  30.178 +}
  30.179 +
  30.180 +  
  30.181 +} // namespace
    31.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.2 +++ b/src/buildings/model/buildings-mobility-model.h	Fri May 11 16:42:40 2012 +0200
    31.3 @@ -0,0 +1,97 @@
    31.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    31.5 +/*
    31.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    31.7 + *
    31.8 + * This program is free software; you can redistribute it and/or modify
    31.9 + * it under the terms of the GNU General Public License version 2 as
   31.10 + * published by the Free Software Foundation;
   31.11 + *
   31.12 + * This program is distributed in the hope that it will be useful,
   31.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   31.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   31.15 + * GNU General Public License for more details.
   31.16 + *
   31.17 + * You should have received a copy of the GNU General Public License
   31.18 + * along with this program; if not, write to the Free Software
   31.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   31.20 + *
   31.21 + * Author: Marco Miozzo  <marco.miozzo@cttc.es>
   31.22 + * 
   31.23 + */
   31.24 +#ifndef BUILDINGS_MOBILITY_MODEL_H
   31.25 +#define BUILDINGS_MOBILITY_MODEL_H
   31.26 +
   31.27 +
   31.28 +
   31.29 +#include <ns3/mobility-model.h>
   31.30 +#include <ns3/ptr.h>
   31.31 +#include <ns3/object.h>
   31.32 +#include <ns3/box.h>
   31.33 +#include <map>
   31.34 +#include <ns3/building.h>
   31.35 +#include <ns3/constant-velocity-helper.h>
   31.36 +
   31.37 +
   31.38 +
   31.39 +namespace ns3 {
   31.40 +
   31.41 +
   31.42 +/**
   31.43 + * \ingroup mobility
   31.44 + * \brief Buildings mobility model
   31.45 + *
   31.46 + * This model implements the managment of scenarios where users might be
   31.47 + * either indoor (e.g., houses, offices, etc.) and outdoor.
   31.48 + * 
   31.49 + */
   31.50 +
   31.51 +
   31.52 +class BuildingsMobilityModel : public MobilityModel
   31.53 +{
   31.54 +public:
   31.55 +  static TypeId GetTypeId (void);
   31.56 +  BuildingsMobilityModel ();
   31.57 +
   31.58 +  bool IsIndoor (void);
   31.59 +  bool IsOutdoor (void);
   31.60 +
   31.61 +  void SetIndoor (Ptr<Building> building);
   31.62 +  void SetIndoor (Ptr<Building> building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy);
   31.63 +  void SetOutdoor (void);
   31.64 +
   31.65 +  void SetFloorNumber (uint8_t nfloor);
   31.66 +  void SetRoomNumberX (uint8_t nroomx);
   31.67 +  void SetRoomNumberY (uint8_t nroomy);
   31.68 +
   31.69 +  uint8_t GetFloorNumber (void);
   31.70 +  uint8_t GetRoomNumberX (void);
   31.71 +  uint8_t GetRoomNumberY (void);
   31.72 +
   31.73 +  Ptr<Building> GetBuilding ();
   31.74 +
   31.75 +
   31.76 +
   31.77 +private:
   31.78 +  virtual void DoDispose (void);
   31.79 +  virtual Vector DoGetPosition (void) const;
   31.80 +  virtual void DoSetPosition (const Vector &position);
   31.81 +  virtual Vector DoGetVelocity (void) const;
   31.82 +  ConstantVelocityHelper m_helper;
   31.83 +
   31.84 +  Ptr<Building> m_myBuilding;
   31.85 +  bool m_indoor;
   31.86 +  /**
   31.87 +  * floors numbering starts from 0 (basement)
   31.88 +  */
   31.89 +  uint8_t m_nFloor;
   31.90 +  uint8_t m_roomX;
   31.91 +  uint8_t m_roomY;
   31.92 +
   31.93 +};
   31.94 +
   31.95 +
   31.96 +
   31.97 +} // namespace ns3
   31.98 +
   31.99 +
  31.100 +#endif // BUILDINGS_MOBILITY_MODEL_H
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/src/buildings/model/buildings-propagation-loss-model.cc	Fri May 11 16:42:40 2012 +0200
    32.3 @@ -0,0 +1,218 @@
    32.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    32.5 +/*
    32.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    32.7 + *
    32.8 + * This program is free software; you can redistribute it and/or modify
    32.9 + * it under the terms of the GNU General Public License version 2 as
   32.10 + * published by the Free Software Foundation;
   32.11 + *
   32.12 + * This program is distributed in the hope that it will be useful,
   32.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   32.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   32.15 + * GNU General Public License for more details.
   32.16 + *
   32.17 + * You should have received a copy of the GNU General Public License
   32.18 + * along with this program; if not, write to the Free Software
   32.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   32.20 + *
   32.21 + * Author: Marco Miozzo  <marco.miozzo@cttc.es>,
   32.22 + *         Nicola Baldo <nbaldo@cttc.es>
   32.23 + * 
   32.24 + */
   32.25 +
   32.26 +#include "ns3/propagation-loss-model.h"
   32.27 +#include "ns3/log.h"
   32.28 +#include "ns3/mobility-model.h"
   32.29 +#include "ns3/double.h"
   32.30 +#include "ns3/pointer.h"
   32.31 +#include <cmath>
   32.32 +#include "buildings-propagation-loss-model.h"
   32.33 +#include "ns3/buildings-mobility-model.h"
   32.34 +#include "ns3/enum.h"
   32.35 +
   32.36 +
   32.37 +NS_LOG_COMPONENT_DEFINE ("BuildingsPropagationLossModel");
   32.38 +
   32.39 +namespace ns3 {
   32.40 +
   32.41 +NS_OBJECT_ENSURE_REGISTERED (BuildingsPropagationLossModel);
   32.42 +
   32.43 +
   32.44 +BuildingsPropagationLossModel::ShadowingLoss::ShadowingLoss ()
   32.45 +{
   32.46 +}
   32.47 +
   32.48 +
   32.49 +BuildingsPropagationLossModel::ShadowingLoss::ShadowingLoss (double mean, double sigma, Ptr<MobilityModel> receiver)
   32.50 +  : m_receiver (receiver),
   32.51 +    m_randVariable (mean, sigma * sigma) // NormalVariable class wants mean and variance (sigma is a standard deviation)
   32.52 +{
   32.53 +  m_shadowingValue = m_randVariable.GetValue ();
   32.54 +  NS_LOG_INFO (this << " New Shadowing: sigma " << sigma << " value " << m_shadowingValue);
   32.55 +}
   32.56 +
   32.57 +double
   32.58 +BuildingsPropagationLossModel::ShadowingLoss::GetLoss () const
   32.59 +{
   32.60 +  return (m_shadowingValue);
   32.61 +}
   32.62 +
   32.63 +Ptr<MobilityModel>
   32.64 +BuildingsPropagationLossModel::ShadowingLoss::GetReceiver () const
   32.65 +{
   32.66 +  return m_receiver;
   32.67 +}
   32.68 +
   32.69 +TypeId
   32.70 +BuildingsPropagationLossModel::GetTypeId (void)
   32.71 +{
   32.72 +  static TypeId tid = TypeId ("ns3::BuildingsPropagationLossModel")
   32.73 +
   32.74 +    .SetParent<PropagationLossModel> ()
   32.75 +
   32.76 +
   32.77 +    .AddAttribute ("ShadowSigmaOutdoor",
   32.78 +                   "Standard deviation of the normal distribution used for calculate the shadowing for outdoor nodes",
   32.79 +                   DoubleValue (7.0),
   32.80 +                   MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaOutdoor),
   32.81 +                   MakeDoubleChecker<double> ())
   32.82 +
   32.83 +    .AddAttribute ("ShadowSigmaIndoor",
   32.84 +                   "Standard deviation of the normal distribution used for calculate the shadowing for indoor nodes ",
   32.85 +                   DoubleValue (8.0),
   32.86 +                   MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaIndoor),
   32.87 +                   MakeDoubleChecker<double> ())
   32.88 +    .AddAttribute ("ShadowSigmaExtWalls",
   32.89 +                   "Standard deviation of the normal distribution used for calculate the shadowing due to ext walls ",
   32.90 +                   DoubleValue (5.0),
   32.91 +                   MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaExtWalls),
   32.92 +                   MakeDoubleChecker<double> ())
   32.93 +
   32.94 +    .AddAttribute ("InternalWallLoss",
   32.95 +                   "Additional loss for each internal wall [dB]",
   32.96 +                   DoubleValue (5.0),
   32.97 +                   MakeDoubleAccessor (&BuildingsPropagationLossModel::m_lossInternalWall),
   32.98 +                   MakeDoubleChecker<double> ());
   32.99 +
  32.100 +
  32.101 +  return tid;
  32.102 +}
  32.103 +
  32.104 +
  32.105 +double
  32.106 +BuildingsPropagationLossModel::ExternalWallLoss (Ptr<BuildingsMobilityModel> a) const
  32.107 +{
  32.108 +  double loss = 0.0;
  32.109 +  Ptr<Building> aBuilding = a->GetBuilding ();
  32.110 +  if (aBuilding->GetExtWallsType () == Building::Wood)
  32.111 +    {
  32.112 +      loss = 4;
  32.113 +    }
  32.114 +  else if (aBuilding->GetExtWallsType () == Building::ConcreteWithWindows)
  32.115 +    {
  32.116 +      loss = 7;
  32.117 +    }
  32.118 +  else if (aBuilding->GetExtWallsType () == Building::ConcreteWithoutWindows)
  32.119 +    {
  32.120 +      loss = 15; // 10 ~ 20 dB
  32.121 +    }
  32.122 +  else if (aBuilding->GetExtWallsType () == Building::StoneBlocks)
  32.123 +    {
  32.124 +      loss = 12;
  32.125 +    }
  32.126 +  return (loss);
  32.127 +}
  32.128 +
  32.129 +double
  32.130 +BuildingsPropagationLossModel::HeightLoss (Ptr<BuildingsMobilityModel> node) const
  32.131 +{
  32.132 +  double loss = 0.0;
  32.133 +
  32.134 +  int nfloors  = node->GetFloorNumber ();
  32.135 +  loss = -2 * (nfloors);
  32.136 +  return (loss);
  32.137 +}
  32.138 +
  32.139 +double
  32.140 +BuildingsPropagationLossModel::InternalWallsLoss (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel>b) const
  32.141 +{
  32.142 +  // approximate the number of internal walls with the Manhattan distance in "rooms" units
  32.143 +  double dx = abs (a->GetRoomNumberX () - b->GetRoomNumberX ());
  32.144 +  double dy = abs (a->GetRoomNumberY () - b->GetRoomNumberY ());    
  32.145 +  return m_lossInternalWall * (dx+dy);
  32.146 +}
  32.147 +
  32.148 +
  32.149 +
  32.150 +double
  32.151 +BuildingsPropagationLossModel::GetShadowing (Ptr<MobilityModel> a, Ptr<MobilityModel> b)
  32.152 +const
  32.153 +{
  32.154 +    Ptr<BuildingsMobilityModel> a1 = DynamicCast<BuildingsMobilityModel> (a);
  32.155 +    Ptr<BuildingsMobilityModel> b1 = DynamicCast<BuildingsMobilityModel> (b);
  32.156 +    NS_ASSERT_MSG ((a1 != 0) && (b1 != 0), "BuildingsPropagationLossModel only works with BuildingsMobilityModel");
  32.157 +  
  32.158 +  std::map<Ptr<MobilityModel>,  std::map<Ptr<MobilityModel>, ShadowingLoss> >::iterator ait = m_shadowingLossMap.find (a);
  32.159 +  if (ait != m_shadowingLossMap.end ())
  32.160 +    {
  32.161 +      std::map<Ptr<MobilityModel>, ShadowingLoss>::iterator bit = ait->second.find (b);
  32.162 +      if (bit != ait->second.end ())
  32.163 +        {
  32.164 +          return (bit->second.GetLoss ());
  32.165 +        }
  32.166 +      else
  32.167 +        {
  32.168 +          double sigma = EvaluateSigma (a1, b1);
  32.169 +          // side effect: will create new entry          
  32.170 +          ait->second[b] = ShadowingLoss (0.0, sigma, b);          
  32.171 +          return (ait->second[b].GetLoss ());
  32.172 +        }
  32.173 +    }
  32.174 +  else
  32.175 +    {
  32.176 +      double sigma = EvaluateSigma (a1, b1);
  32.177 +      // side effect: will create new entries in both maps
  32.178 +      m_shadowingLossMap[a][b] = ShadowingLoss (0.0, sigma, b);  
  32.179 +      return (m_shadowingLossMap[a][b].GetLoss ());       
  32.180 +    }
  32.181 +}
  32.182 +
  32.183 +
  32.184 +
  32.185 +double
  32.186 +BuildingsPropagationLossModel::EvaluateSigma (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b)
  32.187 +const
  32.188 +{
  32.189 +  if (a->IsOutdoor ())
  32.190 +    {
  32.191 +      if (b->IsOutdoor ())
  32.192 +        {
  32.193 +          return (m_shadowingSigmaOutdoor);
  32.194 +        }
  32.195 +      else
  32.196 +        {
  32.197 +          double sigma = sqrt ((m_shadowingSigmaOutdoor * m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls * m_shadowingSigmaExtWalls));
  32.198 +          return (sigma);
  32.199 +        }
  32.200 +    }
  32.201 +  else
  32.202 +  if (b->IsIndoor ())
  32.203 +    {
  32.204 +      return (m_shadowingSigmaIndoor);
  32.205 +    }
  32.206 +  else
  32.207 +    {
  32.208 +      double sigma = sqrt ((m_shadowingSigmaOutdoor * m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls * m_shadowingSigmaExtWalls));
  32.209 +      return (sigma);
  32.210 +    }
  32.211 +}
  32.212 +
  32.213 +
  32.214 +double
  32.215 +BuildingsPropagationLossModel::DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
  32.216 +{
  32.217 +  return txPowerDbm - GetLoss (a, b) - GetShadowing (a, b);
  32.218 +}
  32.219 +
  32.220 +
  32.221 +} // namespace ns3
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/src/buildings/model/buildings-propagation-loss-model.h	Fri May 11 16:42:40 2012 +0200
    33.3 @@ -0,0 +1,106 @@
    33.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    33.5 +/*
    33.6 + * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    33.7 + *
    33.8 + * This program is free software; you can redistribute it and/or modify
    33.9 + * it under the terms of the GNU General Public License version 2 as
   33.10 + * published by the Free Software Foundation;
   33.11 + *
   33.12 + * This program is distributed in the hope that it will be useful,
   33.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   33.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   33.15 + * GNU General Public License for more details.
   33.16 + *
   33.17 + * You should have received a copy of the GNU General Public License
   33.18 + * along with this program; if not, write to the Free Software
   33.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   33.20 + *
   33.21 + * Author: Marco Miozzo  <marco.miozzo@cttc.es>
   33.22 + *         Nicola Baldo <nbaldo@cttc.es>
   33.23 + * 
   33.24 + */
   33.25 +
   33.26 +#ifndef BUILDINGS_PROPAGATION_LOSS_MODEL_H_
   33.27 +#define BUILDINGS_PROPAGATION_LOSS_MODEL_H_
   33.28 +
   33.29 +#include "ns3/nstime.h"
   33.30 +#include "ns3/propagation-loss-model.h"
   33.31 +#include <ns3/building.h>
   33.32 +#include <ns3/buildings-mobility-model.h>
   33.33 +
   33.34 +
   33.35 +namespace ns3 {
   33.36 +
   33.37 +class ShadowingLossModel;
   33.38 +class JakesFadingLossModel;
   33.39 +
   33.40 +/**
   33.41 + * \ingroup propagation
   33.42 + *
   33.43 + *  This model provides means for simulating the following propagation
   33.44 + *  phenomena in the presence of buildings: 
   33.45 + *
   33.46 + *   - shadowing (indoor, outdoor)
   33.47 + *   - external wall penetration loss
   33.48 + *   - internal wall penetration loss
   33.49 + *  
   33.50 + *  The distance-dependent component of propagation loss is deferred
   33.51 + *  to derived classes which are expected to implement the GetLoss method.
   33.52 + *  
   33.53 + *  \warning This model works only with BuildingsMobilityModel
   33.54 + *
   33.55 + */
   33.56 +
   33.57 +class BuildingsPropagationLossModel : public PropagationLossModel
   33.58 +{
   33.59 +
   33.60 +public:
   33.61 +  static TypeId GetTypeId (void);
   33.62 +
   33.63 +  /**
   33.64 +   * \param a the mobility model of the source
   33.65 +   * \param b the mobility model of the destination
   33.66 +   * \returns the propagation loss (in dBm)
   33.67 +   */
   33.68 +  virtual double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const = 0;
   33.69 +
   33.70 +  // inherited from PropagationLossModel
   33.71 +  virtual double DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
   33.72 +
   33.73 +protected:
   33.74 +
   33.75 +  double ExternalWallLoss (Ptr<BuildingsMobilityModel> a) const;
   33.76 +  double HeightLoss (Ptr<BuildingsMobilityModel> n) const;
   33.77 +  double InternalWallsLoss (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
   33.78 +  
   33.79 +  double GetShadowing (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
   33.80 +
   33.81 +  double m_lossInternalWall; // in meters
   33.82 +
   33.83 +  
   33.84 +  class ShadowingLoss
   33.85 +  {
   33.86 +  public:
   33.87 +    ShadowingLoss ();
   33.88 +    ShadowingLoss (double mean, double sigma, Ptr<MobilityModel> receiver);
   33.89 +    double GetLoss () const;
   33.90 +    Ptr<MobilityModel> GetReceiver (void) const;
   33.91 +  protected:
   33.92 +    Ptr<MobilityModel> m_receiver;
   33.93 +    NormalVariable m_randVariable;
   33.94 +    double m_shadowingValue;
   33.95 +  };
   33.96 +
   33.97 +  mutable std::map<Ptr<MobilityModel>,  std::map<Ptr<MobilityModel>, ShadowingLoss> > m_shadowingLossMap;
   33.98 +  double EvaluateSigma (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
   33.99 +
  33.100 +
  33.101 +  double m_shadowingSigmaExtWalls;
  33.102 +  double m_shadowingSigmaOutdoor;
  33.103 +  double m_shadowingSigmaIndoor;
  33.104 +
  33.105 +};
  33.106 +
  33.107 +}
  33.108 +
  33.109 +#endif /* BUILDINGS_PROPAGATION_LOSS_MODEL_H_ */
    34.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    34.2 +++ b/src/buildings/model/hybrid-buildings-propagation-loss-model.cc	Fri May 11 16:42:40 2012 +0200
    34.3 @@ -0,0 +1,291 @@
    34.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    34.5 +/*
    34.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    34.7 + *
    34.8 + * This program is free software; you can redistribute it and/or modify
    34.9 + * it under the terms of the GNU General Public License version 2 as
   34.10 + * published by the Free Software Foundation;
   34.11 + *
   34.12 + * This program is distributed in the hope that it will be useful,
   34.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   34.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   34.15 + * GNU General Public License for more details.
   34.16 + *
   34.17 + * You should have received a copy of the GNU General Public License
   34.18 + * along with this program; if not, write to the Free Software
   34.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   34.20 + *
   34.21 + * Author: Marco Miozzo <marco.miozzo@cttc.es>
   34.22 + *         Nicola Baldo <nbaldo@cttc.es>
   34.23 + * 
   34.24 + */
   34.25 +
   34.26 +#include <cmath>
   34.27 +
   34.28 +#include "ns3/log.h"
   34.29 +#include "ns3/mobility-model.h"
   34.30 +#include "ns3/double.h"
   34.31 +#include "ns3/pointer.h"
   34.32 +#include "ns3/okumura-hata-propagation-loss-model.h"
   34.33 +#include "ns3/itu-r-1411-los-propagation-loss-model.h"
   34.34 +#include "ns3/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h"
   34.35 +#include "ns3/itu-r-1238-propagation-loss-model.h"
   34.36 +#include "ns3/kun-2600-mhz-propagation-loss-model.h"
   34.37 +#include "ns3/buildings-mobility-model.h"
   34.38 +#include "ns3/enum.h"
   34.39 +
   34.40 +#include "hybrid-buildings-propagation-loss-model.h"
   34.41 +
   34.42 +
   34.43 +NS_LOG_COMPONENT_DEFINE ("HybridBuildingsPropagationLossModel");
   34.44 +
   34.45 +namespace ns3 {
   34.46 +
   34.47 +NS_OBJECT_ENSURE_REGISTERED (HybridBuildingsPropagationLossModel);
   34.48 +
   34.49 +
   34.50 +
   34.51 +HybridBuildingsPropagationLossModel::HybridBuildingsPropagationLossModel ()
   34.52 +{
   34.53 +  m_okumuraHata = CreateObject<OkumuraHataPropagationLossModel> ();
   34.54 +  m_ituR1411Los = CreateObject<ItuR1411LosPropagationLossModel> ();
   34.55 +  m_ituR1411NlosOverRooftop = CreateObject<ItuR1411NlosOverRooftopPropagationLossModel> ();
   34.56 +  m_ituR1238 = CreateObject<ItuR1238PropagationLossModel> ();
   34.57 +  m_kun2600Mhz = CreateObject<Kun2600MhzPropagationLossModel> ();
   34.58 +}
   34.59 +
   34.60 +HybridBuildingsPropagationLossModel::~HybridBuildingsPropagationLossModel ()
   34.61 +{
   34.62 +}
   34.63 +
   34.64 +TypeId
   34.65 +HybridBuildingsPropagationLossModel::GetTypeId (void)
   34.66 +{
   34.67 +  static TypeId tid = TypeId ("ns3::HybridBuildingsPropagationLossModel")
   34.68 +    
   34.69 +    .SetParent<BuildingsPropagationLossModel> ()
   34.70 +    
   34.71 +    .AddConstructor<HybridBuildingsPropagationLossModel> ()
   34.72 +    
   34.73 +    .AddAttribute ("Frequency",
   34.74 +                   "The Frequency  (default is 2.106 GHz).",
   34.75 +                   DoubleValue (2160e6),
   34.76 +                   MakeDoubleAccessor (&HybridBuildingsPropagationLossModel::SetFrequency),
   34.77 +                   MakeDoubleChecker<double> ())
   34.78 +
   34.79 +    .AddAttribute ("Los2NlosThr",
   34.80 +                   " Threshold from LoS to NLoS in ITU 1411 [m].",
   34.81 +                   DoubleValue (200.0),
   34.82 +                   MakeDoubleAccessor (&HybridBuildingsPropagationLossModel::m_itu1411NlosThreshold),
   34.83 +                   MakeDoubleChecker<double> ())
   34.84 +
   34.85 +    .AddAttribute ("Environment",
   34.86 +                   "Environment Scenario",
   34.87 +                   EnumValue (UrbanEnvironment),
   34.88 +                   MakeEnumAccessor (&HybridBuildingsPropagationLossModel::SetEnvironment),
   34.89 +                   MakeEnumChecker (UrbanEnvironment, "Urban",
   34.90 +                                    SubUrbanEnvironment, "SubUrban",
   34.91 +                                    OpenAreasEnvironment, "OpenAreas"))
   34.92 +
   34.93 +    .AddAttribute ("CitySize",
   34.94 +                   "Dimension of the city",
   34.95 +                   EnumValue (LargeCity),
   34.96 +                   MakeEnumAccessor (&HybridBuildingsPropagationLossModel::SetCitySize),
   34.97 +                   MakeEnumChecker (SmallCity, "Small",
   34.98 +                                    MediumCity, "Medium",
   34.99 +                                    LargeCity, "Large"))
  34.100 +
  34.101 +    .AddAttribute ("RooftopLevel",
  34.102 +                   "The height of the rooftop level in meters",
  34.103 +                   DoubleValue (20.0),
  34.104 +                   MakeDoubleAccessor (&HybridBuildingsPropagationLossModel::SetRooftopHeight),
  34.105 +                   MakeDoubleChecker<double> (0.0, 90.0))
  34.106 +
  34.107 +    ;
  34.108 +  
  34.109 +  return tid;
  34.110 +}
  34.111 +
  34.112 +void
  34.113 +HybridBuildingsPropagationLossModel::SetEnvironment (EnvironmentType env)
  34.114 +{
  34.115 +  m_okumuraHata->SetAttribute ("Environment", EnumValue (env));
  34.116 +  m_ituR1411NlosOverRooftop->SetAttribute ("Environment", EnumValue (env));
  34.117 +}
  34.118 +
  34.119 +void
  34.120 +HybridBuildingsPropagationLossModel::SetCitySize (CitySize size)
  34.121 +{
  34.122 +  m_okumuraHata->SetAttribute ("CitySize", EnumValue (size));
  34.123 +  m_ituR1411NlosOverRooftop->SetAttribute ("CitySize", EnumValue (size));
  34.124 +}
  34.125 +
  34.126 +void
  34.127 +HybridBuildingsPropagationLossModel::SetFrequency (double freq)
  34.128 +{
  34.129 +  m_okumuraHata->SetAttribute ("Frequency", DoubleValue (freq));
  34.130 +  m_ituR1411Los->SetAttribute ("Frequency", DoubleValue (freq));
  34.131 +  m_ituR1411NlosOverRooftop->SetAttribute ("Frequency", DoubleValue (freq));
  34.132 +  m_ituR1238->SetAttribute ("Frequency", DoubleValue (freq));
  34.133 +  m_frequency = freq;
  34.134 +}
  34.135 +
  34.136 +void
  34.137 +HybridBuildingsPropagationLossModel::SetRooftopHeight (double rooftopHeight)
  34.138 +{
  34.139 +  m_rooftopHeight = rooftopHeight;
  34.140 +  m_ituR1411NlosOverRooftop->SetAttribute ("RooftopLevel", DoubleValue (rooftopHeight));
  34.141 +}
  34.142 +
  34.143 +
  34.144 +double
  34.145 +HybridBuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
  34.146 +{
  34.147 +  NS_ASSERT_MSG ((a->GetPosition ().z >= 0) && (b->GetPosition ().z >= 0), "HybridBuildingsPropagationLossModel does not support underground nodes (placed at z < 0)");
  34.148 +
  34.149 +  
  34.150 +  double distance = a->GetDistanceFrom (b);
  34.151 +
  34.152 +  // get the BuildingsMobilityModel pointers
  34.153 +  Ptr<BuildingsMobilityModel> a1 = DynamicCast<BuildingsMobilityModel> (a);
  34.154 +  Ptr<BuildingsMobilityModel> b1 = DynamicCast<BuildingsMobilityModel> (b);
  34.155 +  NS_ASSERT_MSG ((a1 != 0) && (b1 != 0), "HybridBuildingsPropagationLossModel only works with BuildingsMobilityModel");
  34.156 +
  34.157 +  double loss = 0.0;
  34.158 +
  34.159 +  if (a1->IsOutdoor ())
  34.160 +    {
  34.161 +      if (b1->IsOutdoor ())
  34.162 +        {
  34.163 +          if (distance > 1000)
  34.164 +            {
  34.165 +              NS_LOG_INFO (this << a1->GetPosition ().z << b1->GetPosition ().z << m_rooftopHeight);
  34.166 +              if ((a1->GetPosition ().z < m_rooftopHeight)
  34.167 +                  && (b1->GetPosition ().z < m_rooftopHeight))
  34.168 +                {
  34.169 +                  loss = ItuR1411 (a1, b1);
  34.170 +                  NS_LOG_INFO (this << " 0-0 (>1000): below rooftop -> ITUR1411 : " << loss);
  34.171 +                }
  34.172 +              else
  34.173 +                {
  34.174 +                  // Over the rooftop tranmission -> Okumura Hata
  34.175 +                  loss = OkumuraHata (a1, b1);
  34.176 +                  NS_LOG_INFO (this << " O-O (>1000): above rooftop -> OH : " << loss);
  34.177 +                }
  34.178 +            }
  34.179 +          else
  34.180 +            {
  34.181 +              // short range outdoor communication
  34.182 +              loss = ItuR1411 (a1, b1);
  34.183 +              NS_LOG_INFO (this << " 0-0 (<1000) Street canyon -> ITUR1411 : " << loss);
  34.184 +            }
  34.185 +        }
  34.186 +      else
  34.187 +        {
  34.188 +          // b indoor
  34.189 +          if (distance > 1000)
  34.190 +            {
  34.191 +              if ((a1->GetPosition ().z < m_rooftopHeight)
  34.192 +                  && (b1->GetPosition ().z < m_rooftopHeight))
  34.193 +                {                  
  34.194 +                  loss = ItuR1411 (a1, b1) + ExternalWallLoss (b1) + HeightLoss (a1);
  34.195 +                  NS_LOG_INFO (this << " 0-I (>1000): below rooftop -> ITUR1411 : " << loss);
  34.196 +                }
  34.197 +              else
  34.198 +                {
  34.199 +                  loss = OkumuraHata (a1, b1) + ExternalWallLoss (b1);
  34.200 +                  NS_LOG_INFO (this << " O-I (>1000): above the rooftop -> OH : " << loss);
  34.201 +                }
  34.202 +            }
  34.203 +          else
  34.204 +            {
  34.205 +              loss = ItuR1411 (a1, b1) + ExternalWallLoss (b1) + HeightLoss (b1);
  34.206 +              NS_LOG_INFO (this << " 0-I (<1000) ITUR1411 + BEL : " << loss);
  34.207 +            }
  34.208 +        } // end b1->isIndoor ()
  34.209 +    }
  34.210 +  else
  34.211 +    {
  34.212 +      // a is indoor
  34.213 +      if (b1->IsIndoor ())
  34.214 +        {
  34.215 +          if (a1->GetBuilding () == b1->GetBuilding ())
  34.216 +            {
  34.217 +              // nodes are in same building -> indoor communication ITU-R P.1238
  34.218 +              loss = ItuR1238 (a1, b1) + InternalWallsLoss (a1, b1);;
  34.219 +              NS_LOG_INFO (this << " I-I (same building) ITUR1238 : " << loss);
  34.220 +
  34.221 +            }
  34.222 +          else
  34.223 +            {
  34.224 +              // nodes are in different buildings
  34.225 +              loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1) + ExternalWallLoss (b1);
  34.226 +              NS_LOG_INFO (this << " I-I (different) ITUR1238 + 2*BEL : " << loss);
  34.227 +            }
  34.228 +        }
  34.229 +      else
  34.230 +        {
  34.231 +          // b is outdoor
  34.232 +          if (distance > 1000)
  34.233 +            {
  34.234 +              if ((a1->GetPosition ().z < m_rooftopHeight)
  34.235 +                  && (b1->GetPosition ().z < m_rooftopHeight))
  34.236 +                {
  34.237 +                  loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1) + HeightLoss (a1);
  34.238 +                  NS_LOG_INFO (this << " I-O (>1000): down rooftop -> ITUR1411 : " << loss);
  34.239 +                }
  34.240 +              else
  34.241 +                {
  34.242 +                  // above rooftop -> OH
  34.243 +                  loss = OkumuraHata (a1, b1) + ExternalWallLoss (a1) + HeightLoss (a1);
  34.244 +                  NS_LOG_INFO (this << " =I-O (>1000) over rooftop OH + BEL + HG: " << loss);
  34.245 +                }
  34.246 +            }
  34.247 +          else
  34.248 +            {
  34.249 +              loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1)  + HeightLoss (a1);
  34.250 +              NS_LOG_INFO (this << " I-O (<1000)  ITUR1411 + BEL + HG: " << loss);
  34.251 +            }
  34.252 +        } // end b1->IsIndoor ()
  34.253 +    } // end a1->IsOutdoor ()
  34.254 +
  34.255 +  loss = std::max (loss, 0.0);
  34.256 +
  34.257 +  return loss;
  34.258 +}
  34.259 +
  34.260 +
  34.261 +double
  34.262 +HybridBuildingsPropagationLossModel::OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const
  34.263 +{
  34.264 +  if (m_frequency <= 2.3e9)
  34.265 +    {
  34.266 +      return m_okumuraHata->GetLoss (a, b);
  34.267 +    }
  34.268 +  else
  34.269 +    {
  34.270 +      return m_kun2600Mhz->GetLoss (a, b);
  34.271 +    }
  34.272 +}
  34.273 +
  34.274 +double
  34.275 +HybridBuildingsPropagationLossModel::ItuR1411 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const
  34.276 +{
  34.277 +  if (a->GetDistanceFrom (b) < m_itu1411NlosThreshold)
  34.278 +    {
  34.279 +      return (m_ituR1411Los->GetLoss (a, b));
  34.280 +    }
  34.281 +  else
  34.282 +    {
  34.283 +      return (m_ituR1411NlosOverRooftop->GetLoss (a, b));
  34.284 +    }
  34.285 +}
  34.286 +
  34.287 +double
  34.288 +HybridBuildingsPropagationLossModel::ItuR1238 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const
  34.289 +{
  34.290 +  return m_ituR1238->GetLoss (a,b);
  34.291 +}
  34.292 +
  34.293 +
  34.294 +} // namespace ns3
    35.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.2 +++ b/src/buildings/model/hybrid-buildings-propagation-loss-model.h	Fri May 11 16:42:40 2012 +0200
    35.3 @@ -0,0 +1,121 @@
    35.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    35.5 +/*
    35.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    35.7 + *
    35.8 + * This program is free software; you can redistribute it and/or modify
    35.9 + * it under the terms of the GNU General Public License version 2 as
   35.10 + * published by the Free Software Foundation;
   35.11 + *
   35.12 + * This program is distributed in the hope that it will be useful,
   35.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   35.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   35.15 + * GNU General Public License for more details.
   35.16 + *
   35.17 + * You should have received a copy of the GNU General Public License
   35.18 + * along with this program; if not, write to the Free Software
   35.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   35.20 + *
   35.21 + * Author: Marco Miozzo  <marco.miozzo@cttc.es>
   35.22 + *         Nicola Baldo <nbaldo@cttc.es>
   35.23 + * 
   35.24 + */
   35.25 +
   35.26 +#ifndef HYBRID_BUILDINGS_PROPAGATION_LOSS_MODEL_H_
   35.27 +#define HYBRID_BUILDINGS_PROPAGATION_LOSS_MODEL_H_
   35.28 +
   35.29 +#include <ns3/buildings-propagation-loss-model.h>
   35.30 +#include <ns3/propagation-environment.h>
   35.31 +
   35.32 +namespace ns3 {
   35.33 +
   35.34 +class OkumuraHataPropagationLossModel;
   35.35 +class ItuR1411LosPropagationLossModel;
   35.36 +class ItuR1411NlosOverRooftopPropagationLossModel;
   35.37 +class ItuR1238PropagationLossModel;
   35.38 +class Kun2600MhzPropagationLossModel;
   35.39 +
   35.40 +/**
   35.41 + * \ingroup propagation
   35.42 + *
   35.43 + *  \brief The HybridBuildingsPropagationModel is a compound of different models able to evaluate the pathloss from 200 to 2600 MHz, in different environments and with buildings (i.e., indoor and outdoor communications).
   35.44 + *
   35.45 + *  This model includes Hata model, COST231, ITU-R P.1411 (short range
   35.46 + *  communications), ITU-R P.1238 (indoor communications), which are combined in order
   35.47 + *  to be able to evaluate the pathloss under different scenarios, in detail:
   35.48 + *  - Environments: urban, suburban, open-areas;
   35.49 + *  - frequency: from 200 uo to 2600 MHz
   35.50 + *  - short range communications vs long range communications
   35.51 + *  - Node position respect to buildings: indoor, outdoor and hybrid (indoor <-> outdoor)
   35.52 + *  - Building penetretation loss
   35.53 + *  - floors, etc...
   35.54 + *
   35.55 + *  \warning This model works only with BuildingsMobilityModel
   35.56 + *
   35.57 + */
   35.58 +
   35.59 +class HybridBuildingsPropagationLossModel : public BuildingsPropagationLossModel
   35.60 +{
   35.61 +
   35.62 +public:
   35.63 +  static TypeId GetTypeId (void);
   35.64 +  HybridBuildingsPropagationLossModel ();
   35.65 +  ~HybridBuildingsPropagationLossModel ();
   35.66 +
   35.67 +
   35.68 +  /** 
   35.69 +   * set the environment type
   35.70 +   * 
   35.71 +   * \param env 
   35.72 +   */
   35.73 +  void SetEnvironment (EnvironmentType env);
   35.74 +
   35.75 +  /** 
   35.76 +   * set the size of the city
   35.77 +   * 
   35.78 +   * \param size 
   35.79 +   */
   35.80 +  void SetCitySize (CitySize size);
   35.81 +
   35.82 +  /** 
   35.83 +   * set the propagation frequency
   35.84 +   * 
   35.85 +   * \param freq 
   35.86 +   */
   35.87 +  void SetFrequency (double freq);
   35.88 +
   35.89 +  /** 
   35.90 +   * set the rooftop height
   35.91 +   * 
   35.92 +   * \param rooftopHeight
   35.93 +   */
   35.94 +  void SetRooftopHeight (double rooftopHeight);
   35.95 +
   35.96 +  /**
   35.97 +   * \param a the mobility model of the source
   35.98 +   * \param b the mobility model of the destination
   35.99 +   * \returns the propagation loss (in dBm)
  35.100 +   */
  35.101 +  virtual double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
  35.102 +
  35.103 +  
  35.104 +private:
  35.105 +
  35.106 +  double OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
  35.107 +  double ItuR1411 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
  35.108 +  double ItuR1238 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
  35.109 +
  35.110 +  Ptr<OkumuraHataPropagationLossModel> m_okumuraHata;
  35.111 +  Ptr<ItuR1411LosPropagationLossModel> m_ituR1411Los;
  35.112 +  Ptr<ItuR1411NlosOverRooftopPropagationLossModel> m_ituR1411NlosOverRooftop;
  35.113 +  Ptr<ItuR1238PropagationLossModel> m_ituR1238;
  35.114 +  Ptr<Kun2600MhzPropagationLossModel> m_kun2600Mhz;
  35.115 +
  35.116 +  double m_itu1411NlosThreshold; ///< in meters (switch Los -> NLoS)
  35.117 +  double m_rooftopHeight;
  35.118 +  double m_frequency;
  35.119 +
  35.120 +};
  35.121 +
  35.122 +}
  35.123 +
  35.124 +#endif /* HYBRID_BUILDINGS_PROPAGATION_LOSS_MODEL_H_ */
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/src/buildings/model/itu-r-1238-propagation-loss-model.cc	Fri May 11 16:42:40 2012 +0200
    36.3 @@ -0,0 +1,116 @@
    36.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    36.5 +/*
    36.6 + * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    36.7 + *
    36.8 + * This program is free software; you can redistribute it and/or modify
    36.9 + * it under the terms of the GNU General Public License version 2 as
   36.10 + * published by the Free Software Foundation;
   36.11 + *
   36.12 + * This program is distributed in the hope that it will be useful,
   36.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   36.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   36.15 + * GNU General Public License for more details.
   36.16 + *
   36.17 + * You should have received a copy of the GNU General Public License
   36.18 + * along with this program; if not, write to the Free Software
   36.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   36.20 + *
   36.21 + * Author: Marco Miozzo  <marco.miozzo@cttc.es>,
   36.22 + *         Nicola Baldo <nbaldo@cttc.es>
   36.23 + * 
   36.24 + */
   36.25 +#include "ns3/log.h"
   36.26 +#include "ns3/double.h"
   36.27 +#include "ns3/enum.h"
   36.28 +#include "ns3/mobility-model.h"
   36.29 +#include <cmath>
   36.30 +
   36.31 +#include "itu-r-1238-propagation-loss-model.h"
   36.32 +#include "buildings-mobility-model.h"
   36.33 +
   36.34 +NS_LOG_COMPONENT_DEFINE ("ItuR1238PropagationLossModel");
   36.35 +
   36.36 +namespace ns3 {
   36.37 +
   36.38 +NS_OBJECT_ENSURE_REGISTERED (ItuR1238PropagationLossModel);
   36.39 +
   36.40 +
   36.41 +TypeId
   36.42 +ItuR1238PropagationLossModel::GetTypeId (void)
   36.43 +{
   36.44 +  static TypeId tid = TypeId ("ns3::ItuR1238PropagationLossModel")
   36.45 +
   36.46 +    .SetParent<PropagationLossModel> ()
   36.47 +
   36.48 +    .AddAttribute ("Frequency",
   36.49 +                   "The Frequency  (default is 2.106 GHz).",
   36.50 +                   DoubleValue (2160e6),
   36.51 +                   MakeDoubleAccessor (&ItuR1238PropagationLossModel::m_frequency),
   36.52 +                   MakeDoubleChecker<double> ());
   36.53 +
   36.54 +  return tid;
   36.55 +}
   36.56 +
   36.57 +double
   36.58 +ItuR1238PropagationLossModel::GetLoss (Ptr<MobilityModel> a1, Ptr<MobilityModel> b1) const
   36.59 +{
   36.60 +  NS_LOG_FUNCTION (this << a1 << b1);
   36.61 +  Ptr<BuildingsMobilityModel> a = DynamicCast<BuildingsMobilityModel> (a1);
   36.62 +  Ptr<BuildingsMobilityModel> b = DynamicCast<BuildingsMobilityModel> (b1);
   36.63 +  NS_ASSERT_MSG ((a != 0) && (b != 0), "ItuR1238PropagationLossModel only works with BuildingsMobilityModel");
   36.64 +  NS_ASSERT_MSG (a->GetBuilding ()->GetId () == b->GetBuilding ()->GetId (), "ITU-R 1238 applies only to nodes that are in the same building");
   36.65 +  double N = 0.0;
   36.66 +  int n = abs (a->GetFloorNumber () - b->GetFloorNumber ());
   36.67 +  NS_LOG_LOGIC (this << " A floor " << (uint16_t)a->GetFloorNumber () << " B floor " << (uint16_t)b->GetFloorNumber () << " n " << n);
   36.68 +  double Lf = 0.0;
   36.69 +  Ptr<Building> aBuilding = a->GetBuilding ();
   36.70 +  if (aBuilding->GetBuildingType () == Building::Residential)
   36.71 +    {
   36.72 +      N = 28;
   36.73 +      if (n >= 1)
   36.74 +        {
   36.75 +          Lf = 4 * n;
   36.76 +        }
   36.77 +      NS_LOG_LOGIC (this << " Residential ");
   36.78 +    }
   36.79 +  else if (aBuilding->GetBuildingType () == Building::Office)
   36.80 +    {
   36.81 +      N = 30;
   36.82 +      if (n >= 1)
   36.83 +        {
   36.84 +          Lf = 15 + (4 * (n - 1));
   36.85 +        }
   36.86 +      NS_LOG_LOGIC (this << " Office ");
   36.87 +    }
   36.88 +  else if (aBuilding->GetBuildingType () == Building::Commercial)
   36.89 +    {
   36.90 +      N = 22;
   36.91 +      if (n >= 1)
   36.92 +        {
   36.93 +          Lf = 6 + (3 * (n - 1));
   36.94 +        }
   36.95 +      NS_LOG_LOGIC (this << " Commercial ");
   36.96 +    }
   36.97 +  else
   36.98 +    {
   36.99 +      NS_LOG_ERROR (this << " Unkwnon Wall Type");
  36.100 +    }
  36.101 +  double loss = 20 * log10 (m_frequency / 1e6 /*MHz*/) + N*log10 (a->GetDistanceFrom (b)) + Lf - 28.0;
  36.102 +  NS_LOG_INFO (this << " Node " << a->GetPosition () << " <-> " << b->GetPosition () << " loss = " << loss << " dB");
  36.103 +
  36.104 +  return loss;
  36.105 +}
  36.106 +
  36.107 +
  36.108 +double 
  36.109 +ItuR1238PropagationLossModel::DoCalcRxPower (double txPowerDbm,
  36.110 +						Ptr<MobilityModel> a,
  36.111 +						Ptr<MobilityModel> b) const
  36.112 +{
  36.113 +  return (txPowerDbm - GetLoss (a, b));
  36.114 +}
  36.115 +
  36.116 +
  36.117 +
  36.118 +
  36.119 +} // namespace ns3
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/src/buildings/model/itu-r-1238-propagation-loss-model.h	Fri May 11 16:42:40 2012 +0200
    37.3 @@ -0,0 +1,77 @@
    37.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    37.5 +/*
    37.6 + * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    37.7 + *
    37.8 + * This program is free software; you can redistribute it and/or modify
    37.9 + * it under the terms of the GNU General Public License version 2 as
   37.10 + * published by the Free Software Foundation;
   37.11 + *
   37.12 + * This program is distributed in the hope that it will be useful,
   37.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   37.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   37.15 + * GNU General Public License for more details.
   37.16 + *
   37.17 + * You should have received a copy of the GNU General Public License
   37.18 + * along with this program; if not, write to the Free Software
   37.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   37.20 + *
   37.21 + * Author: Marco Miozzo  <marco.miozzo@cttc.es>
   37.22 + *         Nicola Baldo <nbaldo@cttc.es>
   37.23 + * 
   37.24 + */
   37.25 +
   37.26 +#ifndef ITU_R_1238_PROPAGATION_LOSS_MODEL_H
   37.27 +#define ITU_R_1238_PROPAGATION_LOSS_MODEL_H
   37.28 +
   37.29 +#include <ns3/propagation-loss-model.h>
   37.30 +#include <ns3/propagation-environment.h>
   37.31 +
   37.32 +namespace ns3 {
   37.33 +
   37.34 +/**
   37.35 + * This class implements the ITU-R 1238 propagation loss model.
   37.36 + * 
   37.37 + */
   37.38 +class ItuR1238PropagationLossModel : public PropagationLossModel
   37.39 +{
   37.40 +
   37.41 +public:
   37.42 +
   37.43 +  // inherited from Object
   37.44 +  static TypeId GetTypeId (void);
   37.45 +
   37.46 +  /** 
   37.47 +   * 
   37.48 +   * 
   37.49 +   * \param a the first mobility model
   37.50 +   * \param b the second mobility model
   37.51 +   * 
   37.52 +   * \return the loss in dBm for the propagation between
   37.53 +   * the two given mobility models
   37.54 +   */
   37.55 +  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
   37.56 +
   37.57 +private:
   37.58 +
   37.59 +  // inherited from PropagationLossModel
   37.60 +  virtual double DoCalcRxPower (double txPowerDbm,
   37.61 +                                Ptr<MobilityModel> a,
   37.62 +                                Ptr<MobilityModel> b) const;
   37.63 +  
   37.64 +  double m_frequency; ///< frequency in MHz
   37.65 +  double m_lambda; ///< wavelength
   37.66 +  EnvironmentType m_environment;
   37.67 +  CitySize m_citySize;
   37.68 +  double m_rooftopHeight; ///< in meters
   37.69 +  double m_streetsOrientation; ///< in degrees [0,90]
   37.70 +  double m_streetsWidth; ///< in meters
   37.71 +  double m_buildingsExtend; ///< in meters
   37.72 +  double m_buildingSeparation; ///< in meters
   37.73 +
   37.74 +};
   37.75 +
   37.76 +} // namespace ns3
   37.77 +
   37.78 +
   37.79 +#endif // ITU_R_1238_PROPAGATION_LOSS_MODEL_H
   37.80 +
    38.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    38.2 +++ b/src/buildings/model/oh-buildings-propagation-loss-model.cc	Fri May 11 16:42:40 2012 +0200
    38.3 @@ -0,0 +1,121 @@
    38.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    38.5 +/*
    38.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    38.7 + *
    38.8 + * This program is free software; you can redistribute it and/or modify
    38.9 + * it under the terms of the GNU General Public License version 2 as
   38.10 + * published by the Free Software Foundation;
   38.11 + *
   38.12 + * This program is distributed in the hope that it will be useful,
   38.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   38.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   38.15 + * GNU General Public License for more details.
   38.16 + *
   38.17 + * You should have received a copy of the GNU General Public License
   38.18 + * along with this program; if not, write to the Free Software
   38.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   38.20 + *
   38.21 + * Author: Marco Miozzo  <marco.miozzo@cttc.es>
   38.22 + * 
   38.23 + */
   38.24 +
   38.25 +#include "ns3/propagation-loss-model.h"
   38.26 +#include "ns3/log.h"
   38.27 +#include "ns3/mobility-model.h"
   38.28 +#include "ns3/double.h"
   38.29 +#include "ns3/pointer.h"
   38.30 +#include <math.h>
   38.31 +#include "oh-buildings-propagation-loss-model.h"
   38.32 +#include "ns3/buildings-mobility-model.h"
   38.33 +#include "ns3/okumura-hata-propagation-loss-model.h"
   38.34 +#include "ns3/enum.h"
   38.35 +
   38.36 +
   38.37 +NS_LOG_COMPONENT_DEFINE ("OhBuildingsPropagationLossModel");
   38.38 +
   38.39 +namespace ns3 {
   38.40 +
   38.41 +NS_OBJECT_ENSURE_REGISTERED (OhBuildingsPropagationLossModel);
   38.42 +
   38.43 +
   38.44 +
   38.45 +OhBuildingsPropagationLossModel::OhBuildingsPropagationLossModel ()
   38.46 +{
   38.47 +  m_okumuraHata = CreateObject<OkumuraHataPropagationLossModel> ();
   38.48 +}
   38.49 +
   38.50 +OhBuildingsPropagationLossModel::~OhBuildingsPropagationLossModel ()
   38.51 +{
   38.52 +}
   38.53 +
   38.54 +TypeId
   38.55 +OhBuildingsPropagationLossModel::GetTypeId (void)
   38.56 +{
   38.57 +  static TypeId tid = TypeId ("ns3::OhBuildingsPropagationLossModel")
   38.58 +  
   38.59 +  .SetParent<BuildingsPropagationLossModel> ()
   38.60 +  
   38.61 +  .AddConstructor<OhBuildingsPropagationLossModel> ();
   38.62 +  
   38.63 +  return tid;
   38.64 +}
   38.65 +
   38.66 +
   38.67 +double
   38.68 +OhBuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
   38.69 +{
   38.70 +  NS_LOG_FUNCTION (this << a << b);
   38.71 +
   38.72 +  // get the BuildingsMobilityModel pointers
   38.73 +  Ptr<BuildingsMobilityModel> a1 = DynamicCast<BuildingsMobilityModel> (a);
   38.74 +  Ptr<BuildingsMobilityModel> b1 = DynamicCast<BuildingsMobilityModel> (b);
   38.75 +  NS_ASSERT_MSG ((a1 != 0) && (b1 != 0), "OhBuildingsPropagationLossModel only works with BuildingsMobilityModel");
   38.76 +
   38.77 +  double loss = 0.0;
   38.78 +
   38.79 +  if (a1->IsOutdoor ())
   38.80 +    {
   38.81 +      if (b1->IsOutdoor ())
   38.82 +        {
   38.83 +          loss = m_okumuraHata->GetLoss (a1, b1);
   38.84 +          NS_LOG_INFO (this << " O-O : " << loss);
   38.85 +        }
   38.86 +      else
   38.87 +        {
   38.88 +          // b indoor
   38.89 +          loss = m_okumuraHata->GetLoss (a1, b1) + ExternalWallLoss (b1);
   38.90 +          NS_LOG_INFO (this << " O-I : " << loss);
   38.91 +        } // end b1->isIndoor ()
   38.92 +    }
   38.93 +  else
   38.94 +    {
   38.95 +      // a is indoor
   38.96 +      if (b1->IsIndoor ())
   38.97 +        {
   38.98 +          if (a1->GetBuilding () == b1->GetBuilding ())
   38.99 +            {
  38.100 +              // nodes are in same building -> indoor communication ITU-R P.1238
  38.101 +              loss = m_okumuraHata->GetLoss (a1, b1) + InternalWallsLoss (a1, b1);;
  38.102 +              NS_LOG_INFO (this << " I-I (same building)" << loss);
  38.103 +
  38.104 +            }
  38.105 +          else
  38.106 +            {
  38.107 +              // nodes are in different buildings
  38.108 +              loss = m_okumuraHata->GetLoss (a1, b1) + ExternalWallLoss (a1) + ExternalWallLoss (b1);
  38.109 +              NS_LOG_INFO (this << " I-O-I (different buildings): " << loss);
  38.110 +            }
  38.111 +        }
  38.112 +      else
  38.113 +        {
  38.114 +          loss = m_okumuraHata->GetLoss (a1, b1) + ExternalWallLoss (a1);
  38.115 +          NS_LOG_INFO (this << " I-O : " << loss);
  38.116 +        } // end b1->IsIndoor ()
  38.117 +    } // end a1->IsOutdoor ()
  38.118 +
  38.119 +  loss = std::max (0.0, loss);
  38.120 +  return loss;
  38.121 +}
  38.122 +
  38.123 +
  38.124 +} // namespace ns3
    39.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.2 +++ b/src/buildings/model/oh-buildings-propagation-loss-model.h	Fri May 11 16:42:40 2012 +0200
    39.3 @@ -0,0 +1,62 @@
    39.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    39.5 +/*
    39.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    39.7 + *
    39.8 + * This program is free software; you can redistribute it and/or modify
    39.9 + * it under the terms of the GNU General Public License version 2 as
   39.10 + * published by the Free Software Foundation;
   39.11 + *
   39.12 + * This program is distributed in the hope that it will be useful,
   39.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   39.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   39.15 + * GNU General Public License for more details.
   39.16 + *
   39.17 + * You should have received a copy of the GNU General Public License
   39.18 + * along with this program; if not, write to the Free Software
   39.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   39.20 + *
   39.21 + * Author: Marco Miozzo  <marco.miozzo@cttc.es>
   39.22 + * 
   39.23 + */
   39.24 +
   39.25 +#ifndef OH_BUILDINGS_PROPAGATION_LOSS_MODEL_H_
   39.26 +#define OH_BUILDINGS_PROPAGATION_LOSS_MODEL_H_
   39.27 +
   39.28 +#include <ns3/buildings-propagation-loss-model.h>
   39.29 +
   39.30 +namespace ns3 {
   39.31 +
   39.32 +class OkumuraHataPropagationLossModel;
   39.33 +
   39.34 +/**
   39.35 + * \ingroup propagation
   39.36 + *
   39.37 + *  this model combines the OkumuraHata model with the BuildingsPropagationLossModel
   39.38 + * 
   39.39 + *  \warning This model works with BuildingsMobilityModel only
   39.40 + *
   39.41 + */
   39.42 +class OhBuildingsPropagationLossModel : public BuildingsPropagationLossModel
   39.43 +{
   39.44 +
   39.45 +public:
   39.46 +  static TypeId GetTypeId (void);
   39.47 +  OhBuildingsPropagationLossModel ();
   39.48 +  ~OhBuildingsPropagationLossModel ();
   39.49 +
   39.50 +  /**
   39.51 +   * \param a the mobility model of the source
   39.52 +   * \param b the mobility model of the destination
   39.53 +   * \returns the propagation loss (in dBm)
   39.54 +   */
   39.55 +  virtual double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
   39.56 +  
   39.57 +private:
   39.58 +
   39.59 +  Ptr<OkumuraHataPropagationLossModel> m_okumuraHata;
   39.60 +
   39.61 +};
   39.62 +
   39.63 +}
   39.64 +
   39.65 +#endif /* OH_BUILDINGS_PROPAGATION_LOSS_MODEL_H_ */
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/src/buildings/test/buildings-helper-test.cc	Fri May 11 16:42:40 2012 +0200
    40.3 @@ -0,0 +1,325 @@
    40.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    40.5 +/*
    40.6 + * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    40.7 + *
    40.8 + * This program is free software; you can redistribute it and/or modify
    40.9 + * it under the terms of the GNU General Public License version 2 as
   40.10 + * published by the Free Software Foundation;
   40.11 + *
   40.12 + * This program is distributed in the hope that it will be useful,
   40.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   40.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   40.15 + * GNU General Public License for more details.
   40.16 + *
   40.17 + * You should have received a copy of the GNU General Public License
   40.18 + * along with this program; if not, write to the Free Software
   40.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   40.20 + *
   40.21 + * Author: Nicola Baldo <nbaldo@cttc.es>
   40.22 + */
   40.23 +
   40.24 +
   40.25 +
   40.26 +#include "ns3/log.h"
   40.27 +#include "ns3/test.h"
   40.28 +#include <ns3/buildings-mobility-model.h>
   40.29 +#include <ns3/building.h>
   40.30 +#include <ns3/buildings-helper.h>
   40.31 +#include <ns3/mobility-helper.h>
   40.32 +#include <ns3/simulator.h>
   40.33 +
   40.34 +NS_LOG_COMPONENT_DEFINE ("BuildingsHelperTest");
   40.35 +
   40.36 +using namespace ns3;
   40.37 +
   40.38 +
   40.39 +struct PositionInBuilding
   40.40 +{
   40.41 +  PositionInBuilding ();
   40.42 +  Vector   pos;   // coordinates of the mobility model instance
   40.43 +  bool     indoor; // true if indoor, false otherwise
   40.44 +  uint32_t bid;   // building id
   40.45 +  uint16_t rx;    // room x
   40.46 +  uint16_t ry;    // room y
   40.47 +  uint16_t fn;    // floor number
   40.48 +};
   40.49 +
   40.50 +PositionInBuilding::PositionInBuilding ()
   40.51 +  : pos (0,0,0),
   40.52 +    indoor (false),
   40.53 +    bid (0xffffffff),
   40.54 +    rx (0),
   40.55 +    ry (0),
   40.56 +    fn (0)
   40.57 +{
   40.58 +}
   40.59 +
   40.60 +/**
   40.61 + * data to construct a Building object. We don't want to pass Building
   40.62 + * objects to the TestCase constructor because otherwise BuildingList
   40.63 + * would contain all of them (even if only one is meant to be in the
   40.64 + * test case).
   40.65 + * 
   40.66 + */
   40.67 +struct BuildingData
   40.68 +{
   40.69 +  BuildingData ();
   40.70 +  double xmin;
   40.71 +  double xmax;
   40.72 +  double ymin;
   40.73 +  double ymax;
   40.74 +  double zmin;
   40.75 +  double zmax;
   40.76 +  uint16_t nrx;
   40.77 +  uint16_t nry;
   40.78 +  uint16_t nf;
   40.79 +};
   40.80 +
   40.81 +BuildingData::BuildingData ()
   40.82 +  : xmin (0),
   40.83 +    xmax (0),
   40.84 +    ymin (0),
   40.85 +    ymax (0),
   40.86 +    zmin (0),
   40.87 +    zmax (0),
   40.88 +    nrx (0),
   40.89 +    nry (0),
   40.90 +    nf (0)
   40.91 +{
   40.92 +}
   40.93 +
   40.94 +class BuildingsHelperOneTestCase : public TestCase
   40.95 +{
   40.96 +public:
   40.97 +  static std::string BuildNameString (PositionInBuilding pib, BuildingData bd);
   40.98 +  BuildingsHelperOneTestCase (PositionInBuilding pib, BuildingData bd);
   40.99 +
  40.100 +private:
  40.101 +  virtual void DoRun (void);
  40.102 +
  40.103 +  PositionInBuilding m_pib;
  40.104 +  BuildingData m_bd;
  40.105 +  
  40.106 +};
  40.107 +
  40.108 +std::string BuildingsHelperOneTestCase::BuildNameString (PositionInBuilding pib, BuildingData bd)
  40.109 +{
  40.110 +  std::ostringstream oss;
  40.111 +  oss <<  "pos=" << pib.pos;
  40.112 +  if (pib.indoor)
  40.113 +    {     
  40.114 +      oss << ", bid=" << pib.bid
  40.115 +	  << ", rx=" << pib.rx 
  40.116 +	  << ", ry=" << pib.ry
  40.117 +	  << ", fn=" << pib.fn;    
  40.118 +    }
  40.119 +  else
  40.120 +    {
  40.121 +      oss << ", outdoor";
  40.122 +    }
  40.123 +  return oss.str ();
  40.124 +}
  40.125 +
  40.126 +
  40.127 +BuildingsHelperOneTestCase::BuildingsHelperOneTestCase (PositionInBuilding pib, BuildingData bd)
  40.128 +  : TestCase (BuildNameString (pib, bd)),
  40.129 +    m_pib (pib),
  40.130 +    m_bd (bd)
  40.131 +{
  40.132 +}
  40.133 +
  40.134 +void
  40.135 +BuildingsHelperOneTestCase::DoRun ()
  40.136 +{
  40.137 +  NS_LOG_FUNCTION (this << BuildNameString (m_pib, m_bd));
  40.138 +  MobilityHelper mobility;
  40.139 +  mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
  40.140 +
  40.141 +  NodeContainer nodes;
  40.142 +  nodes.Create (1);
  40.143 +  mobility.Install (nodes);
  40.144 +  
  40.145 +  Ptr<BuildingsMobilityModel> bmm = nodes.Get (0)->GetObject<BuildingsMobilityModel> ();
  40.146 +  bmm->SetPosition (m_pib.pos);
  40.147 +
  40.148 +  NS_LOG_LOGIC ("create building");
  40.149 +  Ptr<Building> b = CreateObject<Building> ();
  40.150 +  b->SetBoundaries (Box (m_bd.xmin, m_bd.xmax, m_bd.ymin, m_bd.ymax, m_bd.zmin, m_bd.zmax));
  40.151 +  b->SetNFloors (m_bd.nf);
  40.152 +  b->SetNRoomsX (m_bd.nrx);
  40.153 +  b->SetNRoomsY (m_bd.nry);
  40.154 +  
  40.155 +  BuildingsHelper::MakeMobilityModelConsistent ();
  40.156 +
  40.157 +  
  40.158 +  NS_TEST_ASSERT_MSG_EQ (bmm->IsIndoor (), m_pib.indoor, "indoor/outdoor mismatch");
  40.159 +  if (m_pib.indoor)
  40.160 +    {
  40.161 +      NS_LOG_LOGIC (" got bid=" << bmm->GetBuilding ()->GetId () << ", f=" << (uint32_t) bmm->GetFloorNumber () << ", rx=" << (uint32_t) bmm->GetRoomNumberX () << ", roomY=" << (uint32_t) bmm->GetRoomNumberY ());
  40.162 +      // only one building in this test, so Id will be 0
  40.163 +      NS_TEST_ASSERT_MSG_EQ (bmm->GetBuilding ()->GetId (), 0, "Building ID mismatch");
  40.164 +      NS_TEST_ASSERT_MSG_EQ ((uint32_t) bmm->GetFloorNumber (), m_pib.fn, "floor number mismatch");
  40.165 +      NS_TEST_ASSERT_MSG_EQ ((uint32_t) bmm->GetRoomNumberX (), m_pib.rx, "x room number mismatch");
  40.166 +      NS_TEST_ASSERT_MSG_EQ ((uint32_t) bmm->GetRoomNumberY (), m_pib.ry, "y room number mismatch");
  40.167 +    }
  40.168 +
  40.169 +  Simulator::Destroy ();  
  40.170 +}
  40.171 +
  40.172 +
  40.173 +
  40.174 +
  40.175 +
  40.176 +
  40.177 +
  40.178 +class BuildingsHelperTestSuite : public TestSuite
  40.179 +{
  40.180 +public:
  40.181 +  BuildingsHelperTestSuite ();
  40.182 +};
  40.183 +
  40.184 +
  40.185 +BuildingsHelperTestSuite::BuildingsHelperTestSuite ()
  40.186 +  : TestSuite ("buildings-helper", UNIT)
  40.187 +{
  40.188 +  NS_LOG_FUNCTION (this);
  40.189 +
  40.190 +  BuildingData b1;
  40.191 +  b1.xmin = 1;
  40.192 +  b1.xmax = 3;
  40.193 +  b1.ymin = 1;
  40.194 +  b1.ymax = 2;
  40.195 +  b1.zmin = 0;
  40.196 +  b1.zmax = 4;
  40.197 +  b1.nrx = 1;
  40.198 +  b1.nry = 1;
  40.199 +  b1.nf = 1;  
  40.200 +
  40.201 +  Vector vp1 (1.5, 1.5, 0.5);
  40.202 +  PositionInBuilding p1;
  40.203 +  p1.pos = vp1;
  40.204 +  p1.indoor = true;
  40.205 +  p1.bid = 0;
  40.206 +  p1.rx = 1;
  40.207 +  p1.ry = 1;
  40.208 +  p1.fn = 1;
  40.209 +  AddTestCase (new BuildingsHelperOneTestCase (p1, b1));
  40.210 +
  40.211 +  Vector vp2 (1.5, 0.5, 0.5);
  40.212 +  PositionInBuilding p2;
  40.213 +  p2.pos = vp2;
  40.214 +  p2.indoor = false;
  40.215 +  AddTestCase (new BuildingsHelperOneTestCase (p2, b1));
  40.216 +
  40.217 +  Vector vp3 (1.5, 2.5, 0.5);
  40.218 +  PositionInBuilding p3;
  40.219 +  p3.pos = vp3;
  40.220 +  p3.indoor = false;
  40.221 +  AddTestCase (new BuildingsHelperOneTestCase (p3, b1));
  40.222 +
  40.223 +  Vector vp4 (1.5, 1.5, 5);
  40.224 +  PositionInBuilding p4;
  40.225 +  p4.pos = vp4;
  40.226 +  p4.indoor = false;
  40.227 +  AddTestCase (new BuildingsHelperOneTestCase (p4, b1));
  40.228 +
  40.229 +  Vector vp5 (2.5, 1.6, 3.5);
  40.230 +  PositionInBuilding p5;
  40.231 +  p5.pos = vp5;
  40.232 +  p5.indoor = true;
  40.233 +  p5.bid = 0;
  40.234 +  p5.rx = 1;
  40.235 +  p5.ry = 1;
  40.236 +  p5.fn = 1;
  40.237 +  AddTestCase (new BuildingsHelperOneTestCase (p5, b1));
  40.238 +
  40.239 +  Vector vp6 (0.9999, 1.5, 1.5);
  40.240 +  PositionInBuilding p6;
  40.241 +  p6.pos = vp6;
  40.242 +  p6.indoor = false;
  40.243 +  AddTestCase (new BuildingsHelperOneTestCase (p6, b1));
  40.244 +
  40.245 +  Vector vp7 (3.0001, 1.5, 2.5);
  40.246 +  PositionInBuilding p7;
  40.247 +  p7.pos = vp7;
  40.248 +  p7.indoor = false;
  40.249 +  AddTestCase (new BuildingsHelperOneTestCase (p7, b1));
  40.250 +
  40.251 +  Vector vp8 (1.001, 1.001, -0.01);
  40.252 +  PositionInBuilding p8;
  40.253 +  p8.pos = vp8;
  40.254 +  p8.indoor = false;
  40.255 +  AddTestCase (new BuildingsHelperOneTestCase (p8, b1));
  40.256 +
  40.257 +  Vector vp9 (1.5, 1.5, 4.001);
  40.258 +  PositionInBuilding p9;
  40.259 +  p9.pos = vp9;
  40.260 +  p9.indoor = false;
  40.261 +  AddTestCase (new BuildingsHelperOneTestCase (p9, b1));
  40.262 +
  40.263 +
  40.264 +
  40.265 +
  40.266 +  BuildingData b2;
  40.267 +  b2.xmin = -1;
  40.268 +  b2.xmax = 0.5;
  40.269 +  b2.ymin = -2;
  40.270 +  b2.ymax = 0.5;
  40.271 +  b2.zmin = 0;
  40.272 +  b2.zmax = 2;
  40.273 +  b2.nrx = 3;
  40.274 +  b2.nry = 5;
  40.275 +  b2.nf = 4;
  40.276 +
  40.277 +  Vector vq1 (-0.7, -1.1, 1.2);
  40.278 +  PositionInBuilding q1;
  40.279 +  q1.pos = vq1;
  40.280 +  q1.indoor = true;
  40.281 +  q1.bid = 1;
  40.282 +  q1.rx = 1;
  40.283 +  q1.ry = 2;
  40.284 +  q1.fn = 3;
  40.285 +  AddTestCase (new BuildingsHelperOneTestCase (q1, b2));
  40.286 +
  40.287 +  Vector vq2 (0.2, 0.3, 0.2);
  40.288 +  PositionInBuilding q2;
  40.289 +  q2.pos = vq2;
  40.290 +  q2.indoor = true;
  40.291 +  q2.bid = 1;
  40.292 +  q2.rx = 3;
  40.293 +  q2.ry = 5;
  40.294 +  q2.fn = 1;
  40.295 +  AddTestCase (new BuildingsHelperOneTestCase (q2, b2));
  40.296 +
  40.297 +  Vector vq3 (0.6, -1.75, 1.5);
  40.298 +  PositionInBuilding q3;
  40.299 +  q3.pos = vq3;
  40.300 +  q3.indoor = false;
  40.301 +  AddTestCase (new BuildingsHelperOneTestCase (q3, b2));
  40.302 +
  40.303 +  Vector vq4 (-1.01, 0.3, 1.99);
  40.304 +  PositionInBuilding q4;
  40.305 +  q4.pos = vq4;
  40.306 +  q4.indoor = false;
  40.307 +  AddTestCase (new BuildingsHelperOneTestCase (q4, b2));
  40.308 +
  40.309 +  Vector vq5 (-0.8, 0.7, 0.01);
  40.310 +  PositionInBuilding q5;
  40.311 +  q5.pos = vq5;
  40.312 +  q5.indoor = false;
  40.313 +  AddTestCase (new BuildingsHelperOneTestCase (q5, b2));
  40.314 +
  40.315 +  Vector vq6 (0.2, 0.3, -0.2);
  40.316 +  PositionInBuilding q6;
  40.317 +  q6.pos = vq6;
  40.318 +  q6.indoor = false;
  40.319 +  AddTestCase (new BuildingsHelperOneTestCase (q6, b2));
  40.320 +
  40.321 +  Vector vq7 (0.2, 0.3, 2.001);
  40.322 +  PositionInBuilding q7;
  40.323 +  q7.pos = vq7;
  40.324 +  q7.indoor = false;
  40.325 +  AddTestCase (new BuildingsHelperOneTestCase (q7, b2));     
  40.326 +}
  40.327 +
  40.328 +static BuildingsHelperTestSuite buildingsHelperAntennaTestSuiteInstance;
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/src/buildings/test/buildings-pathloss-test.cc	Fri May 11 16:42:40 2012 +0200
    41.3 @@ -0,0 +1,337 @@
    41.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    41.5 +/*
    41.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    41.7 + *
    41.8 + * This program is free software; you can redistribute it and/or modify
    41.9 + * it under the terms of the GNU General Public License version 2 as
   41.10 + * published by the Free Software Foundation;
   41.11 + *
   41.12 + * This program is distributed in the hope that it will be useful,
   41.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   41.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   41.15 + * GNU General Public License for more details.
   41.16 + *
   41.17 + * You should have received a copy of the GNU General Public License
   41.18 + * along with this program; if not, write to the Free Software
   41.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   41.20 + *
   41.21 + * Author: Marco Miozzo <marco.miozzo@cttc.es>
   41.22 + */
   41.23 +
   41.24 +#include <ns3/simulator.h>
   41.25 +
   41.26 +#include <ns3/log.h>
   41.27 +
   41.28 +#include <ns3/buildings-pathloss-test.h>
   41.29 +#include "ns3/string.h"
   41.30 +#include "ns3/double.h"
   41.31 +#include <ns3/building.h>
   41.32 +#include <ns3/enum.h>
   41.33 +
   41.34 +
   41.35 +NS_LOG_COMPONENT_DEFINE ("BuildingsPathlossTest");
   41.36 +
   41.37 +namespace ns3 {
   41.38 +
   41.39 +
   41.40 +/**
   41.41 + * Test 1.1 BuildingsPathlossModel Pathloss compound test
   41.42 + */
   41.43 +
   41.44 +/**
   41.45 + * This TestSuite tests the BuildingPathlossModel by reproducing
   41.46 + * several communication scenarios 
   41.47 + */
   41.48 +
   41.49 +
   41.50 +BuildingsPathlossTestSuite::BuildingsPathlossTestSuite ()
   41.51 +  : TestSuite ("buildings-pathloss-test", SYSTEM)
   41.52 +{
   41.53 +
   41.54 +  LogComponentEnable ("BuildingsPathlossTest", LOG_LEVEL_ALL);
   41.55 +
   41.56 +  double freq = 869e6;  // E_UTRA BAND #5 see table 5.5-1 of 36.101
   41.57 +
   41.58 +  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, LargeCity, 137.93, "OH Urban Large city"));
   41.59 +
   41.60 +  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, SmallCity, 137.88, "OH Urban small city"));
   41.61 +
   41.62 +  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, SubUrbanEnvironment, LargeCity, 128.03, "loss OH SubUrban"));
   41.63 +
   41.64 +  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, OpenAreasEnvironment, LargeCity, 110.21, "loss OH OpenAreas"));
   41.65 +
   41.66 +  // Test #2 COST231 Model (1500 < freq < 2000~2170 MHz) (Macro<->UE)
   41.67 +
   41.68 +  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
   41.69 +
   41.70 +  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, LargeCity, 148.55, "COST231 Urban Large city"));
   41.71 +
   41.72 +  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, SmallCity, 150.64, "COST231 Urban small city and suburban"));
   41.73 +
   41.74 +  // Test #3 2.6 GHz model (Macro<->UE)
   41.75 +
   41.76 +  freq = 2.620e9; // E_UTRA BAND #7 see table 5.5-1 of 36.101
   41.77 +
   41.78 +  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, SmallCity, 121.83, "2.6GHz model"));
   41.79 +
   41.80 +  // Test #4 ITU1411 LOS model (Macro<->UE)
   41.81 +
   41.82 +  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
   41.83 +  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 3, UrbanEnvironment, LargeCity, 81.00, "ITU1411 LOS"));
   41.84 +
   41.85 +  // Test #5 ITU1411 NLOS model (Macro<->UE)
   41.86 +
   41.87 +  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
   41.88 +
   41.89 +  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 4, UrbanEnvironment, LargeCity, 143.69, "ITU1411 NLOS"));
   41.90 +
   41.91 +  // Test #6 ITUP1238 (HeNB <-> UE)
   41.92 +
   41.93 +  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
   41.94 +  AddTestCase (new BuildingsPathlossTestCase (freq, 5, 6, UrbanEnvironment, LargeCity, 88.3855, "ITUP1238"));
   41.95 +
   41.96 +  // Test #7 Outdoor -> Indoor OkumuraHata (Macro<->UE)
   41.97 +
   41.98 +  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
   41.99 +  // The loss is as in test #2 (large city) plus the building penetration loss
  41.100 +  // which for ConcreteWithWindows is equal to 7 dB -> 148.55 + 7 = 155.55
  41.101 +  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 7, UrbanEnvironment, LargeCity, 155.55, "Okumura Hata Outdoor -> Indoor"));
  41.102 +
  41.103 +  // Test #8 Outdoor -> Indoor ITU1411 (Macro<->UE)
  41.104 +  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
  41.105 +  // The loss is as in test #4 plus the building penetration loss
  41.106 +  // which for ConcreteWithWindows is equal to 7 dB -> 81.000 + 7 = 88.000
  41.107 +  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 8, UrbanEnvironment, LargeCity, 88.000, "ITU1411 LOS Outdoor -> Indoor"));
  41.108 +
  41.109 +  // Test #9 Indoor -> Outdoor LOS (HeNB <-> UE)
  41.110 +
  41.111 +  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
  41.112 +  // The loss is similar of test #4 plus the building penetration loss
  41.113 +  // which for ConcreteWithWindows is equal to 7 dB and the height gain
  41.114 +  // (2 floors x 2 dB/floor = 4) -> 81.838 + 7 - 4 = 84.838
  41.115 +  AddTestCase (new BuildingsPathlossTestCase (freq, 9, 10, UrbanEnvironment, LargeCity, 84.838, "ITU1411 LOS Indoor -> Outdoor"));
  41.116 +
  41.117 +  // Test #10 Indoor -> Outdoor NLOS (HeNB <-> UE)
  41.118 +
  41.119 +  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
  41.120 +  // The loss is similar as in test #4 plus the building penetration loss
  41.121 +  // which for ConcreteWithWindows is equal to 7 dB and the height gain
  41.122 +  // (2 floors x 2 dB/floor = 4) -> 180.90 + 7 - 4 = 183.90
  41.123 +  AddTestCase (new BuildingsPathlossTestCase (freq, 9, 11, UrbanEnvironment, LargeCity, 183.90, "ITU1411 NLOS Indoor -> Outdoor"));
  41.124 +
  41.125 +
  41.126 +}
  41.127 +
  41.128 +
  41.129 +
  41.130 +static BuildingsPathlossTestSuite buildingsPathlossTestSuite;
  41.131 +
  41.132 +
  41.133 +/**
  41.134 + * TestCase
  41.135 + */
  41.136 +
  41.137 +BuildingsPathlossTestCase::BuildingsPathlossTestCase (double freq, uint16_t m1, uint16_t m2, EnvironmentType env, CitySize city, double refValue, std::string name)
  41.138 +  : TestCase ("LOSS calculation: " + name),
  41.139 +    m_freq (freq),
  41.140 +    m_mobilityModelIndex1 (m1),
  41.141 +    m_mobilityModelIndex2 (m2),
  41.142 +    m_env (env),
  41.143 +    m_city (city),
  41.144 +    m_lossRef (refValue)
  41.145 +{
  41.146 +}
  41.147 +
  41.148 +BuildingsPathlossTestCase::~BuildingsPathlossTestCase ()
  41.149 +{
  41.150 +}
  41.151 +
  41.152 +void
  41.153 +BuildingsPathlossTestCase::DoRun (void)
  41.154 +{
  41.155 +//   LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
  41.156 +
  41.157 +//   LogComponentEnable ("LteEnbRrc", logLevel);
  41.158 +//   LogComponentEnable ("LteUeRrc", logLevel);
  41.159 +//   LogComponentEnable ("LteEnbMac", logLevel);
  41.160 +//   LogComponentEnable ("LteUeMac", logLevel);
  41.161 +//   LogComponentEnable ("LteRlc", logLevel);
  41.162 +//   LogComponentEnable ("RrPacketScheduler", logLevel);
  41.163 +// 
  41.164 +//   LogComponentEnable ("LtePhy", logLevel);
  41.165 +//   LogComponentEnable ("LteEnbPhy", logLevel);
  41.166 +//   LogComponentEnable ("LteUePhy", logLevel);
  41.167 +// 
  41.168 +//   LogComponentEnable ("LteSpectrumPhy", logLevel);
  41.169 +//   LogComponentEnable ("LteInterference", logLevel);
  41.170 +//   LogComponentEnable ("LteSinrChunkProcessor", logLevel);
  41.171 +// 
  41.172 +//   LogComponentEnable ("LtePropagationLossModel", logLevel);
  41.173 +//   LogComponentEnable ("LossModel", logLevel);
  41.174 +//   LogComponentEnable ("ShadowingLossModel", logLevel);
  41.175 +//   LogComponentEnable ("PenetrationLossModel", logLevel);
  41.176 +//   LogComponentEnable ("MultipathLossModel", logLevel);
  41.177 +//   LogComponentEnable ("PathLossModel", logLevel);
  41.178 +// 
  41.179 +//   LogComponentEnable ("LteNetDevice", logLevel);
  41.180 +//   LogComponentEnable ("LteUeNetDevice", logLevel);
  41.181 +//   LogComponentEnable ("LteEnbNetDevice", logLevel);
  41.182 +
  41.183 +  LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
  41.184 +  LogComponentEnable ("HybridBuildingsPropagationLossModel", LOG_LEVEL_ALL);
  41.185 +
  41.186 +  NS_LOG_FUNCTION (this);
  41.187 +
  41.188 +  Ptr<MobilityModel> mma = CreateMobilityModel (m_mobilityModelIndex1);
  41.189 +  Ptr<MobilityModel> mmb = CreateMobilityModel (m_mobilityModelIndex2);
  41.190 +
  41.191 +
  41.192 +
  41.193 +
  41.194 +  Ptr<HybridBuildingsPropagationLossModel> propagationLossModel = CreateObject<HybridBuildingsPropagationLossModel> ();
  41.195 +  propagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq));
  41.196 +  propagationLossModel->SetAttribute ("Environment", EnumValue (m_env));
  41.197 +  propagationLossModel->SetAttribute ("CitySize", EnumValue (m_city));
  41.198 +  // cancel shadowing effect
  41.199 +  propagationLossModel->SetAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
  41.200 +  propagationLossModel->SetAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
  41.201 +  propagationLossModel->SetAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
  41.202 +
  41.203 +  double loss = propagationLossModel->GetLoss (mma, mmb);
  41.204 +
  41.205 +  NS_LOG_INFO ("Calculated loss: " << loss);
  41.206 +  NS_LOG_INFO ("Theoretical loss: " << m_lossRef);
  41.207 + 
  41.208 +  NS_TEST_ASSERT_MSG_EQ_TOL (loss, m_lossRef, 0.1, "Wrong loss !");
  41.209 +  Simulator::Destroy ();
  41.210 +}
  41.211 +
  41.212 +Ptr<MobilityModel>
  41.213 +BuildingsPathlossTestCase::CreateMobilityModel (uint16_t index)
  41.214 +{
  41.215 +
  41.216 +  /*
  41.217 +   * The purpose of this method is to defer the creation of the
  41.218 +   * MobilityModel instances to when DoRun() is called. In a previous
  41.219 +   * version, MobilityModel instances where created directly in the
  41.220 +   * constructor of the test suite, which caused subtle bugs due to
  41.221 +   * "static initialization order fiasco". An example of such a subtle
  41.222 +   * bug is that logging via NS_LOG failed for some modules.
  41.223 +   * 
  41.224 +   */
  41.225 +
  41.226 +
  41.227 +  double distance = 2000;
  41.228 +  double hm = 1;
  41.229 +  double hb = 30;
  41.230 +
  41.231 +  Ptr<BuildingsMobilityModel> mm1 = CreateObject<BuildingsMobilityModel> ();
  41.232 +  mm1->SetPosition (Vector (0.0, 0.0, hb));
  41.233 +
  41.234 +  Ptr<BuildingsMobilityModel> mm2 = CreateObject<BuildingsMobilityModel> ();
  41.235 +  mm2->SetPosition (Vector (distance, 0.0, hm));
  41.236 + 
  41.237 +  distance = 100;
  41.238 +  Ptr<BuildingsMobilityModel> mm3 = CreateObject<BuildingsMobilityModel> ();
  41.239 +  mm3->SetPosition (Vector (distance, 0.0, hm));
  41.240 +
  41.241 +  distance = 900;
  41.242 +  Ptr<BuildingsMobilityModel> mm4 = CreateObject<BuildingsMobilityModel> ();
  41.243 +  mm4->SetPosition (Vector (distance, 0.0, hm));
  41.244 +
  41.245 +  distance = 30;
  41.246 +  double henbHeight = 10.0;
  41.247 +  Ptr<BuildingsMobilityModel> mm5 = CreateObject<BuildingsMobilityModel> ();
  41.248 +  mm5->SetPosition (Vector (0.0, 0.0, henbHeight));
  41.249 +
  41.250 +  // this needs to be static otherwise it will look like a different building every time
  41.251 +  static Ptr<Building> building1 = Create<Building> ();
  41.252 +  building1->SetBoundaries (Box (0.0, 10.0, 0.0, 10.0, 0.0, 20.0 /*, 1, 1, 1*/));
  41.253 +  building1->SetBuildingType (Building::Residential);
  41.254 +  building1->SetExtWallsType (Building::ConcreteWithWindows);
  41.255 +  mm5->SetIndoor (building1);
  41.256 +  Ptr<BuildingsMobilityModel> mm6 = CreateObject<BuildingsMobilityModel> ();
  41.257 +  mm6->SetPosition (Vector (distance, 0.0, hm));
  41.258 +  mm6->SetIndoor (building1);
  41.259 +  mm6->SetFloorNumber (2);
  41.260 + 
  41.261 +  distance = 2000;
  41.262 +  Ptr<BuildingsMobilityModel> mm7 = CreateObject<BuildingsMobilityModel> ();
  41.263 +  mm7->SetPosition (Vector (distance, 0.0, hm));
  41.264 +  mm7->SetIndoor (building1);
  41.265 +
  41.266 +  distance = 100;
  41.267 +  Ptr<BuildingsMobilityModel> mm8 = CreateObject<BuildingsMobilityModel> ();
  41.268 +  mm8->SetPosition (Vector (distance, 0.0, hm));
  41.269 +  mm8->SetIndoor (building1);
  41.270 +
  41.271 +  distance = 100;
  41.272 +  Ptr<BuildingsMobilityModel> mm9 = CreateObject<BuildingsMobilityModel> ();
  41.273 +  mm9->SetPosition (Vector (0.0, 0.0, henbHeight));
  41.274 +  mm9->SetIndoor (building1);
  41.275 +  mm9->SetFloorNumber (2);
  41.276 +  Ptr<BuildingsMobilityModel> mm10 = CreateObject<BuildingsMobilityModel> ();
  41.277 +  mm10->SetPosition (Vector (distance, 0.0, hm));
  41.278 +
  41.279 +  distance = 500;
  41.280 +  Ptr<BuildingsMobilityModel> mm11 = CreateObject<BuildingsMobilityModel> ();
  41.281 +  mm11->SetPosition (Vector (distance, 0.0, hm));
  41.282 + 
  41.283 +
  41.284 +
  41.285 +  switch (index)
  41.286 +    {
  41.287 +    case 1:
  41.288 +      return mm1;
  41.289 +      break;
  41.290 +
  41.291 +    case 2:
  41.292 +      return mm2;
  41.293 +      break;
  41.294 +
  41.295 +    case 3:
  41.296 +      return mm3;
  41.297 +      break;
  41.298 +
  41.299 +    case 4:
  41.300 +      return mm4;
  41.301 +      break;
  41.302 +
  41.303 +    case 5:
  41.304 +      return mm5;
  41.305 +      break;
  41.306 +
  41.307 +    case 6:
  41.308 +      return mm6;
  41.309 +      break;
  41.310 +
  41.311 +    case 7:
  41.312 +      return mm7;
  41.313 +      break;
  41.314 +
  41.315 +    case 8:
  41.316 +      return mm8;
  41.317 +      break;
  41.318 +
  41.319 +    case 9:
  41.320 +      return mm9;
  41.321 +      break;
  41.322 +
  41.323 +    case 10:
  41.324 +      return mm10;
  41.325 +      break;
  41.326 +
  41.327 +    case 11:
  41.328 +      return mm11;
  41.329 +      break;
  41.330 +
  41.331 +    default:
  41.332 +      return 0;
  41.333 +      break;
  41.334 +    }
  41.335 +  return 0;
  41.336 +}
  41.337 +
  41.338 +
  41.339 +
  41.340 +} // namespace ns3
    42.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    42.2 +++ b/src/buildings/test/buildings-pathloss-test.h	Fri May 11 16:42:40 2012 +0200
    42.3 @@ -0,0 +1,64 @@
    42.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    42.5 +/*
    42.6 + * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    42.7 + *
    42.8 + * This program is free software; you can redistribute it and/or modify
    42.9 + * it under the terms of the GNU General Public License version 2 as
   42.10 + * published by the Free Software Foundation;
   42.11 + *
   42.12 + * This program is distributed in the hope that it will be useful,
   42.13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
   42.14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   42.15 + * GNU General Public License for more details.
   42.16 + *
   42.17 + * You should have received a copy of the GNU General Public License
   42.18 + * along with this program; if not, write to the Free Software
   42.19 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   42.20 + *
   42.21 + * Author: Marco Miozzo <marco.miozzo@cttc.es>
   42.22 + */
   42.23 +
   42.24 +#ifndef BUILDINGS_PATHLOSS_TEST_H
   42.25 +#define BUILDINGS_PATHLOSS_TEST_H
   42.26 +
   42.27 +#include <ns3/test.h>
   42.28 +#include <ns3/buildings-mobility-model.h>
   42.29 +#include <ns3/hybrid-buildings-propagation-loss-model.h>
   42.30 +
   42.31 +
   42.32 +namespace ns3 {
   42.33 +
   42.34 +/**
   42.35 +* Test 1.1 pathloss calculation
   42.36 +*/
   42.37 +class BuildingsPathlossTestSuite : public TestSuite
   42.38 +{
   42.39 +public:
   42.40 +  BuildingsPathlossTestSuite ();
   42.41 +};
   42.42 +
   42.43 +
   42.44 +class BuildingsPathlossTestCase : public TestCase
   42.45 +{
   42.46 +public:
   42.47 +  BuildingsPathlossTestCase (double freq, uint16_t m1, uint16_t m2, EnvironmentType env, CitySize city, double refValue, std::string name);
   42.48 +  virtual ~BuildingsPathlossTestCase ();
   42.49 +
   42.50 +private:
   42.51 +  virtual void DoRun (void);
   42.52 +  Ptr<MobilityModel> CreateMobilityModel (uint16_t index);
   42.53 +
   42.54 +  double m_freq;
   42.55 +  uint16_t m_mobilityModelIndex1;
   42.56 +  uint16_t m_mobilityModelIndex2;
   42.57 +  EnvironmentType m_env;
   42.58 +  CitySize m_city;
   42.59 +  double m_lossRef;
   42.60 +
   42.61 +};
   42.62 +
   42.63 +
   42.64 +#endif /* BUILDING_PATHLOSS_TEST_H */
   42.65 +
   42.66 +
   42.67 +} // namespace ns3
    43.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.2 +++ b/src/buildings/test/buildings-shadowing-test.cc	Fri May 11 16:42:40 2012 +0200
    43.3 @@ -0,0 +1,221 @@
    43.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    43.5 +/*
    43.6 +* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    43.7 +*
    43.8 +* This program is free software; you can redistribute it and/or modify
    43.9 +* it under the terms of the GNU General Public License version 2 as
   43.10 +* published by the Free Software Foundation;
   43.11 +*
   43.12 +* This program is distributed in the hope that it will be useful,
   43.13 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
   43.14 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   43.15 +* GNU General Public License for more details.
   43.16 +*
   43.17 +* You should have received a copy of the GNU General Public License
   43.18 +* along with this program; if not, write to the Free Software
   43.19 +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   43.20 +*
   43.21 +* Author: Marco Miozzo <marco.miozzo@cttc.es>
   43.22 +*/
   43.23 +
   43.24 +#include "ns3/simulator.h"
   43.25 +#include "ns3/log.h"
   43.26 +#include "ns3/buildings-shadowing-test.h"
   43.27 +#include <ns3/hybrid-buildings-propagation-loss-model.h>
   43.28 +#include "ns3/string.h"
   43.29 +#include "ns3/double.h"
   43.30 +#include <ns3/building.h>
   43.31 +#include <ns3/enum.h>
   43.32 +
   43.33 +NS_LOG_COMPONENT_DEFINE ("BuildingsShadowingTest");
   43.34 +
   43.35 +using namespace ns3;
   43.36 +
   43.37 +
   43.38 +/**
   43.39 +* Test 1.1 Shadowing compound test
   43.40 +*/
   43.41 +
   43.42 +/**
   43.43 +* This TestSuite tests the shadowing model of BuildingPathlossModel 
   43.44 +* by reproducing several communication scenarios 
   43.45 +*/
   43.46 +
   43.47 +
   43.48 +BuildingsShadowingTestSuite::BuildingsShadowingTestSuite ()
   43.49 +  : TestSuite ("buildings-shadowing-test", SYSTEM)
   43.50 +{
   43.51 +
   43.52 +  LogComponentEnable ("BuildingsShadowingTest", LOG_LEVEL_ALL);
   43.53 +
   43.54 +  // Test #1 Outdoor Model
   43.55 +  AddTestCase (new BuildingsShadowingTestCase (1, 2, 148.86, 7.0, "Outdoor Shadowing"));
   43.56 +
   43.57 +  // Test #2 Indoor model
   43.58 +  AddTestCase (new BuildingsShadowingTestCase (5, 6, 88.5724, 8.0, "Indoor Shadowing"));
   43.59 +
   43.60 +  // Test #3 Indoor -> Outdoor
   43.61 +  AddTestCase (new BuildingsShadowingTestCase (9, 10, 85.0012, 8.6, "Indoor -> Outdoor Shadowing"));
   43.62 +
   43.63 +}
   43.64 +
   43.65 +static BuildingsShadowingTestSuite buildingsShadowingTestSuite;
   43.66 +
   43.67 +
   43.68 +/**
   43.69 +* TestCase
   43.70 +*/
   43.71 +
   43.72 +BuildingsShadowingTestCase::BuildingsShadowingTestCase ( uint16_t m1, uint16_t m2, double refValue, double sigmaRef, std::string name)
   43.73 +  : TestCase ("SHADOWING calculation: " + name),
   43.74 +    m_mobilityModelIndex1 (m1),
   43.75 +    m_mobilityModelIndex2 (m2),
   43.76 +    m_lossRef (refValue),
   43.77 +    m_sigmaRef (sigmaRef)
   43.78 +{
   43.79 +}
   43.80 +
   43.81 +BuildingsShadowingTestCase::~BuildingsShadowingTestCase ()
   43.82 +{
   43.83 +}
   43.84 +
   43.85 +void
   43.86 +BuildingsShadowingTestCase::DoRun (void)
   43.87 +{
   43.88 +//     LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
   43.89 +
   43.90 +  //   LogComponentEnable ("LteEnbRrc", logLevel);
   43.91 +  //   LogComponentEnable ("LteUeRrc", logLevel);
   43.92 +  //   LogComponentEnable ("LteEnbMac", logLevel);
   43.93 +  //   LogComponentEnable ("LteUeMac", logLevel);
   43.94 +  //   LogComponentEnable ("LteRlc", logLevel);
   43.95 +  //   LogComponentEnable ("RrPacketScheduler", logLevel);
   43.96 +  // 
   43.97 +  //   LogComponentEnable ("LtePhy", logLevel);
   43.98 +  //   LogComponentEnable ("LteEnbPhy", logLevel);
   43.99 +  //   LogComponentEnable ("LteUePhy", logLevel);
  43.100 +  // 
  43.101 +  //   LogComponentEnable ("LteSpectrumPhy", logLevel);
  43.102 +  //   LogComponentEnable ("LteInterference", logLevel);
  43.103 +  //   LogComponentEnable ("LteSinrChunkProcessor", logLevel);
  43.104 +  // 
  43.105 +  //   LogComponentEnable ("LtePropagationLossModel", logLevel);
  43.106 +  //   LogComponentEnable ("LossModel", logLevel);
  43.107 +//     LogComponentEnable ("ShadowingLossModel", logLevel);
  43.108 +//   LogComponentEnable ("PenetrationLossModel", logLevel);
  43.109 +//   LogComponentEnable ("MultipathLossModel", logLevel);
  43.110 +//   LogComponentEnable ("PathLossModel", logLevel);
  43.111 +//
  43.112 +//   LogComponentEnable ("LteNetDevice", logLevel);
  43.113 +//   LogComponentEnable ("LteUeNetDevice", logLevel);
  43.114 +//   LogComponentEnable ("LteEnbNetDevice", logLevel);
  43.115 +
  43.116 +//   LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
  43.117 +
  43.118 +
  43.119 +  Ptr<MobilityModel> mma = CreateMobilityModel (m_mobilityModelIndex1);
  43.120 +  Ptr<MobilityModel> mmb = CreateMobilityModel (m_mobilityModelIndex2);
  43.121 +
  43.122 +  std::vector<double> loss;
  43.123 +  double sum = 0.0;
  43.124 +  double sumSquared = 0.0;
  43.125 +  int samples = 10000;
  43.126 +  for (int i = 0; i < samples; i++)
  43.127 +    {
  43.128 +      Ptr<HybridBuildingsPropagationLossModel> propagationLossModel = CreateObject<HybridBuildingsPropagationLossModel> ();
  43.129 +      loss.push_back (propagationLossModel->DoCalcRxPower (0.0, mma, mmb) + m_lossRef);
  43.130 +      sum += loss.at (loss.size () - 1);
  43.131 +      sumSquared += (loss.at (loss.size () - 1) * loss.at (loss.size () - 1));
  43.132 +    }
  43.133 +  double mean = sum / samples;
  43.134 +  double sigma = sqrt (sumSquared / samples - (mean * mean));
  43.135 +  // test whether the distribution falls in the 99% confidence interval, as expected with a nornal distribution
  43.136 +  double ci = (2.575829303549 * sigma) / sqrt (samples);
  43.137 +
  43.138 +  NS_LOG_INFO ("Mean from simulation " << mean << ", sigma " << sigma << ", reference value " << m_sigmaRef << ", CI(99%) " << ci);
  43.139 +
  43.140 +  NS_TEST_ASSERT_MSG_EQ_TOL (fabs (mean), 0.0, ci, "Wrong shadowing distribution !");
  43.141 +  Simulator::Destroy ();
  43.142 +}
  43.143 +
  43.144 +
  43.145 +
  43.146 +Ptr<MobilityModel>
  43.147 +BuildingsShadowingTestCase::CreateMobilityModel (uint16_t index)
  43.148 +{
  43.149 +  /*
  43.150 +   * The purpose of this method is to defer the creation of the
  43.151 +   * MobilityModel instances to when DoRun() is called. In a previous
  43.152 +   * version, MobilityModel instances where created directly in the
  43.153 +   * constructor of the test suite, which caused subtle bugs due to
  43.154 +   * "static initialization order fiasco". An example of such a subtle
  43.155 +   * bug is that logging via NS_LOG failed for some modules.
  43.156 +   * 
  43.157 +   */
  43.158 +
  43.159 +  double distance = 2000;
  43.160 +  double hm = 1;
  43.161 +  double hb = 30;
  43.162 +  Ptr<BuildingsMobilityModel> mm1 = CreateObject<BuildingsMobilityModel> ();
  43.163 +  mm1->SetPosition (Vector (0.0, 0.0, hb));
  43.164 +
  43.165 +  Ptr<BuildingsMobilityModel> mm2 = CreateObject<BuildingsMobilityModel> ();
  43.166 +  mm2->SetPosition (Vector (distance, 0.0, hm));
  43.167 +
  43.168 +
  43.169 +  distance = 30;
  43.170 +  double henbHeight = 10.0;
  43.171 +  Ptr<BuildingsMobilityModel> mm5 = CreateObject<BuildingsMobilityModel> ();
  43.172 +  mm5->SetPosition (Vector (0.0, 0.0, henbHeight));
  43.173 +  static Ptr<Building> building1 = Create<Building> ();
  43.174 +  building1->SetBoundaries (Box (0.0, 10.0, 0.0, 10.0, 0.0, 20.0 /*, 1, 1, 1*/));
  43.175 +  building1->SetBuildingType (Building::Residential);
  43.176 +  building1->SetExtWallsType (Building::ConcreteWithWindows);
  43.177 +  mm5->SetIndoor (building1);
  43.178 +  Ptr<BuildingsMobilityModel> mm6 = CreateObject<BuildingsMobilityModel> ();
  43.179 +  mm6->SetPosition (Vector (distance, 0.0, hm));
  43.180 +  mm6->SetIndoor (building1);
  43.181 +  mm6->SetFloorNumber (2);
  43.182 +
  43.183 +
  43.184 +  distance = 100;
  43.185 +  Ptr<BuildingsMobilityModel> mm9 = CreateObject<BuildingsMobilityModel> ();
  43.186 +  mm9->SetPosition (Vector (0.0, 0.0, henbHeight));
  43.187 +  mm9->SetIndoor (building1);
  43.188 +  mm9->SetFloorNumber (2);
  43.189 +  Ptr<BuildingsMobilityModel> mm10 = CreateObject<BuildingsMobilityModel> ();
  43.190 +  mm10->SetPosition (Vector (distance, 0.0, hm));
  43.191 +
  43.192 +  switch (index)
  43.193 +    {
  43.194 +    case 1:
  43.195 +      return mm1;
  43.196 +      break;
  43.197 +
  43.198 +    case 2:
  43.199 +      return mm2;
  43.200 +      break;
  43.201 +
  43.202 +    case 5:
  43.203 +      return mm5;
  43.204 +      break;
  43.205 +
  43.206 +    case 6:
  43.207 +      return mm6;
  43.208 +      break;
  43.209 +
  43.210 +    case 9:
  43.211 +      return mm9;
  43.212 +      break;
  43.213 +
  43.214 +    case 10:
  43.215 +      return mm10;
  43.216 +      break;
  43.217 +
  43.218 +    default:
  43.219 +      return 0;
  43.220 +      break;
  43.221 +    }
  43.222 +  return 0;
  43.223 +
  43.224 +}
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/src/buildings/test/buildings-shadowing-test.h	Fri May 11 16:42:40 2012 +0200
    44.3 @@ -0,0 +1,60 @@
    44.4 +/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
    44.5 +/*
    44.6 +* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
    44.7 +*
    44.8 +* This program is free software; you can redistribute it and/or modify
    44.9 +* it under the terms of the GNU General Public License version 2 as
   44.10 +* published by the Free Software Foundation;
   44.11 +*
   44.12 +* This program is distributed in the hope that it will be useful,
   44.13 +* but WITHOUT ANY WARRANTY; without even the implied warranty of
   44.14 +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   44.15 +* GNU General Public License for more details.
   44.16 +*
   44.17 +* You should have received a copy of the GNU General Public License
   44.18 +* along with this program; if not, write to the Free Software
   44.19 +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
   44.20 +*
   44.21 +* Author: Marco Miozzo <marco.miozzo@cttc.es>
   44.22 +*/
   44.23 +
   44.24 +#ifndef BUILDINGS_SHADOWING_TEST_H
   44.25 +#define BUILDINGS_SHADOWING_TEST_H
   44.26 +
   44.27 +#include "ns3/test.h"
   44.28 +
   44.29 +#include <ns3/buildings-mobility-model.h>
   44.30 +#include <ns3/buildings-propagation-loss-model.h>
   44.31 +
   44.32 +
   44.33 +using namespace ns3;
   44.34 +
   44.35 +
   44.36 +/**
   44.37 +* Test 1.1 shadowing calculation
   44.38 +*/
   44.39 +class BuildingsShadowingTestSuite : public TestSuite
   44.40 +{
   44.41 +public:
   44.42 +  BuildingsShadowingTestSuite ();
   44.43 +};
   44.44 +
   44.45 +
   44.46 +class BuildingsShadowingTestCase : public TestCase
   44.47 +{
   44.48 +public:
   44.49 +  BuildingsShadowingTestCase (uint16_t m1, uint16_t m2, double refValue, double sigmaRef, std::string name);
   44.50 +  virtual ~BuildingsShadowingTestCase ();
   44.51 +
   44.52 +private:
   44.53 +  virtual void DoRun (void);
   44.54 +  Ptr<MobilityModel> CreateMobilityModel (uint16_t index);
   44.55 +
   44.56 +  uint16_t m_mobilityModelIndex1;
   44.57 +  uint16_t m_mobilityModelIndex2;
   44.58 +  double m_lossRef;     // pathloss value (without shadowing)
   44.59 +  double m_sigmaRef;
   44.60 +
   44.61 +};
   44.62 +
   44.63 +#endif /*BUILDINGS_SHADOWING_TEST_H*/
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/src/buildings/test/examples-to-run.py	Fri May 11 16:42:40 2012 +0200
    45.3 @@ -0,0 +1,21 @@
    45.4 +#! /usr/bin/env python
    45.5 +# -*- coding: utf-8 -*-
    45.6 +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
    45.7 +
    45.8 +# A list of C++ examples to run in order to ensure that they remain
    45.9 +# buildable and runnable over time.  Each tuple in the list contains
   45.10 +#
   45.11 +#     (example_name, do_run, do_valgrind_run).
   45.12 +#
   45.13 +# See test.py for more information.
   45.14 +cpp_examples = [
   45.15 +    ("buildings-pathloss-profiler", "True", "True"),
   45.16 +]
   45.17 +
   45.18 +# A list of Python examples to run in order to ensure that they remain
   45.19 +# runnable over time.  Each tuple in the list contains
   45.20 +#
   45.21 +#     (example_name, do_run).
   45.22 +#
   45.23 +# See test.py for more information.
   45.24 +python_examples = []
    46.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    46.2 +++ b/src/buildings/test/reference/buildings_pathloss.m	Fri May 11 16:42:40 2012 +0200
    46.3 @@ -0,0 +1,87 @@
    46.4 +clear all;
    46.5 +close all;
    46.6 +
    46.7 +%% BuildingsPropagationLossModel pathloss test reference script
    46.8 +
    46.9 +
   46.10 +%% ITU1411, COST231, OH, etc. scripts are in the propagation module
   46.11 +addpath ("../../../propagation/test/reference/");
   46.12 +
   46.13 +
   46.14 +%f = 2114e6;  % carrier freq Hz, EARFCN = 500 (downlink)
   46.15 +%f = 1900e6;  % carrier freq Hz, EARFCN = 500 (downlink)
   46.16 +f = 869e6;
   46.17 +%f = 2620e6;
   46.18 +d = 2; %km
   46.19 +hb = 30;
   46.20 +hm = 1;
   46.21 +hr = 20;
   46.22 +fmhz = f/1e6;
   46.23 +
   46.24 +% Test #1
   46.25 +g = loss_OH_large_cities_urban (d, hb, hm, fmhz);
   46.26 +disp ("Test #1: the value of OH for large cities is:"), disp (g)
   46.27 +
   46.28 +g = loss_OH_small_cities_urban (d, hb, hm, fmhz);
   46.29 +disp ("Test #1: the value of OH for small cities is:"), disp (g)
   46.30 +
   46.31 +g = loss_OH_suburban (d, hb, hm, fmhz);
   46.32 +disp ("Test #1: the value of OH in suburban is:"), disp (g)
   46.33 +
   46.34 +g = loss_OH_openareas (d, hb, hm, fmhz);
   46.35 +disp ("Test #1: the value of OH in openareas is:"), disp (g)
   46.36 +
   46.37 +% Test #2 and #7
   46.38 +fmhz = 2114;
   46.39 +g = loss_COST231_large_cities_urban (d, hb, hm, fmhz);
   46.40 +disp ("Test #2: the value of COST231 for large cities is:"), disp (g)
   46.41 +
   46.42 +g = loss_COST231_small_cities_urban (d, hb, hm, fmhz);
   46.43 +disp ("Test #2: the value of COST231 for small cities is:"), disp (g)
   46.44 +
   46.45 +% Test #3
   46.46 +g = loss_Kun_2_6GHz (d*1000);
   46.47 +disp ("Test #3: the value of Kun 2.6 GHz is:"), disp (g)
   46.48 +
   46.49 +% Test #4
   46.50 +d = 1041.2; %m
   46.51 +f = 2114e6;
   46.52 +g = loss_ITU1411_LOS (d, hb, hm, f);
   46.53 +disp ("Test #4: the value of ITU1411 in LOS is:"), disp (g)
   46.54 +
   46.55 +% Test #5
   46.56 +d = 900;
   46.57 +l = 80;
   46.58 +b = 50;
   46.59 +st_w = 20;
   46.60 +phi = 45;
   46.61 +big = 1; % metropolitan centre
   46.62 +g = loss_ITU1411_NLOS_over_rooftop (d, hb, hm, hr, f, l, b, st_w, phi, big);
   46.63 +disp ("Test #5: the value of ITU1411 in NLOS over the roof-top is:"), disp (g)
   46.64 +
   46.65 +% Test #6
   46.66 +n_floors = 2;
   46.67 +built_t = 2;
   46.68 +d = 31.3209;
   46.69 +g = loss_ITU1238 (d, fmhz, n_floors, built_t);
   46.70 +disp ("Test #6: the value of ITU1238 is:"), disp (g)
   46.71 +
   46.72 +% Test #9
   46.73 +d = 100.404;
   46.74 +f = 2114e6;
   46.75 +hb = 10;
   46.76 +g = loss_ITU1411_LOS (d, hb, hm, hr, f);
   46.77 +disp ("Test #9: the value of ITU1411 in LOS is:"), disp (g)
   46.78 +
   46.79 +
   46.80 +
   46.81 +% Test #10
   46.82 +d = 500;
   46.83 +l = 80;
   46.84 +b = 50;
   46.85 +st_w = 20;
   46.86 +phi = 45;
   46.87 +big = 1; % metropolitan centre
   46.88 +hb = 10;
   46.89 +g = loss_ITU1411_NLOS_over_rooftop (d, hb, hm, hr, f, l, b, st_w, phi, big);
   46.90 +disp ("Test #10: the value of ITU1411 in NLOS over the roof-top is:"), disp (g)
   46.91 \ No newline at end of file
    47.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.2 +++ b/src/buildings/test/reference/loss_ITU1238.m	Fri May 11 16:42:40 2012 +0200
    47.3 @@ -0,0 +1,30 @@
    47.4 +function g = loss_ITU1238 (d, f, n_floors, build_t)
    47.5 +
    47.6 +  %%
    47.7 +  %% function g = loss_ITU1411_NLOS_street_canyons(d, c)
    47.8 +  %%
    47.9 +  %% returns the loss at d meters for f frequency and mobile height m and
   47.10 +  %% base station height of hb
   47.11 +  %% build_t = 0:residential; 1:office; 2:commercial
   47.12 +  
   47.13 +  assert(isscalar(f));
   47.14 +  assert(f > 0);
   47.15 +
   47.16 +
   47.17 +  lambda = 300000000.0 / f;
   47.18 +
   47.19 +
   47.20 +  if (build_t ==1)
   47.21 +    N = 28;
   47.22 +    Lf = 4*n_floors;
   47.23 +  elseif (build_t==2)
   47.24 +    N = 30
   47.25 +    Lf = 15+4*(n_floors-1);
   47.26 +  else
   47.27 +    N = 22;
   47.28 +    Lf = 6 + 3*(n_floors-1);
   47.29 +  endif
   47.30 +
   47.31 +  g(find(d > 0)) = 20*log10(f) + (N*log10(d)) + Lf - 28;
   47.32 +
   47.33 +  g(find(d <= 0)) = 1;
   47.34 \ No newline at end of file
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/src/buildings/wscript	Fri May 11 16:42:40 2012 +0200
    48.3 @@ -0,0 +1,49 @@
    48.4 +## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
    48.5 +
    48.6 +def build(bld):
    48.7 +
    48.8 +    module = bld.create_ns3_module('buildings', ['mobility', 'propagation', 'config-store'])
    48.9 +    module.source = [
   48.10 +        'model/building.cc',
   48.11 +        'model/building-list.cc',
   48.12 +        'model/buildings-mobility-model.cc',
   48.13 +        'model/itu-r-1238-propagation-loss-model.cc',
   48.14 +        'model/buildings-propagation-loss-model.cc',
   48.15 +        'model/hybrid-buildings-propagation-loss-model.cc',
   48.16 +        'model/oh-buildings-propagation-loss-model.cc',
   48.17 +        'helper/building-container.cc',
   48.18 +        'helper/building-position-allocator.cc',
   48.19 +        'helper/building-allocator.cc',
   48.20 +        'helper/buildings-helper.cc',
   48.21 +        ]
   48.22 +
   48.23 +    module_test = bld.create_ns3_module_test_library('buildings')
   48.24 +    module_test.source = [
   48.25 +        'test/buildings-helper-test.cc',
   48.26 +        'test/buildings-pathloss-test.cc',
   48.27 +        'test/buildings-shadowing-test.cc',
   48.28 +        ]
   48.29 +    
   48.30 +    headers = bld.new_task_gen(features=['ns3header'])
   48.31 +    headers.module = 'buildings'
   48.32 +    headers.source = [
   48.33 +        'model/building.h',
   48.34 +        'model/building-list.h',
   48.35 +        'model/buildings-mobility-model.h',
   48.36 +        'model/itu-r-1238-propagation-loss-model.h',
   48.37 +        'model/buildings-propagation-loss-model.h',
   48.38 +        'model/hybrid-buildings-propagation-loss-model.h',
   48.39 +        'model/oh-buildings-propagation-loss-model.h',
   48.40 +        'helper/building-container.h',
   48.41 +        'helper/building-allocator.h',
   48.42 +        'helper/building-position-allocator.h',
   48.43 +        'helper/buildings-helper.h',
   48.44 +        'test/buildings-pathloss-test.h',
   48.45 +        'test/buildings-shadowing-test.h',
   48.46 +        ]
   48.47 +
   48.48 +    if (bld.env['ENABLE_EXAMPLES']):
   48.49 +        bld.add_subdirs('examples')
   48.50 +
   48.51 +
   48.52 +    bld.ns3_python_bindings()
    49.1 --- a/src/lte/AUTHORS	Fri May 11 14:02:54 2012 +0200
    49.2 +++ b/src/lte/AUTHORS	Fri May 11 16:42:40 2012 +0200
    49.3 @@ -1,16 +1,25 @@
    49.4 -Giuseppe Piro
    49.5 -===============
    49.6 -Module manager and main developer
    49.7 -2010
    49.8 -TELEMATICS LAB, Politecnico di Bari
    49.9 -G.Piro@poliba.it
   49.10  
   49.11 +The ns-3 LTE module is the result of the development effort carried out by different people/institutions/projects. The main contributors are listed below.
   49.12  
   49.13 -The module has been firtly developed with 
   49.14 -the support of Google Summer of Code Program, 
   49.15 -under the supervision of 
   49.16 -Nicola Baldo (n.baldo@cttc.es)
   49.17 -and Marco Miozzo (m.miozzo@cttc.es) 
   49.18 +====================================================
   49.19 +       Google Summer of Code (GSoC) (2010)
   49.20 +====================================================
   49.21  
   49.22 +Giuseppe Piro, TELEMATICS LAB, Politecnico di Bari <G.Piro@poliba.it>
   49.23 +design and development
   49.24  
   49.25 +Nicola Baldo, CTTC <nbaldo@cttc.es>
   49.26 +Marco Miozzo, CTTC <mmiozzo@cttc.es>
   49.27 +supervision and GSoC project mentorship
   49.28  
   49.29 +
   49.30 +====================================================
   49.31 +  LTE-EPC Network simulAtor (LENA) Project (2011-12)
   49.32 +====================================================
   49.33 +
   49.34 +Nicola Baldo, CTTC <nbaldo@cttc.es>
   49.35 +Marco Miozzo, CTTC <mmiozzo@cttc.es>
   49.36 +Manuel Requena, CTTC <mrequena@cttc.es>
   49.37 +Jaume Nin, CTTC <jnin@cttc.es>
   49.38 +
   49.39 +
    50.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    50.2 +++ b/src/lte/RELEASE_NOTES	Fri May 11 16:42:40 2012 +0200
    50.3 @@ -0,0 +1,95 @@
    50.4 +
    50.5 ++++++++++++++++++++++++++++++++++++++
    50.6 + RELEASE NOTES of the ns-3 LTE module
    50.7 ++++++++++++++++++++++++++++++++++++++
    50.8 +
    50.9 +This file documents the user-visible features that have been added
   50.10 +within each release of the ns-3 LTE module.
   50.11 +
   50.12 +
   50.13 +
   50.14 +
   50.15 +Milestone 1 (M1) release of the LENA project (June 17, 2011)
   50.16 +============================================================
   50.17 +
   50.18 +Here is a summary of the new features available in the LTE module with
   50.19 +this release:  
   50.20 +
   50.21 +
   50.22 + - uplink PHY and MAC properly implemented including Adaptive
   50.23 +   Modulation and Coding (previously only downlink was supported)  
   50.24 +
   50.25 + - interference modeling was implemented: it is now possible to
   50.26 +   simulate multi-cell scenarios with inter-cell interference
   50.27 +
   50.28 + - flexible spectrum model: it is now possible to specify the carrier
   50.29 +   frequency and bandwidth of each cell independently 
   50.30 +
   50.31 + - an implementation of the Proportional Fair scheduler based on the
   50.32 +   FF LTE MAC Scheduler API is now included 
   50.33 +
   50.34 + - support for output of RLC and MAC layer Key Performance Indicators
   50.35 +   (KPIs) via dedicated trace sinks connected to newly defined trace
   50.36 +   sources 
   50.37 +
   50.38 + - the setting of the most relevant parameters (e.g. tx power, noise,
   50.39 +   carrier frequency, bandwidth, type of scheduler, etc.) is now done
   50.40 +   via the ns-3 attribute system   
   50.41 +
   50.42 + - several test suites have been added, including both unit tests that
   50.43 +   check the correct functionality of specific objects, and system
   50.44 +   tests that validate the output produced by the simulator in several
   50.45 +   scenarios of interest.
   50.46 +
   50.47 + - the documentation of the lte module has been entirely rewritten, it
   50.48 +   now features three separate sections: the design documentation, the
   50.49 +   user documentation and the testing documentation. 
   50.50 +
   50.51 +
   50.52 +
   50.53 +First Public release of the LENA project (March 10, 2011)
   50.54 +=========================================================
   50.55 +
   50.56 +The LENA code is based on the GSoC 2010 project code by Giuseppe Piro,
   50.57 +which was merged into ns-3-dev on December 2010. With respect to the GSoC
   50.58 +code, the main modifications that have been performed are: 
   50.59 +
   50.60 + - the MAC has been entirely rewritten to support the MAC Scheduler
   50.61 +   API defined by the Femto Forum, which is publicly available at this
   50.62 +   location: http://www.femtoforum.org/femto/technical.php
   50.63 +
   50.64 + - a Round Robin scheduler implementation based on the above API is
   50.65 +   also provided
   50.66 +
   50.67 + - the RLC API has been redefined  RLC in particular, at this stage
   50.68 +   only the API definition is in place, together with a simplified RLC
   50.69 +   implementation (RLC TM/UM/AM not available yet) 
   50.70 +
   50.71 +  - the RRC has been entirely rewritten; we plan to reuse part of the
   50.72 +    GSoC 2010 flow classification code (which we plan to reuse) at a
   50.73 +    future stage for the implementation of Traffic Flow Template
   50.74 +    classifiers. 
   50.75 +
   50.76 +  - network layer functionality has been temporarily disabled; it will
   50.77 +    be re-enabled when either RLC/UM or RLC/AM is available. 
   50.78 +
   50.79 +
   50.80 +
   50.81 +
   50.82 +GSoC 2010 release (merged into ns-3-dev on December 2010)
   50.83 +=========================================================
   50.84 +
   50.85 +Here are 
   50.86 +In summary, the most important features provided by the
   50.87 +proposed module are (i) a basic implementation of both the
   50.88 +User Equipment (UE) and the enhanced NodeB (eNB) de-
   50.89 +vices, (ii) RRC entities for both the UE and the eNB, (iii)
   50.90 +a state-of-the-art Adaptive Modulation and Coding (AMC)
   50.91 +scheme for the downlink [9], (iv) the management of the
   50.92 +data radio bearers (with their QoS parameters), the MAC
   50.93 +queues and the RLC instances, (v) Channel Quality Indi-
   50.94 +cator (CQI) management, (vi) support for both uplink and
   50.95 +downlik packet scheduling, (vii) a PHY layer model with
   50.96 +Resource Block level granularity and (viii) a channel model
   50.97 +with the outdoor E-UTRAN propagation loss model.
   50.98 +
    51.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.2 +++ b/src/lte/doc/Makefile	Fri May 11 16:42:40 2012 +0200
    51.3 @@ -0,0 +1,265 @@
    51.4 +EPSTOPDF = epstopdf
    51.5 +DIA = dia
    51.6 +SEQDIAG = seqdiag
    51.7 +CONVERT = convert -density 250
    51.8 +
    51.9 +
   51.10 +SOURCE = source
   51.11 +FIGURES = $(SOURCE)/figures
   51.12 +
   51.13 +# specify dia figures from which .png and .pdf figures need to be built
   51.14 +
   51.15 +IMAGES_DIA = \
   51.16 +	$(FIGURES)/epc-data-flow-dl.dia \
   51.17 +	$(FIGURES)/epc-data-flow-ul.dia \
   51.18 +	$(FIGURES)/epc-profiling-scenario.dia \
   51.19 +	$(FIGURES)/epc-topology.dia \
   51.20 +	$(FIGURES)/eutran-profiling-scenario.dia \
   51.21 +	$(FIGURES)/ff-example.dia \
   51.22 +	$(FIGURES)/ff-mac-saps.dia \
   51.23 +	$(FIGURES)/lte-arch-data-rrc-pdcp-rlc.dia \
   51.24 +	$(FIGURES)/lte-enb-architecture.dia \
   51.25 +	$(FIGURES)/lte-epc-e2e-data-protocol-stack.dia \
   51.26 +	$(FIGURES)/lte-interference-test-scenario.dia \
   51.27 +	$(FIGURES)/lte-ue-architecture.dia
   51.28 +
   51.29 +
   51.30 +# specify eps figures from which .png and .pdf figures need to be built
   51.31 +
   51.32 +IMAGES_EPS = \
   51.33 +	$(FIGURES)/MCS_2_test.eps \
   51.34 +	$(FIGURES)/MCS_12_test.eps \
   51.35 +	$(FIGURES)/MCS_14_test.eps \
   51.36 +	$(FIGURES)/lena-dual-stripe.eps \
   51.37 +	$(FIGURES)/lte-mcs-index.eps \
   51.38 +	$(FIGURES)/lenaThrTestCase1.eps \
   51.39 +	$(FIGURES)/lenaThrTestCase2.eps \
   51.40 +	$(FIGURES)/runningTime10s.eps \
   51.41 +	$(FIGURES)/epcRunningTime.eps \
   51.42 +	$(FIGURES)/propagationModel.eps \
   51.43 +	$(FIGURES)/simulationTime.eps \
   51.44 +	$(FIGURES)/epcSimulationTime.eps \
   51.45 +	$(FIGURES)/epcEutranRunningTime.eps \
   51.46 +	$(FIGURES)/profiling-memory.eps \
   51.47 +	$(FIGURES)/lte-rlc-implementation-model.eps \
   51.48 +	$(FIGURES)/lte-rlc-data-txon-dl.eps \
   51.49 +	$(FIGURES)/lte-rlc-data-retx-dl.eps \
   51.50 +	$(FIGURES)/lte-rlc-data-txon-ul.eps \
   51.51 +	$(FIGURES)/lte-rlc-data-retx-ul.eps 
   51.52 +
   51.53 +
   51.54 +# rescale pdf figures as necessary
   51.55 +$(FIGURES)/testbed.pdf_width = 5in
   51.56 +$(FIGURES)/emulated-channel.pdf_width = 6in
   51.57 +$(FIGURES)/node.pdf_width = 5in
   51.58 +$(FIGURES)/packet.pdf_width = 4in
   51.59 +$(FIGURES)/buffer.pdf_width = 15cm
   51.60 +$(FIGURES)/sockets-overview.pdf_width = 10cm
   51.61 +$(FIGURES)/internet-node-send.pdf_width = 5in
   51.62 +$(FIGURES)/internet-node-recv.pdf_width = 5in
   51.63 +$(FIGURES)/routing.pdf_width = 6in
   51.64 +$(FIGURES)/routing-specialization.pdf_width = 5in
   51.65 +$(FIGURES)/snir.pdf_width = 3in
   51.66 +$(FIGURES)/lte-interference-test-scenario.pdf_width = 3in
   51.67 +$(FIGURES)/epc-topology.pdf_width = 4in
   51.68 +$(FIGURES)/lte-arch-data-rrc-pdcp-rlc.pdf_width = 3in
   51.69 +$(FIGURES)/lte-epc-e2e-data-protocol-stack.pdf_width = 15cm
   51.70 +$(FIGURES)/ff-mac-saps.pdf_width = 5in
   51.71 +$(FIGURES)/ff-example.pdf_width = 5in
   51.72 +$(FIGURES)/lte-rlc-implementation-model.pdf_width = 20in
   51.73 +$(FIGURES)/lte-rlc-data-txon-dl.pdf_width = 10cm
   51.74 +$(FIGURES)/lte-rlc-data-txon-ul.pdf_width = 10cm
   51.75 +$(FIGURES)/lte-rlc-data-retx-ul.pdf_width = 10cm
   51.76 +$(FIGURES)/lte-phy-interference.pdf_width = 12cm
   51.77 +$(FIGURES)/auvmobility-classes.pdf_width = 10cm
   51.78 +
   51.79 +
   51.80 +IMAGES_SEQDIAG = \
   51.81 +	$(FIGURES)/lte-phy-interference.seqdiag \
   51.82 +	$(FIGURES)/helpers.seqdiag
   51.83 +
   51.84 +IMAGES_NOBUILD = $(FIGURES)/fading_pedestrian.png \
   51.85 +	$(FIGURES)/fading_vehicular.png \
   51.86 +	$(FIGURES)/fading_urban_3kmph.png \
   51.87 +	$(FIGURES)/fading_pedestrian.pdf \
   51.88 +	$(FIGURES)/fading_vehicular.pdf \
   51.89 +	$(FIGURES)/fading_urban_3kmph.pdf \
   51.90 +	$(FIGURES)/MCS_1_4.pdf \
   51.91 +	$(FIGURES)/MCS_1_4.png \
   51.92 +	$(FIGURES)/MCS_5_8.pdf \
   51.93 +	$(FIGURES)/MCS_5_8.png \
   51.94 +	$(FIGURES)/MCS_9_12.pdf \
   51.95 +	$(FIGURES)/MCS_9_12.png \
   51.96 +	$(FIGURES)/MCS_13_16.pdf \
   51.97 +	$(FIGURES)/MCS_13_16.png \
   51.98 +	$(FIGURES)/MCS_17_20.pdf \
   51.99 +	$(FIGURES)/MCS_17_20.png \
  51.100 +	$(FIGURES)/MCS_21_24.pdf \
  51.101 +	$(FIGURES)/MCS_21_24.png \
  51.102 +	$(FIGURES)/MCS_25_27.pdf \
  51.103 +	$(FIGURES)/MCS_25_27.png \
  51.104 +	$(FIGURES)/lte-phy-interference.png \
  51.105 +	$(FIGURES)/lte-phy-interference.pdf \
  51.106 +	$(FIGURES)/helpers.png \
  51.107 +	$(FIGURES)/helpers.pdf \
  51.108 +	$(FIGURES)/miesm_scheme.pdf \
  51.109 +	$(FIGURES)/miesm_scheme.png \
  51.110 +	${IMAGES_SEQDIAG:.seqdiag=.png} \
  51.111 +	${IMAGES_SEQDIAG:.seqdiag=.pdf}
  51.112 +
  51.113 +IMAGES_BUILD = \
  51.114 +	${IMAGES_DIA:.dia=.eps} \
  51.115 +	${IMAGES_DIA:.dia=.png} \
  51.116 +	${IMAGES_DIA:.dia=.pdf} \
  51.117 +	${IMAGES_EPS:.eps=.png} \
  51.118 +	${IMAGES_EPS:.eps=.pdf} 
  51.119 +
  51.120 +
  51.121 +
  51.122 +IMAGES = $(IMAGES_NOBUILD) $(IMAGES_BUILD)
  51.123 +
  51.124 +%.eps : %.dia; $(DIA) -t eps $< -e $@
  51.125 +%.png : %.dia; $(DIA) -t png $< -e $@
  51.126 +%.png : %.seqdiag; $(SEQDIAG) -Tpng -o $@ $< 
  51.127 +%.png : %.eps; $(CONVERT) $< $@
  51.128 +%.pdf : %.seqdiag; $(SEQDIAG) -Tpdf -o $@ $< ; if test x$($@_width) != x; then TMPFILE=`mktemp`; ./rescale-pdf.sh $($@_width) $@ $${TMPFILE} && mv $${TMPFILE} $@; fi
  51.129 +%.pdf : %.eps; $(EPSTOPDF) $< -o=$@; if test x$($@_width) != x; then TMPFILE=`mktemp`; ./rescale-pdf.sh $($@_width) $@ $${TMPFILE} && mv $${TMPFILE} $@; fi
  51.130 +
  51.131 +
  51.132 +%.png : %.eps; $(CONVERT) $< $@
  51.133 +%.pdf : %.eps; $(EPSTOPDF) $< -o=$@; if test x$($@_width) != x; then TMPFILE=`mktemp`; ./rescale-pdf.sh $($@_width) $@ $${TMPFILE} && mv $${TMPFILE} $@; fi
  51.134 +
  51.135 +# You can set these variables from the command line.
  51.136 +SPHINXOPTS    =
  51.137 +SPHINXBUILD   = sphinx-build
  51.138 +PAPER         =
  51.139 +BUILDDIR      = build
  51.140 +
  51.141 +# Internal variables.
  51.142 +PAPEROPT_a4     = -D latex_paper_size=a4
  51.143 +PAPEROPT_letter = -D latex_paper_size=letter
  51.144 +ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCE) 
  51.145 +
  51.146 +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
  51.147 +
  51.148 +help:
  51.149 +	@echo "Please use \`make <target>' where <target> is one of"
  51.150 +	@echo "  html       to make standalone HTML files"
  51.151 +	@echo "  dirhtml    to make HTML files named index.html in directories"
  51.152 +	@echo "  singlehtml to make a single large HTML file"
  51.153 +	@echo "  pickle     to make pickle files"
  51.154 +	@echo "  json       to make JSON files"
  51.155 +	@echo "  htmlhelp   to make HTML files and a HTML help project"
  51.156 +	@echo "  qthelp     to make HTML files and a qthelp project"
  51.157 +	@echo "  devhelp    to make HTML files and a Devhelp project"
  51.158 +	@echo "  epub       to make an epub"
  51.159 +	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
  51.160 +	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
  51.161 +	@echo "  text       to make text files"
  51.162 +	@echo "  man        to make manual pages"
  51.163 +	@echo "  changes    to make an overview of all changed/added/deprecated items"
  51.164 +	@echo "  linkcheck  to check all external links for integrity"
  51.165 +	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
  51.166 +
  51.167 +clean:
  51.168 +	-rm -rf $(BUILDDIR)/*
  51.169 +	-rm -f $(IMAGES_BUILD)
  51.170 +
  51.171 +frag: pickle
  51.172 +	@if test ! -d $(BUILDDIR)/frag; then mkdir $(BUILDDIR)/frag; fi
  51.173 +	pushd $(BUILDDIR)/frag && ../../pickle-to-xml.py ../pickle/index.fpickle  > navigation.xml && popd
  51.174 +	cp -r $(BUILDDIR)/pickle/_images $(BUILDDIR)/frag
  51.175 +
  51.176 +html:  $(IMAGES) 
  51.177 +	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
  51.178 +	@echo
  51.179 +	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
  51.180 +
  51.181 +dirhtml:  $(IMAGES)
  51.182 +	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
  51.183 +	@echo
  51.184 +	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
  51.185 +
  51.186 +singlehtml:  $(IMAGES)
  51.187 +	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
  51.188 +	@echo
  51.189 +	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
  51.190 +
  51.191 +pickle:  $(IMAGES)
  51.192 +	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
  51.193 +	@echo
  51.194 +	@echo "Build finished; now you can process the pickle files."
  51.195 +
  51.196 +json:  $(IMAGES)
  51.197 +	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
  51.198 +	@echo
  51.199 +	@echo "Build finished; now you can process the JSON files."
  51.200 +
  51.201 +htmlhelp:  $(IMAGES)
  51.202 +	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
  51.203 +	@echo
  51.204 +	@echo "Build finished; now you can run HTML Help Workshop with the" \
  51.205 +	      ".hhp project file in $(BUILDDIR)/htmlhelp."
  51.206 +
  51.207 +qthelp:  $(IMAGES)
  51.208 +	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
  51.209 +	@echo
  51.210 +	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
  51.211 +	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
  51.212 +	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ns-3.qhcp"
  51.213 +	@echo "To view the help file:"
  51.214 +	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ns-3.qhc"
  51.215 +
  51.216 +devhelp:  $(IMAGES)
  51.217 +	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
  51.218 +	@echo
  51.219 +	@echo "Build finished."
  51.220 +	@echo "To view the help file:"
  51.221 +	@echo "# mkdir -p $$HOME/.local/share/devhelp/ns-3"
  51.222 +	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ns-3"
  51.223 +	@echo "# devhelp"
  51.224 +
  51.225 +epub:  $(IMAGES)
  51.226 +	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
  51.227 +	@echo
  51.228 +	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
  51.229 +
  51.230 +latex:  $(IMAGES)
  51.231 +	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
  51.232 +	@echo
  51.233 +	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
  51.234 +	@echo "Run \`make' in that directory to run these through (pdf)latex" \
  51.235 +	      "(use \`make latexpdf' here to do that automatically)."
  51.236 +
  51.237 +latexpdf:  $(IMAGES)
  51.238 +	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
  51.239 +	@echo "Running LaTeX files through pdflatex..."
  51.240 +	make -C $(BUILDDIR)/latex all-pdf
  51.241 +	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
  51.242 +
  51.243 +text:  $(IMAGES)
  51.244 +	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
  51.245 +	@echo
  51.246 +	@echo "Build finished. The text files are in $(BUILDDIR)/text."
  51.247 +
  51.248 +man:  $(IMAGES)
  51.249 +	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
  51.250 +	@echo
  51.251 +	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
  51.252 +
  51.253 +changes:  $(IMAGES)
  51.254 +	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
  51.255 +	@echo
  51.256 +	@echo "The overview file is in $(BUILDDIR)/changes."
  51.257 +
  51.258 +linkcheck:  $(IMAGEs)
  51.259 +	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
  51.260 +	@echo
  51.261 +	@echo "Link check complete; look for any errors in the above output " \
  51.262 +	      "or in $(BUILDDIR)/linkcheck/output.txt."
  51.263 +
  51.264 +doctest:  $(IMAGES)
  51.265 +	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
  51.266 +	@echo "Testing of doctests in the sources finished, look at the " \
  51.267 +	      "results in $(BUILDDIR)/doctest/output.txt."
  51.268 +
    52.1 Binary file src/lte/doc/lte-transmission.pdf has changed
    53.1 Binary file src/lte/doc/lte-transmission.png has changed
    54.1 --- a/src/lte/doc/lte.rst	Fri May 11 14:02:54 2012 +0200
    54.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    54.3 @@ -1,366 +0,0 @@
    54.4 -LTE Module
    54.5 -----------
    54.6 -
    54.7 -This chapter describes the ns-3 :cpp:class:`ns3::LteNetDevice` and related models. 
    54.8 -By adding :cpp:class:`ns3::LteNetDevice` objects to ns-3 nodes, one can create models 
    54.9 -of 3GPP E-UTRAN infrastructure and Long Term Evolution (LTE) networks.                
   54.10 -
   54.11 -Below, we list some more details about what ns-3 LTE models cover but, in 
   54.12 -summary, the most important features of the ns-3 model are:
   54.13 -
   54.14 -* a basic implementation of both the User Equipment (UE) and the enhanced NodeB (eNB) devices,
   54.15 -* RRC entities for both the UE and the eNB,
   54.16 -* a state-of-the-art Adaptive Modulation and Coding (AMC) scheme for the downlink
   54.17 -* the management of the data radio bearers (with their QoS parameters), the MAC queues and the RLC instances,
   54.18 -* Channel Quality Indicator (CQI) management,
   54.19 -* support for both uplink and downlik packet scheduling,
   54.20 -* a PHY layer model with Resource Block level granularity
   54.21 -* a channel model with the outdoor E-UTRAN propagation loss model.
   54.22 -
   54.23 -Model Description
   54.24 -*****************
   54.25 -
   54.26 -The source code for the LTE models lives in the directory
   54.27 -``src/lte``.
   54.28 -
   54.29 -Design
   54.30 -======
   54.31 -
   54.32 -The LTE model provides a basic implementation of LTE devices, including propagation models and 
   54.33 -PHY and MAC layers. It allow to simulate an E-UTRAN interface where one eNB and several UEs can 
   54.34 -communicate among them using a shared downlink (uplink) channel. 
   54.35 -
   54.36 -The PHY layer has been developed extending the Spectrum Framework [1]_. The MAC model, instead, 
   54.37 -has been developed extending and adding some features to the base class :cpp:class:`ns3::NetDevice`.
   54.38 -
   54.39 -
   54.40 -Physical layer
   54.41 -##############
   54.42 -
   54.43 -A :cpp:class:`ns3::LtePhy` class models the LTE PHY layer. 
   54.44 -
   54.45 -Basic functionalities of the PHY layer are: (i) transmit packets coming from the device to the channel; (ii) receive packets from the channel; (ii) evaluate the quality of the channel from the Signal To Noise ratio of the received signal; and (iii) forward received packets to the device.
   54.46 -
   54.47 -Both the PHY and channel have been developed extending :cpp:class:`ns3::SpectrumPhy` and 
   54.48 -:cpp:class:`ns3::SpectrumChannel` classes, respectively.
   54.49 - 
   54.50 -The module implements an FDD channel access. In FDD channel access, downlink and uplink 
   54.51 -transmissions work together in the time but using a different set of frequencies.  
   54.52 -Since DL and UL are indipendent between them, the PHY is composed by couple of 
   54.53 -:cpp:class:`ns3::LteSpectrumPhy` object (i.e., implemented into the 
   54.54 -:cpp:class:`ns3::LteSpectrumPhy` class); one for the downlink and one for the uplink.
   54.55 -The :cpp:class:`ns3::LtePhy` stores and manages both downlink and uplink 
   54.56 -:cpp:class:`ns3::LteSpectrumPhy` elements. 
   54.57 -
   54.58 -In order to customize all physical functionalities for both UE and eNB devices, dedicated 
   54.59 -classes have been inherited from ones described before. In particular, 
   54.60 -:cpp:class:`ns3::UePhy` and :cpp:class:`ns3::EnbPhy` classes, inherited from 
   54.61 -the :cpp:class:`ns3::LtePhy` class, implement the PHY layer for the UE and the 
   54.62 -eNB, respectively. In the same way, :cpp:class:`ns3::UeLteSpectrumPhy` and 
   54.63 -:cpp:class:`ns3::EnbLteSpectrumPhy` classes, 
   54.64 -inherited from the :cpp:class:`ns3::LteSpectrumPhy`, 
   54.65 -implement the downlink/uplink spectrum channel for the UE and the eNB, respectively.
   54.66 -
   54.67 -The figure below shows how UE and eNB can exchange packets through the considered PHY layer.
   54.68 -
   54.69 -.. _lte-transmission:
   54.70 -
   54.71 -.. figure:: figures/lte-transmission.png
   54.72 -
   54.73 -    DL and UL transmision on the LTE network
   54.74 -
   54.75 -For the downlink, when the eNB whants to send packets, it calls the ``StartTx`` function to 
   54.76 -send them into the downlink channel. Then, the downlink channel delivers the burst 
   54.77 -of packets to all the :cpp:class:`ns3::UeLteSpectrumPhy` attached to it, handling the 
   54.78 -``StartRx`` function. 
   54.79 -When the UE receives packets, it executes the following tasks:
   54.80 -
   54.81 -* compute the SINR for all the sub channel used in the downlink
   54.82 -
   54.83 -* create and send CQI feedbacks
   54.84 -
   54.85 -* forward all the received packets to the device
   54.86 -
   54.87 -The uplink works similary to the previous one.
   54.88 -
   54.89 -Propagation Loss Models
   54.90 -#######################
   54.91 -
   54.92 -A proper propagation loss model has been developed for the LTE E-UTRAN interface (see [2]_ and [3]_).
   54.93 -It is used by the PHY layer to compute the loss due to the propagation. 
   54.94 -
   54.95 -The LTE propagation loss model is composed by 4 different models (shadowing, multipath, 
   54.96 -penetration loss and path loss) [2]_:
   54.97 -
   54.98 -* Pathloss: :math:`PL = 128.1 + (37.6 * log10 (R))`, where R is the distance between the 
   54.99 -  UE and the eNB in Km.
  54.100 -
  54.101 -* Multipath: Jakes model
  54.102 -
  54.103 -* PenetrationLoss: 10 dB
  54.104 -
  54.105 -* Shadowing: log-normal distribution (mean=0dB, standard deviation=8dB)
  54.106 -
  54.107 -Every time that the ``LteSpectrumPHY::StartRx ()`` function is called, the 
  54.108 -``SpectrumInterferenceModel`` is used to computed the SINR, as proposed in [3]_. Then, 
  54.109 -the network device uses the AMC module to map the SINR to a proper CQI and to send it 
  54.110 -to the eNB using the ideal control channel.
  54.111 -
  54.112 -LTE Devices 
  54.113 -###########
  54.114 -
  54.115 -All the common functionalities of the LTE network devices have been defined into 
  54.116 -the :cpp:class:`ns3::LteNetDevice` class. Moreover, the LTE device has been conceived 
  54.117 -as a container of several entities such as MAC, RRC, RLC etc .. For each of these entity 
  54.118 -a dedicated class has been developed.
  54.119 -
  54.120 -For each device are defined the following entity/element
  54.121 -
  54.122 -* the LTE PHY layer (described in the previous sub section)
  54.123 -
  54.124 -* rrc entity
  54.125 -
  54.126 -* mac entity
  54.127 -
  54.128 -* rlc entity
  54.129 -
  54.130 -The module is perfectly integrated into the whole ns-3 project: it is already possible 
  54.131 -to attach to each device a TCP/IP protocol stack and all the implemented applications 
  54.132 -(i.e., udp client/server, trace based, etc..).
  54.133 -
  54.134 -
  54.135 -The RRC Entity
  54.136 -##############
  54.137 -
  54.138 -RRC entity is implemented by the :cpp:class:`ns3::RrcEntity` class, and provides only the 
  54.139 -Radio Bearer management functionality. 
  54.140 -A dedicated bearer is created for each downlink flow.
  54.141 -
  54.142 -The RRC entity performs the classification of the packets coming from the upper 
  54.143 -layer into the corresponding Radio Bearer. This classification is
  54.144 -based on the information provided by the class :cpp:class:`ns3::IpcsClassifierRecord`.
  54.145 -
  54.146 -
  54.147 -
  54.148 -The MAC Entity
  54.149 -##############
  54.150 -
  54.151 -Class ``ns3::MacEntity`` provides a basic implementation of the MAC entity for 
  54.152 -the LTE device. Moreover, ``ns3::EnbMacEntity`` and ``ns3::UeMacEntity`` classes, 
  54.153 -inherited from the previous one, provides an implementation for the eNB and the UE MAC entity, 
  54.154 -respectively. 
  54.155 -In all MAC entities is defined the AMC module [4]_. Furthermore, into the 
  54.156 -:cpp:class:`ns3::EnbMacEntity` class are defined also both uplink and downlink schedulers.    
  54.157 -
  54.158 -Every time the PHY layer of the UE receives a packet form the channel, it calls the AMC module, 
  54.159 -define into the MAC entity, in order to convert the SINR of the received signal to CQI feedbacks. 
  54.160 -Every sub frame, the eNB performs both uplink and downlink radio resource allocation. Actually only 
  54.161 -a simple packet scheduler has been implemented that is able to send, every sub frame, only one 
  54.162 -packet in the downlink.   
  54.163 -
  54.164 -
  54.165 -The RLC Entity
  54.166 -##############
  54.167 -
  54.168 -The RLC entity performs an interface between the MAC layer and the MAC queue for a given bearer. 
  54.169 -Actually, only the RLC Transport Mode has been implemented. 
  54.170 -
  54.171 -
  54.172 -Control Channel
  54.173 -###############
  54.174 -
  54.175 -Control channel keeps a very important role in LTE networks. In fact, it is responsible of the 
  54.176 -transmission of several information (i.e., CQI feedback, allocation map, etc...). For this reason, 
  54.177 -also in a framework oriented to data transmision, it is necesary to find a tecnique for exchange 
  54.178 -these information. To this aim, an ideal control channel will be developed. 
  54.179 -Using ideal control messages, both UE and eNB can exchange control information without simulating 
  54.180 -a realistic transmission over the LTE channel.
  54.181 -
  54.182 -Two types of control messages have been implemented: the Pdcch Map Ideal Control Message and the 
  54.183 -Cqi Ideal Control Message. The first one is used by the eNB to send the uplink and downlink 
  54.184 -resource mapping to all registered UE. In particular, this message carries information about 
  54.185 -UEs that have been scheduled in the ul/dl, a list of assigned sub channels and the selected 
  54.186 -MCS for the transmission. 
  54.187 -The second one, instead, is used by the UE to send CQI feedbacks to the eNB.
  54.188 - 
  54.189 -
  54.190 -
  54.191 -Scope and Limitations
  54.192 -=====================
  54.193 -
  54.194 -The framework has been designed in order to support data transmission for both uplink and 
  54.195 -downlink. It is important to note that downlin and uplink transmissions are managed by the 
  54.196 -packet scheduler that works at the eNB. It decides, in fact, what UEs should be scheduled 
  54.197 -every TTI and what radio resource should be allocated to them.
  54.198 -
  54.199 -In the current implementation, the downlink transmission is administrated by the downlink 
  54.200 -packet scheduler. Furthermore, no packet scheduler for uplink transmission has been developed.
  54.201 -As a consequence, for the downlink packet are sent only after scheduling decisions; for the uplink, 
  54.202 -instead, packet are sent directly, without any scheduling decisions.
  54.203 -
  54.204 -Finally, the transmission of control messages (such as CQI feedbacks, PDCCH, etc..) is done by an 
  54.205 -ideal control channel.
  54.206 -
  54.207 -
  54.208 -Future Work
  54.209 -===========
  54.210 -
  54.211 -In the future, several LTE features will be developed in order to improve the proposed module.
  54.212 -
  54.213 -In particular, for the near future have been scheduled the following implementations:
  54.214 -
  54.215 -* a more efficient design for the RRM (Radio resource management)
  54.216 - 
  54.217 -* a complete packet scheduler (i.e., a simple round robin scheme, maximum througput and 
  54.218 -  proportional fair allocation schemes) for both downlink and uplink, in order to support 
  54.219 -  a standard compliant packet transmission 
  54.220 -
  54.221 -* ideal PDCCH control messages
  54.222 -
  54.223 -* a standard compliant RLC entity
  54.224 -
  54.225 -* PHY error model  
  54.226 -
  54.227 -
  54.228 -
  54.229 -References
  54.230 -==========
  54.231 -
  54.232 -.. [1] N. Baldo and M. Miozzo, Spectrum-aware Channel and PHY layer modeling for ns3, Proceedings 
  54.233 -       of ICST NSTools 2009, Pisa, Italy. The framework is designed to simulate only data 
  54.234 -       transmissions. For the transmission of control messages (such as CQI feedback, PDCCH, 
  54.235 -       etc..) will be used an ideal control channel). 
  54.236 -
  54.237 -.. [2] 3GPP TS 25.814 ( http://www.3gpp.org/ftp/specs/html-INFO/25814.htm ) 
  54.238 -
  54.239 -.. [3] Giuseppe Piro, Luigi Alfredo Grieco, Gennaro Boggia, and Pietro Camarda", A Two-level 
  54.240 -       Scheduling Algorithm for QoS Support in the Downlink of LTE Cellular Networks", Proc. of 
  54.241 -       European Wireless, EW2010, Lucca, Italy, Apr., 2010 ( draft version is available on 
  54.242 -       http://telematics.poliba.it/index.php?option=com_jombib&task=showbib&id=330 )
  54.243 -
  54.244 -.. [4] 3GPP R1-081483 (available on 
  54.245 -       http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip )
  54.246 -
  54.247 -
  54.248 -Usage
  54.249 -*****
  54.250 -
  54.251 -The main way that users who write simulation scripts will typically
  54.252 -interact with the LTE models is through the helper API and through
  54.253 -the publicly visible attributes of the model.
  54.254 -
  54.255 -The helper API is defined in ``src/lte/helper/lte-helper.h``. 
  54.256 -
  54.257 -The example ``src/lte/examples/`` contain some basic
  54.258 -code that shows how to set up the model in order to simualte an 
  54.259 -E-UTRAN downlink transmission.
  54.260 -
  54.261 -Examples
  54.262 -========
  54.263 -
  54.264 -``src/lte/examples/lte-device.cc`` shows how it is possible to set up the LTE module::
  54.265 -
  54.266 -  NodeContainer ueNodes;
  54.267 -  NodeContainer enbNodes;
  54.268 -  
  54.269 -  ueNodes.Create (1);
  54.270 -  enbNodes.Create (1);
  54.271 -
  54.272 -  LteHelper lte;
  54.273 -
  54.274 -  NetDeviceContainer ueDevs, enbDevs;
  54.275 -  ueDevs = lte.Install (ueNodes, LteHelper::DEVICE_TYPE_USER_EQUIPMENT);
  54.276 -  enbDevs = lte.Install (enbNodes, LteHelper::DEVICE_TYPE_ENODEB);
  54.277 -
  54.278 -
  54.279 -The helper method :cpp:func:`ns3::LteHelper::Install` creates LTE device, 
  54.280 -the DL, UL physical layer and attach the to  proper LTE channels.
  54.281 - 
  54.282 -
  54.283 -Moreover, to simulate a complete LTE system, it is necessary to define 
  54.284 -other information, as expressed in what follows:
  54.285 -
  54.286 -#. install IP protocol stack::
  54.287 -
  54.288 -    InternetStackHelper stack;
  54.289 -    stack.Install (ueNodes);
  54.290 -    stack.Install (enbNodes);
  54.291 -    Ipv4AddressHelper address;
  54.292 -    address.SetBase ("10.1.1.0", "255.255.255.0");
  54.293 -    Ipv4InterfaceContainer UEinterfaces = address.Assign (ueDevs);
  54.294 -    Ipv4InterfaceContainer ENBinterface = address.Assign (enbDevs);
  54.295 -
  54.296 -
  54.297 -#. register UE to a given eNB::
  54.298 -
  54.299 -    Ptr<EnbNetDevice> enb = enbDevs.Get (0)->GetObject<EnbNetDevice> ();
  54.300 -    Ptr<UeNetDevice> ue = ueDevs.Get (i)->GetObject<UeNetDevice> ();
  54.301 -    lte.RegisterUeToTheEnb (ue, enb);
  54.302 -
  54.303 -
  54.304 -#. create the mobility model for each device::
  54.305 -
  54.306 -    Ptr<ConstantPositionMobilityModel> enbMobility = new ConstantPositionMobilityModel ();
  54.307 -    enbMobility->SetPosition (Vector (0.0, 0.0, 0.0));
  54.308 -    lte.AddMobility (enb->GetPhy (), enbMobility);
  54.309 -
  54.310 -    Ptr<ConstantVelocityMobilityModel> ueMobility = new ConstantVelocityMobilityModel ();
  54.311 -    ueMobility->SetPosition (Vector (30.0, 0.0, 0.0));
  54.312 -    ueMobility->SetVelocity (Vector (30.0, 0.0, 0.0));
  54.313 -    lte.AddMobility (ue->GetPhy (), ueMobility);
  54.314 -
  54.315 -
  54.316 -#. define a set of sub channels to use for dl and ul transmission::
  54.317 -
  54.318 -    std::vector<int> dlSubChannels;
  54.319 -    for (int i = 0; i < 25; i++)
  54.320 -      {
  54.321 -        dlSubChannels.push_back (i);
  54.322 -      }
  54.323 -    std::vector<int> ulSubChannels;
  54.324 -    for (int i = 50; i < 100; i++)
  54.325 -      {
  54.326 -        ulSubChannels.push_back (i);
  54.327 -      }
  54.328 -
  54.329 -    enb->GetPhy ()->SetDownlinkSubChannels (dlSubChannels);
  54.330 -    enb->GetPhy ()->SetUplinkSubChannels (ulSubChannels);
  54.331 -    ue->GetPhy ()->SetDownlinkSubChannels (dlSubChannels);
  54.332 -    ue->GetPhy ()->SetUplinkSubChannels (ulSubChannels);
  54.333 -
  54.334 -
  54.335 -#. define a channel realization for the PHY model::
  54.336 -
  54.337 -    lte.AddDownlinkChannelRealization (enbMobility, ueMobility, ue->GetPhy ());
  54.338 -
  54.339 -
  54.340 -Helpers
  54.341 -=======
  54.342 -
  54.343 -Attributes
  54.344 -==========
  54.345 -
  54.346 -Tracing
  54.347 -=======
  54.348 -
  54.349 -Logging
  54.350 -=======
  54.351 -
  54.352 -Caveats
  54.353 -=======
  54.354 -
  54.355 -Validation
  54.356 -**********
  54.357 -
  54.358 -In the  ``src/lte/example/lte-amc.cc`` has been developed an important example 
  54.359 -that shows the proper functioning of both AMC module and Channel model. 
  54.360 -The analyzed scenario is composed by two nodes: a eNB and a single UE 
  54.361 -(registered to the eNB). The UE moves into the cell using the 
  54.362 -:cpp:class:`ns3::ConstantVelocityMobilityModel`, along a radial direction. 
  54.363 -The proposed example describes how the channel quality decreases as the distance 
  54.364 -between UE and eNB increases. 
  54.365 -As a conseguence,  the total bit rate (in bits per TTI) available to the UE 
  54.366 -decreases as the distance between nodes increases, as expected.
  54.367 -
  54.368 -
  54.369 -
    55.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.2 +++ b/src/lte/doc/rescale-pdf.sh	Fri May 11 16:42:40 2012 +0200
    55.3 @@ -0,0 +1,12 @@
    55.4 +#!/usr/bin/env bash
    55.5 +
    55.6 +TMPFILE=`mktemp`
    55.7 +
    55.8 +echo "\documentclass{book}
    55.9 +\usepackage{pdfpages}
   55.10 +\begin{document}
   55.11 +\includepdf[width=${1},fitpaper]{${2}}
   55.12 +\end{document}" >${TMPFILE}.tex
   55.13 +pdflatex -output-directory /tmp ${TMPFILE}.tex >/dev/null 2>/dev/null
   55.14 +cp ${TMPFILE}.pdf ${3}
   55.15 +
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/src/lte/doc/source/conf.py	Fri May 11 16:42:40 2012 +0200
    56.3 @@ -0,0 +1,218 @@
    56.4 +# -*- coding: utf-8 -*-
    56.5 +#
    56.6 +# ns-3 documentation build configuration file, created by
    56.7 +# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
    56.8 +#
    56.9 +# This file is execfile()d with the current directory set to its containing dir.
   56.10 +#
   56.11 +# Note that not all possible configuration values are present in this
   56.12 +# autogenerated file.
   56.13 +#
   56.14 +# All configuration values have a default; values that are commented out
   56.15 +# serve to show the default.
   56.16 +
   56.17 +import sys, os
   56.18 +
   56.19 +# If extensions (or modules to document with autodoc) are in another directory,
   56.20 +# add these directories to sys.path here. If the directory is relative to the
   56.21 +# documentation root, use os.path.abspath to make it absolute, like shown here.
   56.22 +#sys.path.insert(0, os.path.abspath('.'))
   56.23 +
   56.24 +# -- General configuration -----------------------------------------------------
   56.25 +
   56.26 +# If your documentation needs a minimal Sphinx version, state it here.
   56.27 +#needs_sphinx = '1.0'
   56.28 +
   56.29 +# Add any Sphinx extension module names here, as strings. They can be extensions
   56.30 +# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
   56.31 +extensions = ['sphinx.ext.pngmath']
   56.32 +
   56.33 +# Add any paths that contain templates here, relative to this directory.
   56.34 +templates_path = ['_templates']
   56.35 +
   56.36 +# The suffix of source filenames.
   56.37 +source_suffix = '.rst'
   56.38 +
   56.39 +# The encoding of source files.
   56.40 +#source_encoding = 'utf-8-sig'
   56.41 +
   56.42 +# The master toctree document.
   56.43 +master_doc = 'index'
   56.44 +
   56.45 +# General information about the project.
   56.46 +project = u'LENA'
   56.47 +copyright = u'CTTC'
   56.48 +
   56.49 +# The version info for the project you're documenting, acts as replacement for
   56.50 +# |version| and |release|, also used in various other places throughout the
   56.51 +# built documents.
   56.52 +#
   56.53 +# The short X.Y version.
   56.54 +version = 'M2'
   56.55 +# The full version, including alpha/beta/rc tags.
   56.56 +release = 'M2'
   56.57 +
   56.58 +# The language for content autogenerated by Sphinx. Refer to documentation
   56.59 +# for a list of supported languages.
   56.60 +#language = None
   56.61 +
   56.62 +# There are two options for replacing |today|: either, you set today to some
   56.63 +# non-false value, then it is used:
   56.64 +#today = ''
   56.65 +# Else, today_fmt is used as the format for a strftime call.
   56.66 +#today_fmt = '%B %d, %Y'
   56.67 +
   56.68 +# List of patterns, relative to source directory, that match files and
   56.69 +# directories to ignore when looking for source files.
   56.70 +exclude_patterns = []
   56.71 +
   56.72 +# The reST default role (used for this markup: `text`) to use for all documents.
   56.73 +#default_role = None
   56.74 +
   56.75 +# If true, '()' will be appended to :func: etc. cross-reference text.
   56.76 +#add_function_parentheses = True
   56.77 +
   56.78 +# If true, the current module name will be prepended to all description
   56.79 +# unit titles (such as .. function::).
   56.80 +#add_module_names = True
   56.81 +
   56.82 +# If true, sectionauthor and moduleauthor directives will be shown in the
   56.83 +# output. They are ignored by default.
   56.84 +#show_authors = False
   56.85 +
   56.86 +# The name of the Pygments (syntax highlighting) style to use.
   56.87 +pygments_style = 'sphinx'
   56.88 +
   56.89 +# A list of ignored prefixes for module index sorting.
   56.90 +#modindex_common_prefix = []
   56.91 +
   56.92 +
   56.93 +# -- Options for HTML output ---------------------------------------------------
   56.94 +
   56.95 +# The theme to use for HTML and HTML Help pages.  See the documentation for
   56.96 +# a list of builtin themes.
   56.97 +html_theme = 'default'
   56.98 +
   56.99 +# Theme options are theme-specific and customize the look and feel of a theme
  56.100 +# further.  For a list of options available for each theme, see the
  56.101 +# documentation.
  56.102 +#html_theme_options = {}
  56.103 +
  56.104 +# Add any paths that contain custom themes here, relative to this directory.
  56.105 +#html_theme_path = []
  56.106 +
  56.107 +# The name for this set of Sphinx documents.  If None, it defaults to
  56.108 +# "<project> v<release> documentation".
  56.109 +#html_title = None
  56.110 +
  56.111 +# A shorter title for the navigation bar.  Default is the same as html_title.
  56.112 +#html_short_title = None
  56.113 +
  56.114 +# The name of an image file (relative to this directory) to place at the top
  56.115 +# of the sidebar.
  56.116 +#html_logo = None
  56.117 +
  56.118 +# The name of an image file (within the static path) to use as favicon of the
  56.119 +# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
  56.120 +# pixels large.
  56.121 +#html_favicon = None
  56.122 +
  56.123 +# Add any paths that contain custom static files (such as style sheets) here,
  56.124 +# relative to this directory. They are copied after the builtin static files,
  56.125 +# so a file named "default.css" will overwrite the builtin "default.css".
  56.126 +#html_static_path = ['_static']
  56.127 +
  56.128 +# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
  56.129 +# using the given strftime format.
  56.130 +#html_last_updated_fmt = '%b %d, %Y'
  56.131 +
  56.132 +# If true, SmartyPants will be used to convert quotes and dashes to
  56.133 +# typographically correct entities.
  56.134 +#html_use_smartypants = True
  56.135 +
  56.136 +# Custom sidebar templates, maps document names to template names.
  56.137 +#html_sidebars = {}
  56.138 +
  56.139 +# Additional templates that should be rendered to pages, maps page names to
  56.140 +# template names.
  56.141 +#html_additional_pages = {}
  56.142 +
  56.143 +# If false, no module index is generated.
  56.144 +#html_domain_indices = True
  56.145 +
  56.146 +# If false, no index is generated.
  56.147 +#html_use_index = True
  56.148 +
  56.149 +# If true, the index is split into individual pages for each letter.
  56.150 +#html_split_index = False
  56.151 +
  56.152 +# If true, links to the reST sources are added to the pages.
  56.153 +#html_show_sourcelink = True
  56.154 +
  56.155 +# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
  56.156 +#html_show_sphinx = True
  56.157 +
  56.158 +# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
  56.159 +#html_show_copyright = True
  56.160 +
  56.161 +# If true, an OpenSearch description file will be output, and all pages will
  56.162 +# contain a <link> tag referring to it.  The value of this option must be the
  56.163 +# base URL from which the finished HTML is served.
  56.164 +#html_use_opensearch = ''
  56.165 +
  56.166 +# This is the file name suffix for HTML files (e.g. ".xhtml").
  56.167 +#html_file_suffix = None
  56.168 +
  56.169 +# Output file base name for HTML help builder.
  56.170 +#htmlhelp_basename = 'ns-3doc'
  56.171 +
  56.172 +
  56.173 +# -- Options for LaTeX output --------------------------------------------------
  56.174 +
  56.175 +# The paper size ('letter' or 'a4').
  56.176 +#latex_paper_size = 'letter'
  56.177 +
  56.178 +# The font size ('10pt', '11pt' or '12pt').
  56.179 +#latex_font_size = '10pt'
  56.180 +
  56.181 +# Grouping the document tree into LaTeX files. List of tuples
  56.182 +# (source start file, target name, title, author, documentclass [howto/manual]).
  56.183 +latex_documents = [
  56.184 +#  ('lte-testing', 'lte-doc-testing.tex', u'LTE Simulator Testing Documentation', u'Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)', 'manual'),
  56.185 +#  ('lte-design', 'lte-doc-design.tex', u'LTE Simulator Design Documentation', u'Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)', 'manual'),
  56.186 +#  ('lte-user', 'lte-doc-user.tex', u'LTE Simulator User Documentation', u'Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)', 'manual'),
  56.187 +  ('lte', 'lte-sim-doc.tex', u'LTE Simulator Documentation', u'Centre Tecnològic de Telecomunicacions de Catalunya (CTTC)', 'manual'),
  56.188 +]
  56.189 +
  56.190 +# The name of an image file (relative to this directory) to place at the top of
  56.191 +# the title page.
  56.192 +#latex_logo = None
  56.193 +
  56.194 +# For "manual" documents, if this is true, then toplevel headings are parts,
  56.195 +# not chapters.
  56.196 +#latex_use_parts = False
  56.197 +
  56.198 +# If true, show page references after internal links.
  56.199 +#latex_show_pagerefs = False
  56.200 +
  56.201 +# If true, show URL addresses after external links.
  56.202 +#latex_show_urls = False
  56.203 +
  56.204 +# Additional stuff for the LaTeX preamble.
  56.205 +#latex_preamble = ''
  56.206 +
  56.207 +# Documents to append as an appendix to all manuals.
  56.208 +#latex_appendices = []
  56.209 +
  56.210 +# If false, no module index is generated.
  56.211 +#latex_domain_indices = True
  56.212 +
  56.213 +
  56.214 +# -- Options for manual page output --------------------------------------------
  56.215 +
  56.216 +# One entry per manual page. List of tuples
  56.217 +# (source start file, name, description, authors, manual section).
  56.218 +man_pages = [
  56.219 +    ('index', 'ns-3-model-library', u'ns-3 Model Library',
  56.220 +     [u'ns-3 project'], 1)
  56.221 +]
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/src/lte/doc/source/figures/MCS_12_test.eps	Fri May 11 16:42:40 2012 +0200
    57.3 @@ -0,0 +1,1511 @@
    57.4 +%!PS-Adobe-2.0 EPSF-2.0
    57.5 +%%Title: /home/mmiozzo/ns3/lena/ns-3-lena-pem/src/lte/doc/source/figures/MCS_12_test.fig
    57.6 +%%Creator: fig2dev Version 3.2 Patchlevel 5a
    57.7 +%%CreationDate: Tue Jan 10 17:47:39 2012
    57.8 +%%BoundingBox: 0 0 1095 718
    57.9 +%Magnification: 1.0000
   57.10 +%%EndComments
   57.11 +%%BeginProlog
   57.12 +/$F2psDict 200 dict def
   57.13 +$F2psDict begin
   57.14 +$F2psDict /mtrx matrix put
   57.15 +/col-1 {0 setgray} bind def
   57.16 +/col0 {0.000 0.000 0.000 srgb} bind def
   57.17 +/col1 {0.000 0.000 1.000 srgb} bind def
   57.18 +/col2 {0.000 1.000 0.000 srgb} bind def
   57.19 +/col3 {0.000 1.000 1.000 srgb} bind def
   57.20 +/col4 {1.000 0.000 0.000 srgb} bind def
   57.21 +/col5 {1.000 0.000 1.000 srgb} bind def
   57.22 +/col6 {1.000 1.000 0.000 srgb} bind def
   57.23 +/col7 {1.000 1.000 1.000 srgb} bind def
   57.24 +/col8 {0.000 0.000 0.560 srgb} bind def
   57.25 +/col9 {0.000 0.000 0.690 srgb} bind def
   57.26 +/col10 {0.000 0.000 0.820 srgb} bind def
   57.27 +/col11 {0.530 0.810 1.000 srgb} bind def
   57.28 +/col12 {0.000 0.560 0.000 srgb} bind def
   57.29 +/col13 {0.000 0.690 0.000 srgb} bind def
   57.30 +/col14 {0.000 0.820 0.000 srgb} bind def
   57.31 +/col15 {0.000 0.560 0.560 srgb} bind def
   57.32 +/col16 {0.000 0.690 0.690 srgb} bind def
   57.33 +/col17 {0.000 0.820 0.820 srgb} bind def
   57.34 +/col18 {0.560 0.000 0.000 srgb} bind def
   57.35 +/col19 {0.690 0.000 0.000 srgb} bind def
   57.36 +/col20 {0.820 0.000 0.000 srgb} bind def
   57.37 +/col21 {0.560 0.000 0.560 srgb} bind def
   57.38 +/col22 {0.690 0.000 0.690 srgb} bind def
   57.39 +/col23 {0.820 0.000 0.820 srgb} bind def
   57.40 +/col24 {0.500 0.190 0.000 srgb} bind def
   57.41 +/col25 {0.630 0.250 0.000 srgb} bind def
   57.42 +/col26 {0.750 0.380 0.000 srgb} bind def
   57.43 +/col27 {1.000 0.500 0.500 srgb} bind def
   57.44 +/col28 {1.000 0.630 0.630 srgb} bind def
   57.45 +/col29 {1.000 0.750 0.750 srgb} bind def
   57.46 +/col30 {1.000 0.880 0.880 srgb} bind def
   57.47 +/col31 {1.000 0.840 0.000 srgb} bind def
   57.48 +
   57.49 +end
   57.50 +
   57.51 +/cp {closepath} bind def
   57.52 +/ef {eofill} bind def
   57.53 +/gr {grestore} bind def
   57.54 +/gs {gsave} bind def
   57.55 +/sa {save} bind def
   57.56 +/rs {restore} bind def
   57.57 +/l {lineto} bind def
   57.58 +/m {moveto} bind def
   57.59 +/rm {rmoveto} bind def
   57.60 +/n {newpath} bind def
   57.61 +/s {stroke} bind def
   57.62 +/sh {show} bind def
   57.63 +/slc {setlinecap} bind def
   57.64 +/slj {setlinejoin} bind def
   57.65 +/slw {setlinewidth} bind def
   57.66 +/srgb {setrgbcolor} bind def
   57.67 +/rot {rotate} bind def
   57.68 +/sc {scale} bind def
   57.69 +/sd {setdash} bind def
   57.70 +/ff {findfont} bind def
   57.71 +/sf {setfont} bind def
   57.72 +/scf {scalefont} bind def
   57.73 +/sw {stringwidth} bind def
   57.74 +/tr {translate} bind def
   57.75 +/tnt {dup dup currentrgbcolor
   57.76 +  4 -2 roll dup 1 exch sub 3 -1 roll mul add
   57.77 +  4 -2 roll dup 1 exch sub 3 -1 roll mul add
   57.78 +  4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
   57.79 +  bind def
   57.80 +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
   57.81 +  4 -2 roll mul srgb} bind def
   57.82 + /DrawEllipse {
   57.83 +	/endangle exch def
   57.84 +	/startangle exch def
   57.85 +	/yrad exch def
   57.86 +	/xrad exch def
   57.87 +	/y exch def
   57.88 +	/x exch def
   57.89 +	/savematrix mtrx currentmatrix def
   57.90 +	x y tr xrad yrad sc 0 0 1 startangle endangle arc
   57.91 +	closepath
   57.92 +	savematrix setmatrix
   57.93 +	} def
   57.94 +
   57.95 +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
   57.96 +/$F2psEnd {$F2psEnteredState restore end} def
   57.97 +
   57.98 +/pageheader {
   57.99 +save
  57.100 +newpath 0 718 moveto 0 0 lineto 1095 0 lineto 1095 718 lineto closepath clip newpath
  57.101 +-2.8 748.3 translate
  57.102 +1 -1 scale
  57.103 +$F2psBegin
  57.104 +10 setmiterlimit
  57.105 +0 slj 0 slc
  57.106 + 0.06299 0.06299 sc
  57.107 +} bind def
  57.108 +/pagefooter {
  57.109 +$F2psEnd
  57.110 +restore
  57.111 +} bind def
  57.112 +%%EndProlog
  57.113 +pageheader
  57.114 +%
  57.115 +% Fig objects follow
  57.116 +%
  57.117 +% 
  57.118 +% here starts figure with depth 51
  57.119 +% Polyline
  57.120 +%
  57.121 +% pen to black in case this eps object doesn't set color first
  57.122 +0 0 0 setrgbcolor
  57.123 +% Begin Imported EPS File: /home/mmiozzo/ns3/lena/ns-3-lena-pem/src/lte/doc/source/figures/MCS_12.eps
  57.124 +%%BeginDocument: /home/mmiozzo/ns3/lena/ns-3-lena-pem/src/lte/doc/source/figures/MCS_12.eps
  57.125 +%
  57.126 +n gs
  57.127 +45 495 tr
  57.128 +17.335329 -18.100159 sc
  57.129 +0 -629 tr
  57.130 +203 -106 tr
  57.131 +sa
  57.132 +n -203 106 m 799 106 l 799 735 l -203 735 l cp clip n
  57.133 +countdictstack
  57.134 +mark
  57.135 +/showpage {} def
  57.136 +% EPS file follows:
  57.137 +%!PS-Adobe-3.0 EPSF-3.0
  57.138 +%%Creator: MATLAB, The Mathworks, Inc. Version 7.8.0.347 (R2009a). Operating System: Microsoft Windows XP.
  57.139 +%%Title: C:\Documents and Settings\Marco Miozzo\My Documents\MATLAB\Final\MCS_27_allTBsizes\MCS_12.eps
  57.140 +%%CreationDate: 01/10/2012  17:32:09
  57.141 +%%DocumentNeededFonts: Helvetica
  57.142 +%%DocumentProcessColors: Cyan Magenta Yellow Black
  57.143 +%%LanguageLevel: 2
  57.144 +%%Pages: 1
  57.145 +%%BoundingBox:  -203   106   799   735
  57.146 +%%EndComments
  57.147 +
  57.148 +%%BeginProlog
  57.149 +% MathWorks dictionary
  57.150 +/MathWorks 160 dict begin
  57.151 +% definition operators
  57.152 +/bdef {bind def} bind def
  57.153 +/ldef {load def} bind def
  57.154 +/xdef {exch def} bdef
  57.155 +/xstore {exch store} bdef
  57.156 +% operator abbreviations
  57.157 +/c  /clip ldef
  57.158 +/cc /concat ldef
  57.159 +/cp /closepath ldef
  57.160 +/gr /grestore ldef
  57.161 +/gs /gsave ldef
  57.162 +/mt /moveto ldef
  57.163 +/np /newpath ldef
  57.164 +/cm /currentmatrix ldef
  57.165 +/sm /setmatrix ldef
  57.166 +/rm /rmoveto ldef
  57.167 +/rl /rlineto ldef
  57.168 +/s {show newpath} bdef
  57.169 +/sc {setcmykcolor} bdef
  57.170 +/sr /setrgbcolor ldef
  57.171 +/sg /setgray ldef
  57.172 +/w /setlinewidth ldef
  57.173 +/j /setlinejoin ldef
  57.174 +/cap /setlinecap ldef
  57.175 +/rc {rectclip} bdef
  57.176 +/rf {rectfill} bdef
  57.177 +% page state control
  57.178 +/pgsv () def
  57.179 +/bpage {/pgsv save def} bdef
  57.180 +/epage {pgsv restore} bdef
  57.181 +/bplot /gsave ldef
  57.182 +/eplot {stroke grestore} bdef
  57.183 +% orientation switch
  57.184 +/portraitMode 0 def /landscapeMode 1 def /rotateMode 2 def
  57.185 +% coordinate system mappings
  57.186 +/dpi2point 0 def
  57.187 +% font control
  57.188 +/FontSize 0 def
  57.189 +/FMS {/FontSize xstore findfont [FontSize 0 0 FontSize neg 0 0]
  57.190 +  makefont setfont} bdef
  57.191 +/ISOLatin1Encoding where {pop /WindowsLatin1Encoding 256 array bdef
  57.192 +ISOLatin1Encoding WindowsLatin1Encoding copy pop
  57.193 +/.notdef/.notdef/quotesinglbase/florin/quotedblbase/ellipsis/dagger
  57.194 +/daggerdbl/circumflex/perthousand/Scaron/guilsinglleft/OE/.notdef/.notdef
  57.195 +/.notdef/.notdef/quoteleft/quoteright/quotedblleft/quotedblright/bullet
  57.196 +/endash/emdash/tilde/trademark/scaron/guilsinglright/oe/.notdef/.notdef
  57.197 +/Ydieresis WindowsLatin1Encoding 128 32 getinterval astore pop}
  57.198 +{/WindowsLatin1Encoding StandardEncoding bdef} ifelse
  57.199 +/reencode {exch dup where {pop load} {pop StandardEncoding} ifelse
  57.200 +  exch dup 3 1 roll findfont dup length dict begin
  57.201 +  { 1 index /FID ne {def}{pop pop} ifelse } forall
  57.202 +  /Encoding exch def currentdict end definefont pop} bdef
  57.203 +/isroman {findfont /CharStrings get /Agrave known} bdef
  57.204 +/FMSR {3 1 roll 1 index dup isroman {reencode} {pop pop} ifelse
  57.205 +  exch FMS} bdef
  57.206 +/csm {1 dpi2point div -1 dpi2point div scale neg translate
  57.207 + dup landscapeMode eq {pop -90 rotate}
  57.208 +  {rotateMode eq {90 rotate} if} ifelse} bdef
  57.209 +% line types: solid, dotted, dashed, dotdash
  57.210 +/SO { [] 0 setdash } bdef
  57.211 +/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
  57.212 +/DA { [6 dpi2point mul] 0 setdash } bdef
  57.213 +/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4
  57.214 +  dpi2point mul] 0 setdash } bdef
  57.215 +% macros for lines and objects
  57.216 +/L {lineto stroke} bdef
  57.217 +/MP {3 1 roll moveto 1 sub {rlineto} repeat} bdef
  57.218 +/AP {{rlineto} repeat} bdef
  57.219 +/PDlw -1 def
  57.220 +/W {/PDlw currentlinewidth def setlinewidth} def
  57.221 +/PP {closepath eofill} bdef
  57.222 +/DP {closepath stroke} bdef
  57.223 +/MR {4 -2 roll moveto dup  0 exch rlineto exch 0 rlineto
  57.224 +  neg 0 exch rlineto closepath} bdef
  57.225 +/FR {MR stroke} bdef
  57.226 +/PR {MR fill} bdef
  57.227 +/L1i {{currentfile picstr readhexstring pop} image} bdef
  57.228 +/tMatrix matrix def
  57.229 +/MakeOval {newpath tMatrix currentmatrix pop translate scale
  57.230 +0 0 1 0 360 arc tMatrix setmatrix} bdef
  57.231 +/FO {MakeOval stroke} bdef
  57.232 +/PO {MakeOval fill} bdef
  57.233 +/PD {currentlinewidth 2 div 0 360 arc fill
  57.234 +   PDlw -1 eq not {PDlw w /PDlw -1 def} if} def
  57.235 +/FA {newpath tMatrix currentmatrix pop translate scale
  57.236 +  0 0 1 5 -2 roll arc tMatrix setmatrix stroke} bdef
  57.237 +/PA {newpath tMatrix currentmatrix pop	translate 0 0 moveto scale
  57.238 +  0 0 1 5 -2 roll arc closepath tMatrix setmatrix fill} bdef
  57.239 +/FAn {newpath tMatrix currentmatrix pop translate scale
  57.240 +  0 0 1 5 -2 roll arcn tMatrix setmatrix stroke} bdef
  57.241 +/PAn {newpath tMatrix currentmatrix pop translate 0 0 moveto scale
  57.242 +  0 0 1 5 -2 roll arcn closepath tMatrix setmatrix fill} bdef
  57.243 +/vradius 0 def /hradius 0 def /lry 0 def
  57.244 +/lrx 0 def /uly 0 def /ulx 0 def /rad 0 def
  57.245 +/MRR {/vradius xdef /hradius xdef /lry xdef /lrx xdef /uly xdef
  57.246 +  /ulx xdef newpath tMatrix currentmatrix pop ulx hradius add uly
  57.247 +  vradius add translate hradius vradius scale 0 0 1 180 270 arc 
  57.248 +  tMatrix setmatrix lrx hradius sub uly vradius add translate
  57.249 +  hradius vradius scale 0 0 1 270 360 arc tMatrix setmatrix
  57.250 +  lrx hradius sub lry vradius sub translate hradius vradius scale
  57.251 +  0 0 1 0 90 arc tMatrix setmatrix ulx hradius add lry vradius sub
  57.252 +  translate hradius vradius scale 0 0 1 90 180 arc tMatrix setmatrix
  57.253 +  closepath} bdef
  57.254 +/FRR {MRR stroke } bdef
  57.255 +/PRR {MRR fill } bdef
  57.256 +/MlrRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lry uly sub 2 div def
  57.257 +  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
  57.258 +  rad rad scale 0 0 1 90 270 arc tMatrix setmatrix lrx rad sub lry rad
  57.259 +  sub translate rad rad scale 0 0 1 270 90 arc tMatrix setmatrix
  57.260 +  closepath} bdef
  57.261 +/FlrRR {MlrRR stroke } bdef
  57.262 +/PlrRR {MlrRR fill } bdef
  57.263 +/MtbRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lrx ulx sub 2 div def
  57.264 +  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
  57.265 +  rad rad scale 0 0 1 180 360 arc tMatrix setmatrix lrx rad sub lry rad
  57.266 +  sub translate rad rad scale 0 0 1 0 180 arc tMatrix setmatrix
  57.267 +  closepath} bdef
  57.268 +/FtbRR {MtbRR stroke } bdef
  57.269 +/PtbRR {MtbRR fill } bdef
  57.270 +/stri 6 array def /dtri 6 array def
  57.271 +/smat 6 array def /dmat 6 array def
  57.272 +/tmat1 6 array def /tmat2 6 array def /dif 3 array def
  57.273 +/asub {/ind2 exch def /ind1 exch def dup dup
  57.274 +  ind1 get exch ind2 get sub exch } bdef
  57.275 +/tri_to_matrix {
  57.276 +  2 0 asub 3 1 asub 4 0 asub 5 1 asub
  57.277 +  dup 0 get exch 1 get 7 -1 roll astore } bdef
  57.278 +/compute_transform {
  57.279 +  dmat dtri tri_to_matrix tmat1 invertmatrix 
  57.280 +  smat stri tri_to_matrix tmat2 concatmatrix } bdef
  57.281 +/ds {stri astore pop} bdef
  57.282 +/dt {dtri astore pop} bdef
  57.283 +/db {2 copy /cols xdef /rows xdef mul dup 3 mul string
  57.284 +  currentfile 
  57.285 +  3 index 0 eq {/ASCIIHexDecode filter}
  57.286 +  {/ASCII85Decode filter 3 index 2 eq {/RunLengthDecode filter} if }
  57.287 +  ifelse exch readstring pop
  57.288 +  dup 0 3 index getinterval /rbmap xdef
  57.289 +  dup 2 index dup getinterval /gbmap xdef
  57.290 +  1 index dup 2 mul exch getinterval /bbmap xdef pop pop}bdef
  57.291 +/it {gs np dtri aload pop moveto lineto lineto cp c
  57.292 +  cols rows 8 compute_transform 
  57.293 +  rbmap gbmap bbmap true 3 colorimage gr}bdef
  57.294 +/il {newpath moveto lineto stroke}bdef
  57.295 +currentdict end def
  57.296 +%%EndProlog
  57.297 +
  57.298 +%%BeginSetup
  57.299 +MathWorks begin
  57.300 +
  57.301 +0 cap
  57.302 +
  57.303 +end
  57.304 +%%EndSetup
  57.305 +
  57.306 +%%Page: 1 1
  57.307 +%%BeginPageSetup
  57.308 +%%PageBoundingBox:  -203   106   799   735
  57.309 +MathWorks begin
  57.310 +bpage
  57.311 +%%EndPageSetup
  57.312 +
  57.313 +%%BeginObject: obj1
  57.314 +bplot
  57.315 +
  57.316 +/dpi2point 12 def
  57.317 +portraitMode -2436 8820 csm
  57.318 +
  57.319 +    0     0 12034  7546 rc
  57.320 +85 dict begin %Colortable dictionary
  57.321 +/c0 { 0.000000 0.000000 0.000000 sr} bdef
  57.322 +/c1 { 1.000000 1.000000 1.000000 sr} bdef
  57.323 +/c2 { 0.900000 0.000000 0.000000 sr} bdef
  57.324 +/c3 { 0.000000 0.820000 0.000000 sr} bdef
  57.325 +/c4 { 0.000000 0.000000 0.800000 sr} bdef
  57.326 +/c5 { 0.910000 0.820000 0.320000 sr} bdef
  57.327 +/c6 { 1.000000 0.260000 0.820000 sr} bdef
  57.328 +/c7 { 0.000000 0.820000 0.820000 sr} bdef
  57.329 +c0
  57.330 +1 j
  57.331 +1 sg
  57.332 +   0    0 12035 7547 rf
  57.333 +6 w
  57.334 +0 6150 9327 0 0 -6150 1564 6716 4 MP
  57.335 +PP
  57.336 +-9327 0 0 6150 9327 0 0 -6150 1564 6716 5 MP stroke
  57.337 +4 w
  57.338 +DO
  57.339 +0 sg
  57.340 +1564 6716 mt 1564  566 L
  57.341 +1564  566 mt 1564  566 L
  57.342 +2729 6716 mt 2729  566 L
  57.343 +2729  566 mt 2729  566 L
  57.344 +3895 6716 mt 3895  566 L
  57.345 +3895  566 mt 3895  566 L
  57.346 +5061 6716 mt 5061  566 L
  57.347 +5061  566 mt 5061  566 L
  57.348 +6227 6716 mt 6227  566 L
  57.349 +6227  566 mt 6227  566 L
  57.350 +7393 6716 mt 7393  566 L
  57.351 +7393  566 mt 7393  566 L
  57.352 +8559 6716 mt 8559  566 L
  57.353 +8559  566 mt 8559  566 L
  57.354 +9725 6716 mt 9725  566 L
  57.355 +9725  566 mt 9725  566 L
  57.356 +10891 6716 mt 10891  566 L
  57.357 +10891  566 mt 10891  566 L
  57.358 +1564 6716 mt 10891 6716 L
  57.359 +10891 6716 mt 10891 6716 L
  57.360 +1564 5178 mt 10891 5178 L
  57.361 +10891 5178 mt 10891 5178 L
  57.362 +1564 3641 mt 10891 3641 L
  57.363 +10891 3641 mt 10891 3641 L
  57.364 +1564 2103 mt 10891 2103 L
  57.365 +10891 2103 mt 10891 2103 L
  57.366 +1564  566 mt 10891  566 L
  57.367 +10891  566 mt 10891  566 L
  57.368 +SO
  57.369 +6 w
  57.370 +1564  566 mt 10891  566 L
  57.371 +1564 6716 mt 10891 6716 L
  57.372 +10891 6716 mt 10891  566 L
  57.373 +1564 6716 mt 1564  566 L
  57.374 +1564 6716 mt 10891 6716 L
  57.375 +1564 6716 mt 1564  566 L
  57.376 +1564 6716 mt 1564 6622 L
  57.377 +1564  566 mt 1564  659 L
  57.378 +%%IncludeResource: font Helvetica
  57.379 +/Helvetica /WindowsLatin1Encoding 120 FMSR
  57.380 +
  57.381 +1531 6861 mt 
  57.382 +(4) s
  57.383 +2729 6716 mt 2729 6622 L
  57.384 +2729  566 mt 2729  659 L
  57.385 +2646 6861 mt 
  57.386 +(4.5) s
  57.387 +3895 6716 mt 3895 6622 L
  57.388 +3895  566 mt 3895  659 L
  57.389 +3862 6861 mt 
  57.390 +(5) s
  57.391 +5061 6716 mt 5061 6622 L
  57.392 +5061  566 mt 5061  659 L
  57.393 +4978 6861 mt 
  57.394 +(5.5) s
  57.395 +6227 6716 mt 6227 6622 L
  57.396 +6227  566 mt 6227  659 L
  57.397 +6194 6861 mt 
  57.398 +(6) s
  57.399 +7393 6716 mt 7393 6622 L
  57.400 +7393  566 mt 7393  659 L
  57.401 +7310 6861 mt 
  57.402 +(6.5) s
  57.403 +8559 6716 mt 8559 6622 L
  57.404 +8559  566 mt 8559  659 L
  57.405 +8526 6861 mt 
  57.406 +(7) s
  57.407 +9725 6716 mt 9725 6622 L
  57.408 +9725  566 mt 9725  659 L
  57.409 +9642 6861 mt 
  57.410 +(7.5) s
  57.411 +10891 6716 mt 10891 6622 L
  57.412 +10891  566 mt 10891  659 L
  57.413 +10858 6861 mt 
  57.414 +(8) s
  57.415 +1564 6716 mt 1610 6716 L
  57.416 +10891 6716 mt 10844 6716 L
  57.417 +DO
  57.418 +1564 6716 mt 10891 6716 L
  57.419 +10891 6716 mt 10891 6716 L
  57.420 +SO
  57.421 +1564 6716 mt 1657 6716 L
  57.422 +10891 6716 mt 10797 6716 L
  57.423 +1305 6760 mt 
  57.424 +(10) s
  57.425 +%%IncludeResource: font Helvetica
  57.426 +/Helvetica /WindowsLatin1Encoding 80 FMSR
  57.427 +
  57.428 +1438 6686 mt 
  57.429 +(-4) s
  57.430 +1564 6253 mt 1610 6253 L
  57.431 +10891 6253 mt 10844 6253 L
  57.432 +DO
  57.433 +1564 6253 mt 10891 6253 L
  57.434 +10891 6253 mt 10891 6253 L
  57.435 +SO
  57.436 +1564 5982 mt 1610 5982 L
  57.437 +10891 5982 mt 10844 5982 L
  57.438 +DO
  57.439 +1564 5982 mt 10891 5982 L
  57.440 +10891 5982 mt 10891 5982 L
  57.441 +SO
  57.442 +1564 5790 mt 1610 5790 L
  57.443 +10891 5790 mt 10844 5790 L
  57.444 +DO
  57.445 +1564 5790 mt 10891 5790 L
  57.446 +10891 5790 mt 10891 5790 L
  57.447 +SO
  57.448 +1564 5641 mt 1610 5641 L
  57.449 +10891 5641 mt 10844 5641 L
  57.450 +DO
  57.451 +1564 5641 mt 10891 5641 L
  57.452 +10891 5641 mt 10891 5641 L
  57.453 +SO
  57.454 +1564 5519 mt 1610 5519 L
  57.455 +10891 5519 mt 10844 5519 L
  57.456 +DO
  57.457 +1564 5519 mt 10891 5519 L
  57.458 +10891 5519 mt 10891 5519 L
  57.459 +SO
  57.460 +1564 5416 mt 1610 5416 L
  57.461 +10891 5416 mt 10844 5416 L
  57.462 +DO
  57.463 +1564 5416 mt 10891 5416 L
  57.464 +10891 5416 mt 10891 5416 L
  57.465 +SO
  57.466 +1564 5327 mt 1610 5327 L
  57.467 +10891 5327 mt 10844 5327 L
  57.468 +DO
  57.469 +1564 5327 mt 10891 5327 L
  57.470 +10891 5327 mt 10891 5327 L
  57.471 +SO
  57.472 +1564 5248 mt 1610 5248 L
  57.473 +10891 5248 mt 10844 5248 L
  57.474 +DO
  57.475 +1564 5248 mt 10891 5248 L
  57.476 +10891 5248 mt 10891 5248 L
  57.477 +SO
  57.478 +1564 5178 mt 1610 5178 L
  57.479 +10891 5178 mt 10844 5178 L
  57.480 +DO
  57.481 +1564 5178 mt 10891 5178 L
  57.482 +10891 5178 mt 10891 5178 L
  57.483 +SO
  57.484 +1564 5178 mt 1657 5178 L
  57.485 +10891 5178 mt 10797 5178 L
  57.486 +%%IncludeResource: font Helvetica
  57.487 +/Helvetica /WindowsLatin1Encoding 120 FMSR
  57.488 +
  57.489 +1305 5222 mt 
  57.490 +(10) s
  57.491 +%%IncludeResource: font Helvetica
  57.492 +/Helvetica /WindowsLatin1Encoding 80 FMSR
  57.493 +
  57.494 +1438 5148 mt 
  57.495 +(-3) s
  57.496 +1564 4715 mt 1610 4715 L
  57.497 +10891 4715 mt 10844 4715 L
  57.498 +DO
  57.499 +1564 4715 mt 10891 4715 L
  57.500 +10891 4715 mt 10891 4715 L
  57.501 +SO
  57.502 +1564 4444 mt 1610 4444 L
  57.503 +10891 4444 mt 10844 4444 L
  57.504 +DO
  57.505 +1564 4444 mt 10891 4444 L
  57.506 +10891 4444 mt 10891 4444 L
  57.507 +SO
  57.508 +1564 4252 mt 1610 4252 L
  57.509 +10891 4252 mt 10844 4252 L
  57.510 +DO
  57.511 +1564 4252 mt 10891 4252 L
  57.512 +10891 4252 mt 10891 4252 L
  57.513 +SO
  57.514 +1564 4103 mt 1610 4103 L
  57.515 +10891 4103 mt 10844 4103 L
  57.516 +DO
  57.517 +1564 4103 mt 10891 4103 L
  57.518 +10891 4103 mt 10891 4103 L
  57.519 +SO
  57.520 +1564 3982 mt 1610 3982 L
  57.521 +10891 3982 mt 10844 3982 L
  57.522 +DO
  57.523 +1564 3982 mt 10891 3982 L
  57.524 +10891 3982 mt 10891 3982 L
  57.525 +SO
  57.526 +1564 3879 mt 1610 3879 L
  57.527 +10891 3879 mt 10844 3879 L
  57.528 +DO
  57.529 +1564 3879 mt 10891 3879 L
  57.530 +10891 3879 mt 10891 3879 L
  57.531 +SO
  57.532 +1564 3789 mt 1610 3789 L
  57.533 +10891 3789 mt 10844 3789 L
  57.534 +DO
  57.535 +1564 3789 mt 10891 3789 L
  57.536 +10891 3789 mt 10891 3789 L
  57.537 +SO
  57.538 +1564 3711 mt 1610 3711 L
  57.539 +10891 3711 mt 10844 3711 L
  57.540 +DO
  57.541 +1564 3711 mt 10891 3711 L
  57.542 +10891 3711 mt 10891 3711 L
  57.543 +SO
  57.544 +1564 3641 mt 1610 3641 L
  57.545 +10891 3641 mt 10844 3641 L
  57.546 +DO
  57.547 +1564 3641 mt 10891 3641 L
  57.548 +10891 3641 mt 10891 3641 L
  57.549 +SO
  57.550 +1564 3641 mt 1657 3641 L
  57.551 +10891 3641 mt 10797 3641 L
  57.552 +%%IncludeResource: font Helvetica
  57.553 +/Helvetica /WindowsLatin1Encoding 120 FMSR
  57.554 +
  57.555 +1305 3685 mt 
  57.556 +(10) s
  57.557 +%%IncludeResource: font Helvetica
  57.558 +/Helvetica /WindowsLatin1Encoding 80 FMSR
  57.559 +
  57.560 +1438 3611 mt 
  57.561 +(-2) s
  57.562 +1564 3178 mt 1610 3178 L
  57.563 +10891 3178 mt 10844 3178 L
  57.564 +DO
  57.565 +1564 3178 mt 10891 3178 L
  57.566 +10891 3178 mt 10891 3178 L
  57.567 +SO
  57.568 +1564 2907 mt 1610 2907 L
  57.569 +10891 2907 mt 10844 2907 L
  57.570 +DO
  57.571 +1564 2907 mt 10891 2907 L
  57.572 +10891 2907 mt 10891 2907 L
  57.573 +SO
  57.574 +1564 2715 mt 1610 2715 L
  57.575 +10891 2715 mt 10844 2715 L
  57.576 +DO
  57.577 +1564 2715 mt 10891 2715 L
  57.578 +10891 2715 mt 10891 2715 L
  57.579 +SO
  57.580 +1564 2566 mt 1610 2566 L
  57.581 +10891 2566 mt 10844 2566 L
  57.582 +DO
  57.583 +1564 2566 mt 10891 2566 L
  57.584 +10891 2566 mt 10891 2566 L
  57.585 +SO
  57.586 +1564 2444 mt 1610 2444 L
  57.587 +10891 2444 mt 10844 2444 L
  57.588 +DO
  57.589 +1564 2444 mt 10891 2444 L
  57.590 +10891 2444 mt 10891 2444 L
  57.591 +SO
  57.592 +1564 2341 mt 1610 2341 L
  57.593 +10891 2341 mt 10844 2341 L
  57.594 +DO
  57.595 +1564 2341 mt 10891 2341 L
  57.596 +10891 2341 mt 10891 2341 L
  57.597 +SO
  57.598 +1564 2252 mt 1610 2252 L
  57.599 +10891 2252 mt 10844 2252 L
  57.600 +DO
  57.601 +1564 2252 mt 10891 2252 L
  57.602 +10891 2252 mt 10891 2252 L
  57.603 +SO
  57.604 +1564 2173 mt 1610 2173 L
  57.605 +10891 2173 mt 10844 2173 L
  57.606 +DO
  57.607 +1564 2173 mt 10891 2173 L
  57.608 +10891 2173 mt 10891 2173 L
  57.609 +SO
  57.610 +1564 2103 mt 1610 2103 L
  57.611 +10891 2103 mt 10844 2103 L
  57.612 +DO
  57.613 +1564 2103 mt 10891 2103 L
  57.614 +10891 2103 mt 10891 2103 L
  57.615 +SO
  57.616 +1564 2103 mt 1657 2103 L
  57.617 +10891 2103 mt 10797 2103 L
  57.618 +%%IncludeResource: font Helvetica
  57.619 +/Helvetica /WindowsLatin1Encoding 120 FMSR
  57.620 +
  57.621 +1305 2147 mt 
  57.622 +(10) s
  57.623 +%%IncludeResource: font Helvetica
  57.624 +/Helvetica /WindowsLatin1Encoding 80 FMSR
  57.625 +
  57.626 +1438 2073 mt 
  57.627 +(-1) s
  57.628 +1564 1640 mt 1610 1640 L
  57.629 +10891 1640 mt 10844 1640 L
  57.630 +DO
  57.631 +1564 1640 mt 10891 1640 L
  57.632 +10891 1640 mt 10891 1640 L
  57.633 +SO
  57.634 +1564 1369 mt 1610 1369 L
  57.635 +10891 1369 mt 10844 1369 L
  57.636 +DO
  57.637 +1564 1369 mt 10891 1369 L
  57.638 +10891 1369 mt 10891 1369 L
  57.639 +SO
  57.640 +1564 1177 mt 1610 1177 L
  57.641 +10891 1177 mt 10844 1177 L
  57.642 +DO
  57.643 +1564 1177 mt 10891 1177 L
  57.644 +10891 1177 mt 10891 1177 L
  57.645 +SO
  57.646 +1564 1028 mt 1610 1028 L
  57.647 +10891 1028 mt 10844 1028 L
  57.648 +DO
  57.649 +1564 1028 mt 10891 1028 L
  57.650 +10891 1028 mt 10891 1028 L
  57.651 +SO
  57.652 +1564  907 mt 1610  907 L
  57.653 +10891  907 mt 10844  907 L
  57.654 +DO
  57.655 +1564  907 mt 10891  907 L
  57.656 +10891  907 mt 10891  907 L
  57.657 +SO
  57.658 +1564  804 mt 1610  804 L
  57.659 +10891  804 mt 10844  804 L
  57.660 +DO
  57.661 +1564  804 mt 10891  804 L
  57.662 +10891  804 mt 10891  804 L
  57.663 +SO
  57.664 +1564  714 mt 1610  714 L
  57.665 +10891  714 mt 10844  714 L
  57.666 +DO
  57.667 +1564  714 mt 10891  714 L
  57.668 +10891  714 mt 10891  714 L
  57.669 +SO
  57.670 +1564  636 mt 1610  636 L
  57.671 +10891  636 mt 10844  636 L
  57.672 +DO
  57.673 +1564  636 mt 10891  636 L
  57.674 +10891  636 mt 10891  636 L
  57.675 +SO
  57.676 +1564  566 mt 1610  566 L
  57.677 +10891  566 mt 10844  566 L
  57.678 +DO
  57.679 +1564  566 mt 10891  566 L
  57.680 +10891  566 mt 10891  566 L
  57.681 +SO
  57.682 +1564  566 mt 1657  566 L
  57.683 +10891  566 mt 10797  566 L
  57.684 +%%IncludeResource: font Helvetica
  57.685 +/Helvetica /WindowsLatin1Encoding 120 FMSR
  57.686 +
  57.687 +1305  610 mt 
  57.688 +(10) s
  57.689 +%%IncludeResource: font Helvetica
  57.690 +/Helvetica /WindowsLatin1Encoding 80 FMSR
  57.691 +
  57.692 +1438  536 mt 
  57.693 +(0) s
  57.694 +1564  566 mt 10891  566 L
  57.695 +1564 6716 mt 10891 6716 L
  57.696 +10891 6716 mt 10891  566 L
  57.697 +1564 6716 mt 1564  566 L
  57.698 +gs 1564 566 9328 6151 rc
  57.699 +DA
  57.700 +24 w
  57.701 +/c8 { 1.000000 0.000000 0.000000 sr} bdef
  57.702 +c8
  57.703 +234 1611 233 1104 233 888 233 536 233 245 234 88 233 16 233 2 
  57.704 +233 0 233 0 233 0 234 0 233 0 233 0 233 0 233 0 
  57.705 +233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 24 MP stroke
  57.706 +SO
  57.707 +/c9 { 0.000000 0.000000 1.000000 sr} bdef
  57.708 +c9
  57.709 +234 1632 233 1300 233 889 233 530 233 251 234 84 233 17 233 2 
  57.710 +233 0 233 0 233 0 234 0 233 0 233 0 233 0 233 0 
  57.711 +233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 24 MP stroke
  57.712 +gr
  57.713 +
  57.714 +24 w
  57.715 +c9
  57.716 +gs 1418 420 5656 4998 rc
  57.717 +0 j
  57.718 +69 119 -138 0 69 -119 1564 645 4 MP
  57.719 +DP
  57.720 +69 119 -138 0 69 -119 1797 645 4 MP
  57.721 +DP
  57.722 +69 119 -138 0 69 -119 2030 645 4 MP
  57.723 +DP
  57.724 +69 119 -138 0 69 -119 2263 645 4 MP
  57.725 +DP
  57.726 +69 119 -138 0 69 -119 2496 645 4 MP
  57.727 +DP
  57.728 +69 119 -138 0 69 -119 2729 645 4 MP
  57.729 +DP
  57.730 +69 119 -138 0 69 -119 2963 645 4 MP
  57.731 +DP
  57.732 +69 119 -138 0 69 -119 3196 645 4 MP
  57.733 +DP
  57.734 +69 119 -138 0 69 -119 3429 645 4 MP
  57.735 +DP
  57.736 +69 119 -138 0 69 -119 3662 645 4 MP
  57.737 +DP
  57.738 +69 119 -138 0 69 -119 3895 645 4 MP
  57.739 +DP
  57.740 +69 119 -138 0 69 -119 4128 645 4 MP
  57.741 +DP
  57.742 +69 119 -138 0 69 -119 4362 645 4 MP
  57.743 +DP
  57.744 +69 119 -138 0 69 -119 4595 645 4 MP
  57.745 +DP
  57.746 +69 119 -138 0 69 -119 4828 645 4 MP
  57.747 +DP
  57.748 +69 119 -138 0 69 -119 5061 645 4 MP
  57.749 +DP
  57.750 +69 119 -138 0 69 -119 5294 647 4 MP
  57.751 +DP
  57.752 +69 119 -138 0 69 -119 5527 664 4 MP
  57.753 +DP
  57.754 +69 119 -138 0 69 -119 5761 748 4 MP
  57.755 +DP
  57.756 +69 119 -138 0 69 -119 5994 999 4 MP
  57.757 +DP
  57.758 +69 119 -138 0 69 -119 6227 1529 4 MP
  57.759 +DP
  57.760 +69 119 -138 0 69 -119 6460 2418 4 MP
  57.761 +DP
  57.762 +69 119 -138 0 69 -119 6693 3718 4 MP
  57.763 +DP
  57.764 +69 119 -138 0 69 -119 6927 5350 4 MP
  57.765 +DP
  57.766 +gr
  57.767 +
  57.768 +gs 1564 566 9328 6151 rc
  57.769 +DA
  57.770 +c8
  57.771 +234 1192 233 909 233 642 233 440 233 245 234 111 233 42 233 10 
  57.772 +233 2 233 0 233 0 234 0 233 0 233 0 233 0 233 0 
  57.773 +233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 24 MP stroke
  57.774 +SO
  57.775 +c9
  57.776 +234 1109 233 911 233 657 233 431 233 246 234 114 233 41 233 10 
  57.777 +233 1 233 0 233 0 234 0 233 0 233 0 233 0 233 0 
  57.778 +233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 24 MP stroke
  57.779 +gr
  57.780 +
  57.781 +gs 1418 420 5656 3813 rc
  57.782 +0 j
  57.783 +-69 119 -69 -119 138 0 1495 606 4 MP
  57.784 +DP
  57.785 +-69 119 -69 -119 138 0 1728 606 4 MP
  57.786 +DP
  57.787 +-69 119 -69 -119 138 0 1961 606 4 MP
  57.788 +DP
  57.789 +-69 119 -69 -119 138 0 2194 606 4 MP
  57.790 +DP
  57.791 +-69 119 -69 -119 138 0 2427 606 4 MP
  57.792 +DP
  57.793 +-69 119 -69 -119 138 0 2660 606 4 MP
  57.794 +DP
  57.795 +-69 119 -69 -119 138 0 2894 606 4 MP
  57.796 +DP
  57.797 +-69 119 -69 -119 138 0 3127 606 4 MP
  57.798 +DP
  57.799 +-69 119 -69 -119 138 0 3360 606 4 MP
  57.800 +DP
  57.801 +-69 119 -69 -119 138 0 3593 606 4 MP
  57.802 +DP
  57.803 +-69 119 -69 -119 138 0 3826 606 4 MP
  57.804 +DP
  57.805 +-69 119 -69 -119 138 0 4059 606 4 MP
  57.806 +DP
  57.807 +-69 119 -69 -119 138 0 4293 606 4 MP
  57.808 +DP
  57.809 +-69 119 -69 -119 138 0 4526 606 4 MP
  57.810 +DP
  57.811 +-69 119 -69 -119 138 0 4759 606 4 MP
  57.812 +DP
  57.813 +-69 119 -69 -119 138 0 4992 607 4 MP
  57.814 +DP
  57.815 +-69 119 -69 -119 138 0 5225 617 4 MP
  57.816 +DP
  57.817 +-69 119 -69 -119 138 0 5458 658 4 MP
  57.818 +DP
  57.819 +-69 119 -69 -119 138 0 5692 772 4 MP
  57.820 +DP
  57.821 +-69 119 -69 -119 138 0 5925 1018 4 MP
  57.822 +DP
  57.823 +-69 119 -69 -119 138 0 6158 1449 4 MP
  57.824 +DP
  57.825 +-69 119 -69 -119 138 0 6391 2106 4 MP
  57.826 +DP
  57.827 +-69 119 -69 -119 138 0 6624 3017 4 MP
  57.828 +DP
  57.829 +-69 119 -69 -119 138 0 6858 4126 4 MP
  57.830 +DP
  57.831 +gr
  57.832 +
  57.833 +gs 1564 566 9328 6151 rc
  57.834 +DA
  57.835 +c8
  57.836 +233 958 234 779 233 567 233 455 233 297 233 179 234 97 233 41 
  57.837 +233 17 233 4 233 0 233 0 234 0 233 0 233 0 233 0 
  57.838 +233 0 233 0 234 0 233 0 233 0 233 0 233 0 233 0 
  57.839 +1564 566 25 MP stroke
  57.840 +SO
  57.841 +c9
  57.842 +233 942 234 724 233 598 233 439 233 298 233 182 234 96 233 43 
  57.843 +233 14 233 5 233 0 233 0 234 0 233 0 233 0 233 0 
  57.844 +233 0 233 0 234 0 233 0 233 0 233 0 233 0 233 0 
  57.845 +1564 566 25 MP stroke
  57.846 +gr
  57.847 +
  57.848 +gs 1418 420 5889 3634 rc
  57.849 +0 j
  57.850 +0 -94 -94 0 0 94 94 0 1517 519 5 MP
  57.851 +DP
  57.852 +0 -94 -94 0 0 94 94 0 1750 519 5 MP
  57.853 +DP
  57.854 +0 -94 -94 0 0 94 94 0 1983 519 5 MP
  57.855 +DP
  57.856 +0 -94 -94 0 0 94 94 0 2216 519 5 MP
  57.857 +DP
  57.858 +0 -94 -94 0 0 94 94 0 2449 519 5 MP
  57.859 +DP
  57.860 +0 -94 -94 0 0 94 94 0 2682 519 5 MP
  57.861 +DP
  57.862 +0 -94 -94 0 0 94 94 0 2916 519 5 MP
  57.863 +DP
  57.864 +0 -94 -94 0 0 94 94 0 3149 519 5 MP
  57.865 +DP
  57.866 +0 -94 -94 0 0 94 94 0 3382 519 5 MP
  57.867 +DP
  57.868 +0 -94 -94 0 0 94 94 0 3615 519 5 MP
  57.869 +DP
  57.870 +0 -94 -94 0 0 94 94 0 3848 519 5 MP
  57.871 +DP
  57.872 +0 -94 -94 0 0 94 94 0 4081 519 5 MP
  57.873 +DP
  57.874 +0 -94 -94 0 0 94 94 0 4315 519 5 MP
  57.875 +DP
  57.876 +0 -94 -94 0 0 94 94 0 4548 519 5 MP
  57.877 +DP
  57.878 +0 -94 -94 0 0 94 94 0 4781 519 5 MP
  57.879 +DP
  57.880 +0 -94 -94 0 0 94 94 0 5014 524 5 MP
  57.881 +DP
  57.882 +0 -94 -94 0 0 94 94 0 5247 538 5 MP
  57.883 +DP
  57.884 +0 -94 -94 0 0 94 94 0 5480 581 5 MP
  57.885 +DP
  57.886 +0 -94 -94 0 0 94 94 0 5714 677 5 MP
  57.887 +DP
  57.888 +0 -94 -94 0 0 94 94 0 5947 859 5 MP
  57.889 +DP
  57.890 +0 -94 -94 0 0 94 94 0 6180 1157 5 MP
  57.891 +DP
  57.892 +0 -94 -94 0 0 94 94 0 6413 1596 5 MP
  57.893 +DP
  57.894 +0 -94 -94 0 0 94 94 0 6646 2194 5 MP
  57.895 +DP
  57.896 +0 -94 -94 0 0 94 94 0 6880 2918 5 MP
  57.897 +DP
  57.898 +0 -94 -94 0 0 94 94 0 7113 3860 5 MP
  57.899 +DP
  57.900 +gr
  57.901 +
  57.902 +gs 1564 566 9328 6151 rc
  57.903 +DA
  57.904 +c8
  57.905 +233 622 233 481 233 485 233 398 234 326 233 275 233 195 233 147 
  57.906 +233 109 234 71 233 44 233 27 233 15 233 8 233 3 234 1 
  57.907 +233 0 233 0 233 0 233 0 233 0 234 0 233 0 233 0 
  57.908 +233 0 233 0 233 0 1564 566 28 MP stroke
  57.909 +SO
  57.910 +c9
  57.911 +233 605 233 529 233 456 233 386 234 304 233 261 233 203 233 153 
  57.912 +233 108 234 73 233 46 233 26 233 14 233 6 233 3 234 1 
  57.913 +233 0 233 0 233 0 233 0 233 0 234 0 233 0 233 0 
  57.914 +233 0 233 0 233 0 1564 566 28 MP stroke
  57.915 +gr
  57.916 +
  57.917 +gs 1418 420 6588 3467 rc
  57.918 +1504  566 mt 1624  566 L
  57.919 +1564  506 mt 1564  626 L
  57.920 +1737  566 mt 1857  566 L
  57.921 +1797  506 mt 1797  626 L
  57.922 +1970  566 mt 2090  566 L
  57.923 +2030  506 mt 2030  626 L
  57.924 +2203  566 mt 2323  566 L
  57.925 +2263  506 mt 2263  626 L
  57.926 +2436  566 mt 2556  566 L
  57.927 +2496  506 mt 2496  626 L
  57.928 +2669  566 mt 2789  566 L
  57.929 +2729  506 mt 2729  626 L
  57.930 +2903  566 mt 3023  566 L
  57.931 +2963  506 mt 2963  626 L
  57.932 +3136  566 mt 3256  566 L
  57.933 +3196  506 mt 3196  626 L
  57.934 +3369  566 mt 3489  566 L
  57.935 +3429  506 mt 3429  626 L
  57.936 +3602  566 mt 3722  566 L
  57.937 +3662  506 mt 3662  626 L
  57.938 +3835  566 mt 3955  566 L
  57.939 +3895  506 mt 3895  626 L
  57.940 +4068  566 mt 4188  566 L
  57.941 +4128  506 mt 4128  626 L
  57.942 +4302  567 mt 4422  567 L
  57.943 +4362  507 mt 4362  627 L
  57.944 +4535  570 mt 4655  570 L
  57.945 +4595  510 mt 4595  630 L
  57.946 +4768  576 mt 4888  576 L
  57.947 +4828  516 mt 4828  636 L
  57.948 +5001  590 mt 5121  590 L
  57.949 +5061  530 mt 5061  650 L
  57.950 +5234  616 mt 5354  616 L
  57.951 +5294  556 mt 5294  676 L
  57.952 +5467  662 mt 5587  662 L
  57.953 +5527  602 mt 5527  722 L
  57.954 +5701  735 mt 5821  735 L
  57.955 +5761  675 mt 5761  795 L
  57.956 +5934  843 mt 6054  843 L
  57.957 +5994  783 mt 5994  903 L
  57.958 +6167  996 mt 6287  996 L
  57.959 +6227  936 mt 6227 1056 L
  57.960 +6400 1199 mt 6520 1199 L
  57.961 +6460 1139 mt 6460 1259 L
  57.962 +6633 1460 mt 6753 1460 L
  57.963 +6693 1400 mt 6693 1520 L
  57.964 +6867 1764 mt 6987 1764 L
  57.965 +6927 1704 mt 6927 1824 L
  57.966 +7100 2150 mt 7220 2150 L
  57.967 +7160 2090 mt 7160 2210 L
  57.968 +7333 2606 mt 7453 2606 L
  57.969 +7393 2546 mt 7393 2666 L
  57.970 +7566 3135 mt 7686 3135 L
  57.971 +7626 3075 mt 7626 3195 L
  57.972 +7799 3740 mt 7919 3740 L
  57.973 +7859 3680 mt 7859 3800 L
  57.974 +gr
  57.975 +
  57.976 +gs 1564 566 9328 6151 rc
  57.977 +DA
  57.978 +c8
  57.979 +233 462 233 467 234 305 233 362 233 277 233 250 233 219 233 185 
  57.980 +234 168 233 125 233 112 233 87 233 62 234 46 233 38 233 19 
  57.981 +233 16 233 10 233 5 234 4 233 3 233 1 233 0 233 0 
  57.982 +233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 32 MP stroke
  57.983 +SO
  57.984 +c9
  57.985 +233 442 233 404 234 365 233 328 233 291 233 257 233 222 233 190 
  57.986 +234 152 233 134 233 108 233 85 233 65 234 49 233 34 233 23 
  57.987 +233 16 233 9 233 6 234 3 233 2 233 1 233 0 233 0 
  57.988 +233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 32 MP stroke
  57.989 +gr
  57.990 +
  57.991 +gs 1418 420 7521 3479 rc
  57.992 +0 j
  57.993 +-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
  57.994 +34 0 17 30 17 -30 34 0 1513 536 13 MP
  57.995 +DP
  57.996 +-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
  57.997 +34 0 17 30 17 -30 34 0 1746 536 13 MP
  57.998 +DP
  57.999 +-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
 57.1000 +34 0 17 30 17 -30 34 0 1979 536 13 MP
 57.1001 +DP
 57.1002 +-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
 57.1003 +34 0 17 30 17 -30 34 0 2212 536 13 MP
 57.1004 +DP
 57.1005 +-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
 57.1006 +34 0 17 30 17 -30 34 0 2445 536 13 MP
 57.1007 +DP
 57.1008 +-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
 57.1009 +34 0 17 30 17 -30 34 0 2678 536 13 MP
 57.1010 +DP
 57.1011 +-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
 57.1012 +34 0 17 30 17 -30 34 0 2912 536 13 MP
 57.1013 +DP
 57.1014 +-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
 57.1015 +34 0 17 30 17 -30 34 0 3145 536 13 MP
 57.1016 +DP
 57.1017 +-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
 57.1018 +34 0 17 30 17 -30 34 0 3378 536 13 MP
 57.1019 +DP
 57.1020 +-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
 57.1021 +34 0 17 30 17 -30 34 0 3611 536 13 MP
 57.1022 +DP
 57.1