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 8749 4462ac63d4cf
parent 8748 87a141a38088 (current diff)
parent 8747 2aec19a85c73 (diff)
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
--- a/.hgignore	Fri May 11 14:02:54 2012 +0200
+++ b/.hgignore	Fri May 11 16:42:40 2012 +0200
@@ -28,7 +28,7 @@
 ^doc/manual/figures/.*eps
 ^doc/manual/figures/.*pdf
 ^doc/manual/figures/.*png
-^src/antenna/doc/build
+^src/.*/doc/build
 ^bindings/python/pybindgen/
 ms_print.*
 massif.*
--- a/CHANGES.html	Fri May 11 14:02:54 2012 +0200
+++ b/CHANGES.html	Fri May 11 16:42:40 2012 +0200
@@ -50,6 +50,13 @@
 <ul>
 <li>The new class AntennaModel provides an API for modeling the radiation pattern of antennas.
 </li>
+<li>The new buildings module introduces an API (classes, helpers, etc)
+  to model the presence of buildings in a wireless network topology. 
+</li>
+<li>The LENA project's implementation of the LTE Mac Scheduler Interface Specification
+   standardized by the Small Cell Forum (formerly Femto Forum) is now available for
+  use with the LTE module.
+</li>
 </ul>
 
 <h2>Changes to existing API:</h2>
@@ -101,6 +108,11 @@
 <li>
 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".
 </li>
+<li>
+The API of the LTE module has undergone a significant redesign with
+the merge of the code from the LENA project. The new API is not
+backwards compatible with the previous version of the LTE module.
+</li>
 </ul>
 
 <h2>Changes to build system:</h2>
--- a/RELEASE_NOTES	Fri May 11 14:02:54 2012 +0200
+++ b/RELEASE_NOTES	Fri May 11 16:42:40 2012 +0200
@@ -36,6 +36,13 @@
 - Longer and more descriptive names are used for error units in RateErrorModel
   class and queue mode in Queue class. Attributs in those classes are also
   changed for consistency. See API documentation for details.
+- A new buildings module is introduced which allows to model the
+  presence of buildings in a wireless network topology.  
+- New propagation models (OkumuraHata, ITU-R P.1411, ITU-R P.1238)
+  have been added
+- The LTE code from the LENA project has been merged, bringin in a
+  significant redesign of the LTE module as well as many new features.
+
 
 Bugs fixed
 ----------
--- a/doc/models/Makefile	Fri May 11 14:02:54 2012 +0200
+++ b/doc/models/Makefile	Fri May 11 16:42:40 2012 +0200
@@ -24,6 +24,11 @@
 	$(SRC)/aodv/doc/aodv.rst \
 	$(SRC)/applications/doc/applications.rst \
 	$(SRC)/bridge/doc/bridge.rst \
+	$(SRC)/buildings/doc/source/buildings.rst \
+	$(SRC)/buildings/doc/source/buildings-design.rst \
+	$(SRC)/buildings/doc/source/buildings-user.rst \
+	$(SRC)/buildings/doc/source/buildings-testing.rst \
+	$(SRC)/buildings/doc/source/buildings-references.rst \
 	$(SRC)/click/doc/click.rst \
 	$(SRC)/csma/doc/csma.rst \
 	$(SRC)/dsdv/doc/dsdv.rst \
@@ -32,7 +37,12 @@
 	$(SRC)/emu/doc/emu.rst \
 	$(SRC)/tap-bridge/doc/tap.rst \
 	$(SRC)/mesh/doc/mesh.rst \
-	$(SRC)/lte/doc/lte.rst \
+	$(SRC)/lte/doc/source/lte.rst \
+	$(SRC)/lte/doc/source/lte-user.rst \
+	$(SRC)/lte/doc/source/lte-design.rst \
+	$(SRC)/lte/doc/source/lte-testing.rst \
+	$(SRC)/lte/doc/source/lte-profiling.rst \
+	$(SRC)/lte/doc/source/lte-references.rst \
 	$(SRC)/propagation/doc/propagation.rst \
 	$(SRC)/network/doc/network-overview.rst \
 	$(SRC)/network/doc/packets.rst \
@@ -76,8 +86,63 @@
 	$(SRC)/wifi/doc/WifiArchitecture.dia \
 	$(SRC)/wifi/doc/snir.dia \
 	$(SRC)/wimax/doc/WimaxArchitecture.dia \
-	$(SRC)/lte/doc/lte-transmission.png \
-	$(SRC)/lte/doc/lte-transmission.pdf \
+	$(SRC)/lte/doc/source/figures/ff-mac-saps.dia \
+	$(SRC)/lte/doc/source/figures/ff-example.dia \
+	$(SRC)/lte/doc/source/figures/lte-enb-architecture.dia \
+	$(SRC)/lte/doc/source/figures/lte-ue-architecture.dia \
+	$(SRC)/lte/doc/source/figures/epc-profiling-scenario.dia \
+	$(SRC)/lte/doc/source/figures/eutran-profiling-scenario.dia \
+	$(SRC)/lte/doc/source/figures/lte-interference-test-scenario.dia \
+	$(SRC)/lte/doc/source/figures/epc-topology.dia \
+	$(SRC)/lte/doc/source/figures/epc-data-flow-dl.dia \
+	$(SRC)/lte/doc/source/figures/epc-data-flow-ul.dia \
+	$(SRC)/lte/doc/source/figures/lte-arch-data-rrc-pdcp-rlc.dia \
+	$(SRC)/lte/doc/source/figures/lte-epc-e2e-data-protocol-stack.dia \
+	$(SRC)/lte/doc/source/figures/MCS_2_test.eps \
+	$(SRC)/lte/doc/source/figures/MCS_12_test.eps \
+	$(SRC)/lte/doc/source/figures/MCS_14_test.eps \
+	$(SRC)/lte/doc/source/figures/lena-dual-stripe.eps \
+	$(SRC)/lte/doc/source/figures/lte-mcs-index.eps \
+	$(SRC)/lte/doc/source/figures/lenaThrTestCase1.eps \
+	$(SRC)/lte/doc/source/figures/lenaThrTestCase2.eps \
+	$(SRC)/lte/doc/source/figures/runningTime10s.eps \
+	$(SRC)/lte/doc/source/figures/epcRunningTime.eps \
+	$(SRC)/lte/doc/source/figures/propagationModel.eps \
+	$(SRC)/lte/doc/source/figures/simulationTime.eps \
+	$(SRC)/lte/doc/source/figures/epcSimulationTime.eps \
+	$(SRC)/lte/doc/source/figures/epcEutranRunningTime.eps \
+	$(SRC)/lte/doc/source/figures/profiling-memory.eps \
+	$(SRC)/lte/doc/source/figures/lte-rlc-implementation-model.eps \
+	$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-dl.eps \
+	$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-dl.eps \
+	$(SRC)/lte/doc/source/figures/lte-rlc-data-txon-ul.eps \
+	$(SRC)/lte/doc/source/figures/lte-rlc-data-retx-ul.eps \
+	$(SRC)/lte/doc/source/figures/fading_pedestrian.png \
+	$(SRC)/lte/doc/source/figures/fading_vehicular.png \
+	$(SRC)/lte/doc/source/figures/fading_urban_3kmph.png \
+	$(SRC)/lte/doc/source/figures/fading_pedestrian.pdf \
+	$(SRC)/lte/doc/source/figures/fading_vehicular.pdf \
+	$(SRC)/lte/doc/source/figures/fading_urban_3kmph.pdf \
+	$(SRC)/lte/doc/source/figures/MCS_1_4.pdf \
+	$(SRC)/lte/doc/source/figures/MCS_1_4.png \
+	$(SRC)/lte/doc/source/figures/MCS_5_8.pdf \
+	$(SRC)/lte/doc/source/figures/MCS_5_8.png \
+	$(SRC)/lte/doc/source/figures/MCS_9_12.pdf \
+	$(SRC)/lte/doc/source/figures/MCS_9_12.png \
+	$(SRC)/lte/doc/source/figures/MCS_13_16.pdf \
+	$(SRC)/lte/doc/source/figures/MCS_13_16.png \
+	$(SRC)/lte/doc/source/figures/MCS_17_20.pdf \
+	$(SRC)/lte/doc/source/figures/MCS_17_20.png \
+	$(SRC)/lte/doc/source/figures/MCS_21_24.pdf \
+	$(SRC)/lte/doc/source/figures/MCS_21_24.png \
+	$(SRC)/lte/doc/source/figures/MCS_25_27.pdf \
+	$(SRC)/lte/doc/source/figures/MCS_25_27.png \
+	$(SRC)/lte/doc/source/figures/lte-phy-interference.png \
+	$(SRC)/lte/doc/source/figures/lte-phy-interference.pdf \
+	$(SRC)/lte/doc/source/figures/helpers.png \
+	$(SRC)/lte/doc/source/figures/helpers.pdf \
+	$(SRC)/lte/doc/source/figures/miesm_scheme.pdf \
+	$(SRC)/lte/doc/source/figures/miesm_scheme.png \
 	$(SRC)/uan/doc/auvmobility-classes.dia \
 	$(SRC)/stats/doc/Stat-framework-arch.png \
 	$(SRC)/stats/doc/Wifi-default.png \
@@ -101,6 +166,37 @@
 	$(FIGURES)/WifiArchitecture.eps \
 	$(FIGURES)/snir.eps \
 	$(FIGURES)/WimaxArchitecture.eps \
+	$(FIGURES)/ff-mac-saps.eps \
+	$(FIGURES)/ff-example.eps \
+	$(FIGURES)/lte-enb-architecture.eps \
+	$(FIGURES)/lte-ue-architecture.eps \
+	$(FIGURES)/epc-profiling-scenario.eps \
+	$(FIGURES)/eutran-profiling-scenario.eps \
+	$(FIGURES)/lte-interference-test-scenario.eps \
+	$(FIGURES)/epc-topology.eps \
+	$(FIGURES)/epc-data-flow-dl.eps \
+	$(FIGURES)/epc-data-flow-ul.eps \
+	$(FIGURES)/lte-arch-data-rrc-pdcp-rlc.eps \
+	$(FIGURES)/lte-epc-e2e-data-protocol-stack.eps \
+	$(FIGURES)/MCS_2_test.eps \
+	$(FIGURES)/MCS_12_test.eps \
+	$(FIGURES)/MCS_14_test.eps \
+	$(FIGURES)/lena-dual-stripe.eps \
+	$(FIGURES)/lte-mcs-index.eps \
+	$(FIGURES)/lenaThrTestCase1.eps \
+	$(FIGURES)/lenaThrTestCase2.eps \
+	$(FIGURES)/runningTime10s.eps \
+	$(FIGURES)/epcRunningTime.eps \
+	$(FIGURES)/propagationModel.eps \
+	$(FIGURES)/simulationTime.eps \
+	$(FIGURES)/epcSimulationTime.eps \
+	$(FIGURES)/epcEutranRunningTime.eps \
+	$(FIGURES)/profiling-memory.eps \
+	$(FIGURES)/lte-rlc-implementation-model.eps \
+	$(FIGURES)/lte-rlc-data-txon-dl.eps \
+	$(FIGURES)/lte-rlc-data-retx-dl.eps \
+	$(FIGURES)/lte-rlc-data-txon-ul.eps \
+	$(FIGURES)/lte-rlc-data-retx-ul.eps \
         $(FIGURES)/auvmobility-classes.eps \
 
 # rescale pdf figures as necessary
@@ -116,7 +212,17 @@
 $(FIGURES)/routing.pdf_width = 6in
 $(FIGURES)/routing-specialization.pdf_width = 5in
 $(FIGURES)/snir.pdf_width = 3in
-$(FIGURES)/lte-transmission.pdf_width = 3in
+$(FIGURES)/lte-interference-test-scenario.pdf_width = 3in
+$(FIGURES)/epc-topology.pdf_width = 4in
+$(FIGURES)/lte-arch-data-rrc-pdcp-rlc.pdf_width = 3in
+$(FIGURES)/lte-epc-e2e-data-protocol-stack.pdf_width = 15cm
+$(FIGURES)/ff-mac-saps.pdf_width = 5in
+$(FIGURES)/ff-example.pdf_width = 5in
+$(FIGURES)/lte-rlc-implementation-model.pdf_width = 20in
+$(FIGURES)/lte-rlc-data-txon-dl.pdf_width = 10cm
+$(FIGURES)/lte-rlc-data-txon-ul.pdf_width = 10cm
+$(FIGURES)/lte-rlc-data-retx-ul.pdf_width = 10cm
+$(FIGURES)/lte-phy-interference.pdf_width = 12cm
 $(FIGURES)/auvmobility-classes.pdf_width = 10cm
 
 IMAGES_PNG = ${IMAGES_EPS:.eps=.png}
--- a/doc/models/source/index.rst	Fri May 11 14:02:54 2012 +0200
+++ b/doc/models/source/index.rst	Fri May 11 16:42:40 2012 +0200
@@ -22,6 +22,7 @@
    aodv
    applications
    bridge
+   buildings
    click
    csma
    dsdv
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/doc/Makefile	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,173 @@
+EPSTOPDF = epstopdf
+DIA = dia
+CONVERT = convert
+
+SOURCE = source
+FIGURES = $(SOURCE)/figures
+
+# specify figures from which .png and .pdf figures need to be
+# generated (all dia and eps figures)
+IMAGES_EPS = 
+
+# specify figures for build process (all eps figures)
+GRAPHS_EPS = 
+
+# rescale pdf figures as necessary
+$(FIGURES)/testbed.pdf_width = 5in
+
+IMAGES_PNG = ${IMAGES_EPS:.eps=.png}
+IMAGES_PDF = ${IMAGES_EPS:.eps=.pdf} 
+
+IMAGES = $(IMAGES_EPS) $(IMAGES_PNG) $(IMAGES_PDF)
+
+%.eps : %.dia; $(DIA) -t eps $< -e $@
+%.png : %.dia; $(DIA) -t png $< -e $@
+%.png : %.eps; $(CONVERT) $< $@
+%.pdf : %.eps; $(EPSTOPDF) $< -o=$@; if test x$($@_width) != x; then TMPFILE=`mktemp`; ./rescale-pdf.sh $($@_width) $@ $${TMPFILE} && mv $${TMPFILE} $@; fi
+
+GRAPHS_PNG = ${GRAPHS_EPS:.eps=.png}
+GRAPHS_PDF = ${GRAPHS_EPS:.eps=.pdf}
+
+GRAPHS = $(GRAPHS_EPS) $(GRAPHS_PNG) $(GRAPHS_PDF)
+
+%.png : %.eps; $(CONVERT) $< $@
+%.pdf : %.eps; $(EPSTOPDF) $< -o=$@; if test x$($@_width) != x; then TMPFILE=`mktemp`; ./rescale-pdf.sh $($@_width) $@ $${TMPFILE} && mv $${TMPFILE} $@; fi
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCE) 
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+	-rm -f $(IMAGES_PNG)
+	-rm -f $(IMAGES_PDF)
+	-rm -f $(GRAPHS_PNG)
+	-rm -f $(GRAPHS_PDF)
+
+frag: pickle
+	@if test ! -d $(BUILDDIR)/frag; then mkdir $(BUILDDIR)/frag; fi
+	pushd $(BUILDDIR)/frag && ../../pickle-to-xml.py ../pickle/index.fpickle  > navigation.xml && popd
+	cp -r $(BUILDDIR)/pickle/_images $(BUILDDIR)/frag
+
+html:  $(IMAGES) ${GRAPHS}
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:  $(IMAGES)
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:  $(IMAGES)
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:  $(IMAGES)
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:  $(IMAGES)
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:  $(IMAGES)
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:  $(IMAGES)
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ns-3.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ns-3.qhc"
+
+devhelp:  $(IMAGES)
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/ns-3"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ns-3"
+	@echo "# devhelp"
+
+epub:  $(IMAGES)
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:  $(IMAGES) ${GRAPHS}
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:  $(IMAGES) ${GRAPHS}
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	make -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:  $(IMAGES)
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:  $(IMAGES)
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+changes:  $(IMAGES)
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:  $(IMAGEs)
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:  $(IMAGES)
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/doc/rescale-pdf.sh	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+TMPFILE=`mktemp`
+
+echo "\documentclass{book}
+\usepackage{pdfpages}
+\begin{document}
+\includepdf[width=${1},fitpaper]{${2}}
+\end{document}" >${TMPFILE}.tex
+pdflatex -output-directory /tmp ${TMPFILE}.tex >/dev/null 2>/dev/null
+cp ${TMPFILE}.pdf ${3}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/doc/source/buildings-design.rst	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,243 @@
+cd .. include:: replace.txt
+
+
+++++++++++++++++++++++++++++++++++++++
+Design documentation
+++++++++++++++++++++++++++++++++++++++
+
+
+Overview
+++++++++
+
+The Buildings module provides:
+
+ #. a new class (``Building``) that models the presence of a building in a simulation scenario;  
+ #. 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;
+ #. a container class with the definition of the most useful pathloss models and the correspondent variables called ``BuildingsPropagationLossModel``.
+ #. 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.
+ #. a simplified model working only with Okumura Hata (``OhBuildingsPropagationLossModel``) considering the phenomenon of indoor/outdoor propagation in the presence of buildings.
+
+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). 
+
+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. 
+
+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.
+
+
+The Building class
+++++++++++++++++++
+
+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:
+
+  * building type:
+
+    * Residential (default value)
+    * Office
+    * Commercial
+
+  * external walls type
+
+    * Wood
+    * ConcreteWithWindows (default value)
+    * ConcreteWithoutWindows
+    * StoneBlocks
+
+  * number of floors (default value 1, which means only ground-floor)
+  * number of rooms in x-axis (default value 1)
+  * number of rooms in y-axis (default value 1)
+
+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.
+
+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).
+
+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.).
+
+
+
+
+ItuR1238PropagationLossModel
+++++++++++++++++++++++++++++
+
+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).
+The analytical expression is given in the following.
+
+.. math::
+
+  L_\mathrm{total} = 20\log f + N\log d + L_f(n)- 28 [dB]
+
+where:
+
+  :math:`N = \left\{ \begin{array}{lll} 28 & residential \\ 30 & office \\ 22 & commercial\end{array} \right.` : power loss coefficient [dB]
+
+  :math:`L_f = \left\{ \begin{array}{lll} 4n & residential \\ 15+4(n-1) & office \\ 6+3(n-1) & commercial\end{array} \right.`
+
+  :math:`n` : number of floors between base station and mobile (:math:`n\ge 1`)
+
+  :math:`f` : frequency [MHz]
+
+  :math:`d` : distance (where :math:`d > 1`) [m]
+
+
+
+
+BuildingsPropagationLossModel
++++++++++++++++++++++++++++++
+
+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.
+
+
+
+External Wall Loss (EWL)
+-------------------------
+
+This component models the penetration loss through walls for indoor to outdoor communications and vice-versa. The values are taken from the [cost231]_ model.
+
+  * Wood ~ 4 dB
+  * Concrete with windows (not metallized) ~ 7 dB
+  * Concrete without windows ~ 15 dB (spans between 10 and 20 in COST231)
+  * Stone blocks ~ 12 dB
+
+
+Internal Walls Loss (IWL)
+-------------------------
+
+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 
+
+.. math::
+
+  L_{IWL} = L_{siw} (|x_1 -x_2| + |y_1 - y_2|)
+
+  
+
+
+
+Height Gain Model (HG)
+-----------------------
+
+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.
+
+
+Shadowing Model
+---------------
+
+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:
+
+ * outdoor (``m_shadowingSigmaOutdoor``, defaul value of 7 dB) :math:`\rightarrow X_\mathrm{O} \sim N(\mu_\mathrm{O}, \sigma_\mathrm{O}^2)`.
+ * indoor (``m_shadowingSigmaIndoor``, defaul value of 10 dB) :math:`\rightarrow X_\mathrm{I} \sim N(\mu_\mathrm{I}, \sigma_\mathrm{I}^2)`.
+ * external walls penetration (``m_shadowingSigmaExtWalls``, default value 5 dB) :math:`\rightarrow X_\mathrm{W} \sim N(\mu_\mathrm{W}, \sigma_\mathrm{W}^2)`
+
+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. 
+
+.. math::
+  
+  X \sim N(\mu,\sigma^2) \mbox{ and } Y \sim N(\nu,\tau^2)
+
+  Z = X + Y \sim Z (\mu + \nu, \sigma^2 + \tau^2) 
+
+  \Rightarrow \sigma_\mathrm{IO} = \sqrt{\sigma_\mathrm{O}^2 + \sigma_\mathrm{W}^2}
+
+
+
+
+
+Pathloss logics
++++++++++++++++
+
+In the following we describe the different pathloss logic that are implemented by inheriting from BuildingsPropagationLossModel.
+
+
+HybridBuildingsPropagationLossModel
+-----------------------------------
+
+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:
+
+ * OkumuraHataPropagationLossModel (OH) (at frequencies > 2.3 GHz substituted by Kun2600MhzPropagationLossModel)
+ * ItuR1411LosPropagationLossModel and ItuR1411NlosOverRooftopPropagationLossModel (I1411)
+ * ItuR1238PropagationLossModel (I1238)
+ * the pathloss elements of the BuildingsPropagationLossModel (EWL, HG, IWL)
+
+The following pseudo-code illustrates how the different pathloss model elements described above are integrated in  ``HybridBuildingsPropagationLossModel``::
+
+  if (txNode is outdoor)
+    then
+      if (rxNode is outdoor)
+        then
+          if (distance > 1 km)
+            then
+              if (rxNode or txNode is below the rooftop)
+                then
+                  L = I1411
+                else
+                  L = OH 
+            else
+              L = I1411
+        else (rxNode is indoor)
+          if (distance > 1 km)
+            then
+              if (rxNode or txNode is below the rooftop)
+                L = I1411 + EWL + HG
+              else
+                L = OH + EWL + HG
+            else
+              L = I1411 + EWL + HG
+  else (txNode is indoor)
+    if (rxNode is indoor)
+      then
+       if (same building)
+          then
+            L = I1238 + IWL
+          else
+            L = I1411 + 2*EWL 
+     else (rxNode is outdoor)
+      if (distance > 1 km)
+        then 
+          if (rxNode or txNode is below the rooftop)
+                then
+                  L = I1411 + EWL + HG
+                else
+                  L = OH + EWL + HG
+        else
+          L = I1411 + EWL
+
+
+
+
+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.
+
+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.
+
+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.
+
+
+OhBuildingsPropagationLossModel
+-------------------------------
+
+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. 
+
+In detail, the class ``OhBuildingsPropagationLossModel`` integrates the following pathloss models:
+
+ * OkumuraHataPropagationLossModel (OH)
+ * the pathloss elements of the BuildingsPropagationLossModel (EWL, HG, IWL)
+
+The following pseudo-code illustrates how the different pathloss model elements described above are integrated in ``OhBuildingsPropagationLossModel``::
+
+  if (txNode is outdoor)
+    then
+      if (rxNode is outdoor)
+        then
+          L = OH 
+        else (rxNode is indoor)
+          L = OH + EWL
+  else (txNode is indoor)
+    if (rxNode is indoor)
+      then
+       if (same building)
+          then
+            L = OH + IWL
+          else
+            L = OH + 2*EWL 
+     else (rxNode is outdoor)
+        L = OH + EWL
+      
+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. 
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/doc/source/buildings-references.rst	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,6 @@
+.. include:: replace.txt
+
+
+.. [turkmani] Turkmani A.M.D., J.D. Parson and D.G. Lewis, "Radio propagation into buildings at 441, 900 and 1400 MHz",
+   in Proc. of 4th Int. Conference on Land Mobile Radio, 1987.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/doc/source/buildings-testing.rst	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,104 @@
++++++++++++++++++++++++++++++++++++++
+ Testing Documentation
++++++++++++++++++++++++++++++++++++++
+
+
+Overview
+********
+
+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::
+
+    ./waf configure --enable-tests --enable-modules=buildings
+    ./test.py
+
+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.
+
+You can get a more detailed report in HTML format in this way::
+
+    ./test.py -w results.html
+
+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. 
+
+You can run each test suite separately using this command::
+
+    ./test.py -s test-suite-name
+
+For more details about ``test.py`` and the ns-3 testing framework, please refer to the ns-3 manual.
+
+
+
+Description of the test suites
+******************************
+
+
+BuildingsHelper test
+~~~~~~~~~~~~~~~~~~~~
+
+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.
+
+
+Pathloss tests
+~~~~~~~~~~~~~~
+
+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).
+
+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.
+
+Test #1 Okumura Hata
+--------------------
+
+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).
+
+Test #2 COST231 Model
+---------------------
+
+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.
+
+Test #3 2.6 GHz model
+---------------------
+
+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.
+
+Test #4 ITU1411 LoS model
+-------------------------
+
+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.).
+
+Test #5 ITU1411 NLoS model
+--------------------------
+
+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.).
+
+Test #6 ITUP1238 model
+----------------------
+
+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.
+
+Test #7 Outdoor -> Indoor with Okumura Hata model
+-------------------------------------------------
+
+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.
+
+Test #8 Outdoor -> Indoor with ITU1411 model
+-------------------------------------------------
+
+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.
+
+
+Test #9 Indoor -> Outdoor with ITU1411 model
+-------------------------------------------------
+
+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.
+
+Test #10 Indoor -> Outdoor with ITU1411 model
+-------------------------------------------------
+
+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.
+
+
+Shadowing Test
+~~~~~~~~~~~~~~
+
+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.
+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.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/doc/source/buildings-user.rst	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,51 @@
+.. include:: replace.txt
+
+
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+  User Documentation
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+
+
+Main configurable parameters
+----------------------------
+
+The ``Building`` class has the following configurable parameters:
+
+* building type: Residential, Office and Commercial.
+* external walls type: Wood, ConcreteWithWindows, ConcreteWithoutWindows and StoneBlocks.
+* building bounds: a ``Box`` class with the building bounds.
+* number of floors.
+* number of rooms in x-axis and y-axis (rooms can be placed only in a grid way).
+
+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:
+
+* the number of floor the node is placed (default 0).
+* the position in the rooms grid.
+
+
+The ``BuildingPropagationLossModel`` class has the following configurable parameters configurable with the attribute system:
+
+* ``Frequency``: reference frequency (default 2160 MHz), note that by setting the frequency the wavelength is set accordingly automatically and viceversa).
+* ``Lambda``: the wavelength (0.139 meters, considering the above frequency).
+* ``ShadowSigmaOutdoor``: the standard deviation of the shadowing for outdoor nodes (defaul 7.0).
+* ``ShadowSigmaIndoor``: the standard deviation of the shadowing for indoor nodes (default 8.0).
+* ``ShadowSigmaExtWalls``: the standard deviation of the shadowing due to external walls penetration for outdoor to indoor communications (default 5.0).
+* ``RooftopLevel``: the level of the rooftop of the building in meters (default 20 meters).
+* ``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).
+* ``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).
+* ``MinDistance``: the minimum distance in meters between two nodes for evaluating the pathloss (considered neglictible before this threshold) (default 0.5 meters).
+* ``Environment``: the environment scenario among Urban, SubUrban and OpenAreas (default Urban).
+* ``CitySize``: the dimension of the city among Small, Medium, Large (default Large).
+
+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.
+The simple ``OhBuildingMobilityLossModel`` overcome this problem by using only the Okumura Hata model and the wall penetration losses.
+
+
+
+
+
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/doc/source/buildings.rst	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,18 @@
+
+#####################################################
+Buildings Module
+#####################################################
+
+
+
+
+.. toctree::
+
+    buildings-design
+    buildings-user
+    buildings-testing
+    buildings-references
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/doc/source/conf.py	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,216 @@
+# -*- coding: utf-8 -*-
+#
+# ns-3 documentation build configuration file, created by
+# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.pngmath', 
+              'sphinxcontrib.seqdiag']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'LENA'
+copyright = u'2011-2012, CTTC'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = 'M2'
+# The full version, including alpha/beta/rc tags.
+release = 'M2'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+#html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+#htmlhelp_basename = 'ns-3doc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+  ('buildings', 'buildings.tex', u'Buildings Module Documentation', u'Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    ('index', 'ns-3-model-library', u'ns-3 Model Library',
+     [u'ns-3 project'], 1)
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/doc/source/index.rst	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,17 @@
+
+#####################################################
+Buildings Module
+#####################################################
+
+
+
+
+.. toctree::
+
+    buildings-design
+    buildings-user
+    buildings-testing
+
+
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/doc/source/replace.txt	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,3 @@
+.. |ns3| replace:: *ns-3*
+
+.. |ns2| replace:: *ns-2*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/examples/buildings-pathloss-profiler.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,97 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2 as
+* published by the Free Software Foundation;
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*
+* Author: Marco Miozzo <marco.miozzo@cttc.es>
+*/
+
+#include "ns3/core-module.h"
+#include "ns3/network-module.h"
+#include "ns3/mobility-module.h"
+#include "ns3/lte-module.h"
+#include "ns3/config-store.h"
+#include <ns3/hybrid-buildings-propagation-loss-model.h>
+
+#include <iomanip>
+#include <string>
+#include <vector>
+
+using namespace ns3;
+using std::vector;
+
+int
+main (int argc, char *argv[])
+{
+  
+  double hEnb = 30.0;
+  double hUe = 1.0;
+  bool enbIndoor = false;
+  bool ueIndoor = false;
+  CommandLine cmd;
+  
+  cmd.AddValue("hEnb", "Height of the eNB", hEnb);
+  cmd.AddValue("hUe", "Height of UE", hUe);
+  cmd.AddValue("enbIndoor", "Boolean for eNB Indoor/Outdoor selection",               enbIndoor);
+  cmd.AddValue("ueIndoor", "Boolean for UE Indoor/Outdoor selection",               ueIndoor);
+  cmd.Parse(argc, argv);
+  
+  ConfigStore inputConfig;
+  inputConfig.ConfigureDefaults ();
+  
+  
+  // parse again so you can override default values from the command line
+  cmd.Parse (argc, argv);
+  
+  
+  std::ofstream outFile;
+  outFile.open ("buildings-pathloss-profiler.out");
+  if (!outFile.is_open ())
+  {
+    NS_FATAL_ERROR ("Can't open output file");
+  }
+  
+  Ptr<BuildingsMobilityModel> mmEnb = CreateObject<BuildingsMobilityModel> ();
+  mmEnb->SetPosition (Vector (0.0, 0.0, hEnb));
+  if (enbIndoor)
+    {
+      Ptr<Building> building1 = Create<Building> (0.0, 10.0, 0.0, 10.0, 0.0, 20.0 /*, 1, 1, 1*/);
+      building1->SetBuildingType (Building::Residential);
+      building1->SetExtWallsType (Building::ConcreteWithWindows);
+      mmEnb->SetIndoor (building1);
+    }
+  
+  Ptr<HybridBuildingsPropagationLossModel> propagationLossModel = CreateObject<HybridBuildingsPropagationLossModel> ();
+  // cancel shadowing effect
+  propagationLossModel->SetAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
+  propagationLossModel->SetAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
+  propagationLossModel->SetAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
+  
+//   propagationLossModel->SetAttribute ("Los2NlosThr", DoubleValue (1550.0));
+  
+  //for (uint8_t i = 0; i < 23; i++)
+  for (uint32_t i = 1; i < 2300; i++)
+    {
+      Ptr<BuildingsMobilityModel> mmUe = CreateObject<BuildingsMobilityModel> ();
+      mmUe->SetPosition (Vector (i, 0.0, hUe));
+      double loss = propagationLossModel->GetLoss (mmEnb, mmUe);
+      outFile << i << "\t"
+              << loss 
+              << std::endl;
+    }
+    
+  Simulator::Destroy ();
+  
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/examples/wscript	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,6 @@
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+def build(bld):
+    obj = bld.create_ns3_program('buildings-pathloss-profiler',
+                                 ['buildings'])
+    obj.source = 'buildings-pathloss-profiler.cc'
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/helper/building-allocator.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,146 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2007 INRIA
+ * Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ * Author: Nicola Baldo <nbaldo@cttc.es> (took position-allocator and turned it into building-allocator)
+ */
+#include "building-allocator.h"
+#include "ns3/building.h"
+#include "ns3/random-variable.h"
+#include "ns3/double.h"
+#include "ns3/uinteger.h"
+#include "ns3/enum.h"
+#include "ns3/log.h"
+#include <cmath>
+
+NS_LOG_COMPONENT_DEFINE ("BuildingAllocator");
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (GridBuildingAllocator);
+
+GridBuildingAllocator::GridBuildingAllocator ()
+  : m_current (0)
+{
+  m_buildingFactory.SetTypeId ("ns3::Building");
+  m_lowerLeftPositionAllocator = CreateObject<GridPositionAllocator> ();
+  m_upperRightPositionAllocator = CreateObject<GridPositionAllocator> ();
+}
+
+GridBuildingAllocator::~GridBuildingAllocator ()
+{
+}
+
+TypeId 
+GridBuildingAllocator::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::GridBuildingAllocator")
+    .SetParent<Object> ()
+    .AddConstructor<GridBuildingAllocator> ()
+    .AddAttribute ("GridWidth", "The number of objects layed out on a line.",
+                   UintegerValue (10),
+                   MakeUintegerAccessor (&GridBuildingAllocator::m_n),
+                   MakeUintegerChecker<uint32_t> ())
+    .AddAttribute ("MinX", "The x coordinate where the grid starts.",
+                   DoubleValue (1.0),
+                   MakeDoubleAccessor (&GridBuildingAllocator::m_xMin),
+                   MakeDoubleChecker<double> ())
+    .AddAttribute ("MinY", "The y coordinate where the grid starts.",
+                   DoubleValue (0.0),
+                   MakeDoubleAccessor (&GridBuildingAllocator::m_yMin),
+                   MakeDoubleChecker<double> ())
+    .AddAttribute ("LengthX", " the length of the wall of each building along the X axis.",
+                   DoubleValue (1.0),
+                   MakeDoubleAccessor (&GridBuildingAllocator::m_lengthX),
+                   MakeDoubleChecker<double> ())
+    .AddAttribute ("LengthY", " the length of the wall of each building along the X axis.",
+                   DoubleValue (1.0),
+                   MakeDoubleAccessor (&GridBuildingAllocator::m_lengthY),
+                   MakeDoubleChecker<double> ())
+    .AddAttribute ("DeltaX", "The x space between buildings.",
+                   DoubleValue (1.0),
+                   MakeDoubleAccessor (&GridBuildingAllocator::m_deltaX),
+                   MakeDoubleChecker<double> ())
+    .AddAttribute ("DeltaY", "The y space between buildings.",
+                   DoubleValue (1.0),
+                   MakeDoubleAccessor (&GridBuildingAllocator::m_deltaY),
+                   MakeDoubleChecker<double> ())
+    .AddAttribute ("Height", "The height of the building (roof level)",
+                   DoubleValue (10),
+                   MakeDoubleAccessor (&GridBuildingAllocator::m_height),
+                   MakeDoubleChecker<double> ())
+    .AddAttribute ("LayoutType", "The type of layout.",
+                   EnumValue (GridPositionAllocator::ROW_FIRST),
+                   MakeEnumAccessor (&GridBuildingAllocator::m_layoutType),
+                   MakeEnumChecker (GridPositionAllocator::ROW_FIRST, "RowFirst",
+                                    GridPositionAllocator::COLUMN_FIRST, "ColumnFirst"))
+  ;
+  return tid;
+}
+
+void
+GridBuildingAllocator::SetBuildingAttribute (std::string n, const AttributeValue &v)
+{
+  NS_LOG_FUNCTION (this);
+  m_buildingFactory.Set (n, v);
+}
+
+BuildingContainer
+GridBuildingAllocator::Create (uint32_t n) const
+{
+  NS_LOG_FUNCTION (this);
+  PushAttributes ();
+  BuildingContainer bc;
+  uint32_t limit = n + m_current;
+  for (; m_current < limit; ++m_current)
+    {
+      Vector lowerLeft = m_lowerLeftPositionAllocator->GetNext ();
+      Vector upperRight = m_upperRightPositionAllocator->GetNext ();
+      Box box (lowerLeft.x, upperRight.x, lowerLeft.y, upperRight.y, 0, m_height);
+      NS_LOG_LOGIC ("new building : " <<  box);
+      BoxValue boxValue (box);
+      m_buildingFactory.Set ("Boundaries", boxValue);
+      Ptr<Building> b  = m_buildingFactory.Create<Building> ();
+      bc.Add (b);     
+    }
+  return bc;
+}
+
+void
+GridBuildingAllocator::PushAttributes () const
+{
+  NS_LOG_FUNCTION (this);
+  m_lowerLeftPositionAllocator->SetMinX (m_xMin);
+  m_upperRightPositionAllocator->SetMinX (m_xMin + m_lengthX);
+  m_lowerLeftPositionAllocator->SetDeltaX (m_lengthX + m_deltaX);
+  m_upperRightPositionAllocator->SetDeltaX (m_lengthX + m_deltaX);
+  
+  m_lowerLeftPositionAllocator->SetMinY (m_yMin);
+  m_upperRightPositionAllocator->SetMinY (m_yMin + m_lengthY);
+  m_lowerLeftPositionAllocator->SetDeltaY (m_lengthY + m_deltaY);
+  m_upperRightPositionAllocator->SetDeltaY (m_lengthY + m_deltaY); 
+
+  m_lowerLeftPositionAllocator->SetLayoutType (m_layoutType);
+  m_upperRightPositionAllocator->SetLayoutType (m_layoutType);
+
+  m_lowerLeftPositionAllocator->SetN (m_n);
+  m_upperRightPositionAllocator->SetN (m_n);
+}
+
+
+} // namespace ns3 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/helper/building-allocator.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,93 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2007 INRIA
+ * Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr>
+ * Author: Nicola Baldo <nbaldo@cttc.es> (took position-allocator and turned it into building-allocator)
+ */
+#ifndef BUILDING_ALLOCATOR_H
+#define BUILDING_ALLOCATOR_H
+
+#include "ns3/object.h"
+#include "ns3/object-factory.h"
+#include "ns3/random-variable.h"
+#include "ns3/vector.h"
+#include "ns3/building-container.h"
+#include "ns3/position-allocator.h"
+
+namespace ns3 {
+
+class Building;
+
+
+/**
+ * \ingroup buildings
+ * \brief Allocate buildings on a rectangular 2d grid.
+ *
+ * This class allows to create a set of buildings positioned on a
+ * rectangular 2D grid. Under the hood, this class uses two instances
+ * of GridPositionAllocator. 
+ */
+class GridBuildingAllocator : public Object
+{
+public:
+  GridBuildingAllocator ();
+  virtual ~GridBuildingAllocator ();
+
+  // inherited from Object
+  static TypeId GetTypeId (void);
+
+  /** 
+   * Set an attribute to be used for each new building to be created
+   * 
+   * \param n attribute name
+   * \param v attribute value
+   */
+  void SetBuildingAttribute (std::string n, const AttributeValue &v);
+
+  /** 
+   * Create a set of buildings allocated on a grid
+   * 
+   * \param n the number of buildings to create
+   * 
+   * \return the BuildingContainer that contains the newly created buildings
+   */
+  BuildingContainer Create (uint32_t n) const;
+
+private:
+
+  void PushAttributes () const;
+  mutable uint32_t m_current;
+  enum GridPositionAllocator::LayoutType m_layoutType;
+  double m_xMin;
+  double m_yMin;
+  uint32_t m_n;
+  double m_lengthX;
+  double m_lengthY;
+  double m_deltaX;
+  double m_deltaY;
+  double m_height;
+
+  mutable ObjectFactory m_buildingFactory;
+  Ptr<GridPositionAllocator> m_lowerLeftPositionAllocator;
+  Ptr<GridPositionAllocator> m_upperRightPositionAllocator;
+  
+};
+
+} // namespace ns3
+
+#endif /* BUILDING_ALLOCATOR_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/helper/building-container.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,102 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 INRIA
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> (original node-container.cc)
+ *         Nicola Baldo (wrote building-container.cc based on node-container.cc)
+ */
+#include "building-container.h"
+#include "ns3/building-list.h"
+#include "ns3/names.h"
+
+namespace ns3 {
+
+BuildingContainer::BuildingContainer ()
+{
+}
+
+BuildingContainer::BuildingContainer (Ptr<Building> building)
+{
+  m_buildings.push_back (building);
+}
+BuildingContainer::BuildingContainer (std::string buildingName)
+{
+  Ptr<Building> building = Names::Find<Building> (buildingName);
+  m_buildings.push_back (building);
+}
+
+BuildingContainer::Iterator 
+BuildingContainer::Begin (void) const
+{
+  return m_buildings.begin ();
+}
+BuildingContainer::Iterator 
+BuildingContainer::End (void) const
+{
+  return m_buildings.end ();
+}
+
+uint32_t 
+BuildingContainer::GetN (void) const
+{
+  return m_buildings.size ();
+}
+Ptr<Building> 
+BuildingContainer::Get (uint32_t i) const
+{
+  return m_buildings[i];
+}
+void 
+BuildingContainer::Create (uint32_t n)
+{
+  for (uint32_t i = 0; i < n; i++)
+    {
+      m_buildings.push_back (CreateObject<Building> ());
+    }
+}
+void 
+BuildingContainer::Add (BuildingContainer other)
+{
+  for (Iterator i = other.Begin (); i != other.End (); i++)
+    {
+      m_buildings.push_back (*i);
+    }
+}
+void 
+BuildingContainer::Add (Ptr<Building> building)
+{
+  m_buildings.push_back (building);
+}
+void 
+BuildingContainer::Add (std::string buildingName)
+{
+  Ptr<Building> building = Names::Find<Building> (buildingName);
+  m_buildings.push_back (building);
+}
+
+BuildingContainer 
+BuildingContainer::GetGlobal (void)
+{
+  BuildingContainer c;
+  for (BuildingList::Iterator i = BuildingList::Begin (); i != BuildingList::End (); ++i)
+    {
+      c.Add (*i);
+    }
+  return c;
+}
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/helper/building-container.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,208 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2008 INRIA
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Mathieu Lacage <mathieu.lacage@sophia.inria.fr> (original node-container.h)
+ *         Nicola Baldo (wrote building-container.h based on node-container.h)
+ */
+#ifndef BUILDING_CONTAINER_H
+#define BUILDING_CONTAINER_H
+
+#include <stdint.h>
+#include <vector>
+#include <ns3/building.h>
+
+namespace ns3 {
+
+/**
+ * \brief keep track of a set of building pointers.
+ *
+ * Some ns-3 helpers operate on more than one building at a time.  For example
+ * a PositionAllocator may want to position nodes on a set of buildings.
+ * The helper methods will then usually take a BuildingContainer as a
+ * parameter.  BuildingContainers hold the multiple Ptr<Building> which are used
+ * to refer to the buildings.
+ */
+class BuildingContainer
+{
+public:
+  typedef std::vector<Ptr<Building> >::const_iterator Iterator;
+
+  /**
+   * Create an empty BuildingContainer.
+   */
+  BuildingContainer ();
+
+  /**
+   * Create a BuildingContainer with exactly one building which has been previously
+   * instantiated.  The single Building is specified by a smart pointer.
+   *
+   * \param building The Ptr<Building> to add to the container.
+   */
+  BuildingContainer (Ptr<Building> building);
+
+  /**
+   * Create a BuildingContainer with exactly one building which has been previously 
+   * instantiated and assigned a name using the Object Name Service.  This 
+   * Building is then specified by its assigned name. 
+   *
+   * \param buildingName The name of the Building Object to add to the container.
+   */
+  BuildingContainer (std::string buildingName);
+
+  /**
+   * \brief Get an iterator which refers to the first Building in the 
+   * container.
+   *
+   * Buildings can be retrieved from the container in two ways.  First,
+   * directly by an index into the container, and second, using an iterator.
+   * This method is used in the iterator method and is typically used in a 
+   * for-loop to run through the Buildings
+   *
+   * \code
+   *   BuildingContainer::Iterator i;
+   *   for (i = container.Begin (); i != container.End (); ++i)
+   *     {
+   *       (*i)->method ();  // some Building method
+   *     }
+   * \endcode
+   *
+   * \returns an iterator which refers to the first Building in the container.
+   */
+  Iterator Begin (void) const;
+
+  /**
+   * \brief Get an iterator which indicates past-the-last Building in the 
+   * container.
+   *
+   * Buildings can be retrieved from the container in two ways.  First,
+   * directly by an index into the container, and second, using an iterator.
+   * This method is used in the iterator method and is typically used in a 
+   * for-loop to run through the Buildings
+   *
+   * \code
+   *   BuildingContainer::Iterator i;
+   *   for (i = container.Begin (); i != container.End (); ++i)
+   *     {
+   *       (*i)->method ();  // some Building method
+   *     }
+   * \endcode
+   *
+   * \returns an iterator which indicates an ending condition for a loop.
+   */
+  Iterator End (void) const;
+
+  /**
+   * \brief Get the number of Ptr<Building> stored in this container.
+   *
+   * Buildings can be retrieved from the container in two ways.  First,
+   * directly by an index into the container, and second, using an iterator.
+   * This method is used in the direct method and is typically used to
+   * define an ending condition in a for-loop that runs through the stored
+   * Buildings
+   *
+   * \code
+   *   uint32_t nBuildings = container.GetN ();
+   *   for (uint32_t i = 0 i < nBuildings; ++i)
+   *     {
+   *       Ptr<Building> p = container.Get (i)
+   *       i->method ();  // some Building method
+   *     }
+   * \endcode
+   *
+   * \returns the number of Ptr<Building> stored in this container.
+   */
+  uint32_t GetN (void) const;
+
+  /**
+   * \brief Get the Ptr<Building> stored in this container at a given
+   * index.
+   *
+   * Buildings can be retrieved from the container in two ways.  First,
+   * directly by an index into the container, and second, using an iterator.
+   * This method is used in the direct method and is used to retrieve the
+   * indexed Ptr<Appliation>.
+   *
+   * \code
+   *   uint32_t nBuildings = container.GetN ();
+   *   for (uint32_t i = 0 i < nBuildings; ++i)
+   *     {
+   *       Ptr<Building> p = container.Get (i)
+   *       i->method ();  // some Building method
+   *     }
+   * \endcode
+   *
+   * \param i the index of the requested building pointer.
+   * \returns the requested building pointer.
+   */
+  Ptr<Building> Get (uint32_t i) const;
+
+  /**
+   * \brief Create n buildings and append pointers to them to the end of this 
+   * BuildingContainer.
+   *
+   * Buildings are at the heart of any ns-3 simulation.  One of the first tasks that
+   * any simulation needs to do is to create a number of buildings.  This method
+   * automates that task.
+   *
+   * \param n The number of Buildings to create
+   */
+  void Create (uint32_t n);
+
+  /**
+   * \brief Append the contents of another BuildingContainer to the end of
+   * this container.
+   *
+   * \param other The BuildingContainer to append.
+   */
+  void Add (BuildingContainer other);
+
+  /**
+   * \brief Append a single Ptr<Building> to this container.
+   *
+   * \param building The Ptr<Building> to append.
+   */
+  void Add (Ptr<Building> building);
+
+  /**
+   * \brief Append to this container the single Ptr<Building> referred to
+   * via its object name service registered name.
+   *
+   * \param buildingName The name of the Building Object to add to the container.
+   */
+  void Add (std::string buildingName);
+
+  /**
+   * \brief Create a BuildingContainer that contains a list of _all_ buildings
+   * stored in the ns3::BuildingList.
+   *
+   * Whenever a Building is created, a Ptr<Building> is added to a global list of all
+   * buildings in the system.  It is sometimes useful to be able to get to all
+   * buildings in one place.  This method creates a BuildingContainer that is 
+   * initialized to contain all of the simulation buildings,
+   *
+   * \returns a BuildingContainer which contains a list of all Buildings.
+   */
+  static BuildingContainer GetGlobal (void);
+
+private:
+  std::vector<Ptr<Building> > m_buildings;
+};
+
+} // namespace ns3
+
+#endif /* BUILDING_CONTAINER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/helper/building-position-allocator.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,270 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (C)  2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Nicola Baldo <nbaldo@cttc.es>
+ */
+#include "building-position-allocator.h"
+#include "ns3/buildings-mobility-model.h"
+#include "ns3/buildings-helper.h"
+#include "ns3/random-variable.h"
+#include "ns3/double.h"
+#include "ns3/uinteger.h"
+#include "ns3/enum.h"
+#include "ns3/boolean.h"
+#include "ns3/log.h"
+#include "ns3/box.h"
+#include "ns3/building.h"
+#include <cmath>
+
+#include "ns3/building-list.h"
+
+NS_LOG_COMPONENT_DEFINE ("BuildingPositionAllocator");
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (RandomBuildingPositionAllocator);
+
+
+RandomBuildingPositionAllocator::RandomBuildingPositionAllocator ()
+{
+}
+
+TypeId
+RandomBuildingPositionAllocator::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::RandomBuildingPositionAllocator")
+    .SetParent<PositionAllocator> ()
+    .SetGroupName ("Mobility")
+    .AddConstructor<RandomBuildingPositionAllocator> ()
+    .AddAttribute ("WithReplacement",
+                   "If true, the building will be randomly selected with replacement. "
+                   "If false, no replacement will occur, until the list of buildings "
+                   "to select becomes empty, at which point it will be filled again "
+                   "with the list of all buildings.",
+                   BooleanValue (false),
+                   MakeBooleanAccessor (&RandomBuildingPositionAllocator::m_withReplacement),
+                   MakeBooleanChecker ());
+  return tid;
+}
+
+Vector 
+RandomBuildingPositionAllocator::GetNext () const
+{
+  UniformVariable rand;
+  NS_ASSERT_MSG (BuildingList::GetNBuildings () > 0, "no building found");
+  Ptr<Building> b;
+  if (m_withReplacement)
+    {
+      uint32_t n = rand.GetInteger (0, BuildingList::GetNBuildings () - 1);
+      b = BuildingList::GetBuilding (n);
+    }
+  else
+    {
+      if (m_buildingListWithoutReplacement.empty ())
+        {
+            for (BuildingList::Iterator bit = BuildingList::Begin (); bit != BuildingList::End (); ++bit)
+              {
+                m_buildingListWithoutReplacement.push_back (*bit);
+              }
+        }
+      uint32_t n = rand.GetInteger (0, m_buildingListWithoutReplacement.size () - 1);
+      b = m_buildingListWithoutReplacement.at (n);      
+      m_buildingListWithoutReplacement.erase (m_buildingListWithoutReplacement.begin () + n);
+    }
+
+  Ptr<RandomBoxPositionAllocator> pa = CreateObject<RandomBoxPositionAllocator> ();
+  UniformVariable v;
+  BoxValue bv;
+  b->GetAttribute ("Boundaries", bv);
+  double x = v.GetValue (bv.Get ().xMin, bv.Get ().xMax);
+  double y = v.GetValue (bv.Get ().yMin, bv.Get ().yMax);
+  double z = v.GetValue (bv.Get ().zMin, bv.Get ().zMax);
+  return Vector (x, y, z);
+}
+
+
+
+
+NS_OBJECT_ENSURE_REGISTERED (RandomRoomPositionAllocator);
+
+
+RandomRoomPositionAllocator::RandomRoomPositionAllocator ()
+{
+}
+
+TypeId
+RandomRoomPositionAllocator::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::RandomRoomPositionAllocator")
+    .SetParent<PositionAllocator> ()
+    .SetGroupName ("Mobility")
+    .AddConstructor<RandomRoomPositionAllocator> ();
+  return tid;
+}
+
+Vector 
+RandomRoomPositionAllocator::GetNext () const
+{
+  NS_LOG_FUNCTION (this);
+  UniformVariable rand;
+  NS_ASSERT_MSG (BuildingList::GetNBuildings () > 0, "no building found");
+ 
+  if (m_roomListWithoutReplacement.empty ())
+    {
+      for (BuildingList::Iterator bit = BuildingList::Begin (); bit != BuildingList::End (); ++bit)
+        {
+          NS_LOG_LOGIC ("building " << (*bit)->GetId ());
+          for (uint32_t rx = 0; rx < (*bit)->GetNRoomsX (); ++rx)
+            {
+              for (uint32_t ry = 0; ry < (*bit)->GetNRoomsY (); ++ry)
+                {
+                  for (uint32_t f = 0; f < (*bit)->GetNFloors (); ++f)
+                    {
+                      RoomInfo i;
+                      i.roomx = rx;
+                      i.roomy = ry;
+                      i.floor = f; 
+                      i.b = *bit;
+                      NS_LOG_LOGIC ("adding room (" << rx << ", " << ry << ", " << f << ")");
+                      m_roomListWithoutReplacement.push_back (i);
+                    }
+                }
+            }
+        }
+    }
+  uint32_t n = rand.GetInteger (0,m_roomListWithoutReplacement.size () - 1);
+  RoomInfo r = m_roomListWithoutReplacement.at (n);      
+  m_roomListWithoutReplacement.erase (m_roomListWithoutReplacement.begin () + n);  
+  NS_LOG_LOGIC ("considering room (" << r.roomx << ", " << r.roomy << ", " << r.floor << ")");
+
+  Ptr<RandomBoxPositionAllocator> pa = CreateObject<RandomBoxPositionAllocator> ();
+  UniformVariable v;
+  BoxValue bv;
+  r.b->GetAttribute ("Boundaries", bv);
+  Box box = bv.Get ();
+  double rdx =  (box.xMax - box.xMin) / r.b->GetNRoomsX ();
+  double rdy =  (box.yMax - box.yMin) / r.b->GetNRoomsY ();
+  double rdz =  (box.zMax - box.zMin) / r.b->GetNFloors ();
+  double x1 = box.xMin + rdx * r.roomx;
+  double x2 = box.xMin + rdx * (r.roomx + 1);
+  double y1 = box.yMin + rdy * r.roomy;
+  double y2 = box.yMin + rdy * (r.roomy + 1);
+  double z1 = box.zMin + rdz * r.floor;
+  double z2 = box.zMin + rdz * (r.floor + 1);
+  NS_LOG_LOGIC ("randomly allocating position in "
+                << " (" << x1 << "," << x2 << ") "
+                << "x (" << y1 << "," << y2 << ") "
+                << "x (" << z1 << "," << z2 << ") ");
+
+  double x = v.GetValue (x1, x2);
+  double y = v.GetValue (y1, y2);
+  double z = v.GetValue (z1, z2);
+  
+  return Vector (x, y, z);
+}
+
+
+
+
+
+NS_OBJECT_ENSURE_REGISTERED (SameRoomPositionAllocator);
+
+SameRoomPositionAllocator::SameRoomPositionAllocator ()
+{
+  NS_FATAL_ERROR (" Constructor \"SameRoomPositionAllocator ()\" should not be used");
+}
+
+
+SameRoomPositionAllocator::SameRoomPositionAllocator (NodeContainer c)
+  : m_nodes (c)
+{
+  m_nodeIt = m_nodes.Begin ();
+  // this is needed to make sure the building models associated with c have been initialized
+  for (NodeContainer::Iterator it = m_nodes.Begin (); it != m_nodes.End (); ++it)
+    {
+      Ptr<MobilityModel> mm = (*it)->GetObject<MobilityModel> ();
+      NS_ASSERT_MSG (mm, "no mobility model aggregated to this node");
+      Ptr<BuildingsMobilityModel> bmm = DynamicCast<BuildingsMobilityModel> (mm);
+      NS_ASSERT_MSG (bmm, "mobility model aggregated to this node is not a BuildingsMobilityModel");
+      BuildingsHelper::MakeConsistent (bmm);
+    }
+}
+
+TypeId
+SameRoomPositionAllocator::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::SameRoomPositionAllocator")
+    .SetParent<PositionAllocator> ()
+    .SetGroupName ("Mobility")
+    .AddConstructor<SameRoomPositionAllocator> ();
+  return tid;
+}
+
+Vector 
+SameRoomPositionAllocator::GetNext () const
+{
+  NS_LOG_FUNCTION (this);
+  UniformVariable rand;
+  if (m_nodeIt == m_nodes.End ())
+    {
+      m_nodeIt  = m_nodes.Begin ();
+    }
+  
+  NS_ASSERT_MSG (m_nodeIt != m_nodes.End (), "no node in container");
+
+  NS_LOG_LOGIC ("considering node " << (*m_nodeIt)->GetId ());
+  Ptr<MobilityModel> mm = (*m_nodeIt)->GetObject<MobilityModel> ();
+  NS_ASSERT_MSG (mm, "no mobility model aggregated to this node");
+  Ptr<BuildingsMobilityModel> bmm = DynamicCast<BuildingsMobilityModel> (mm);
+  NS_ASSERT_MSG (bmm, "mobility model aggregated to this node is not a BuildingsMobilityModel");
+
+  ++m_nodeIt;
+  uint32_t roomx = bmm->GetRoomNumberX ();
+  uint32_t roomy = bmm->GetRoomNumberY ();
+  uint32_t floor = bmm->GetFloorNumber ();
+  NS_LOG_LOGIC ("considering building " << bmm->GetBuilding ()->GetId () << " room (" << roomx << ", " << roomy << ", " << floor << ")");
+
+  Ptr<Building> b = bmm->GetBuilding ();
+  Ptr<RandomBoxPositionAllocator> pa = CreateObject<RandomBoxPositionAllocator> ();
+  UniformVariable v;
+  BoxValue bv;
+  b->GetAttribute ("Boundaries", bv);
+  Box box = bv.Get ();
+  double rdx =  (box.xMax - box.xMin) / b->GetNRoomsX ();
+  double rdy =  (box.yMax - box.yMin) / b->GetNRoomsY ();
+  double rdz =  (box.zMax - box.zMin) / b->GetNFloors ();
+  double x1 = box.xMin + rdx * roomx;
+  double x2 = box.xMin + rdx * (roomx + 1);
+  double y1 = box.yMin + rdy * roomy;
+  double y2 = box.yMin + rdy * (roomy + 1);
+  double z1 = box.zMin + rdz * floor;
+  double z2 = box.zMin + rdz * (floor + 1);
+  NS_LOG_LOGIC ("randomly allocating position in "
+                << " (" << x1 << "," << x2 << ") "
+                << "x (" << y1 << "," << y2 << ") "
+                << "x (" << z1 << "," << z2 << ") ");
+
+  double x = v.GetValue (x1, x2);
+  double y = v.GetValue (y1, y2);
+  double z = v.GetValue (z1, z2);
+  
+  return Vector (x, y, z);
+}
+
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/helper/building-position-allocator.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,112 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (C) 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Nicola Baldo <nbaldo@cttc.es>
+ */
+#ifndef BUILDING_POSITION_ALLOCATOR_H
+#define BUILDING_POSITION_ALLOCATOR_H
+
+#include <ns3/ptr.h>
+#include <ns3/position-allocator.h>
+#include <ns3/node-container.h>
+
+namespace ns3 {
+
+class Building;
+
+
+/**
+ * Allocate each position by randomly chosing a building from the list
+ * of all buildings, and then randomly chosing a position inside the building.
+ * 
+ */
+class RandomBuildingPositionAllocator : public PositionAllocator
+{
+public:
+  RandomBuildingPositionAllocator ();
+
+  // inherited from Object
+  static TypeId GetTypeId (void);
+
+  // inherited from PositionAllocator
+  virtual Vector GetNext (void) const;
+
+private:
+  
+  bool m_withReplacement;
+  mutable std::vector< Ptr<Building> > m_buildingListWithoutReplacement;
+};
+
+
+/**
+ * Allocate each position by randomly chosing a room from the list
+ * of all buildings, and then randomly chosing a position inside the room.
+ * The selection of the room is always done without replacement.
+ * 
+ */
+class RandomRoomPositionAllocator : public PositionAllocator
+{
+public:
+  RandomRoomPositionAllocator ();
+
+  // inherited from Object
+  static TypeId GetTypeId (void);
+
+  // inherited from PositionAllocator
+  virtual Vector GetNext (void) const;
+
+private:
+  
+  bool m_withReplacement;
+  struct RoomInfo 
+  {
+    Ptr<Building> b;
+    uint32_t roomx;
+    uint32_t roomy;
+    uint32_t floor;
+  };
+  mutable std::vector<RoomInfo> m_roomListWithoutReplacement;
+};
+
+
+/**
+ * Walks a given NodeContainer sequentially, and for each node allocate a new
+ * position randomly in the same room of that node
+ * 
+ */
+class SameRoomPositionAllocator : public PositionAllocator
+{
+public:
+  SameRoomPositionAllocator ();
+  SameRoomPositionAllocator (NodeContainer c);
+
+  // inherited from Object
+  static TypeId GetTypeId (void);
+
+  // inherited from PositionAllocator
+  virtual Vector GetNext (void) const;
+
+private:
+
+  NodeContainer m_nodes;
+  mutable NodeContainer::Iterator m_nodeIt;
+};
+
+
+} // namespace ns3
+
+#endif /* BUILDING_POSITION_ALLOCATOR_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/helper/buildings-helper.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,79 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2012 CTTC
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Nicola Baldo <nbaldo@cttc.es>
+ */
+
+#include "buildings-helper.h"
+
+#include <ns3/node-list.h>
+#include <ns3/building.h>
+#include <ns3/building-list.h>
+#include <ns3/mobility-model.h>
+#include <ns3/buildings-mobility-model.h>
+#include <ns3/abort.h>
+#include <ns3/log.h>
+
+
+NS_LOG_COMPONENT_DEFINE ("BuildingsHelper");
+
+namespace ns3 {
+
+void
+BuildingsHelper::MakeMobilityModelConsistent ()
+{
+  NS_LOG_FUNCTION_NOARGS ();
+  for (NodeList::Iterator nit = NodeList::Begin (); nit != NodeList::End (); ++nit)
+    {
+      Ptr<MobilityModel> mm = (*nit)->GetObject<MobilityModel> ();
+      if (mm != 0)
+        {
+          Ptr<BuildingsMobilityModel> bmm = DynamicCast<BuildingsMobilityModel> (mm);
+          NS_ABORT_MSG_UNLESS (0 != bmm, "node " << (*nit)->GetId () << " has a MobilityModel but it is not a BuildingsMobilityModel");
+          MakeConsistent (bmm);
+        }
+    }
+}
+
+
+void
+BuildingsHelper::MakeConsistent (Ptr<BuildingsMobilityModel> bmm)
+{
+  bool found = false;
+  for (BuildingList::Iterator bit = BuildingList::Begin (); bit != BuildingList::End (); ++bit)
+    {
+      Vector pos = bmm->GetPosition ();
+      if ((*bit)->IsInside (pos))
+        {
+          NS_LOG_LOGIC ("BuildingsMobilityModel " << bmm << " falls inside building " << (*bit)->GetId ());
+          NS_ABORT_MSG_UNLESS (found == false, " BuildingsMobilityModel already inside another building!");		
+          found = true;
+          uint16_t floor = (*bit)->GetFloor (pos);
+          uint16_t roomX = (*bit)->GetRoomX (pos);
+          uint16_t roomY = (*bit)->GetRoomY (pos);	   
+          bmm->SetIndoor (*bit, floor, roomX, roomY);	      
+        }		    	  
+    }
+  if (!found)
+    {
+      NS_LOG_LOGIC ("BuildingsMobilityModel " << bmm  << " is outdoor");
+      bmm->SetOutdoor ();
+    }
+
+}
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/helper/buildings-helper.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,46 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2012 CTTC
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Nicola Baldo <nbaldo@cttc.es>
+ */
+
+#ifndef BUILDINGS_HELPER_H
+#define BUILDINGS_HELPER_H
+
+#include <string>
+#include <ns3/attribute.h>
+#include <ns3/object-factory.h>
+#include <ns3/node-container.h>
+#include <ns3/ptr.h>
+
+
+namespace ns3 {
+
+class BuildingsMobilityModel;
+
+class BuildingsHelper
+{
+public:  
+  static void MakeMobilityModelConsistent ();
+  static void MakeConsistent (Ptr<BuildingsMobilityModel> bmm);
+  
+};
+
+
+}
+
+#endif /* BUILDINGS_HELPER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/building-list.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,192 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Jaume Nin <jaume.nin@cttc,cat>
+ * Based on BuildingList implemenation by Mathieu Lacage  <mathieu.lacage@sophia.inria.fr>
+ *
+ */
+#include "building-list.h"
+#include "ns3/simulator.h"
+#include "ns3/object-vector.h"
+#include "ns3/config.h"
+#include "ns3/log.h"
+#include "ns3/assert.h"
+#include "building-list.h"
+#include "building.h"
+
+namespace ns3 {
+
+NS_LOG_COMPONENT_DEFINE ("BuildingList");
+
+/**
+ * \brief private implementation detail of the BuildingList API.
+ */
+class BuildingListPriv : public Object
+{
+public:
+  static TypeId GetTypeId (void);
+  BuildingListPriv ();
+  ~BuildingListPriv ();
+
+  uint32_t Add (Ptr<Building> building);
+  BuildingList::Iterator Begin (void) const;
+  BuildingList::Iterator End (void) const;
+  Ptr<Building> GetBuilding (uint32_t n);
+  uint32_t GetNBuildings (void);
+
+  static Ptr<BuildingListPriv> Get (void);
+
+private:
+  virtual void DoDispose (void);
+  static Ptr<BuildingListPriv> *DoGet (void);
+  static void Delete (void);
+  std::vector<Ptr<Building> > m_buildings;
+};
+
+NS_OBJECT_ENSURE_REGISTERED (BuildingListPriv);
+
+TypeId
+BuildingListPriv::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::BuildingListPriv")
+    .SetParent<Object> ()
+    .AddAttribute ("BuildingList", "The list of all buildings created during the simulation.",
+                   ObjectVectorValue (),
+                   MakeObjectVectorAccessor (&BuildingListPriv::m_buildings),
+                   MakeObjectVectorChecker<Building> ())
+  ;
+  return tid;
+}
+
+Ptr<BuildingListPriv>
+BuildingListPriv::Get (void)
+{
+  return *DoGet ();
+}
+Ptr<BuildingListPriv> *
+BuildingListPriv::DoGet (void)
+{
+  static Ptr<BuildingListPriv> ptr = 0;
+  if (ptr == 0)
+    {
+      ptr = CreateObject<BuildingListPriv> ();
+      Config::RegisterRootNamespaceObject (ptr);
+      Simulator::ScheduleDestroy (&BuildingListPriv::Delete);
+    }
+  return &ptr;
+}
+void
+BuildingListPriv::Delete (void)
+{
+  NS_LOG_FUNCTION_NOARGS ();
+  Config::UnregisterRootNamespaceObject (Get ());
+  (*DoGet ()) = 0;
+}
+
+
+BuildingListPriv::BuildingListPriv ()
+{
+  NS_LOG_FUNCTION_NOARGS ();
+}
+BuildingListPriv::~BuildingListPriv ()
+{
+}
+void
+BuildingListPriv::DoDispose (void)
+{
+  NS_LOG_FUNCTION_NOARGS ();
+  for (std::vector<Ptr<Building> >::iterator i = m_buildings.begin ();
+       i != m_buildings.end (); i++)
+    {
+      Ptr<Building> building = *i;
+      building->Dispose ();
+      *i = 0;
+    }
+  m_buildings.erase (m_buildings.begin (), m_buildings.end ());
+  Object::DoDispose ();
+}
+
+
+uint32_t
+BuildingListPriv::Add (Ptr<Building> building)
+{
+  uint32_t index = m_buildings.size ();
+  m_buildings.push_back (building);
+  Simulator::ScheduleWithContext (index, TimeStep (0), &Building::Start, building);
+  return index;
+
+}
+BuildingList::Iterator
+BuildingListPriv::Begin (void) const
+{
+  return m_buildings.begin ();
+}
+BuildingList::Iterator
+BuildingListPriv::End (void) const
+{
+  return m_buildings.end ();
+}
+uint32_t
+BuildingListPriv::GetNBuildings (void)
+{
+  return m_buildings.size ();
+}
+
+Ptr<Building>
+BuildingListPriv::GetBuilding (uint32_t n)
+{
+  NS_ASSERT_MSG (n < m_buildings.size (), "Building index " << n <<
+                 " is out of range (only have " << m_buildings.size () << " buildings).");
+  return m_buildings.at (n);
+}
+
+}
+
+/**
+ * The implementation of the public static-based API
+ * which calls into the private implementation through
+ * the simulation singleton.
+ */
+namespace ns3 {
+
+uint32_t
+BuildingList::Add (Ptr<Building> building)
+{
+  return BuildingListPriv::Get ()->Add (building);
+}
+BuildingList::Iterator
+BuildingList::Begin (void)
+{
+  return BuildingListPriv::Get ()->Begin ();
+}
+BuildingList::Iterator
+BuildingList::End (void)
+{
+  return BuildingListPriv::Get ()->End ();
+}
+Ptr<Building>
+BuildingList::GetBuilding (uint32_t n)
+{
+  return BuildingListPriv::Get ()->GetBuilding (n);
+}
+uint32_t
+BuildingList::GetNBuildings (void)
+{
+  return BuildingListPriv::Get ()->GetNBuildings ();
+}
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/building-list.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,71 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Jaume Nin <jaume.nin@cttc,cat>
+ * Based on NodeList implementation by Mathieu Lacage  <mathieu.lacage@sophia.inria.fr>
+ *
+ */
+
+#ifndef BUILDING_LIST_H_
+#define BUILDING_LIST_H_
+
+#include <vector>
+#include "ns3/ptr.h"
+
+namespace ns3 {
+
+class Building;
+
+class BuildingList
+{
+public:
+  typedef std::vector< Ptr<Building> >::const_iterator Iterator;
+
+  /**
+   * \param building building to add
+   * \returns index of building in list.
+   *
+   * This method is called automatically from Building::Building so
+   * the user has little reason to call it himself.
+   */
+  static uint32_t Add (Ptr<Building> building);
+  /**
+   * \returns a C++ iterator located at the beginning of this
+   *          list.
+   */
+  static Iterator Begin (void);
+  /**
+   * \returns a C++ iterator located at the end of this
+   *          list.
+   */
+  static Iterator End (void);
+  /**
+   * \param n index of requested building.
+   * \returns the Building associated to index n.
+   */
+  static Ptr<Building> GetBuilding (uint32_t n);
+  /**
+   * \returns the number of buildings currently in the list.
+   */
+  static uint32_t GetNBuildings (void);
+};
+
+} // namespace ns3
+
+#endif /* BUILDING_LIST_H_ */
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/building.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,288 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Authors: Marco Miozzo  <marco.miozzo@cttc.es>
+ *          Nicola Baldo <nbaldo@cttc.es>
+ * 
+ */
+
+#include "building.h"
+#include "building-list.h"
+
+#include <ns3/enum.h>
+#include <ns3/uinteger.h>
+#include <ns3/log.h>
+#include <ns3/assert.h>
+#include <math.h>
+
+NS_LOG_COMPONENT_DEFINE ("Building");
+
+namespace ns3 {
+
+
+NS_OBJECT_ENSURE_REGISTERED (Building);
+
+TypeId
+Building::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::Building")
+    .SetParent<Object> ()
+    .AddConstructor<Building> ()
+    .AddAttribute ("NRoomsX", "The number of rooms in the X axis.",
+                   UintegerValue (1),
+                   MakeUintegerAccessor (&Building::GetNRoomsX, &Building::SetNRoomsX),
+                   MakeUintegerChecker<uint32_t> ())
+    .AddAttribute ("NRoomsY", "The number of rooms in the Y axis.",
+                   UintegerValue (1),
+                   MakeUintegerAccessor (&Building::GetNRoomsY, &Building::SetNRoomsY),
+                   MakeUintegerChecker<uint32_t> ())
+    .AddAttribute ("NFloors", "The number of floors of this building.",
+                   UintegerValue (1),
+                   MakeUintegerAccessor (&Building::GetNFloors, &Building::SetNFloors),
+                   MakeUintegerChecker<uint32_t> ())
+    .AddAttribute ("Id", "The id (unique integer) of this Building.",
+                   UintegerValue (0),
+                   MakeUintegerAccessor (&Building::GetId),
+                   MakeUintegerChecker<uint32_t> ())
+    .AddAttribute ("Boundaries", "The boundaries of this Building as a value of type ns3::Box",
+                   BoxValue (Box ()),
+                   MakeBoxAccessor (&Building::GetBoundaries, &Building::SetBoundaries),
+                   MakeBoxChecker ())
+    .AddAttribute ("Type",
+                   "The type of building",
+                   EnumValue (Building::Residential),
+                   MakeEnumAccessor (&Building::GetBuildingType, &Building::SetBuildingType),
+                   MakeEnumChecker (Building::Residential, "Residential",
+                                    Building::Office, "Office",
+                                    Building::Commercial, "Commercial"))
+    .AddAttribute ("ExternalWallsType",
+                   "The type of material of which the external walls are made",
+                   EnumValue (Building::ConcreteWithWindows),
+                   MakeEnumAccessor (&Building::GetExtWallsType, &Building::SetExtWallsType),
+                   MakeEnumChecker (Building::Wood, "Wood",
+                                    Building::ConcreteWithWindows, "ConcreteWithWindows",
+                                    Building::ConcreteWithoutWindows, "ConcreteWithoutWindows",
+                                    Building::StoneBlocks, "StoneBlocks"))
+  ;
+  return tid;
+}
+
+Building::Building (double xMin, 
+                    double xMax,
+                    double yMin, 
+                    double yMax,
+                    double zMin, 
+                    double zMax)
+{
+  NS_FATAL_ERROR (std::endl << "this function is not supported any more:" << std::endl
+                  << " Building::Building (double xMin, double xMax, double yMin, " << std::endl
+                  << "                     double yMax, double zMin, double zMax)\n" << std::endl
+                  << "so you can't do any more stuff like:" << std::endl
+                  << "Ptr<Building> b = CreateObject<Building> (" 
+                  << xMin << ", "
+                  << xMax << ", "
+                  << yMin << ", "
+                  << yMax << ", "
+                  << zMin << ", "
+                  << zMax << ")\n" << std::endl
+                  << "Please use instead something like this:" << std::endl
+                  << " Ptr<Building> b = CreateObject<Building> ();" << std::endl
+                  << " b->SetBoundaries (Box ("
+                  << xMin << ", "
+                  << xMax << ", "
+                  << yMin << ", "
+                  << yMax << ", "
+                  << zMin << ", "
+                  << zMax << "));" << std::endl <<std::endl);
+}
+
+
+Building::Building () 
+{
+  NS_LOG_FUNCTION (this);
+  m_buildingId = BuildingList::Add(this);
+}
+
+Building::~Building () 
+{
+  NS_LOG_FUNCTION (this);
+}
+
+void
+Building::DoDispose () 
+{
+  NS_LOG_FUNCTION (this);
+}
+
+uint32_t
+Building::GetId (void) const
+{
+  NS_LOG_FUNCTION (this);
+  return m_buildingId;
+}
+
+void
+Building::SetBoundaries (Box boundaries)
+{
+  NS_LOG_FUNCTION (this << boundaries);
+  m_buildingBounds = boundaries;
+}
+
+void
+Building::SetBuildingType (Building::BuildingType_t t)
+{
+  NS_LOG_FUNCTION (this << t);
+  m_buildingType = t;
+}
+
+void 
+Building::SetExtWallsType (Building::ExtWallsType_t t)
+{
+  NS_LOG_FUNCTION (this << t);
+  m_externalWalls = t;
+}
+
+void
+Building::SetNFloors (uint16_t nfloors)
+{
+  NS_LOG_FUNCTION (this << nfloors);
+  m_floors = nfloors;
+}
+
+void
+Building::SetNRoomsX (uint16_t nroomx)
+{
+  NS_LOG_FUNCTION (this << nroomx);
+  m_roomsX = nroomx;
+}
+
+void
+Building::SetNRoomsY (uint16_t nroomy)
+{
+  NS_LOG_FUNCTION (this << nroomy);
+  m_roomsY = nroomy;
+}
+
+Box
+Building::GetBoundaries () const
+{
+  NS_LOG_FUNCTION (this);
+  return m_buildingBounds;
+}
+
+Building::BuildingType_t 
+Building::GetBuildingType () const
+{
+  return (m_buildingType);
+}
+
+Building::ExtWallsType_t
+Building::GetExtWallsType () const
+{
+  return (m_externalWalls);
+}
+
+uint16_t 
+Building::GetNFloors () const
+{
+  return (m_floors);
+}
+
+uint16_t 
+Building::GetNRoomsX () const
+{
+  return (m_roomsX);
+}
+
+uint16_t 
+Building::GetNRoomsY () const
+{
+  return (m_roomsY);
+}
+
+bool 
+Building::IsInside (Vector position) const
+{
+  return m_buildingBounds.IsInside (position);
+}
+
+
+uint16_t 
+Building::GetRoomX (Vector position) const
+{
+  NS_ASSERT (IsInside (position));
+  uint16_t n;
+
+  if (position.x ==  m_buildingBounds.xMax)
+    {
+      n = m_roomsX;
+    }                                                                   
+  else
+    {
+      double xLength = m_buildingBounds.xMax - m_buildingBounds.xMin;
+      double x = position.x - m_buildingBounds.xMin;
+      n = floor (m_roomsX * x/xLength) + 1;
+      NS_LOG_LOGIC ("xLength=" << xLength << ", x=" << x << ", m_roomsX=" << m_roomsX);
+    }
+  NS_LOG_LOGIC ("RoomX: " << n);
+  return n;
+}
+
+uint16_t 
+Building::GetRoomY (Vector position) const
+{
+  NS_ASSERT (IsInside (position));
+  uint16_t n;
+
+  if (position.y ==  m_buildingBounds.yMax)
+    {
+      n = m_roomsY;
+    }                                                                   
+  else
+    {
+      double yLength = m_buildingBounds.yMax - m_buildingBounds.yMin;
+      double y = position.y - m_buildingBounds.yMin;
+      n = floor (m_roomsY * y/yLength) + 1;
+      NS_LOG_LOGIC ("yLength=" << yLength << ", y=" << y << ", m_roomsY=" << m_roomsY);
+    }
+  NS_LOG_LOGIC ("RoomY: " << n);
+  return n;
+}
+
+uint16_t 
+Building::GetFloor (Vector position) const
+{
+  NS_ASSERT (IsInside (position));
+  uint16_t n;
+
+  if (position.z ==  m_buildingBounds.zMax)
+    {
+      n = m_floors;
+    }                                                                   
+  else
+    {
+      double zLength = m_buildingBounds.zMax - m_buildingBounds.zMin;
+      double z = position.z - m_buildingBounds.zMin;
+      n = floor (m_floors * z/zLength) + 1;
+      NS_LOG_LOGIC ("zLength=" << zLength << ", z=" << z << ", m_floors=" << m_floors);
+    }
+  NS_LOG_LOGIC ("floor: " << n);
+  return n;
+}
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/building.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,227 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo  <marco.miozzo@cttc.es>
+ * 
+ */
+#ifndef BUILDING_H
+#define BUILDING_H
+
+#include <ns3/attribute.h>
+#include <ns3/attribute-helper.h>
+#include <ns3/vector.h>
+#include <ns3/box.h>
+#include <ns3/simple-ref-count.h>
+#include <ns3/object.h>
+
+namespace ns3 {
+
+/**
+ * \ingroup mobility
+ * \brief a 3d building block
+ */
+class Building : public Object
+{
+public:
+
+  // inherited from Object
+  static TypeId GetTypeId (void);
+  virtual void DoDispose ();
+
+
+  enum BuildingType_t
+    {
+      Residential, Office, Commercial
+    };
+  enum ExtWallsType_t
+    {
+      Wood, ConcreteWithWindows, ConcreteWithoutWindows, StoneBlocks
+    };
+  
+  /**
+   * Construct a simple building with 1 room and 1 floor
+   * 
+   * \param xMin x coordinates of left boundary.
+   * \param xMax x coordinates of right boundary.
+   * \param yMin y coordinates of bottom boundary.
+   * \param yMax y coordinates of top boundary.
+   * \param zMin z coordinates of down boundary.
+   * \param zMax z coordinates of up boundary.
+   *
+   */
+  Building (double xMin, 
+            double xMax,
+            double yMin, 
+            double yMax,
+            double zMin, 
+            double zMax);
+
+  /**
+   * Create a zero-sized building located at coordinates (0.0,0.0,0.0)
+   * and with 1 floors and 1 room.
+   */
+  Building ();
+
+  /** 
+   * Destructor
+   * 
+   */
+  virtual ~Building ();
+
+  /**
+   * \return the unique id of this Building. This unique id happens to
+   * be also the index of the Building into the BuildingList. 
+   */
+  uint32_t GetId (void) const;
+
+  /** 
+   * Set the boundaries of the building
+   * 
+   * \param box the Box defining the boundaries of the building
+   */
+  void SetBoundaries (Box box);
+
+  /**
+   * \param t the type of building (i.e., Residential, Office, Commercial)
+   *
+   * This method allows to set building type (default is Residential)
+   */
+  void SetBuildingType (Building::BuildingType_t t);
+
+  /**
+   * \param t the type of external walls (i.e., Wood, ConcreteWithWindows,
+   * ConcreteWithoutWindows and StoneBlocks), used for evaluating the loss
+   * due to the penetration of external walls in outdoor <-> indoor comm.
+   *
+   * This method allows to set external walls type (default is Residential)
+   */
+  void SetExtWallsType (Building::ExtWallsType_t t);
+
+  /**
+   * \param nfloors the number of floors in the building
+   *
+   * This method allows to set the number of floors in the building
+   * (default is 1)
+   */
+  void SetNFloors (uint16_t nfloors);
+
+  /**
+   * \param nroomx the number of rooms along the x axis
+   *
+   * This method allows to set the number of rooms along the x-axis
+   */
+  void SetNRoomsX (uint16_t nroomx);
+
+  /**
+   * \param nroomy the number of floors in the building
+   *
+   * This method allows to set the number of rooms along the y-axis
+   */
+  void SetNRoomsY (uint16_t nroomy);
+
+  /** 
+   * 
+   * \return the boundaries of the building
+   */
+  Box GetBoundaries () const;
+
+  /**
+   * \return the type of building
+   */
+  BuildingType_t GetBuildingType () const;
+
+  /**
+   * \return the type of external walls of the building
+   */
+  ExtWallsType_t GetExtWallsType () const;
+
+  /**
+   * \return the number of floors of the building
+   */
+  uint16_t GetNFloors () const;
+
+  /**
+   * \return the number of rooms along the x-axis of the building
+   */
+  uint16_t GetNRoomsX () const;
+
+  /**
+   * \return the number of rooms along the y-axis
+   */
+  uint16_t GetNRoomsY () const;
+  
+  /** 
+   * 
+   * 
+   * \param position some position
+   * 
+   * \return true if the position fall inside the building, false otherwise
+   */
+  bool IsInside (Vector position) const;
+ 
+  /** 
+   * 
+   * 
+   * \param position a position inside the building
+   * 
+   * \return the number of the room along the X axis where the
+   * position falls
+   */
+  uint16_t GetRoomX (Vector position) const;
+
+  /** 
+   * 
+   * 
+   * \param position a position inside the building
+   * 
+   * \return  the number of the room along the Y axis where the
+   * position falls
+   */
+  uint16_t GetRoomY (Vector position) const;
+
+  /** 
+   * 
+   * \param position a position inside the building 
+   * 
+   * \return  the floor where the position falls
+   */
+  uint16_t GetFloor (Vector position) const;
+
+
+
+
+private:
+
+  Box m_buildingBounds;
+
+  /**
+   * number of floors, must be greater than 0, and 1 means only one floor
+   * (i.e., groundfloor)
+   */
+  uint16_t m_floors;
+  uint16_t m_roomsX;
+  uint16_t m_roomsY;
+
+  uint32_t m_buildingId;
+  BuildingType_t m_buildingType;
+  ExtWallsType_t m_externalWalls;
+
+};
+
+} // namespace ns3
+
+#endif /* BUILDING_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/buildings-mobility-model.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,178 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo  <marco.miozzo@cttc.es>
+ * 
+ */
+
+#include <ns3/simulator.h>
+#include <ns3/position-allocator.h>
+#include <ns3/buildings-mobility-model.h>
+#include <ns3/pointer.h>
+#include <ns3/log.h>
+
+NS_LOG_COMPONENT_DEFINE ("BuildingsMobilityModel");
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (BuildingsMobilityModel);
+
+TypeId
+BuildingsMobilityModel::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::BuildingsMobilityModel")
+    .SetParent<MobilityModel> ()
+    .SetGroupName ("Mobility")
+    .AddConstructor<BuildingsMobilityModel> ();
+
+  return tid;
+}
+
+
+BuildingsMobilityModel::BuildingsMobilityModel ()
+{
+  NS_LOG_FUNCTION (this);
+  m_indoor = false;
+  m_nFloor = 0;
+  m_roomX = 1;
+  m_roomY = 1;
+}
+
+void
+BuildingsMobilityModel::DoDispose (void)
+{
+  NS_LOG_FUNCTION (this);
+  MobilityModel::DoDispose ();
+}
+
+Vector
+BuildingsMobilityModel::DoGetPosition (void) const
+{
+  NS_LOG_FUNCTION (this);
+  m_helper.Update ();
+  return m_helper.GetCurrentPosition ();
+}
+void 
+BuildingsMobilityModel::DoSetPosition (const Vector &position)
+{
+  NS_LOG_FUNCTION (this);
+  m_helper.SetPosition (position);
+}
+Vector
+BuildingsMobilityModel::DoGetVelocity (void) const
+{
+  NS_LOG_FUNCTION (this);
+  return m_helper.GetVelocity ();
+}
+
+bool
+BuildingsMobilityModel::IsIndoor (void)
+{
+  NS_LOG_FUNCTION (this);
+  return (m_indoor);
+}
+
+bool
+BuildingsMobilityModel::IsOutdoor (void)
+{
+  NS_LOG_FUNCTION (this);
+  return (!m_indoor);
+}
+
+void
+BuildingsMobilityModel::SetIndoor (Ptr<Building> building)
+{
+  NS_LOG_FUNCTION (this);
+  m_indoor = true;
+  m_myBuilding = building;
+}
+
+void
+BuildingsMobilityModel::SetIndoor (Ptr<Building> building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy)
+{
+  NS_LOG_FUNCTION (this);
+  m_indoor = true;
+  m_myBuilding = building;
+  m_nFloor = nfloor;
+  m_roomX = nroomx;
+  m_roomY = nroomy;
+  
+  if (!building->IsInside (m_helper.GetCurrentPosition ()))
+    {
+      NS_FATAL_ERROR ("Position of the node is inconsistent with building bounds");
+    }
+}
+
+
+void
+BuildingsMobilityModel::SetOutdoor (void)
+{
+  NS_LOG_FUNCTION (this);
+  m_indoor = false;
+}
+
+void
+BuildingsMobilityModel::SetFloorNumber (uint8_t nfloor)
+{
+  NS_LOG_FUNCTION (this);
+  m_nFloor = nfloor;
+}
+
+void
+BuildingsMobilityModel::SetRoomNumberX (uint8_t nroomx)
+{
+  m_roomX = nroomx;
+}
+
+void
+BuildingsMobilityModel::SetRoomNumberY (uint8_t nroomy)
+{
+  NS_LOG_FUNCTION (this);
+  m_roomY = nroomy;
+}
+
+uint8_t
+BuildingsMobilityModel::GetFloorNumber (void)
+{
+  NS_LOG_FUNCTION (this);
+  return (m_nFloor);
+}
+
+uint8_t
+BuildingsMobilityModel::GetRoomNumberX (void)
+{
+  NS_LOG_FUNCTION (this);
+  return (m_roomX);
+}
+
+uint8_t
+BuildingsMobilityModel::GetRoomNumberY (void)
+{
+  NS_LOG_FUNCTION (this);
+  return (m_roomY);
+}
+
+
+Ptr<Building>
+BuildingsMobilityModel::GetBuilding ()
+{
+  NS_LOG_FUNCTION (this);
+  return (m_myBuilding);
+}
+
+  
+} // namespace
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/buildings-mobility-model.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,97 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo  <marco.miozzo@cttc.es>
+ * 
+ */
+#ifndef BUILDINGS_MOBILITY_MODEL_H
+#define BUILDINGS_MOBILITY_MODEL_H
+
+
+
+#include <ns3/mobility-model.h>
+#include <ns3/ptr.h>
+#include <ns3/object.h>
+#include <ns3/box.h>
+#include <map>
+#include <ns3/building.h>
+#include <ns3/constant-velocity-helper.h>
+
+
+
+namespace ns3 {
+
+
+/**
+ * \ingroup mobility
+ * \brief Buildings mobility model
+ *
+ * This model implements the managment of scenarios where users might be
+ * either indoor (e.g., houses, offices, etc.) and outdoor.
+ * 
+ */
+
+
+class BuildingsMobilityModel : public MobilityModel
+{
+public:
+  static TypeId GetTypeId (void);
+  BuildingsMobilityModel ();
+
+  bool IsIndoor (void);
+  bool IsOutdoor (void);
+
+  void SetIndoor (Ptr<Building> building);
+  void SetIndoor (Ptr<Building> building, uint8_t nfloor, uint8_t nroomx, uint8_t nroomy);
+  void SetOutdoor (void);
+
+  void SetFloorNumber (uint8_t nfloor);
+  void SetRoomNumberX (uint8_t nroomx);
+  void SetRoomNumberY (uint8_t nroomy);
+
+  uint8_t GetFloorNumber (void);
+  uint8_t GetRoomNumberX (void);
+  uint8_t GetRoomNumberY (void);
+
+  Ptr<Building> GetBuilding ();
+
+
+
+private:
+  virtual void DoDispose (void);
+  virtual Vector DoGetPosition (void) const;
+  virtual void DoSetPosition (const Vector &position);
+  virtual Vector DoGetVelocity (void) const;
+  ConstantVelocityHelper m_helper;
+
+  Ptr<Building> m_myBuilding;
+  bool m_indoor;
+  /**
+  * floors numbering starts from 0 (basement)
+  */
+  uint8_t m_nFloor;
+  uint8_t m_roomX;
+  uint8_t m_roomY;
+
+};
+
+
+
+} // namespace ns3
+
+
+#endif // BUILDINGS_MOBILITY_MODEL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/buildings-propagation-loss-model.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,218 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo  <marco.miozzo@cttc.es>,
+ *         Nicola Baldo <nbaldo@cttc.es>
+ * 
+ */
+
+#include "ns3/propagation-loss-model.h"
+#include "ns3/log.h"
+#include "ns3/mobility-model.h"
+#include "ns3/double.h"
+#include "ns3/pointer.h"
+#include <cmath>
+#include "buildings-propagation-loss-model.h"
+#include "ns3/buildings-mobility-model.h"
+#include "ns3/enum.h"
+
+
+NS_LOG_COMPONENT_DEFINE ("BuildingsPropagationLossModel");
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (BuildingsPropagationLossModel);
+
+
+BuildingsPropagationLossModel::ShadowingLoss::ShadowingLoss ()
+{
+}
+
+
+BuildingsPropagationLossModel::ShadowingLoss::ShadowingLoss (double mean, double sigma, Ptr<MobilityModel> receiver)
+  : m_receiver (receiver),
+    m_randVariable (mean, sigma * sigma) // NormalVariable class wants mean and variance (sigma is a standard deviation)
+{
+  m_shadowingValue = m_randVariable.GetValue ();
+  NS_LOG_INFO (this << " New Shadowing: sigma " << sigma << " value " << m_shadowingValue);
+}
+
+double
+BuildingsPropagationLossModel::ShadowingLoss::GetLoss () const
+{
+  return (m_shadowingValue);
+}
+
+Ptr<MobilityModel>
+BuildingsPropagationLossModel::ShadowingLoss::GetReceiver () const
+{
+  return m_receiver;
+}
+
+TypeId
+BuildingsPropagationLossModel::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::BuildingsPropagationLossModel")
+
+    .SetParent<PropagationLossModel> ()
+
+
+    .AddAttribute ("ShadowSigmaOutdoor",
+                   "Standard deviation of the normal distribution used for calculate the shadowing for outdoor nodes",
+                   DoubleValue (7.0),
+                   MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaOutdoor),
+                   MakeDoubleChecker<double> ())
+
+    .AddAttribute ("ShadowSigmaIndoor",
+                   "Standard deviation of the normal distribution used for calculate the shadowing for indoor nodes ",
+                   DoubleValue (8.0),
+                   MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaIndoor),
+                   MakeDoubleChecker<double> ())
+    .AddAttribute ("ShadowSigmaExtWalls",
+                   "Standard deviation of the normal distribution used for calculate the shadowing due to ext walls ",
+                   DoubleValue (5.0),
+                   MakeDoubleAccessor (&BuildingsPropagationLossModel::m_shadowingSigmaExtWalls),
+                   MakeDoubleChecker<double> ())
+
+    .AddAttribute ("InternalWallLoss",
+                   "Additional loss for each internal wall [dB]",
+                   DoubleValue (5.0),
+                   MakeDoubleAccessor (&BuildingsPropagationLossModel::m_lossInternalWall),
+                   MakeDoubleChecker<double> ());
+
+
+  return tid;
+}
+
+
+double
+BuildingsPropagationLossModel::ExternalWallLoss (Ptr<BuildingsMobilityModel> a) const
+{
+  double loss = 0.0;
+  Ptr<Building> aBuilding = a->GetBuilding ();
+  if (aBuilding->GetExtWallsType () == Building::Wood)
+    {
+      loss = 4;
+    }
+  else if (aBuilding->GetExtWallsType () == Building::ConcreteWithWindows)
+    {
+      loss = 7;
+    }
+  else if (aBuilding->GetExtWallsType () == Building::ConcreteWithoutWindows)
+    {
+      loss = 15; // 10 ~ 20 dB
+    }
+  else if (aBuilding->GetExtWallsType () == Building::StoneBlocks)
+    {
+      loss = 12;
+    }
+  return (loss);
+}
+
+double
+BuildingsPropagationLossModel::HeightLoss (Ptr<BuildingsMobilityModel> node) const
+{
+  double loss = 0.0;
+
+  int nfloors  = node->GetFloorNumber ();
+  loss = -2 * (nfloors);
+  return (loss);
+}
+
+double
+BuildingsPropagationLossModel::InternalWallsLoss (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel>b) const
+{
+  // approximate the number of internal walls with the Manhattan distance in "rooms" units
+  double dx = abs (a->GetRoomNumberX () - b->GetRoomNumberX ());
+  double dy = abs (a->GetRoomNumberY () - b->GetRoomNumberY ());    
+  return m_lossInternalWall * (dx+dy);
+}
+
+
+
+double
+BuildingsPropagationLossModel::GetShadowing (Ptr<MobilityModel> a, Ptr<MobilityModel> b)
+const
+{
+    Ptr<BuildingsMobilityModel> a1 = DynamicCast<BuildingsMobilityModel> (a);
+    Ptr<BuildingsMobilityModel> b1 = DynamicCast<BuildingsMobilityModel> (b);
+    NS_ASSERT_MSG ((a1 != 0) && (b1 != 0), "BuildingsPropagationLossModel only works with BuildingsMobilityModel");
+  
+  std::map<Ptr<MobilityModel>,  std::map<Ptr<MobilityModel>, ShadowingLoss> >::iterator ait = m_shadowingLossMap.find (a);
+  if (ait != m_shadowingLossMap.end ())
+    {
+      std::map<Ptr<MobilityModel>, ShadowingLoss>::iterator bit = ait->second.find (b);
+      if (bit != ait->second.end ())
+        {
+          return (bit->second.GetLoss ());
+        }
+      else
+        {
+          double sigma = EvaluateSigma (a1, b1);
+          // side effect: will create new entry          
+          ait->second[b] = ShadowingLoss (0.0, sigma, b);          
+          return (ait->second[b].GetLoss ());
+        }
+    }
+  else
+    {
+      double sigma = EvaluateSigma (a1, b1);
+      // side effect: will create new entries in both maps
+      m_shadowingLossMap[a][b] = ShadowingLoss (0.0, sigma, b);  
+      return (m_shadowingLossMap[a][b].GetLoss ());       
+    }
+}
+
+
+
+double
+BuildingsPropagationLossModel::EvaluateSigma (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b)
+const
+{
+  if (a->IsOutdoor ())
+    {
+      if (b->IsOutdoor ())
+        {
+          return (m_shadowingSigmaOutdoor);
+        }
+      else
+        {
+          double sigma = sqrt ((m_shadowingSigmaOutdoor * m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls * m_shadowingSigmaExtWalls));
+          return (sigma);
+        }
+    }
+  else
+  if (b->IsIndoor ())
+    {
+      return (m_shadowingSigmaIndoor);
+    }
+  else
+    {
+      double sigma = sqrt ((m_shadowingSigmaOutdoor * m_shadowingSigmaOutdoor) + (m_shadowingSigmaExtWalls * m_shadowingSigmaExtWalls));
+      return (sigma);
+    }
+}
+
+
+double
+BuildingsPropagationLossModel::DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
+{
+  return txPowerDbm - GetLoss (a, b) - GetShadowing (a, b);
+}
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/buildings-propagation-loss-model.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,106 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo  <marco.miozzo@cttc.es>
+ *         Nicola Baldo <nbaldo@cttc.es>
+ * 
+ */
+
+#ifndef BUILDINGS_PROPAGATION_LOSS_MODEL_H_
+#define BUILDINGS_PROPAGATION_LOSS_MODEL_H_
+
+#include "ns3/nstime.h"
+#include "ns3/propagation-loss-model.h"
+#include <ns3/building.h>
+#include <ns3/buildings-mobility-model.h>
+
+
+namespace ns3 {
+
+class ShadowingLossModel;
+class JakesFadingLossModel;
+
+/**
+ * \ingroup propagation
+ *
+ *  This model provides means for simulating the following propagation
+ *  phenomena in the presence of buildings: 
+ *
+ *   - shadowing (indoor, outdoor)
+ *   - external wall penetration loss
+ *   - internal wall penetration loss
+ *  
+ *  The distance-dependent component of propagation loss is deferred
+ *  to derived classes which are expected to implement the GetLoss method.
+ *  
+ *  \warning This model works only with BuildingsMobilityModel
+ *
+ */
+
+class BuildingsPropagationLossModel : public PropagationLossModel
+{
+
+public:
+  static TypeId GetTypeId (void);
+
+  /**
+   * \param a the mobility model of the source
+   * \param b the mobility model of the destination
+   * \returns the propagation loss (in dBm)
+   */
+  virtual double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const = 0;
+
+  // inherited from PropagationLossModel
+  virtual double DoCalcRxPower (double txPowerDbm, Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
+
+protected:
+
+  double ExternalWallLoss (Ptr<BuildingsMobilityModel> a) const;
+  double HeightLoss (Ptr<BuildingsMobilityModel> n) const;
+  double InternalWallsLoss (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
+  
+  double GetShadowing (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
+
+  double m_lossInternalWall; // in meters
+
+  
+  class ShadowingLoss
+  {
+  public:
+    ShadowingLoss ();
+    ShadowingLoss (double mean, double sigma, Ptr<MobilityModel> receiver);
+    double GetLoss () const;
+    Ptr<MobilityModel> GetReceiver (void) const;
+  protected:
+    Ptr<MobilityModel> m_receiver;
+    NormalVariable m_randVariable;
+    double m_shadowingValue;
+  };
+
+  mutable std::map<Ptr<MobilityModel>,  std::map<Ptr<MobilityModel>, ShadowingLoss> > m_shadowingLossMap;
+  double EvaluateSigma (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
+
+
+  double m_shadowingSigmaExtWalls;
+  double m_shadowingSigmaOutdoor;
+  double m_shadowingSigmaIndoor;
+
+};
+
+}
+
+#endif /* BUILDINGS_PROPAGATION_LOSS_MODEL_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/hybrid-buildings-propagation-loss-model.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,291 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo <marco.miozzo@cttc.es>
+ *         Nicola Baldo <nbaldo@cttc.es>
+ * 
+ */
+
+#include <cmath>
+
+#include "ns3/log.h"
+#include "ns3/mobility-model.h"
+#include "ns3/double.h"
+#include "ns3/pointer.h"
+#include "ns3/okumura-hata-propagation-loss-model.h"
+#include "ns3/itu-r-1411-los-propagation-loss-model.h"
+#include "ns3/itu-r-1411-nlos-over-rooftop-propagation-loss-model.h"
+#include "ns3/itu-r-1238-propagation-loss-model.h"
+#include "ns3/kun-2600-mhz-propagation-loss-model.h"
+#include "ns3/buildings-mobility-model.h"
+#include "ns3/enum.h"
+
+#include "hybrid-buildings-propagation-loss-model.h"
+
+
+NS_LOG_COMPONENT_DEFINE ("HybridBuildingsPropagationLossModel");
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (HybridBuildingsPropagationLossModel);
+
+
+
+HybridBuildingsPropagationLossModel::HybridBuildingsPropagationLossModel ()
+{
+  m_okumuraHata = CreateObject<OkumuraHataPropagationLossModel> ();
+  m_ituR1411Los = CreateObject<ItuR1411LosPropagationLossModel> ();
+  m_ituR1411NlosOverRooftop = CreateObject<ItuR1411NlosOverRooftopPropagationLossModel> ();
+  m_ituR1238 = CreateObject<ItuR1238PropagationLossModel> ();
+  m_kun2600Mhz = CreateObject<Kun2600MhzPropagationLossModel> ();
+}
+
+HybridBuildingsPropagationLossModel::~HybridBuildingsPropagationLossModel ()
+{
+}
+
+TypeId
+HybridBuildingsPropagationLossModel::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::HybridBuildingsPropagationLossModel")
+    
+    .SetParent<BuildingsPropagationLossModel> ()
+    
+    .AddConstructor<HybridBuildingsPropagationLossModel> ()
+    
+    .AddAttribute ("Frequency",
+                   "The Frequency  (default is 2.106 GHz).",
+                   DoubleValue (2160e6),
+                   MakeDoubleAccessor (&HybridBuildingsPropagationLossModel::SetFrequency),
+                   MakeDoubleChecker<double> ())
+
+    .AddAttribute ("Los2NlosThr",
+                   " Threshold from LoS to NLoS in ITU 1411 [m].",
+                   DoubleValue (200.0),
+                   MakeDoubleAccessor (&HybridBuildingsPropagationLossModel::m_itu1411NlosThreshold),
+                   MakeDoubleChecker<double> ())
+
+    .AddAttribute ("Environment",
+                   "Environment Scenario",
+                   EnumValue (UrbanEnvironment),
+                   MakeEnumAccessor (&HybridBuildingsPropagationLossModel::SetEnvironment),
+                   MakeEnumChecker (UrbanEnvironment, "Urban",
+                                    SubUrbanEnvironment, "SubUrban",
+                                    OpenAreasEnvironment, "OpenAreas"))
+
+    .AddAttribute ("CitySize",
+                   "Dimension of the city",
+                   EnumValue (LargeCity),
+                   MakeEnumAccessor (&HybridBuildingsPropagationLossModel::SetCitySize),
+                   MakeEnumChecker (SmallCity, "Small",
+                                    MediumCity, "Medium",
+                                    LargeCity, "Large"))
+
+    .AddAttribute ("RooftopLevel",
+                   "The height of the rooftop level in meters",
+                   DoubleValue (20.0),
+                   MakeDoubleAccessor (&HybridBuildingsPropagationLossModel::SetRooftopHeight),
+                   MakeDoubleChecker<double> (0.0, 90.0))
+
+    ;
+  
+  return tid;
+}
+
+void
+HybridBuildingsPropagationLossModel::SetEnvironment (EnvironmentType env)
+{
+  m_okumuraHata->SetAttribute ("Environment", EnumValue (env));
+  m_ituR1411NlosOverRooftop->SetAttribute ("Environment", EnumValue (env));
+}
+
+void
+HybridBuildingsPropagationLossModel::SetCitySize (CitySize size)
+{
+  m_okumuraHata->SetAttribute ("CitySize", EnumValue (size));
+  m_ituR1411NlosOverRooftop->SetAttribute ("CitySize", EnumValue (size));
+}
+
+void
+HybridBuildingsPropagationLossModel::SetFrequency (double freq)
+{
+  m_okumuraHata->SetAttribute ("Frequency", DoubleValue (freq));
+  m_ituR1411Los->SetAttribute ("Frequency", DoubleValue (freq));
+  m_ituR1411NlosOverRooftop->SetAttribute ("Frequency", DoubleValue (freq));
+  m_ituR1238->SetAttribute ("Frequency", DoubleValue (freq));
+  m_frequency = freq;
+}
+
+void
+HybridBuildingsPropagationLossModel::SetRooftopHeight (double rooftopHeight)
+{
+  m_rooftopHeight = rooftopHeight;
+  m_ituR1411NlosOverRooftop->SetAttribute ("RooftopLevel", DoubleValue (rooftopHeight));
+}
+
+
+double
+HybridBuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
+{
+  NS_ASSERT_MSG ((a->GetPosition ().z >= 0) && (b->GetPosition ().z >= 0), "HybridBuildingsPropagationLossModel does not support underground nodes (placed at z < 0)");
+
+  
+  double distance = a->GetDistanceFrom (b);
+
+  // get the BuildingsMobilityModel pointers
+  Ptr<BuildingsMobilityModel> a1 = DynamicCast<BuildingsMobilityModel> (a);
+  Ptr<BuildingsMobilityModel> b1 = DynamicCast<BuildingsMobilityModel> (b);
+  NS_ASSERT_MSG ((a1 != 0) && (b1 != 0), "HybridBuildingsPropagationLossModel only works with BuildingsMobilityModel");
+
+  double loss = 0.0;
+
+  if (a1->IsOutdoor ())
+    {
+      if (b1->IsOutdoor ())
+        {
+          if (distance > 1000)
+            {
+              NS_LOG_INFO (this << a1->GetPosition ().z << b1->GetPosition ().z << m_rooftopHeight);
+              if ((a1->GetPosition ().z < m_rooftopHeight)
+                  && (b1->GetPosition ().z < m_rooftopHeight))
+                {
+                  loss = ItuR1411 (a1, b1);
+                  NS_LOG_INFO (this << " 0-0 (>1000): below rooftop -> ITUR1411 : " << loss);
+                }
+              else
+                {
+                  // Over the rooftop tranmission -> Okumura Hata
+                  loss = OkumuraHata (a1, b1);
+                  NS_LOG_INFO (this << " O-O (>1000): above rooftop -> OH : " << loss);
+                }
+            }
+          else
+            {
+              // short range outdoor communication
+              loss = ItuR1411 (a1, b1);
+              NS_LOG_INFO (this << " 0-0 (<1000) Street canyon -> ITUR1411 : " << loss);
+            }
+        }
+      else
+        {
+          // b indoor
+          if (distance > 1000)
+            {
+              if ((a1->GetPosition ().z < m_rooftopHeight)
+                  && (b1->GetPosition ().z < m_rooftopHeight))
+                {                  
+                  loss = ItuR1411 (a1, b1) + ExternalWallLoss (b1) + HeightLoss (a1);
+                  NS_LOG_INFO (this << " 0-I (>1000): below rooftop -> ITUR1411 : " << loss);
+                }
+              else
+                {
+                  loss = OkumuraHata (a1, b1) + ExternalWallLoss (b1);
+                  NS_LOG_INFO (this << " O-I (>1000): above the rooftop -> OH : " << loss);
+                }
+            }
+          else
+            {
+              loss = ItuR1411 (a1, b1) + ExternalWallLoss (b1) + HeightLoss (b1);
+              NS_LOG_INFO (this << " 0-I (<1000) ITUR1411 + BEL : " << loss);
+            }
+        } // end b1->isIndoor ()
+    }
+  else
+    {
+      // a is indoor
+      if (b1->IsIndoor ())
+        {
+          if (a1->GetBuilding () == b1->GetBuilding ())
+            {
+              // nodes are in same building -> indoor communication ITU-R P.1238
+              loss = ItuR1238 (a1, b1) + InternalWallsLoss (a1, b1);;
+              NS_LOG_INFO (this << " I-I (same building) ITUR1238 : " << loss);
+
+            }
+          else
+            {
+              // nodes are in different buildings
+              loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1) + ExternalWallLoss (b1);
+              NS_LOG_INFO (this << " I-I (different) ITUR1238 + 2*BEL : " << loss);
+            }
+        }
+      else
+        {
+          // b is outdoor
+          if (distance > 1000)
+            {
+              if ((a1->GetPosition ().z < m_rooftopHeight)
+                  && (b1->GetPosition ().z < m_rooftopHeight))
+                {
+                  loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1) + HeightLoss (a1);
+                  NS_LOG_INFO (this << " I-O (>1000): down rooftop -> ITUR1411 : " << loss);
+                }
+              else
+                {
+                  // above rooftop -> OH
+                  loss = OkumuraHata (a1, b1) + ExternalWallLoss (a1) + HeightLoss (a1);
+                  NS_LOG_INFO (this << " =I-O (>1000) over rooftop OH + BEL + HG: " << loss);
+                }
+            }
+          else
+            {
+              loss = ItuR1411 (a1, b1) + ExternalWallLoss (a1)  + HeightLoss (a1);
+              NS_LOG_INFO (this << " I-O (<1000)  ITUR1411 + BEL + HG: " << loss);
+            }
+        } // end b1->IsIndoor ()
+    } // end a1->IsOutdoor ()
+
+  loss = std::max (loss, 0.0);
+
+  return loss;
+}
+
+
+double
+HybridBuildingsPropagationLossModel::OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const
+{
+  if (m_frequency <= 2.3e9)
+    {
+      return m_okumuraHata->GetLoss (a, b);
+    }
+  else
+    {
+      return m_kun2600Mhz->GetLoss (a, b);
+    }
+}
+
+double
+HybridBuildingsPropagationLossModel::ItuR1411 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const
+{
+  if (a->GetDistanceFrom (b) < m_itu1411NlosThreshold)
+    {
+      return (m_ituR1411Los->GetLoss (a, b));
+    }
+  else
+    {
+      return (m_ituR1411NlosOverRooftop->GetLoss (a, b));
+    }
+}
+
+double
+HybridBuildingsPropagationLossModel::ItuR1238 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const
+{
+  return m_ituR1238->GetLoss (a,b);
+}
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/hybrid-buildings-propagation-loss-model.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,121 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo  <marco.miozzo@cttc.es>
+ *         Nicola Baldo <nbaldo@cttc.es>
+ * 
+ */
+
+#ifndef HYBRID_BUILDINGS_PROPAGATION_LOSS_MODEL_H_
+#define HYBRID_BUILDINGS_PROPAGATION_LOSS_MODEL_H_
+
+#include <ns3/buildings-propagation-loss-model.h>
+#include <ns3/propagation-environment.h>
+
+namespace ns3 {
+
+class OkumuraHataPropagationLossModel;
+class ItuR1411LosPropagationLossModel;
+class ItuR1411NlosOverRooftopPropagationLossModel;
+class ItuR1238PropagationLossModel;
+class Kun2600MhzPropagationLossModel;
+
+/**
+ * \ingroup propagation
+ *
+ *  \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).
+ *
+ *  This model includes Hata model, COST231, ITU-R P.1411 (short range
+ *  communications), ITU-R P.1238 (indoor communications), which are combined in order
+ *  to be able to evaluate the pathloss under different scenarios, in detail:
+ *  - Environments: urban, suburban, open-areas;
+ *  - frequency: from 200 uo to 2600 MHz
+ *  - short range communications vs long range communications
+ *  - Node position respect to buildings: indoor, outdoor and hybrid (indoor <-> outdoor)
+ *  - Building penetretation loss
+ *  - floors, etc...
+ *
+ *  \warning This model works only with BuildingsMobilityModel
+ *
+ */
+
+class HybridBuildingsPropagationLossModel : public BuildingsPropagationLossModel
+{
+
+public:
+  static TypeId GetTypeId (void);
+  HybridBuildingsPropagationLossModel ();
+  ~HybridBuildingsPropagationLossModel ();
+
+
+  /** 
+   * set the environment type
+   * 
+   * \param env 
+   */
+  void SetEnvironment (EnvironmentType env);
+
+  /** 
+   * set the size of the city
+   * 
+   * \param size 
+   */
+  void SetCitySize (CitySize size);
+
+  /** 
+   * set the propagation frequency
+   * 
+   * \param freq 
+   */
+  void SetFrequency (double freq);
+
+  /** 
+   * set the rooftop height
+   * 
+   * \param rooftopHeight
+   */
+  void SetRooftopHeight (double rooftopHeight);
+
+  /**
+   * \param a the mobility model of the source
+   * \param b the mobility model of the destination
+   * \returns the propagation loss (in dBm)
+   */
+  virtual double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
+
+  
+private:
+
+  double OkumuraHata (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
+  double ItuR1411 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
+  double ItuR1238 (Ptr<BuildingsMobilityModel> a, Ptr<BuildingsMobilityModel> b) const;
+
+  Ptr<OkumuraHataPropagationLossModel> m_okumuraHata;
+  Ptr<ItuR1411LosPropagationLossModel> m_ituR1411Los;
+  Ptr<ItuR1411NlosOverRooftopPropagationLossModel> m_ituR1411NlosOverRooftop;
+  Ptr<ItuR1238PropagationLossModel> m_ituR1238;
+  Ptr<Kun2600MhzPropagationLossModel> m_kun2600Mhz;
+
+  double m_itu1411NlosThreshold; ///< in meters (switch Los -> NLoS)
+  double m_rooftopHeight;
+  double m_frequency;
+
+};
+
+}
+
+#endif /* HYBRID_BUILDINGS_PROPAGATION_LOSS_MODEL_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/itu-r-1238-propagation-loss-model.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,116 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo  <marco.miozzo@cttc.es>,
+ *         Nicola Baldo <nbaldo@cttc.es>
+ * 
+ */
+#include "ns3/log.h"
+#include "ns3/double.h"
+#include "ns3/enum.h"
+#include "ns3/mobility-model.h"
+#include <cmath>
+
+#include "itu-r-1238-propagation-loss-model.h"
+#include "buildings-mobility-model.h"
+
+NS_LOG_COMPONENT_DEFINE ("ItuR1238PropagationLossModel");
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (ItuR1238PropagationLossModel);
+
+
+TypeId
+ItuR1238PropagationLossModel::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::ItuR1238PropagationLossModel")
+
+    .SetParent<PropagationLossModel> ()
+
+    .AddAttribute ("Frequency",
+                   "The Frequency  (default is 2.106 GHz).",
+                   DoubleValue (2160e6),
+                   MakeDoubleAccessor (&ItuR1238PropagationLossModel::m_frequency),
+                   MakeDoubleChecker<double> ());
+
+  return tid;
+}
+
+double
+ItuR1238PropagationLossModel::GetLoss (Ptr<MobilityModel> a1, Ptr<MobilityModel> b1) const
+{
+  NS_LOG_FUNCTION (this << a1 << b1);
+  Ptr<BuildingsMobilityModel> a = DynamicCast<BuildingsMobilityModel> (a1);
+  Ptr<BuildingsMobilityModel> b = DynamicCast<BuildingsMobilityModel> (b1);
+  NS_ASSERT_MSG ((a != 0) && (b != 0), "ItuR1238PropagationLossModel only works with BuildingsMobilityModel");
+  NS_ASSERT_MSG (a->GetBuilding ()->GetId () == b->GetBuilding ()->GetId (), "ITU-R 1238 applies only to nodes that are in the same building");
+  double N = 0.0;
+  int n = abs (a->GetFloorNumber () - b->GetFloorNumber ());
+  NS_LOG_LOGIC (this << " A floor " << (uint16_t)a->GetFloorNumber () << " B floor " << (uint16_t)b->GetFloorNumber () << " n " << n);
+  double Lf = 0.0;
+  Ptr<Building> aBuilding = a->GetBuilding ();
+  if (aBuilding->GetBuildingType () == Building::Residential)
+    {
+      N = 28;
+      if (n >= 1)
+        {
+          Lf = 4 * n;
+        }
+      NS_LOG_LOGIC (this << " Residential ");
+    }
+  else if (aBuilding->GetBuildingType () == Building::Office)
+    {
+      N = 30;
+      if (n >= 1)
+        {
+          Lf = 15 + (4 * (n - 1));
+        }
+      NS_LOG_LOGIC (this << " Office ");
+    }
+  else if (aBuilding->GetBuildingType () == Building::Commercial)
+    {
+      N = 22;
+      if (n >= 1)
+        {
+          Lf = 6 + (3 * (n - 1));
+        }
+      NS_LOG_LOGIC (this << " Commercial ");
+    }
+  else
+    {
+      NS_LOG_ERROR (this << " Unkwnon Wall Type");
+    }
+  double loss = 20 * log10 (m_frequency / 1e6 /*MHz*/) + N*log10 (a->GetDistanceFrom (b)) + Lf - 28.0;
+  NS_LOG_INFO (this << " Node " << a->GetPosition () << " <-> " << b->GetPosition () << " loss = " << loss << " dB");
+
+  return loss;
+}
+
+
+double 
+ItuR1238PropagationLossModel::DoCalcRxPower (double txPowerDbm,
+						Ptr<MobilityModel> a,
+						Ptr<MobilityModel> b) const
+{
+  return (txPowerDbm - GetLoss (a, b));
+}
+
+
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/itu-r-1238-propagation-loss-model.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,77 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo  <marco.miozzo@cttc.es>
+ *         Nicola Baldo <nbaldo@cttc.es>
+ * 
+ */
+
+#ifndef ITU_R_1238_PROPAGATION_LOSS_MODEL_H
+#define ITU_R_1238_PROPAGATION_LOSS_MODEL_H
+
+#include <ns3/propagation-loss-model.h>
+#include <ns3/propagation-environment.h>
+
+namespace ns3 {
+
+/**
+ * This class implements the ITU-R 1238 propagation loss model.
+ * 
+ */
+class ItuR1238PropagationLossModel : public PropagationLossModel
+{
+
+public:
+
+  // inherited from Object
+  static TypeId GetTypeId (void);
+
+  /** 
+   * 
+   * 
+   * \param a the first mobility model
+   * \param b the second mobility model
+   * 
+   * \return the loss in dBm for the propagation between
+   * the two given mobility models
+   */
+  double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
+
+private:
+
+  // inherited from PropagationLossModel
+  virtual double DoCalcRxPower (double txPowerDbm,
+                                Ptr<MobilityModel> a,
+                                Ptr<MobilityModel> b) const;
+  
+  double m_frequency; ///< frequency in MHz
+  double m_lambda; ///< wavelength
+  EnvironmentType m_environment;
+  CitySize m_citySize;
+  double m_rooftopHeight; ///< in meters
+  double m_streetsOrientation; ///< in degrees [0,90]
+  double m_streetsWidth; ///< in meters
+  double m_buildingsExtend; ///< in meters
+  double m_buildingSeparation; ///< in meters
+
+};
+
+} // namespace ns3
+
+
+#endif // ITU_R_1238_PROPAGATION_LOSS_MODEL_H
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/oh-buildings-propagation-loss-model.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,121 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo  <marco.miozzo@cttc.es>
+ * 
+ */
+
+#include "ns3/propagation-loss-model.h"
+#include "ns3/log.h"
+#include "ns3/mobility-model.h"
+#include "ns3/double.h"
+#include "ns3/pointer.h"
+#include <math.h>
+#include "oh-buildings-propagation-loss-model.h"
+#include "ns3/buildings-mobility-model.h"
+#include "ns3/okumura-hata-propagation-loss-model.h"
+#include "ns3/enum.h"
+
+
+NS_LOG_COMPONENT_DEFINE ("OhBuildingsPropagationLossModel");
+
+namespace ns3 {
+
+NS_OBJECT_ENSURE_REGISTERED (OhBuildingsPropagationLossModel);
+
+
+
+OhBuildingsPropagationLossModel::OhBuildingsPropagationLossModel ()
+{
+  m_okumuraHata = CreateObject<OkumuraHataPropagationLossModel> ();
+}
+
+OhBuildingsPropagationLossModel::~OhBuildingsPropagationLossModel ()
+{
+}
+
+TypeId
+OhBuildingsPropagationLossModel::GetTypeId (void)
+{
+  static TypeId tid = TypeId ("ns3::OhBuildingsPropagationLossModel")
+  
+  .SetParent<BuildingsPropagationLossModel> ()
+  
+  .AddConstructor<OhBuildingsPropagationLossModel> ();
+  
+  return tid;
+}
+
+
+double
+OhBuildingsPropagationLossModel::GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const
+{
+  NS_LOG_FUNCTION (this << a << b);
+
+  // get the BuildingsMobilityModel pointers
+  Ptr<BuildingsMobilityModel> a1 = DynamicCast<BuildingsMobilityModel> (a);
+  Ptr<BuildingsMobilityModel> b1 = DynamicCast<BuildingsMobilityModel> (b);
+  NS_ASSERT_MSG ((a1 != 0) && (b1 != 0), "OhBuildingsPropagationLossModel only works with BuildingsMobilityModel");
+
+  double loss = 0.0;
+
+  if (a1->IsOutdoor ())
+    {
+      if (b1->IsOutdoor ())
+        {
+          loss = m_okumuraHata->GetLoss (a1, b1);
+          NS_LOG_INFO (this << " O-O : " << loss);
+        }
+      else
+        {
+          // b indoor
+          loss = m_okumuraHata->GetLoss (a1, b1) + ExternalWallLoss (b1);
+          NS_LOG_INFO (this << " O-I : " << loss);
+        } // end b1->isIndoor ()
+    }
+  else
+    {
+      // a is indoor
+      if (b1->IsIndoor ())
+        {
+          if (a1->GetBuilding () == b1->GetBuilding ())
+            {
+              // nodes are in same building -> indoor communication ITU-R P.1238
+              loss = m_okumuraHata->GetLoss (a1, b1) + InternalWallsLoss (a1, b1);;
+              NS_LOG_INFO (this << " I-I (same building)" << loss);
+
+            }
+          else
+            {
+              // nodes are in different buildings
+              loss = m_okumuraHata->GetLoss (a1, b1) + ExternalWallLoss (a1) + ExternalWallLoss (b1);
+              NS_LOG_INFO (this << " I-O-I (different buildings): " << loss);
+            }
+        }
+      else
+        {
+          loss = m_okumuraHata->GetLoss (a1, b1) + ExternalWallLoss (a1);
+          NS_LOG_INFO (this << " I-O : " << loss);
+        } // end b1->IsIndoor ()
+    } // end a1->IsOutdoor ()
+
+  loss = std::max (0.0, loss);
+  return loss;
+}
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/model/oh-buildings-propagation-loss-model.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,62 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo  <marco.miozzo@cttc.es>
+ * 
+ */
+
+#ifndef OH_BUILDINGS_PROPAGATION_LOSS_MODEL_H_
+#define OH_BUILDINGS_PROPAGATION_LOSS_MODEL_H_
+
+#include <ns3/buildings-propagation-loss-model.h>
+
+namespace ns3 {
+
+class OkumuraHataPropagationLossModel;
+
+/**
+ * \ingroup propagation
+ *
+ *  this model combines the OkumuraHata model with the BuildingsPropagationLossModel
+ * 
+ *  \warning This model works with BuildingsMobilityModel only
+ *
+ */
+class OhBuildingsPropagationLossModel : public BuildingsPropagationLossModel
+{
+
+public:
+  static TypeId GetTypeId (void);
+  OhBuildingsPropagationLossModel ();
+  ~OhBuildingsPropagationLossModel ();
+
+  /**
+   * \param a the mobility model of the source
+   * \param b the mobility model of the destination
+   * \returns the propagation loss (in dBm)
+   */
+  virtual double GetLoss (Ptr<MobilityModel> a, Ptr<MobilityModel> b) const;
+  
+private:
+
+  Ptr<OkumuraHataPropagationLossModel> m_okumuraHata;
+
+};
+
+}
+
+#endif /* OH_BUILDINGS_PROPAGATION_LOSS_MODEL_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/test/buildings-helper-test.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,325 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011, 2012 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Nicola Baldo <nbaldo@cttc.es>
+ */
+
+
+
+#include "ns3/log.h"
+#include "ns3/test.h"
+#include <ns3/buildings-mobility-model.h>
+#include <ns3/building.h>
+#include <ns3/buildings-helper.h>
+#include <ns3/mobility-helper.h>
+#include <ns3/simulator.h>
+
+NS_LOG_COMPONENT_DEFINE ("BuildingsHelperTest");
+
+using namespace ns3;
+
+
+struct PositionInBuilding
+{
+  PositionInBuilding ();
+  Vector   pos;   // coordinates of the mobility model instance
+  bool     indoor; // true if indoor, false otherwise
+  uint32_t bid;   // building id
+  uint16_t rx;    // room x
+  uint16_t ry;    // room y
+  uint16_t fn;    // floor number
+};
+
+PositionInBuilding::PositionInBuilding ()
+  : pos (0,0,0),
+    indoor (false),
+    bid (0xffffffff),
+    rx (0),
+    ry (0),
+    fn (0)
+{
+}
+
+/**
+ * data to construct a Building object. We don't want to pass Building
+ * objects to the TestCase constructor because otherwise BuildingList
+ * would contain all of them (even if only one is meant to be in the
+ * test case).
+ * 
+ */
+struct BuildingData
+{
+  BuildingData ();
+  double xmin;
+  double xmax;
+  double ymin;
+  double ymax;
+  double zmin;
+  double zmax;
+  uint16_t nrx;
+  uint16_t nry;
+  uint16_t nf;
+};
+
+BuildingData::BuildingData ()
+  : xmin (0),
+    xmax (0),
+    ymin (0),
+    ymax (0),
+    zmin (0),
+    zmax (0),
+    nrx (0),
+    nry (0),
+    nf (0)
+{
+}
+
+class BuildingsHelperOneTestCase : public TestCase
+{
+public:
+  static std::string BuildNameString (PositionInBuilding pib, BuildingData bd);
+  BuildingsHelperOneTestCase (PositionInBuilding pib, BuildingData bd);
+
+private:
+  virtual void DoRun (void);
+
+  PositionInBuilding m_pib;
+  BuildingData m_bd;
+  
+};
+
+std::string BuildingsHelperOneTestCase::BuildNameString (PositionInBuilding pib, BuildingData bd)
+{
+  std::ostringstream oss;
+  oss <<  "pos=" << pib.pos;
+  if (pib.indoor)
+    {     
+      oss << ", bid=" << pib.bid
+	  << ", rx=" << pib.rx 
+	  << ", ry=" << pib.ry
+	  << ", fn=" << pib.fn;    
+    }
+  else
+    {
+      oss << ", outdoor";
+    }
+  return oss.str ();
+}
+
+
+BuildingsHelperOneTestCase::BuildingsHelperOneTestCase (PositionInBuilding pib, BuildingData bd)
+  : TestCase (BuildNameString (pib, bd)),
+    m_pib (pib),
+    m_bd (bd)
+{
+}
+
+void
+BuildingsHelperOneTestCase::DoRun ()
+{
+  NS_LOG_FUNCTION (this << BuildNameString (m_pib, m_bd));
+  MobilityHelper mobility;
+  mobility.SetMobilityModel ("ns3::BuildingsMobilityModel");
+
+  NodeContainer nodes;
+  nodes.Create (1);
+  mobility.Install (nodes);
+  
+  Ptr<BuildingsMobilityModel> bmm = nodes.Get (0)->GetObject<BuildingsMobilityModel> ();
+  bmm->SetPosition (m_pib.pos);
+
+  NS_LOG_LOGIC ("create building");
+  Ptr<Building> b = CreateObject<Building> ();
+  b->SetBoundaries (Box (m_bd.xmin, m_bd.xmax, m_bd.ymin, m_bd.ymax, m_bd.zmin, m_bd.zmax));
+  b->SetNFloors (m_bd.nf);
+  b->SetNRoomsX (m_bd.nrx);
+  b->SetNRoomsY (m_bd.nry);
+  
+  BuildingsHelper::MakeMobilityModelConsistent ();
+
+  
+  NS_TEST_ASSERT_MSG_EQ (bmm->IsIndoor (), m_pib.indoor, "indoor/outdoor mismatch");
+  if (m_pib.indoor)
+    {
+      NS_LOG_LOGIC (" got bid=" << bmm->GetBuilding ()->GetId () << ", f=" << (uint32_t) bmm->GetFloorNumber () << ", rx=" << (uint32_t) bmm->GetRoomNumberX () << ", roomY=" << (uint32_t) bmm->GetRoomNumberY ());
+      // only one building in this test, so Id will be 0
+      NS_TEST_ASSERT_MSG_EQ (bmm->GetBuilding ()->GetId (), 0, "Building ID mismatch");
+      NS_TEST_ASSERT_MSG_EQ ((uint32_t) bmm->GetFloorNumber (), m_pib.fn, "floor number mismatch");
+      NS_TEST_ASSERT_MSG_EQ ((uint32_t) bmm->GetRoomNumberX (), m_pib.rx, "x room number mismatch");
+      NS_TEST_ASSERT_MSG_EQ ((uint32_t) bmm->GetRoomNumberY (), m_pib.ry, "y room number mismatch");
+    }
+
+  Simulator::Destroy ();  
+}
+
+
+
+
+
+
+
+class BuildingsHelperTestSuite : public TestSuite
+{
+public:
+  BuildingsHelperTestSuite ();
+};
+
+
+BuildingsHelperTestSuite::BuildingsHelperTestSuite ()
+  : TestSuite ("buildings-helper", UNIT)
+{
+  NS_LOG_FUNCTION (this);
+
+  BuildingData b1;
+  b1.xmin = 1;
+  b1.xmax = 3;
+  b1.ymin = 1;
+  b1.ymax = 2;
+  b1.zmin = 0;
+  b1.zmax = 4;
+  b1.nrx = 1;
+  b1.nry = 1;
+  b1.nf = 1;  
+
+  Vector vp1 (1.5, 1.5, 0.5);
+  PositionInBuilding p1;
+  p1.pos = vp1;
+  p1.indoor = true;
+  p1.bid = 0;
+  p1.rx = 1;
+  p1.ry = 1;
+  p1.fn = 1;
+  AddTestCase (new BuildingsHelperOneTestCase (p1, b1));
+
+  Vector vp2 (1.5, 0.5, 0.5);
+  PositionInBuilding p2;
+  p2.pos = vp2;
+  p2.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (p2, b1));
+
+  Vector vp3 (1.5, 2.5, 0.5);
+  PositionInBuilding p3;
+  p3.pos = vp3;
+  p3.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (p3, b1));
+
+  Vector vp4 (1.5, 1.5, 5);
+  PositionInBuilding p4;
+  p4.pos = vp4;
+  p4.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (p4, b1));
+
+  Vector vp5 (2.5, 1.6, 3.5);
+  PositionInBuilding p5;
+  p5.pos = vp5;
+  p5.indoor = true;
+  p5.bid = 0;
+  p5.rx = 1;
+  p5.ry = 1;
+  p5.fn = 1;
+  AddTestCase (new BuildingsHelperOneTestCase (p5, b1));
+
+  Vector vp6 (0.9999, 1.5, 1.5);
+  PositionInBuilding p6;
+  p6.pos = vp6;
+  p6.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (p6, b1));
+
+  Vector vp7 (3.0001, 1.5, 2.5);
+  PositionInBuilding p7;
+  p7.pos = vp7;
+  p7.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (p7, b1));
+
+  Vector vp8 (1.001, 1.001, -0.01);
+  PositionInBuilding p8;
+  p8.pos = vp8;
+  p8.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (p8, b1));
+
+  Vector vp9 (1.5, 1.5, 4.001);
+  PositionInBuilding p9;
+  p9.pos = vp9;
+  p9.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (p9, b1));
+
+
+
+
+  BuildingData b2;
+  b2.xmin = -1;
+  b2.xmax = 0.5;
+  b2.ymin = -2;
+  b2.ymax = 0.5;
+  b2.zmin = 0;
+  b2.zmax = 2;
+  b2.nrx = 3;
+  b2.nry = 5;
+  b2.nf = 4;
+
+  Vector vq1 (-0.7, -1.1, 1.2);
+  PositionInBuilding q1;
+  q1.pos = vq1;
+  q1.indoor = true;
+  q1.bid = 1;
+  q1.rx = 1;
+  q1.ry = 2;
+  q1.fn = 3;
+  AddTestCase (new BuildingsHelperOneTestCase (q1, b2));
+
+  Vector vq2 (0.2, 0.3, 0.2);
+  PositionInBuilding q2;
+  q2.pos = vq2;
+  q2.indoor = true;
+  q2.bid = 1;
+  q2.rx = 3;
+  q2.ry = 5;
+  q2.fn = 1;
+  AddTestCase (new BuildingsHelperOneTestCase (q2, b2));
+
+  Vector vq3 (0.6, -1.75, 1.5);
+  PositionInBuilding q3;
+  q3.pos = vq3;
+  q3.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (q3, b2));
+
+  Vector vq4 (-1.01, 0.3, 1.99);
+  PositionInBuilding q4;
+  q4.pos = vq4;
+  q4.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (q4, b2));
+
+  Vector vq5 (-0.8, 0.7, 0.01);
+  PositionInBuilding q5;
+  q5.pos = vq5;
+  q5.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (q5, b2));
+
+  Vector vq6 (0.2, 0.3, -0.2);
+  PositionInBuilding q6;
+  q6.pos = vq6;
+  q6.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (q6, b2));
+
+  Vector vq7 (0.2, 0.3, 2.001);
+  PositionInBuilding q7;
+  q7.pos = vq7;
+  q7.indoor = false;
+  AddTestCase (new BuildingsHelperOneTestCase (q7, b2));     
+}
+
+static BuildingsHelperTestSuite buildingsHelperAntennaTestSuiteInstance;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/test/buildings-pathloss-test.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,337 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo <marco.miozzo@cttc.es>
+ */
+
+#include <ns3/simulator.h>
+
+#include <ns3/log.h>
+
+#include <ns3/buildings-pathloss-test.h>
+#include "ns3/string.h"
+#include "ns3/double.h"
+#include <ns3/building.h>
+#include <ns3/enum.h>
+
+
+NS_LOG_COMPONENT_DEFINE ("BuildingsPathlossTest");
+
+namespace ns3 {
+
+
+/**
+ * Test 1.1 BuildingsPathlossModel Pathloss compound test
+ */
+
+/**
+ * This TestSuite tests the BuildingPathlossModel by reproducing
+ * several communication scenarios 
+ */
+
+
+BuildingsPathlossTestSuite::BuildingsPathlossTestSuite ()
+  : TestSuite ("buildings-pathloss-test", SYSTEM)
+{
+
+  LogComponentEnable ("BuildingsPathlossTest", LOG_LEVEL_ALL);
+
+  double freq = 869e6;  // E_UTRA BAND #5 see table 5.5-1 of 36.101
+
+  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, LargeCity, 137.93, "OH Urban Large city"));
+
+  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, SmallCity, 137.88, "OH Urban small city"));
+
+  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, SubUrbanEnvironment, LargeCity, 128.03, "loss OH SubUrban"));
+
+  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, OpenAreasEnvironment, LargeCity, 110.21, "loss OH OpenAreas"));
+
+  // Test #2 COST231 Model (1500 < freq < 2000~2170 MHz) (Macro<->UE)
+
+  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
+
+  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, LargeCity, 148.55, "COST231 Urban Large city"));
+
+  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, SmallCity, 150.64, "COST231 Urban small city and suburban"));
+
+  // Test #3 2.6 GHz model (Macro<->UE)
+
+  freq = 2.620e9; // E_UTRA BAND #7 see table 5.5-1 of 36.101
+
+  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, SmallCity, 121.83, "2.6GHz model"));
+
+  // Test #4 ITU1411 LOS model (Macro<->UE)
+
+  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
+  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 3, UrbanEnvironment, LargeCity, 81.00, "ITU1411 LOS"));
+
+  // Test #5 ITU1411 NLOS model (Macro<->UE)
+
+  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
+
+  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 4, UrbanEnvironment, LargeCity, 143.69, "ITU1411 NLOS"));
+
+  // Test #6 ITUP1238 (HeNB <-> UE)
+
+  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
+  AddTestCase (new BuildingsPathlossTestCase (freq, 5, 6, UrbanEnvironment, LargeCity, 88.3855, "ITUP1238"));
+
+  // Test #7 Outdoor -> Indoor OkumuraHata (Macro<->UE)
+
+  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
+  // The loss is as in test #2 (large city) plus the building penetration loss
+  // which for ConcreteWithWindows is equal to 7 dB -> 148.55 + 7 = 155.55
+  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 7, UrbanEnvironment, LargeCity, 155.55, "Okumura Hata Outdoor -> Indoor"));
+
+  // Test #8 Outdoor -> Indoor ITU1411 (Macro<->UE)
+  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
+  // The loss is as in test #4 plus the building penetration loss
+  // which for ConcreteWithWindows is equal to 7 dB -> 81.000 + 7 = 88.000
+  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 8, UrbanEnvironment, LargeCity, 88.000, "ITU1411 LOS Outdoor -> Indoor"));
+
+  // Test #9 Indoor -> Outdoor LOS (HeNB <-> UE)
+
+  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
+  // The loss is similar of test #4 plus the building penetration loss
+  // which for ConcreteWithWindows is equal to 7 dB and the height gain
+  // (2 floors x 2 dB/floor = 4) -> 81.838 + 7 - 4 = 84.838
+  AddTestCase (new BuildingsPathlossTestCase (freq, 9, 10, UrbanEnvironment, LargeCity, 84.838, "ITU1411 LOS Indoor -> Outdoor"));
+
+  // Test #10 Indoor -> Outdoor NLOS (HeNB <-> UE)
+
+  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
+  // The loss is similar as in test #4 plus the building penetration loss
+  // which for ConcreteWithWindows is equal to 7 dB and the height gain
+  // (2 floors x 2 dB/floor = 4) -> 180.90 + 7 - 4 = 183.90
+  AddTestCase (new BuildingsPathlossTestCase (freq, 9, 11, UrbanEnvironment, LargeCity, 183.90, "ITU1411 NLOS Indoor -> Outdoor"));
+
+
+}
+
+
+
+static BuildingsPathlossTestSuite buildingsPathlossTestSuite;
+
+
+/**
+ * TestCase
+ */
+
+BuildingsPathlossTestCase::BuildingsPathlossTestCase (double freq, uint16_t m1, uint16_t m2, EnvironmentType env, CitySize city, double refValue, std::string name)
+  : TestCase ("LOSS calculation: " + name),
+    m_freq (freq),
+    m_mobilityModelIndex1 (m1),
+    m_mobilityModelIndex2 (m2),
+    m_env (env),
+    m_city (city),
+    m_lossRef (refValue)
+{
+}
+
+BuildingsPathlossTestCase::~BuildingsPathlossTestCase ()
+{
+}
+
+void
+BuildingsPathlossTestCase::DoRun (void)
+{
+//   LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
+
+//   LogComponentEnable ("LteEnbRrc", logLevel);
+//   LogComponentEnable ("LteUeRrc", logLevel);
+//   LogComponentEnable ("LteEnbMac", logLevel);
+//   LogComponentEnable ("LteUeMac", logLevel);
+//   LogComponentEnable ("LteRlc", logLevel);
+//   LogComponentEnable ("RrPacketScheduler", logLevel);
+// 
+//   LogComponentEnable ("LtePhy", logLevel);
+//   LogComponentEnable ("LteEnbPhy", logLevel);
+//   LogComponentEnable ("LteUePhy", logLevel);
+// 
+//   LogComponentEnable ("LteSpectrumPhy", logLevel);
+//   LogComponentEnable ("LteInterference", logLevel);
+//   LogComponentEnable ("LteSinrChunkProcessor", logLevel);
+// 
+//   LogComponentEnable ("LtePropagationLossModel", logLevel);
+//   LogComponentEnable ("LossModel", logLevel);
+//   LogComponentEnable ("ShadowingLossModel", logLevel);
+//   LogComponentEnable ("PenetrationLossModel", logLevel);
+//   LogComponentEnable ("MultipathLossModel", logLevel);
+//   LogComponentEnable ("PathLossModel", logLevel);
+// 
+//   LogComponentEnable ("LteNetDevice", logLevel);
+//   LogComponentEnable ("LteUeNetDevice", logLevel);
+//   LogComponentEnable ("LteEnbNetDevice", logLevel);
+
+  LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
+  LogComponentEnable ("HybridBuildingsPropagationLossModel", LOG_LEVEL_ALL);
+
+  NS_LOG_FUNCTION (this);
+
+  Ptr<MobilityModel> mma = CreateMobilityModel (m_mobilityModelIndex1);
+  Ptr<MobilityModel> mmb = CreateMobilityModel (m_mobilityModelIndex2);
+
+
+
+
+  Ptr<HybridBuildingsPropagationLossModel> propagationLossModel = CreateObject<HybridBuildingsPropagationLossModel> ();
+  propagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq));
+  propagationLossModel->SetAttribute ("Environment", EnumValue (m_env));
+  propagationLossModel->SetAttribute ("CitySize", EnumValue (m_city));
+  // cancel shadowing effect
+  propagationLossModel->SetAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
+  propagationLossModel->SetAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
+  propagationLossModel->SetAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
+
+  double loss = propagationLossModel->GetLoss (mma, mmb);
+
+  NS_LOG_INFO ("Calculated loss: " << loss);
+  NS_LOG_INFO ("Theoretical loss: " << m_lossRef);
+ 
+  NS_TEST_ASSERT_MSG_EQ_TOL (loss, m_lossRef, 0.1, "Wrong loss !");
+  Simulator::Destroy ();
+}
+
+Ptr<MobilityModel>
+BuildingsPathlossTestCase::CreateMobilityModel (uint16_t index)
+{
+
+  /*
+   * The purpose of this method is to defer the creation of the
+   * MobilityModel instances to when DoRun() is called. In a previous
+   * version, MobilityModel instances where created directly in the
+   * constructor of the test suite, which caused subtle bugs due to
+   * "static initialization order fiasco". An example of such a subtle
+   * bug is that logging via NS_LOG failed for some modules.
+   * 
+   */
+
+
+  double distance = 2000;
+  double hm = 1;
+  double hb = 30;
+
+  Ptr<BuildingsMobilityModel> mm1 = CreateObject<BuildingsMobilityModel> ();
+  mm1->SetPosition (Vector (0.0, 0.0, hb));
+
+  Ptr<BuildingsMobilityModel> mm2 = CreateObject<BuildingsMobilityModel> ();
+  mm2->SetPosition (Vector (distance, 0.0, hm));
+ 
+  distance = 100;
+  Ptr<BuildingsMobilityModel> mm3 = CreateObject<BuildingsMobilityModel> ();
+  mm3->SetPosition (Vector (distance, 0.0, hm));
+
+  distance = 900;
+  Ptr<BuildingsMobilityModel> mm4 = CreateObject<BuildingsMobilityModel> ();
+  mm4->SetPosition (Vector (distance, 0.0, hm));
+
+  distance = 30;
+  double henbHeight = 10.0;
+  Ptr<BuildingsMobilityModel> mm5 = CreateObject<BuildingsMobilityModel> ();
+  mm5->SetPosition (Vector (0.0, 0.0, henbHeight));
+
+  // this needs to be static otherwise it will look like a different building every time
+  static Ptr<Building> building1 = Create<Building> ();
+  building1->SetBoundaries (Box (0.0, 10.0, 0.0, 10.0, 0.0, 20.0 /*, 1, 1, 1*/));
+  building1->SetBuildingType (Building::Residential);
+  building1->SetExtWallsType (Building::ConcreteWithWindows);
+  mm5->SetIndoor (building1);
+  Ptr<BuildingsMobilityModel> mm6 = CreateObject<BuildingsMobilityModel> ();
+  mm6->SetPosition (Vector (distance, 0.0, hm));
+  mm6->SetIndoor (building1);
+  mm6->SetFloorNumber (2);
+ 
+  distance = 2000;
+  Ptr<BuildingsMobilityModel> mm7 = CreateObject<BuildingsMobilityModel> ();
+  mm7->SetPosition (Vector (distance, 0.0, hm));
+  mm7->SetIndoor (building1);
+
+  distance = 100;
+  Ptr<BuildingsMobilityModel> mm8 = CreateObject<BuildingsMobilityModel> ();
+  mm8->SetPosition (Vector (distance, 0.0, hm));
+  mm8->SetIndoor (building1);
+
+  distance = 100;
+  Ptr<BuildingsMobilityModel> mm9 = CreateObject<BuildingsMobilityModel> ();
+  mm9->SetPosition (Vector (0.0, 0.0, henbHeight));
+  mm9->SetIndoor (building1);
+  mm9->SetFloorNumber (2);
+  Ptr<BuildingsMobilityModel> mm10 = CreateObject<BuildingsMobilityModel> ();
+  mm10->SetPosition (Vector (distance, 0.0, hm));
+
+  distance = 500;
+  Ptr<BuildingsMobilityModel> mm11 = CreateObject<BuildingsMobilityModel> ();
+  mm11->SetPosition (Vector (distance, 0.0, hm));
+ 
+
+
+  switch (index)
+    {
+    case 1:
+      return mm1;
+      break;
+
+    case 2:
+      return mm2;
+      break;
+
+    case 3:
+      return mm3;
+      break;
+
+    case 4:
+      return mm4;
+      break;
+
+    case 5:
+      return mm5;
+      break;
+
+    case 6:
+      return mm6;
+      break;
+
+    case 7:
+      return mm7;
+      break;
+
+    case 8:
+      return mm8;
+      break;
+
+    case 9:
+      return mm9;
+      break;
+
+    case 10:
+      return mm10;
+      break;
+
+    case 11:
+      return mm11;
+      break;
+
+    default:
+      return 0;
+      break;
+    }
+  return 0;
+}
+
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/test/buildings-pathloss-test.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,64 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation;
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ *
+ * Author: Marco Miozzo <marco.miozzo@cttc.es>
+ */
+
+#ifndef BUILDINGS_PATHLOSS_TEST_H
+#define BUILDINGS_PATHLOSS_TEST_H
+
+#include <ns3/test.h>
+#include <ns3/buildings-mobility-model.h>
+#include <ns3/hybrid-buildings-propagation-loss-model.h>
+
+
+namespace ns3 {
+
+/**
+* Test 1.1 pathloss calculation
+*/
+class BuildingsPathlossTestSuite : public TestSuite
+{
+public:
+  BuildingsPathlossTestSuite ();
+};
+
+
+class BuildingsPathlossTestCase : public TestCase
+{
+public:
+  BuildingsPathlossTestCase (double freq, uint16_t m1, uint16_t m2, EnvironmentType env, CitySize city, double refValue, std::string name);
+  virtual ~BuildingsPathlossTestCase ();
+
+private:
+  virtual void DoRun (void);
+  Ptr<MobilityModel> CreateMobilityModel (uint16_t index);
+
+  double m_freq;
+  uint16_t m_mobilityModelIndex1;
+  uint16_t m_mobilityModelIndex2;
+  EnvironmentType m_env;
+  CitySize m_city;
+  double m_lossRef;
+
+};
+
+
+#endif /* BUILDING_PATHLOSS_TEST_H */
+
+
+} // namespace ns3
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/test/buildings-shadowing-test.cc	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,221 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2 as
+* published by the Free Software Foundation;
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*
+* Author: Marco Miozzo <marco.miozzo@cttc.es>
+*/
+
+#include "ns3/simulator.h"
+#include "ns3/log.h"
+#include "ns3/buildings-shadowing-test.h"
+#include <ns3/hybrid-buildings-propagation-loss-model.h>
+#include "ns3/string.h"
+#include "ns3/double.h"
+#include <ns3/building.h>
+#include <ns3/enum.h>
+
+NS_LOG_COMPONENT_DEFINE ("BuildingsShadowingTest");
+
+using namespace ns3;
+
+
+/**
+* Test 1.1 Shadowing compound test
+*/
+
+/**
+* This TestSuite tests the shadowing model of BuildingPathlossModel 
+* by reproducing several communication scenarios 
+*/
+
+
+BuildingsShadowingTestSuite::BuildingsShadowingTestSuite ()
+  : TestSuite ("buildings-shadowing-test", SYSTEM)
+{
+
+  LogComponentEnable ("BuildingsShadowingTest", LOG_LEVEL_ALL);
+
+  // Test #1 Outdoor Model
+  AddTestCase (new BuildingsShadowingTestCase (1, 2, 148.86, 7.0, "Outdoor Shadowing"));
+
+  // Test #2 Indoor model
+  AddTestCase (new BuildingsShadowingTestCase (5, 6, 88.5724, 8.0, "Indoor Shadowing"));
+
+  // Test #3 Indoor -> Outdoor
+  AddTestCase (new BuildingsShadowingTestCase (9, 10, 85.0012, 8.6, "Indoor -> Outdoor Shadowing"));
+
+}
+
+static BuildingsShadowingTestSuite buildingsShadowingTestSuite;
+
+
+/**
+* TestCase
+*/
+
+BuildingsShadowingTestCase::BuildingsShadowingTestCase ( uint16_t m1, uint16_t m2, double refValue, double sigmaRef, std::string name)
+  : TestCase ("SHADOWING calculation: " + name),
+    m_mobilityModelIndex1 (m1),
+    m_mobilityModelIndex2 (m2),
+    m_lossRef (refValue),
+    m_sigmaRef (sigmaRef)
+{
+}
+
+BuildingsShadowingTestCase::~BuildingsShadowingTestCase ()
+{
+}
+
+void
+BuildingsShadowingTestCase::DoRun (void)
+{
+//     LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
+
+  //   LogComponentEnable ("LteEnbRrc", logLevel);
+  //   LogComponentEnable ("LteUeRrc", logLevel);
+  //   LogComponentEnable ("LteEnbMac", logLevel);
+  //   LogComponentEnable ("LteUeMac", logLevel);
+  //   LogComponentEnable ("LteRlc", logLevel);
+  //   LogComponentEnable ("RrPacketScheduler", logLevel);
+  // 
+  //   LogComponentEnable ("LtePhy", logLevel);
+  //   LogComponentEnable ("LteEnbPhy", logLevel);
+  //   LogComponentEnable ("LteUePhy", logLevel);
+  // 
+  //   LogComponentEnable ("LteSpectrumPhy", logLevel);
+  //   LogComponentEnable ("LteInterference", logLevel);
+  //   LogComponentEnable ("LteSinrChunkProcessor", logLevel);
+  // 
+  //   LogComponentEnable ("LtePropagationLossModel", logLevel);
+  //   LogComponentEnable ("LossModel", logLevel);
+//     LogComponentEnable ("ShadowingLossModel", logLevel);
+//   LogComponentEnable ("PenetrationLossModel", logLevel);
+//   LogComponentEnable ("MultipathLossModel", logLevel);
+//   LogComponentEnable ("PathLossModel", logLevel);
+//
+//   LogComponentEnable ("LteNetDevice", logLevel);
+//   LogComponentEnable ("LteUeNetDevice", logLevel);
+//   LogComponentEnable ("LteEnbNetDevice", logLevel);
+
+//   LogComponentEnable ("BuildingsPropagationLossModel", LOG_LEVEL_ALL);
+
+
+  Ptr<MobilityModel> mma = CreateMobilityModel (m_mobilityModelIndex1);
+  Ptr<MobilityModel> mmb = CreateMobilityModel (m_mobilityModelIndex2);
+
+  std::vector<double> loss;
+  double sum = 0.0;
+  double sumSquared = 0.0;
+  int samples = 10000;
+  for (int i = 0; i < samples; i++)
+    {
+      Ptr<HybridBuildingsPropagationLossModel> propagationLossModel = CreateObject<HybridBuildingsPropagationLossModel> ();
+      loss.push_back (propagationLossModel->DoCalcRxPower (0.0, mma, mmb) + m_lossRef);
+      sum += loss.at (loss.size () - 1);
+      sumSquared += (loss.at (loss.size () - 1) * loss.at (loss.size () - 1));
+    }
+  double mean = sum / samples;
+  double sigma = sqrt (sumSquared / samples - (mean * mean));
+  // test whether the distribution falls in the 99% confidence interval, as expected with a nornal distribution
+  double ci = (2.575829303549 * sigma) / sqrt (samples);
+
+  NS_LOG_INFO ("Mean from simulation " << mean << ", sigma " << sigma << ", reference value " << m_sigmaRef << ", CI(99%) " << ci);
+
+  NS_TEST_ASSERT_MSG_EQ_TOL (fabs (mean), 0.0, ci, "Wrong shadowing distribution !");
+  Simulator::Destroy ();
+}
+
+
+
+Ptr<MobilityModel>
+BuildingsShadowingTestCase::CreateMobilityModel (uint16_t index)
+{
+  /*
+   * The purpose of this method is to defer the creation of the
+   * MobilityModel instances to when DoRun() is called. In a previous
+   * version, MobilityModel instances where created directly in the
+   * constructor of the test suite, which caused subtle bugs due to
+   * "static initialization order fiasco". An example of such a subtle
+   * bug is that logging via NS_LOG failed for some modules.
+   * 
+   */
+
+  double distance = 2000;
+  double hm = 1;
+  double hb = 30;
+  Ptr<BuildingsMobilityModel> mm1 = CreateObject<BuildingsMobilityModel> ();
+  mm1->SetPosition (Vector (0.0, 0.0, hb));
+
+  Ptr<BuildingsMobilityModel> mm2 = CreateObject<BuildingsMobilityModel> ();
+  mm2->SetPosition (Vector (distance, 0.0, hm));
+
+
+  distance = 30;
+  double henbHeight = 10.0;
+  Ptr<BuildingsMobilityModel> mm5 = CreateObject<BuildingsMobilityModel> ();
+  mm5->SetPosition (Vector (0.0, 0.0, henbHeight));
+  static Ptr<Building> building1 = Create<Building> ();
+  building1->SetBoundaries (Box (0.0, 10.0, 0.0, 10.0, 0.0, 20.0 /*, 1, 1, 1*/));
+  building1->SetBuildingType (Building::Residential);
+  building1->SetExtWallsType (Building::ConcreteWithWindows);
+  mm5->SetIndoor (building1);
+  Ptr<BuildingsMobilityModel> mm6 = CreateObject<BuildingsMobilityModel> ();
+  mm6->SetPosition (Vector (distance, 0.0, hm));
+  mm6->SetIndoor (building1);
+  mm6->SetFloorNumber (2);
+
+
+  distance = 100;
+  Ptr<BuildingsMobilityModel> mm9 = CreateObject<BuildingsMobilityModel> ();
+  mm9->SetPosition (Vector (0.0, 0.0, henbHeight));
+  mm9->SetIndoor (building1);
+  mm9->SetFloorNumber (2);
+  Ptr<BuildingsMobilityModel> mm10 = CreateObject<BuildingsMobilityModel> ();
+  mm10->SetPosition (Vector (distance, 0.0, hm));
+
+  switch (index)
+    {
+    case 1:
+      return mm1;
+      break;
+
+    case 2:
+      return mm2;
+      break;
+
+    case 5:
+      return mm5;
+      break;
+
+    case 6:
+      return mm6;
+      break;
+
+    case 9:
+      return mm9;
+      break;
+
+    case 10:
+      return mm10;
+      break;
+
+    default:
+      return 0;
+      break;
+    }
+  return 0;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/test/buildings-shadowing-test.h	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,60 @@
+/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
+/*
+* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
+*
+* This program is free software; you can redistribute it and/or modify
+* it under the terms of the GNU General Public License version 2 as
+* published by the Free Software Foundation;
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+*
+* Author: Marco Miozzo <marco.miozzo@cttc.es>
+*/
+
+#ifndef BUILDINGS_SHADOWING_TEST_H
+#define BUILDINGS_SHADOWING_TEST_H
+
+#include "ns3/test.h"
+
+#include <ns3/buildings-mobility-model.h>
+#include <ns3/buildings-propagation-loss-model.h>
+
+
+using namespace ns3;
+
+
+/**
+* Test 1.1 shadowing calculation
+*/
+class BuildingsShadowingTestSuite : public TestSuite
+{
+public:
+  BuildingsShadowingTestSuite ();
+};
+
+
+class BuildingsShadowingTestCase : public TestCase
+{
+public:
+  BuildingsShadowingTestCase (uint16_t m1, uint16_t m2, double refValue, double sigmaRef, std::string name);
+  virtual ~BuildingsShadowingTestCase ();
+
+private:
+  virtual void DoRun (void);
+  Ptr<MobilityModel> CreateMobilityModel (uint16_t index);
+
+  uint16_t m_mobilityModelIndex1;
+  uint16_t m_mobilityModelIndex2;
+  double m_lossRef;     // pathloss value (without shadowing)
+  double m_sigmaRef;
+
+};
+
+#endif /*BUILDINGS_SHADOWING_TEST_H*/
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/test/examples-to-run.py	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,21 @@
+#! /usr/bin/env python
+# -*- coding: utf-8 -*-
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+# A list of C++ examples to run in order to ensure that they remain
+# buildable and runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run, do_valgrind_run).
+#
+# See test.py for more information.
+cpp_examples = [
+    ("buildings-pathloss-profiler", "True", "True"),
+]
+
+# A list of Python examples to run in order to ensure that they remain
+# runnable over time.  Each tuple in the list contains
+#
+#     (example_name, do_run).
+#
+# See test.py for more information.
+python_examples = []
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/test/reference/buildings_pathloss.m	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,87 @@
+clear all;
+close all;
+
+%% BuildingsPropagationLossModel pathloss test reference script
+
+
+%% ITU1411, COST231, OH, etc. scripts are in the propagation module
+addpath ("../../../propagation/test/reference/");
+
+
+%f = 2114e6;  % carrier freq Hz, EARFCN = 500 (downlink)
+%f = 1900e6;  % carrier freq Hz, EARFCN = 500 (downlink)
+f = 869e6;
+%f = 2620e6;
+d = 2; %km
+hb = 30;
+hm = 1;
+hr = 20;
+fmhz = f/1e6;
+
+% Test #1
+g = loss_OH_large_cities_urban (d, hb, hm, fmhz);
+disp ("Test #1: the value of OH for large cities is:"), disp (g)
+
+g = loss_OH_small_cities_urban (d, hb, hm, fmhz);
+disp ("Test #1: the value of OH for small cities is:"), disp (g)
+
+g = loss_OH_suburban (d, hb, hm, fmhz);
+disp ("Test #1: the value of OH in suburban is:"), disp (g)
+
+g = loss_OH_openareas (d, hb, hm, fmhz);
+disp ("Test #1: the value of OH in openareas is:"), disp (g)
+
+% Test #2 and #7
+fmhz = 2114;
+g = loss_COST231_large_cities_urban (d, hb, hm, fmhz);
+disp ("Test #2: the value of COST231 for large cities is:"), disp (g)
+
+g = loss_COST231_small_cities_urban (d, hb, hm, fmhz);
+disp ("Test #2: the value of COST231 for small cities is:"), disp (g)
+
+% Test #3
+g = loss_Kun_2_6GHz (d*1000);
+disp ("Test #3: the value of Kun 2.6 GHz is:"), disp (g)
+
+% Test #4
+d = 1041.2; %m
+f = 2114e6;
+g = loss_ITU1411_LOS (d, hb, hm, f);
+disp ("Test #4: the value of ITU1411 in LOS is:"), disp (g)
+
+% Test #5
+d = 900;
+l = 80;
+b = 50;
+st_w = 20;
+phi = 45;
+big = 1; % metropolitan centre
+g = loss_ITU1411_NLOS_over_rooftop (d, hb, hm, hr, f, l, b, st_w, phi, big);
+disp ("Test #5: the value of ITU1411 in NLOS over the roof-top is:"), disp (g)
+
+% Test #6
+n_floors = 2;
+built_t = 2;
+d = 31.3209;
+g = loss_ITU1238 (d, fmhz, n_floors, built_t);
+disp ("Test #6: the value of ITU1238 is:"), disp (g)
+
+% Test #9
+d = 100.404;
+f = 2114e6;
+hb = 10;
+g = loss_ITU1411_LOS (d, hb, hm, hr, f);
+disp ("Test #9: the value of ITU1411 in LOS is:"), disp (g)
+
+
+
+% Test #10
+d = 500;
+l = 80;
+b = 50;
+st_w = 20;
+phi = 45;
+big = 1; % metropolitan centre
+hb = 10;
+g = loss_ITU1411_NLOS_over_rooftop (d, hb, hm, hr, f, l, b, st_w, phi, big);
+disp ("Test #10: the value of ITU1411 in NLOS over the roof-top is:"), disp (g)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/test/reference/loss_ITU1238.m	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,30 @@
+function g = loss_ITU1238 (d, f, n_floors, build_t)
+
+  %%
+  %% function g = loss_ITU1411_NLOS_street_canyons(d, c)
+  %%
+  %% returns the loss at d meters for f frequency and mobile height m and
+  %% base station height of hb
+  %% build_t = 0:residential; 1:office; 2:commercial
+  
+  assert(isscalar(f));
+  assert(f > 0);
+
+
+  lambda = 300000000.0 / f;
+
+
+  if (build_t ==1)
+    N = 28;
+    Lf = 4*n_floors;
+  elseif (build_t==2)
+    N = 30
+    Lf = 15+4*(n_floors-1);
+  else
+    N = 22;
+    Lf = 6 + 3*(n_floors-1);
+  endif
+
+  g(find(d > 0)) = 20*log10(f) + (N*log10(d)) + Lf - 28;
+
+  g(find(d <= 0)) = 1;
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/buildings/wscript	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,49 @@
+## -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-
+
+def build(bld):
+
+    module = bld.create_ns3_module('buildings', ['mobility', 'propagation', 'config-store'])
+    module.source = [
+        'model/building.cc',
+        'model/building-list.cc',
+        'model/buildings-mobility-model.cc',
+        'model/itu-r-1238-propagation-loss-model.cc',
+        'model/buildings-propagation-loss-model.cc',
+        'model/hybrid-buildings-propagation-loss-model.cc',
+        'model/oh-buildings-propagation-loss-model.cc',
+        'helper/building-container.cc',
+        'helper/building-position-allocator.cc',
+        'helper/building-allocator.cc',
+        'helper/buildings-helper.cc',
+        ]
+
+    module_test = bld.create_ns3_module_test_library('buildings')
+    module_test.source = [
+        'test/buildings-helper-test.cc',
+        'test/buildings-pathloss-test.cc',
+        'test/buildings-shadowing-test.cc',
+        ]
+    
+    headers = bld.new_task_gen(features=['ns3header'])
+    headers.module = 'buildings'
+    headers.source = [
+        'model/building.h',
+        'model/building-list.h',
+        'model/buildings-mobility-model.h',
+        'model/itu-r-1238-propagation-loss-model.h',
+        'model/buildings-propagation-loss-model.h',
+        'model/hybrid-buildings-propagation-loss-model.h',
+        'model/oh-buildings-propagation-loss-model.h',
+        'helper/building-container.h',
+        'helper/building-allocator.h',
+        'helper/building-position-allocator.h',
+        'helper/buildings-helper.h',
+        'test/buildings-pathloss-test.h',
+        'test/buildings-shadowing-test.h',
+        ]
+
+    if (bld.env['ENABLE_EXAMPLES']):
+        bld.add_subdirs('examples')
+
+
+    bld.ns3_python_bindings()
--- a/src/lte/AUTHORS	Fri May 11 14:02:54 2012 +0200
+++ b/src/lte/AUTHORS	Fri May 11 16:42:40 2012 +0200
@@ -1,16 +1,25 @@
-Giuseppe Piro
-===============
-Module manager and main developer
-2010
-TELEMATICS LAB, Politecnico di Bari
-G.Piro@poliba.it
+
+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.
+
+====================================================
+       Google Summer of Code (GSoC) (2010)
+====================================================
+
+Giuseppe Piro, TELEMATICS LAB, Politecnico di Bari <G.Piro@poliba.it>
+design and development
+
+Nicola Baldo, CTTC <nbaldo@cttc.es>
+Marco Miozzo, CTTC <mmiozzo@cttc.es>
+supervision and GSoC project mentorship
 
 
-The module has been firtly developed with 
-the support of Google Summer of Code Program, 
-under the supervision of 
-Nicola Baldo (n.baldo@cttc.es)
-and Marco Miozzo (m.miozzo@cttc.es) 
+====================================================
+  LTE-EPC Network simulAtor (LENA) Project (2011-12)
+====================================================
+
+Nicola Baldo, CTTC <nbaldo@cttc.es>
+Marco Miozzo, CTTC <mmiozzo@cttc.es>
+Manuel Requena, CTTC <mrequena@cttc.es>
+Jaume Nin, CTTC <jnin@cttc.es>
 
 
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/RELEASE_NOTES	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,95 @@
+
++++++++++++++++++++++++++++++++++++++
+ RELEASE NOTES of the ns-3 LTE module
++++++++++++++++++++++++++++++++++++++
+
+This file documents the user-visible features that have been added
+within each release of the ns-3 LTE module.
+
+
+
+
+Milestone 1 (M1) release of the LENA project (June 17, 2011)
+============================================================
+
+Here is a summary of the new features available in the LTE module with
+this release:  
+
+
+ - uplink PHY and MAC properly implemented including Adaptive
+   Modulation and Coding (previously only downlink was supported)  
+
+ - interference modeling was implemented: it is now possible to
+   simulate multi-cell scenarios with inter-cell interference
+
+ - flexible spectrum model: it is now possible to specify the carrier
+   frequency and bandwidth of each cell independently 
+
+ - an implementation of the Proportional Fair scheduler based on the
+   FF LTE MAC Scheduler API is now included 
+
+ - support for output of RLC and MAC layer Key Performance Indicators
+   (KPIs) via dedicated trace sinks connected to newly defined trace
+   sources 
+
+ - the setting of the most relevant parameters (e.g. tx power, noise,
+   carrier frequency, bandwidth, type of scheduler, etc.) is now done
+   via the ns-3 attribute system   
+
+ - several test suites have been added, including both unit tests that
+   check the correct functionality of specific objects, and system
+   tests that validate the output produced by the simulator in several
+   scenarios of interest.
+
+ - the documentation of the lte module has been entirely rewritten, it
+   now features three separate sections: the design documentation, the
+   user documentation and the testing documentation. 
+
+
+
+First Public release of the LENA project (March 10, 2011)
+=========================================================
+
+The LENA code is based on the GSoC 2010 project code by Giuseppe Piro,
+which was merged into ns-3-dev on December 2010. With respect to the GSoC
+code, the main modifications that have been performed are: 
+
+ - the MAC has been entirely rewritten to support the MAC Scheduler
+   API defined by the Femto Forum, which is publicly available at this
+   location: http://www.femtoforum.org/femto/technical.php
+
+ - a Round Robin scheduler implementation based on the above API is
+   also provided
+
+ - the RLC API has been redefined  RLC in particular, at this stage
+   only the API definition is in place, together with a simplified RLC
+   implementation (RLC TM/UM/AM not available yet) 
+
+  - the RRC has been entirely rewritten; we plan to reuse part of the
+    GSoC 2010 flow classification code (which we plan to reuse) at a
+    future stage for the implementation of Traffic Flow Template
+    classifiers. 
+
+  - network layer functionality has been temporarily disabled; it will
+    be re-enabled when either RLC/UM or RLC/AM is available. 
+
+
+
+
+GSoC 2010 release (merged into ns-3-dev on December 2010)
+=========================================================
+
+Here are 
+In summary, the most important features provided by the
+proposed module are (i) a basic implementation of both the
+User Equipment (UE) and the enhanced NodeB (eNB) de-
+vices, (ii) RRC entities for both the UE and the eNB, (iii)
+a state-of-the-art Adaptive Modulation and Coding (AMC)
+scheme for the downlink [9], (iv) the management of the
+data radio bearers (with their QoS parameters), the MAC
+queues and the RLC instances, (v) Channel Quality Indi-
+cator (CQI) management, (vi) support for both uplink and
+downlik packet scheduling, (vii) a PHY layer model with
+Resource Block level granularity and (viii) a channel model
+with the outdoor E-UTRAN propagation loss model.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/doc/Makefile	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,265 @@
+EPSTOPDF = epstopdf
+DIA = dia
+SEQDIAG = seqdiag
+CONVERT = convert -density 250
+
+
+SOURCE = source
+FIGURES = $(SOURCE)/figures
+
+# specify dia figures from which .png and .pdf figures need to be built
+
+IMAGES_DIA = \
+	$(FIGURES)/epc-data-flow-dl.dia \
+	$(FIGURES)/epc-data-flow-ul.dia \
+	$(FIGURES)/epc-profiling-scenario.dia \
+	$(FIGURES)/epc-topology.dia \
+	$(FIGURES)/eutran-profiling-scenario.dia \
+	$(FIGURES)/ff-example.dia \
+	$(FIGURES)/ff-mac-saps.dia \
+	$(FIGURES)/lte-arch-data-rrc-pdcp-rlc.dia \
+	$(FIGURES)/lte-enb-architecture.dia \
+	$(FIGURES)/lte-epc-e2e-data-protocol-stack.dia \
+	$(FIGURES)/lte-interference-test-scenario.dia \
+	$(FIGURES)/lte-ue-architecture.dia
+
+
+# specify eps figures from which .png and .pdf figures need to be built
+
+IMAGES_EPS = \
+	$(FIGURES)/MCS_2_test.eps \
+	$(FIGURES)/MCS_12_test.eps \
+	$(FIGURES)/MCS_14_test.eps \
+	$(FIGURES)/lena-dual-stripe.eps \
+	$(FIGURES)/lte-mcs-index.eps \
+	$(FIGURES)/lenaThrTestCase1.eps \
+	$(FIGURES)/lenaThrTestCase2.eps \
+	$(FIGURES)/runningTime10s.eps \
+	$(FIGURES)/epcRunningTime.eps \
+	$(FIGURES)/propagationModel.eps \
+	$(FIGURES)/simulationTime.eps \
+	$(FIGURES)/epcSimulationTime.eps \
+	$(FIGURES)/epcEutranRunningTime.eps \
+	$(FIGURES)/profiling-memory.eps \
+	$(FIGURES)/lte-rlc-implementation-model.eps \
+	$(FIGURES)/lte-rlc-data-txon-dl.eps \
+	$(FIGURES)/lte-rlc-data-retx-dl.eps \
+	$(FIGURES)/lte-rlc-data-txon-ul.eps \
+	$(FIGURES)/lte-rlc-data-retx-ul.eps 
+
+
+# rescale pdf figures as necessary
+$(FIGURES)/testbed.pdf_width = 5in
+$(FIGURES)/emulated-channel.pdf_width = 6in
+$(FIGURES)/node.pdf_width = 5in
+$(FIGURES)/packet.pdf_width = 4in
+$(FIGURES)/buffer.pdf_width = 15cm
+$(FIGURES)/sockets-overview.pdf_width = 10cm
+$(FIGURES)/internet-node-send.pdf_width = 5in
+$(FIGURES)/internet-node-recv.pdf_width = 5in
+$(FIGURES)/routing.pdf_width = 6in
+$(FIGURES)/routing-specialization.pdf_width = 5in
+$(FIGURES)/snir.pdf_width = 3in
+$(FIGURES)/lte-interference-test-scenario.pdf_width = 3in
+$(FIGURES)/epc-topology.pdf_width = 4in
+$(FIGURES)/lte-arch-data-rrc-pdcp-rlc.pdf_width = 3in
+$(FIGURES)/lte-epc-e2e-data-protocol-stack.pdf_width = 15cm
+$(FIGURES)/ff-mac-saps.pdf_width = 5in
+$(FIGURES)/ff-example.pdf_width = 5in
+$(FIGURES)/lte-rlc-implementation-model.pdf_width = 20in
+$(FIGURES)/lte-rlc-data-txon-dl.pdf_width = 10cm
+$(FIGURES)/lte-rlc-data-txon-ul.pdf_width = 10cm
+$(FIGURES)/lte-rlc-data-retx-ul.pdf_width = 10cm
+$(FIGURES)/lte-phy-interference.pdf_width = 12cm
+$(FIGURES)/auvmobility-classes.pdf_width = 10cm
+
+
+IMAGES_SEQDIAG = \
+	$(FIGURES)/lte-phy-interference.seqdiag \
+	$(FIGURES)/helpers.seqdiag
+
+IMAGES_NOBUILD = $(FIGURES)/fading_pedestrian.png \
+	$(FIGURES)/fading_vehicular.png \
+	$(FIGURES)/fading_urban_3kmph.png \
+	$(FIGURES)/fading_pedestrian.pdf \
+	$(FIGURES)/fading_vehicular.pdf \
+	$(FIGURES)/fading_urban_3kmph.pdf \
+	$(FIGURES)/MCS_1_4.pdf \
+	$(FIGURES)/MCS_1_4.png \
+	$(FIGURES)/MCS_5_8.pdf \
+	$(FIGURES)/MCS_5_8.png \
+	$(FIGURES)/MCS_9_12.pdf \
+	$(FIGURES)/MCS_9_12.png \
+	$(FIGURES)/MCS_13_16.pdf \
+	$(FIGURES)/MCS_13_16.png \
+	$(FIGURES)/MCS_17_20.pdf \
+	$(FIGURES)/MCS_17_20.png \
+	$(FIGURES)/MCS_21_24.pdf \
+	$(FIGURES)/MCS_21_24.png \
+	$(FIGURES)/MCS_25_27.pdf \
+	$(FIGURES)/MCS_25_27.png \
+	$(FIGURES)/lte-phy-interference.png \
+	$(FIGURES)/lte-phy-interference.pdf \
+	$(FIGURES)/helpers.png \
+	$(FIGURES)/helpers.pdf \
+	$(FIGURES)/miesm_scheme.pdf \
+	$(FIGURES)/miesm_scheme.png \
+	${IMAGES_SEQDIAG:.seqdiag=.png} \
+	${IMAGES_SEQDIAG:.seqdiag=.pdf}
+
+IMAGES_BUILD = \
+	${IMAGES_DIA:.dia=.eps} \
+	${IMAGES_DIA:.dia=.png} \
+	${IMAGES_DIA:.dia=.pdf} \
+	${IMAGES_EPS:.eps=.png} \
+	${IMAGES_EPS:.eps=.pdf} 
+
+
+
+IMAGES = $(IMAGES_NOBUILD) $(IMAGES_BUILD)
+
+%.eps : %.dia; $(DIA) -t eps $< -e $@
+%.png : %.dia; $(DIA) -t png $< -e $@
+%.png : %.seqdiag; $(SEQDIAG) -Tpng -o $@ $< 
+%.png : %.eps; $(CONVERT) $< $@
+%.pdf : %.seqdiag; $(SEQDIAG) -Tpdf -o $@ $< ; if test x$($@_width) != x; then TMPFILE=`mktemp`; ./rescale-pdf.sh $($@_width) $@ $${TMPFILE} && mv $${TMPFILE} $@; fi
+%.pdf : %.eps; $(EPSTOPDF) $< -o=$@; if test x$($@_width) != x; then TMPFILE=`mktemp`; ./rescale-pdf.sh $($@_width) $@ $${TMPFILE} && mv $${TMPFILE} $@; fi
+
+
+%.png : %.eps; $(CONVERT) $< $@
+%.pdf : %.eps; $(EPSTOPDF) $< -o=$@; if test x$($@_width) != x; then TMPFILE=`mktemp`; ./rescale-pdf.sh $($@_width) $@ $${TMPFILE} && mv $${TMPFILE} $@; fi
+
+# You can set these variables from the command line.
+SPHINXOPTS    =
+SPHINXBUILD   = sphinx-build
+PAPER         =
+BUILDDIR      = build
+
+# Internal variables.
+PAPEROPT_a4     = -D latex_paper_size=a4
+PAPEROPT_letter = -D latex_paper_size=letter
+ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) $(SOURCE) 
+
+.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
+
+help:
+	@echo "Please use \`make <target>' where <target> is one of"
+	@echo "  html       to make standalone HTML files"
+	@echo "  dirhtml    to make HTML files named index.html in directories"
+	@echo "  singlehtml to make a single large HTML file"
+	@echo "  pickle     to make pickle files"
+	@echo "  json       to make JSON files"
+	@echo "  htmlhelp   to make HTML files and a HTML help project"
+	@echo "  qthelp     to make HTML files and a qthelp project"
+	@echo "  devhelp    to make HTML files and a Devhelp project"
+	@echo "  epub       to make an epub"
+	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
+	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
+	@echo "  text       to make text files"
+	@echo "  man        to make manual pages"
+	@echo "  changes    to make an overview of all changed/added/deprecated items"
+	@echo "  linkcheck  to check all external links for integrity"
+	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"
+
+clean:
+	-rm -rf $(BUILDDIR)/*
+	-rm -f $(IMAGES_BUILD)
+
+frag: pickle
+	@if test ! -d $(BUILDDIR)/frag; then mkdir $(BUILDDIR)/frag; fi
+	pushd $(BUILDDIR)/frag && ../../pickle-to-xml.py ../pickle/index.fpickle  > navigation.xml && popd
+	cp -r $(BUILDDIR)/pickle/_images $(BUILDDIR)/frag
+
+html:  $(IMAGES) 
+	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
+
+dirhtml:  $(IMAGES)
+	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
+	@echo
+	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
+
+singlehtml:  $(IMAGES)
+	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
+	@echo
+	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
+
+pickle:  $(IMAGES)
+	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
+	@echo
+	@echo "Build finished; now you can process the pickle files."
+
+json:  $(IMAGES)
+	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
+	@echo
+	@echo "Build finished; now you can process the JSON files."
+
+htmlhelp:  $(IMAGES)
+	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
+	@echo
+	@echo "Build finished; now you can run HTML Help Workshop with the" \
+	      ".hhp project file in $(BUILDDIR)/htmlhelp."
+
+qthelp:  $(IMAGES)
+	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
+	@echo
+	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
+	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
+	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/ns-3.qhcp"
+	@echo "To view the help file:"
+	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/ns-3.qhc"
+
+devhelp:  $(IMAGES)
+	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
+	@echo
+	@echo "Build finished."
+	@echo "To view the help file:"
+	@echo "# mkdir -p $$HOME/.local/share/devhelp/ns-3"
+	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/ns-3"
+	@echo "# devhelp"
+
+epub:  $(IMAGES)
+	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
+	@echo
+	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
+
+latex:  $(IMAGES)
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo
+	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
+	@echo "Run \`make' in that directory to run these through (pdf)latex" \
+	      "(use \`make latexpdf' here to do that automatically)."
+
+latexpdf:  $(IMAGES)
+	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
+	@echo "Running LaTeX files through pdflatex..."
+	make -C $(BUILDDIR)/latex all-pdf
+	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
+
+text:  $(IMAGES)
+	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
+	@echo
+	@echo "Build finished. The text files are in $(BUILDDIR)/text."
+
+man:  $(IMAGES)
+	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
+	@echo
+	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
+
+changes:  $(IMAGES)
+	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
+	@echo
+	@echo "The overview file is in $(BUILDDIR)/changes."
+
+linkcheck:  $(IMAGEs)
+	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
+	@echo
+	@echo "Link check complete; look for any errors in the above output " \
+	      "or in $(BUILDDIR)/linkcheck/output.txt."
+
+doctest:  $(IMAGES)
+	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
+	@echo "Testing of doctests in the sources finished, look at the " \
+	      "results in $(BUILDDIR)/doctest/output.txt."
+
Binary file src/lte/doc/lte-transmission.pdf has changed
Binary file src/lte/doc/lte-transmission.png has changed
--- a/src/lte/doc/lte.rst	Fri May 11 14:02:54 2012 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,366 +0,0 @@
-LTE Module
-----------
-
-This chapter describes the ns-3 :cpp:class:`ns3::LteNetDevice` and related models. 
-By adding :cpp:class:`ns3::LteNetDevice` objects to ns-3 nodes, one can create models 
-of 3GPP E-UTRAN infrastructure and Long Term Evolution (LTE) networks.                
-
-Below, we list some more details about what ns-3 LTE models cover but, in 
-summary, the most important features of the ns-3 model are:
-
-* a basic implementation of both the User Equipment (UE) and the enhanced NodeB (eNB) devices,
-* RRC entities for both the UE and the eNB,
-* a state-of-the-art Adaptive Modulation and Coding (AMC) scheme for the downlink
-* the management of the data radio bearers (with their QoS parameters), the MAC queues and the RLC instances,
-* Channel Quality Indicator (CQI) management,
-* support for both uplink and downlik packet scheduling,
-* a PHY layer model with Resource Block level granularity
-* a channel model with the outdoor E-UTRAN propagation loss model.
-
-Model Description
-*****************
-
-The source code for the LTE models lives in the directory
-``src/lte``.
-
-Design
-======
-
-The LTE model provides a basic implementation of LTE devices, including propagation models and 
-PHY and MAC layers. It allow to simulate an E-UTRAN interface where one eNB and several UEs can 
-communicate among them using a shared downlink (uplink) channel. 
-
-The PHY layer has been developed extending the Spectrum Framework [1]_. The MAC model, instead, 
-has been developed extending and adding some features to the base class :cpp:class:`ns3::NetDevice`.
-
-
-Physical layer
-##############
-
-A :cpp:class:`ns3::LtePhy` class models the LTE PHY layer. 
-
-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.
-
-Both the PHY and channel have been developed extending :cpp:class:`ns3::SpectrumPhy` and 
-:cpp:class:`ns3::SpectrumChannel` classes, respectively.
- 
-The module implements an FDD channel access. In FDD channel access, downlink and uplink 
-transmissions work together in the time but using a different set of frequencies.  
-Since DL and UL are indipendent between them, the PHY is composed by couple of 
-:cpp:class:`ns3::LteSpectrumPhy` object (i.e., implemented into the 
-:cpp:class:`ns3::LteSpectrumPhy` class); one for the downlink and one for the uplink.
-The :cpp:class:`ns3::LtePhy` stores and manages both downlink and uplink 
-:cpp:class:`ns3::LteSpectrumPhy` elements. 
-
-In order to customize all physical functionalities for both UE and eNB devices, dedicated 
-classes have been inherited from ones described before. In particular, 
-:cpp:class:`ns3::UePhy` and :cpp:class:`ns3::EnbPhy` classes, inherited from 
-the :cpp:class:`ns3::LtePhy` class, implement the PHY layer for the UE and the 
-eNB, respectively. In the same way, :cpp:class:`ns3::UeLteSpectrumPhy` and 
-:cpp:class:`ns3::EnbLteSpectrumPhy` classes, 
-inherited from the :cpp:class:`ns3::LteSpectrumPhy`, 
-implement the downlink/uplink spectrum channel for the UE and the eNB, respectively.
-
-The figure below shows how UE and eNB can exchange packets through the considered PHY layer.
-
-.. _lte-transmission:
-
-.. figure:: figures/lte-transmission.png
-
-    DL and UL transmision on the LTE network
-
-For the downlink, when the eNB whants to send packets, it calls the ``StartTx`` function to 
-send them into the downlink channel. Then, the downlink channel delivers the burst 
-of packets to all the :cpp:class:`ns3::UeLteSpectrumPhy` attached to it, handling the 
-``StartRx`` function. 
-When the UE receives packets, it executes the following tasks:
-
-* compute the SINR for all the sub channel used in the downlink
-
-* create and send CQI feedbacks
-
-* forward all the received packets to the device
-
-The uplink works similary to the previous one.
-
-Propagation Loss Models
-#######################
-
-A proper propagation loss model has been developed for the LTE E-UTRAN interface (see [2]_ and [3]_).
-It is used by the PHY layer to compute the loss due to the propagation. 
-
-The LTE propagation loss model is composed by 4 different models (shadowing, multipath, 
-penetration loss and path loss) [2]_:
-
-* Pathloss: :math:`PL = 128.1 + (37.6 * log10 (R))`, where R is the distance between the 
-  UE and the eNB in Km.
-
-* Multipath: Jakes model
-
-* PenetrationLoss: 10 dB
-
-* Shadowing: log-normal distribution (mean=0dB, standard deviation=8dB)
-
-Every time that the ``LteSpectrumPHY::StartRx ()`` function is called, the 
-``SpectrumInterferenceModel`` is used to computed the SINR, as proposed in [3]_. Then, 
-the network device uses the AMC module to map the SINR to a proper CQI and to send it 
-to the eNB using the ideal control channel.
-
-LTE Devices 
-###########
-
-All the common functionalities of the LTE network devices have been defined into 
-the :cpp:class:`ns3::LteNetDevice` class. Moreover, the LTE device has been conceived 
-as a container of several entities such as MAC, RRC, RLC etc .. For each of these entity 
-a dedicated class has been developed.
-
-For each device are defined the following entity/element
-
-* the LTE PHY layer (described in the previous sub section)
-
-* rrc entity
-
-* mac entity
-
-* rlc entity
-
-The module is perfectly integrated into the whole ns-3 project: it is already possible 
-to attach to each device a TCP/IP protocol stack and all the implemented applications 
-(i.e., udp client/server, trace based, etc..).
-
-
-The RRC Entity
-##############
-
-RRC entity is implemented by the :cpp:class:`ns3::RrcEntity` class, and provides only the 
-Radio Bearer management functionality. 
-A dedicated bearer is created for each downlink flow.
-
-The RRC entity performs the classification of the packets coming from the upper 
-layer into the corresponding Radio Bearer. This classification is
-based on the information provided by the class :cpp:class:`ns3::IpcsClassifierRecord`.
-
-
-
-The MAC Entity
-##############
-
-Class ``ns3::MacEntity`` provides a basic implementation of the MAC entity for 
-the LTE device. Moreover, ``ns3::EnbMacEntity`` and ``ns3::UeMacEntity`` classes, 
-inherited from the previous one, provides an implementation for the eNB and the UE MAC entity, 
-respectively. 
-In all MAC entities is defined the AMC module [4]_. Furthermore, into the 
-:cpp:class:`ns3::EnbMacEntity` class are defined also both uplink and downlink schedulers.    
-
-Every time the PHY layer of the UE receives a packet form the channel, it calls the AMC module, 
-define into the MAC entity, in order to convert the SINR of the received signal to CQI feedbacks. 
-Every sub frame, the eNB performs both uplink and downlink radio resource allocation. Actually only 
-a simple packet scheduler has been implemented that is able to send, every sub frame, only one 
-packet in the downlink.   
-
-
-The RLC Entity
-##############
-
-The RLC entity performs an interface between the MAC layer and the MAC queue for a given bearer. 
-Actually, only the RLC Transport Mode has been implemented. 
-
-
-Control Channel
-###############
-
-Control channel keeps a very important role in LTE networks. In fact, it is responsible of the 
-transmission of several information (i.e., CQI feedback, allocation map, etc...). For this reason, 
-also in a framework oriented to data transmision, it is necesary to find a tecnique for exchange 
-these information. To this aim, an ideal control channel will be developed. 
-Using ideal control messages, both UE and eNB can exchange control information without simulating 
-a realistic transmission over the LTE channel.
-
-Two types of control messages have been implemented: the Pdcch Map Ideal Control Message and the 
-Cqi Ideal Control Message. The first one is used by the eNB to send the uplink and downlink 
-resource mapping to all registered UE. In particular, this message carries information about 
-UEs that have been scheduled in the ul/dl, a list of assigned sub channels and the selected 
-MCS for the transmission. 
-The second one, instead, is used by the UE to send CQI feedbacks to the eNB.
- 
-
-
-Scope and Limitations
-=====================
-
-The framework has been designed in order to support data transmission for both uplink and 
-downlink. It is important to note that downlin and uplink transmissions are managed by the 
-packet scheduler that works at the eNB. It decides, in fact, what UEs should be scheduled 
-every TTI and what radio resource should be allocated to them.
-
-In the current implementation, the downlink transmission is administrated by the downlink 
-packet scheduler. Furthermore, no packet scheduler for uplink transmission has been developed.
-As a consequence, for the downlink packet are sent only after scheduling decisions; for the uplink, 
-instead, packet are sent directly, without any scheduling decisions.
-
-Finally, the transmission of control messages (such as CQI feedbacks, PDCCH, etc..) is done by an 
-ideal control channel.
-
-
-Future Work
-===========
-
-In the future, several LTE features will be developed in order to improve the proposed module.
-
-In particular, for the near future have been scheduled the following implementations:
-
-* a more efficient design for the RRM (Radio resource management)
- 
-* a complete packet scheduler (i.e., a simple round robin scheme, maximum througput and 
-  proportional fair allocation schemes) for both downlink and uplink, in order to support 
-  a standard compliant packet transmission 
-
-* ideal PDCCH control messages
-
-* a standard compliant RLC entity
-
-* PHY error model  
-
-
-
-References
-==========
-
-.. [1] N. Baldo and M. Miozzo, Spectrum-aware Channel and PHY layer modeling for ns3, Proceedings 
-       of ICST NSTools 2009, Pisa, Italy. The framework is designed to simulate only data 
-       transmissions. For the transmission of control messages (such as CQI feedback, PDCCH, 
-       etc..) will be used an ideal control channel). 
-
-.. [2] 3GPP TS 25.814 ( http://www.3gpp.org/ftp/specs/html-INFO/25814.htm ) 
-
-.. [3] Giuseppe Piro, Luigi Alfredo Grieco, Gennaro Boggia, and Pietro Camarda", A Two-level 
-       Scheduling Algorithm for QoS Support in the Downlink of LTE Cellular Networks", Proc. of 
-       European Wireless, EW2010, Lucca, Italy, Apr., 2010 ( draft version is available on 
-       http://telematics.poliba.it/index.php?option=com_jombib&task=showbib&id=330 )
-
-.. [4] 3GPP R1-081483 (available on 
-       http://www.3gpp.org/ftp/tsg_ran/WG1_RL1/TSGR1_52b/Docs/R1-081483.zip )
-
-
-Usage
-*****
-
-The main way that users who write simulation scripts will typically
-interact with the LTE models is through the helper API and through
-the publicly visible attributes of the model.
-
-The helper API is defined in ``src/lte/helper/lte-helper.h``. 
-
-The example ``src/lte/examples/`` contain some basic
-code that shows how to set up the model in order to simualte an 
-E-UTRAN downlink transmission.
-
-Examples
-========
-
-``src/lte/examples/lte-device.cc`` shows how it is possible to set up the LTE module::
-
-  NodeContainer ueNodes;
-  NodeContainer enbNodes;
-  
-  ueNodes.Create (1);
-  enbNodes.Create (1);
-
-  LteHelper lte;
-
-  NetDeviceContainer ueDevs, enbDevs;
-  ueDevs = lte.Install (ueNodes, LteHelper::DEVICE_TYPE_USER_EQUIPMENT);
-  enbDevs = lte.Install (enbNodes, LteHelper::DEVICE_TYPE_ENODEB);
-
-
-The helper method :cpp:func:`ns3::LteHelper::Install` creates LTE device, 
-the DL, UL physical layer and attach the to  proper LTE channels.
- 
-
-Moreover, to simulate a complete LTE system, it is necessary to define 
-other information, as expressed in what follows:
-
-#. install IP protocol stack::
-
-    InternetStackHelper stack;
-    stack.Install (ueNodes);
-    stack.Install (enbNodes);
-    Ipv4AddressHelper address;
-    address.SetBase ("10.1.1.0", "255.255.255.0");
-    Ipv4InterfaceContainer UEinterfaces = address.Assign (ueDevs);
-    Ipv4InterfaceContainer ENBinterface = address.Assign (enbDevs);
-
-
-#. register UE to a given eNB::
-
-    Ptr<EnbNetDevice> enb = enbDevs.Get (0)->GetObject<EnbNetDevice> ();
-    Ptr<UeNetDevice> ue = ueDevs.Get (i)->GetObject<UeNetDevice> ();
-    lte.RegisterUeToTheEnb (ue, enb);
-
-
-#. create the mobility model for each device::
-
-    Ptr<ConstantPositionMobilityModel> enbMobility = new ConstantPositionMobilityModel ();
-    enbMobility->SetPosition (Vector (0.0, 0.0, 0.0));
-    lte.AddMobility (enb->GetPhy (), enbMobility);
-
-    Ptr<ConstantVelocityMobilityModel> ueMobility = new ConstantVelocityMobilityModel ();
-    ueMobility->SetPosition (Vector (30.0, 0.0, 0.0));
-    ueMobility->SetVelocity (Vector (30.0, 0.0, 0.0));
-    lte.AddMobility (ue->GetPhy (), ueMobility);
-
-
-#. define a set of sub channels to use for dl and ul transmission::
-
-    std::vector<int> dlSubChannels;
-    for (int i = 0; i < 25; i++)
-      {
-        dlSubChannels.push_back (i);
-      }
-    std::vector<int> ulSubChannels;
-    for (int i = 50; i < 100; i++)
-      {
-        ulSubChannels.push_back (i);
-      }
-
-    enb->GetPhy ()->SetDownlinkSubChannels (dlSubChannels);
-    enb->GetPhy ()->SetUplinkSubChannels (ulSubChannels);
-    ue->GetPhy ()->SetDownlinkSubChannels (dlSubChannels);
-    ue->GetPhy ()->SetUplinkSubChannels (ulSubChannels);
-
-
-#. define a channel realization for the PHY model::
-
-    lte.AddDownlinkChannelRealization (enbMobility, ueMobility, ue->GetPhy ());
-
-
-Helpers
-=======
-
-Attributes
-==========
-
-Tracing
-=======
-
-Logging
-=======
-
-Caveats
-=======
-
-Validation
-**********
-
-In the  ``src/lte/example/lte-amc.cc`` has been developed an important example 
-that shows the proper functioning of both AMC module and Channel model. 
-The analyzed scenario is composed by two nodes: a eNB and a single UE 
-(registered to the eNB). The UE moves into the cell using the 
-:cpp:class:`ns3::ConstantVelocityMobilityModel`, along a radial direction. 
-The proposed example describes how the channel quality decreases as the distance 
-between UE and eNB increases. 
-As a conseguence,  the total bit rate (in bits per TTI) available to the UE 
-decreases as the distance between nodes increases, as expected.
-
-
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/doc/rescale-pdf.sh	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+TMPFILE=`mktemp`
+
+echo "\documentclass{book}
+\usepackage{pdfpages}
+\begin{document}
+\includepdf[width=${1},fitpaper]{${2}}
+\end{document}" >${TMPFILE}.tex
+pdflatex -output-directory /tmp ${TMPFILE}.tex >/dev/null 2>/dev/null
+cp ${TMPFILE}.pdf ${3}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/doc/source/conf.py	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,218 @@
+# -*- coding: utf-8 -*-
+#
+# ns-3 documentation build configuration file, created by
+# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
+#
+# This file is execfile()d with the current directory set to its containing dir.
+#
+# Note that not all possible configuration values are present in this
+# autogenerated file.
+#
+# All configuration values have a default; values that are commented out
+# serve to show the default.
+
+import sys, os
+
+# If extensions (or modules to document with autodoc) are in another directory,
+# add these directories to sys.path here. If the directory is relative to the
+# documentation root, use os.path.abspath to make it absolute, like shown here.
+#sys.path.insert(0, os.path.abspath('.'))
+
+# -- General configuration -----------------------------------------------------
+
+# If your documentation needs a minimal Sphinx version, state it here.
+#needs_sphinx = '1.0'
+
+# Add any Sphinx extension module names here, as strings. They can be extensions
+# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
+extensions = ['sphinx.ext.pngmath']
+
+# Add any paths that contain templates here, relative to this directory.
+templates_path = ['_templates']
+
+# The suffix of source filenames.
+source_suffix = '.rst'
+
+# The encoding of source files.
+#source_encoding = 'utf-8-sig'
+
+# The master toctree document.
+master_doc = 'index'
+
+# General information about the project.
+project = u'LENA'
+copyright = u'CTTC'
+
+# The version info for the project you're documenting, acts as replacement for
+# |version| and |release|, also used in various other places throughout the
+# built documents.
+#
+# The short X.Y version.
+version = 'M2'
+# The full version, including alpha/beta/rc tags.
+release = 'M2'
+
+# The language for content autogenerated by Sphinx. Refer to documentation
+# for a list of supported languages.
+#language = None
+
+# There are two options for replacing |today|: either, you set today to some
+# non-false value, then it is used:
+#today = ''
+# Else, today_fmt is used as the format for a strftime call.
+#today_fmt = '%B %d, %Y'
+
+# List of patterns, relative to source directory, that match files and
+# directories to ignore when looking for source files.
+exclude_patterns = []
+
+# The reST default role (used for this markup: `text`) to use for all documents.
+#default_role = None
+
+# If true, '()' will be appended to :func: etc. cross-reference text.
+#add_function_parentheses = True
+
+# If true, the current module name will be prepended to all description
+# unit titles (such as .. function::).
+#add_module_names = True
+
+# If true, sectionauthor and moduleauthor directives will be shown in the
+# output. They are ignored by default.
+#show_authors = False
+
+# The name of the Pygments (syntax highlighting) style to use.
+pygments_style = 'sphinx'
+
+# A list of ignored prefixes for module index sorting.
+#modindex_common_prefix = []
+
+
+# -- Options for HTML output ---------------------------------------------------
+
+# The theme to use for HTML and HTML Help pages.  See the documentation for
+# a list of builtin themes.
+html_theme = 'default'
+
+# Theme options are theme-specific and customize the look and feel of a theme
+# further.  For a list of options available for each theme, see the
+# documentation.
+#html_theme_options = {}
+
+# Add any paths that contain custom themes here, relative to this directory.
+#html_theme_path = []
+
+# The name for this set of Sphinx documents.  If None, it defaults to
+# "<project> v<release> documentation".
+#html_title = None
+
+# A shorter title for the navigation bar.  Default is the same as html_title.
+#html_short_title = None
+
+# The name of an image file (relative to this directory) to place at the top
+# of the sidebar.
+#html_logo = None
+
+# The name of an image file (within the static path) to use as favicon of the
+# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32
+# pixels large.
+#html_favicon = None
+
+# Add any paths that contain custom static files (such as style sheets) here,
+# relative to this directory. They are copied after the builtin static files,
+# so a file named "default.css" will overwrite the builtin "default.css".
+#html_static_path = ['_static']
+
+# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
+# using the given strftime format.
+#html_last_updated_fmt = '%b %d, %Y'
+
+# If true, SmartyPants will be used to convert quotes and dashes to
+# typographically correct entities.
+#html_use_smartypants = True
+
+# Custom sidebar templates, maps document names to template names.
+#html_sidebars = {}
+
+# Additional templates that should be rendered to pages, maps page names to
+# template names.
+#html_additional_pages = {}
+
+# If false, no module index is generated.
+#html_domain_indices = True
+
+# If false, no index is generated.
+#html_use_index = True
+
+# If true, the index is split into individual pages for each letter.
+#html_split_index = False
+
+# If true, links to the reST sources are added to the pages.
+#html_show_sourcelink = True
+
+# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
+#html_show_sphinx = True
+
+# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
+#html_show_copyright = True
+
+# If true, an OpenSearch description file will be output, and all pages will
+# contain a <link> tag referring to it.  The value of this option must be the
+# base URL from which the finished HTML is served.
+#html_use_opensearch = ''
+
+# This is the file name suffix for HTML files (e.g. ".xhtml").
+#html_file_suffix = None
+
+# Output file base name for HTML help builder.
+#htmlhelp_basename = 'ns-3doc'
+
+
+# -- Options for LaTeX output --------------------------------------------------
+
+# The paper size ('letter' or 'a4').
+#latex_paper_size = 'letter'
+
+# The font size ('10pt', '11pt' or '12pt').
+#latex_font_size = '10pt'
+
+# Grouping the document tree into LaTeX files. List of tuples
+# (source start file, target name, title, author, documentclass [howto/manual]).
+latex_documents = [
+#  ('lte-testing', 'lte-doc-testing.tex', u'LTE Simulator Testing Documentation', u'Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)', 'manual'),
+#  ('lte-design', 'lte-doc-design.tex', u'LTE Simulator Design Documentation', u'Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)', 'manual'),
+#  ('lte-user', 'lte-doc-user.tex', u'LTE Simulator User Documentation', u'Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)', 'manual'),
+  ('lte', 'lte-sim-doc.tex', u'LTE Simulator Documentation', u'Centre Tecnològic de Telecomunicacions de Catalunya (CTTC)', 'manual'),
+]
+
+# The name of an image file (relative to this directory) to place at the top of
+# the title page.
+#latex_logo = None
+
+# For "manual" documents, if this is true, then toplevel headings are parts,
+# not chapters.
+#latex_use_parts = False
+
+# If true, show page references after internal links.
+#latex_show_pagerefs = False
+
+# If true, show URL addresses after external links.
+#latex_show_urls = False
+
+# Additional stuff for the LaTeX preamble.
+#latex_preamble = ''
+
+# Documents to append as an appendix to all manuals.
+#latex_appendices = []
+
+# If false, no module index is generated.
+#latex_domain_indices = True
+
+
+# -- Options for manual page output --------------------------------------------
+
+# One entry per manual page. List of tuples
+# (source start file, name, description, authors, manual section).
+man_pages = [
+    ('index', 'ns-3-model-library', u'ns-3 Model Library',
+     [u'ns-3 project'], 1)
+]
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/doc/source/figures/MCS_12_test.eps	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,1511 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: /home/mmiozzo/ns3/lena/ns-3-lena-pem/src/lte/doc/source/figures/MCS_12_test.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5a
+%%CreationDate: Tue Jan 10 17:47:39 2012
+%%BoundingBox: 0 0 1095 718
+%Magnification: 1.0000
+%%EndComments
+%%BeginProlog
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+  4 -2 roll dup 1 exch sub 3 -1 roll mul add
+  4 -2 roll dup 1 exch sub 3 -1 roll mul add
+  4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+  bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+  4 -2 roll mul srgb} bind def
+ /DrawEllipse {
+	/endangle exch def
+	/startangle exch def
+	/yrad exch def
+	/xrad exch def
+	/y exch def
+	/x exch def
+	/savematrix mtrx currentmatrix def
+	x y tr xrad yrad sc 0 0 1 startangle endangle arc
+	closepath
+	savematrix setmatrix
+	} def
+
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+/pageheader {
+save
+newpath 0 718 moveto 0 0 lineto 1095 0 lineto 1095 718 lineto closepath clip newpath
+-2.8 748.3 translate
+1 -1 scale
+$F2psBegin
+10 setmiterlimit
+0 slj 0 slc
+ 0.06299 0.06299 sc
+} bind def
+/pagefooter {
+$F2psEnd
+restore
+} bind def
+%%EndProlog
+pageheader
+%
+% Fig objects follow
+%
+% 
+% here starts figure with depth 51
+% Polyline
+%
+% pen to black in case this eps object doesn't set color first
+0 0 0 setrgbcolor
+% Begin Imported EPS File: /home/mmiozzo/ns3/lena/ns-3-lena-pem/src/lte/doc/source/figures/MCS_12.eps
+%%BeginDocument: /home/mmiozzo/ns3/lena/ns-3-lena-pem/src/lte/doc/source/figures/MCS_12.eps
+%
+n gs
+45 495 tr
+17.335329 -18.100159 sc
+0 -629 tr
+203 -106 tr
+sa
+n -203 106 m 799 106 l 799 735 l -203 735 l cp clip n
+countdictstack
+mark
+/showpage {} def
+% EPS file follows:
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: MATLAB, The Mathworks, Inc. Version 7.8.0.347 (R2009a). Operating System: Microsoft Windows XP.
+%%Title: C:\Documents and Settings\Marco Miozzo\My Documents\MATLAB\Final\MCS_27_allTBsizes\MCS_12.eps
+%%CreationDate: 01/10/2012  17:32:09
+%%DocumentNeededFonts: Helvetica
+%%DocumentProcessColors: Cyan Magenta Yellow Black
+%%LanguageLevel: 2
+%%Pages: 1
+%%BoundingBox:  -203   106   799   735
+%%EndComments
+
+%%BeginProlog
+% MathWorks dictionary
+/MathWorks 160 dict begin
+% definition operators
+/bdef {bind def} bind def
+/ldef {load def} bind def
+/xdef {exch def} bdef
+/xstore {exch store} bdef
+% operator abbreviations
+/c  /clip ldef
+/cc /concat ldef
+/cp /closepath ldef
+/gr /grestore ldef
+/gs /gsave ldef
+/mt /moveto ldef
+/np /newpath ldef
+/cm /currentmatrix ldef
+/sm /setmatrix ldef
+/rm /rmoveto ldef
+/rl /rlineto ldef
+/s {show newpath} bdef
+/sc {setcmykcolor} bdef
+/sr /setrgbcolor ldef
+/sg /setgray ldef
+/w /setlinewidth ldef
+/j /setlinejoin ldef
+/cap /setlinecap ldef
+/rc {rectclip} bdef
+/rf {rectfill} bdef
+% page state control
+/pgsv () def
+/bpage {/pgsv save def} bdef
+/epage {pgsv restore} bdef
+/bplot /gsave ldef
+/eplot {stroke grestore} bdef
+% orientation switch
+/portraitMode 0 def /landscapeMode 1 def /rotateMode 2 def
+% coordinate system mappings
+/dpi2point 0 def
+% font control
+/FontSize 0 def
+/FMS {/FontSize xstore findfont [FontSize 0 0 FontSize neg 0 0]
+  makefont setfont} bdef
+/ISOLatin1Encoding where {pop /WindowsLatin1Encoding 256 array bdef
+ISOLatin1Encoding WindowsLatin1Encoding copy pop
+/.notdef/.notdef/quotesinglbase/florin/quotedblbase/ellipsis/dagger
+/daggerdbl/circumflex/perthousand/Scaron/guilsinglleft/OE/.notdef/.notdef
+/.notdef/.notdef/quoteleft/quoteright/quotedblleft/quotedblright/bullet
+/endash/emdash/tilde/trademark/scaron/guilsinglright/oe/.notdef/.notdef
+/Ydieresis WindowsLatin1Encoding 128 32 getinterval astore pop}
+{/WindowsLatin1Encoding StandardEncoding bdef} ifelse
+/reencode {exch dup where {pop load} {pop StandardEncoding} ifelse
+  exch dup 3 1 roll findfont dup length dict begin
+  { 1 index /FID ne {def}{pop pop} ifelse } forall
+  /Encoding exch def currentdict end definefont pop} bdef
+/isroman {findfont /CharStrings get /Agrave known} bdef
+/FMSR {3 1 roll 1 index dup isroman {reencode} {pop pop} ifelse
+  exch FMS} bdef
+/csm {1 dpi2point div -1 dpi2point div scale neg translate
+ dup landscapeMode eq {pop -90 rotate}
+  {rotateMode eq {90 rotate} if} ifelse} bdef
+% line types: solid, dotted, dashed, dotdash
+/SO { [] 0 setdash } bdef
+/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
+/DA { [6 dpi2point mul] 0 setdash } bdef
+/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4
+  dpi2point mul] 0 setdash } bdef
+% macros for lines and objects
+/L {lineto stroke} bdef
+/MP {3 1 roll moveto 1 sub {rlineto} repeat} bdef
+/AP {{rlineto} repeat} bdef
+/PDlw -1 def
+/W {/PDlw currentlinewidth def setlinewidth} def
+/PP {closepath eofill} bdef
+/DP {closepath stroke} bdef
+/MR {4 -2 roll moveto dup  0 exch rlineto exch 0 rlineto
+  neg 0 exch rlineto closepath} bdef
+/FR {MR stroke} bdef
+/PR {MR fill} bdef
+/L1i {{currentfile picstr readhexstring pop} image} bdef
+/tMatrix matrix def
+/MakeOval {newpath tMatrix currentmatrix pop translate scale
+0 0 1 0 360 arc tMatrix setmatrix} bdef
+/FO {MakeOval stroke} bdef
+/PO {MakeOval fill} bdef
+/PD {currentlinewidth 2 div 0 360 arc fill
+   PDlw -1 eq not {PDlw w /PDlw -1 def} if} def
+/FA {newpath tMatrix currentmatrix pop translate scale
+  0 0 1 5 -2 roll arc tMatrix setmatrix stroke} bdef
+/PA {newpath tMatrix currentmatrix pop	translate 0 0 moveto scale
+  0 0 1 5 -2 roll arc closepath tMatrix setmatrix fill} bdef
+/FAn {newpath tMatrix currentmatrix pop translate scale
+  0 0 1 5 -2 roll arcn tMatrix setmatrix stroke} bdef
+/PAn {newpath tMatrix currentmatrix pop translate 0 0 moveto scale
+  0 0 1 5 -2 roll arcn closepath tMatrix setmatrix fill} bdef
+/vradius 0 def /hradius 0 def /lry 0 def
+/lrx 0 def /uly 0 def /ulx 0 def /rad 0 def
+/MRR {/vradius xdef /hradius xdef /lry xdef /lrx xdef /uly xdef
+  /ulx xdef newpath tMatrix currentmatrix pop ulx hradius add uly
+  vradius add translate hradius vradius scale 0 0 1 180 270 arc 
+  tMatrix setmatrix lrx hradius sub uly vradius add translate
+  hradius vradius scale 0 0 1 270 360 arc tMatrix setmatrix
+  lrx hradius sub lry vradius sub translate hradius vradius scale
+  0 0 1 0 90 arc tMatrix setmatrix ulx hradius add lry vradius sub
+  translate hradius vradius scale 0 0 1 90 180 arc tMatrix setmatrix
+  closepath} bdef
+/FRR {MRR stroke } bdef
+/PRR {MRR fill } bdef
+/MlrRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lry uly sub 2 div def
+  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
+  rad rad scale 0 0 1 90 270 arc tMatrix setmatrix lrx rad sub lry rad
+  sub translate rad rad scale 0 0 1 270 90 arc tMatrix setmatrix
+  closepath} bdef
+/FlrRR {MlrRR stroke } bdef
+/PlrRR {MlrRR fill } bdef
+/MtbRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lrx ulx sub 2 div def
+  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
+  rad rad scale 0 0 1 180 360 arc tMatrix setmatrix lrx rad sub lry rad
+  sub translate rad rad scale 0 0 1 0 180 arc tMatrix setmatrix
+  closepath} bdef
+/FtbRR {MtbRR stroke } bdef
+/PtbRR {MtbRR fill } bdef
+/stri 6 array def /dtri 6 array def
+/smat 6 array def /dmat 6 array def
+/tmat1 6 array def /tmat2 6 array def /dif 3 array def
+/asub {/ind2 exch def /ind1 exch def dup dup
+  ind1 get exch ind2 get sub exch } bdef
+/tri_to_matrix {
+  2 0 asub 3 1 asub 4 0 asub 5 1 asub
+  dup 0 get exch 1 get 7 -1 roll astore } bdef
+/compute_transform {
+  dmat dtri tri_to_matrix tmat1 invertmatrix 
+  smat stri tri_to_matrix tmat2 concatmatrix } bdef
+/ds {stri astore pop} bdef
+/dt {dtri astore pop} bdef
+/db {2 copy /cols xdef /rows xdef mul dup 3 mul string
+  currentfile 
+  3 index 0 eq {/ASCIIHexDecode filter}
+  {/ASCII85Decode filter 3 index 2 eq {/RunLengthDecode filter} if }
+  ifelse exch readstring pop
+  dup 0 3 index getinterval /rbmap xdef
+  dup 2 index dup getinterval /gbmap xdef
+  1 index dup 2 mul exch getinterval /bbmap xdef pop pop}bdef
+/it {gs np dtri aload pop moveto lineto lineto cp c
+  cols rows 8 compute_transform 
+  rbmap gbmap bbmap true 3 colorimage gr}bdef
+/il {newpath moveto lineto stroke}bdef
+currentdict end def
+%%EndProlog
+
+%%BeginSetup
+MathWorks begin
+
+0 cap
+
+end
+%%EndSetup
+
+%%Page: 1 1
+%%BeginPageSetup
+%%PageBoundingBox:  -203   106   799   735
+MathWorks begin
+bpage
+%%EndPageSetup
+
+%%BeginObject: obj1
+bplot
+
+/dpi2point 12 def
+portraitMode -2436 8820 csm
+
+    0     0 12034  7546 rc
+85 dict begin %Colortable dictionary
+/c0 { 0.000000 0.000000 0.000000 sr} bdef
+/c1 { 1.000000 1.000000 1.000000 sr} bdef
+/c2 { 0.900000 0.000000 0.000000 sr} bdef
+/c3 { 0.000000 0.820000 0.000000 sr} bdef
+/c4 { 0.000000 0.000000 0.800000 sr} bdef
+/c5 { 0.910000 0.820000 0.320000 sr} bdef
+/c6 { 1.000000 0.260000 0.820000 sr} bdef
+/c7 { 0.000000 0.820000 0.820000 sr} bdef
+c0
+1 j
+1 sg
+   0    0 12035 7547 rf
+6 w
+0 6150 9327 0 0 -6150 1564 6716 4 MP
+PP
+-9327 0 0 6150 9327 0 0 -6150 1564 6716 5 MP stroke
+4 w
+DO
+0 sg
+1564 6716 mt 1564  566 L
+1564  566 mt 1564  566 L
+2729 6716 mt 2729  566 L
+2729  566 mt 2729  566 L
+3895 6716 mt 3895  566 L
+3895  566 mt 3895  566 L
+5061 6716 mt 5061  566 L
+5061  566 mt 5061  566 L
+6227 6716 mt 6227  566 L
+6227  566 mt 6227  566 L
+7393 6716 mt 7393  566 L
+7393  566 mt 7393  566 L
+8559 6716 mt 8559  566 L
+8559  566 mt 8559  566 L
+9725 6716 mt 9725  566 L
+9725  566 mt 9725  566 L
+10891 6716 mt 10891  566 L
+10891  566 mt 10891  566 L
+1564 6716 mt 10891 6716 L
+10891 6716 mt 10891 6716 L
+1564 5178 mt 10891 5178 L
+10891 5178 mt 10891 5178 L
+1564 3641 mt 10891 3641 L
+10891 3641 mt 10891 3641 L
+1564 2103 mt 10891 2103 L
+10891 2103 mt 10891 2103 L
+1564  566 mt 10891  566 L
+10891  566 mt 10891  566 L
+SO
+6 w
+1564  566 mt 10891  566 L
+1564 6716 mt 10891 6716 L
+10891 6716 mt 10891  566 L
+1564 6716 mt 1564  566 L
+1564 6716 mt 10891 6716 L
+1564 6716 mt 1564  566 L
+1564 6716 mt 1564 6622 L
+1564  566 mt 1564  659 L
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+1531 6861 mt 
+(4) s
+2729 6716 mt 2729 6622 L
+2729  566 mt 2729  659 L
+2646 6861 mt 
+(4.5) s
+3895 6716 mt 3895 6622 L
+3895  566 mt 3895  659 L
+3862 6861 mt 
+(5) s
+5061 6716 mt 5061 6622 L
+5061  566 mt 5061  659 L
+4978 6861 mt 
+(5.5) s
+6227 6716 mt 6227 6622 L
+6227  566 mt 6227  659 L
+6194 6861 mt 
+(6) s
+7393 6716 mt 7393 6622 L
+7393  566 mt 7393  659 L
+7310 6861 mt 
+(6.5) s
+8559 6716 mt 8559 6622 L
+8559  566 mt 8559  659 L
+8526 6861 mt 
+(7) s
+9725 6716 mt 9725 6622 L
+9725  566 mt 9725  659 L
+9642 6861 mt 
+(7.5) s
+10891 6716 mt 10891 6622 L
+10891  566 mt 10891  659 L
+10858 6861 mt 
+(8) s
+1564 6716 mt 1610 6716 L
+10891 6716 mt 10844 6716 L
+DO
+1564 6716 mt 10891 6716 L
+10891 6716 mt 10891 6716 L
+SO
+1564 6716 mt 1657 6716 L
+10891 6716 mt 10797 6716 L
+1305 6760 mt 
+(10) s
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 80 FMSR
+
+1438 6686 mt 
+(-4) s
+1564 6253 mt 1610 6253 L
+10891 6253 mt 10844 6253 L
+DO
+1564 6253 mt 10891 6253 L
+10891 6253 mt 10891 6253 L
+SO
+1564 5982 mt 1610 5982 L
+10891 5982 mt 10844 5982 L
+DO
+1564 5982 mt 10891 5982 L
+10891 5982 mt 10891 5982 L
+SO
+1564 5790 mt 1610 5790 L
+10891 5790 mt 10844 5790 L
+DO
+1564 5790 mt 10891 5790 L
+10891 5790 mt 10891 5790 L
+SO
+1564 5641 mt 1610 5641 L
+10891 5641 mt 10844 5641 L
+DO
+1564 5641 mt 10891 5641 L
+10891 5641 mt 10891 5641 L
+SO
+1564 5519 mt 1610 5519 L
+10891 5519 mt 10844 5519 L
+DO
+1564 5519 mt 10891 5519 L
+10891 5519 mt 10891 5519 L
+SO
+1564 5416 mt 1610 5416 L
+10891 5416 mt 10844 5416 L
+DO
+1564 5416 mt 10891 5416 L
+10891 5416 mt 10891 5416 L
+SO
+1564 5327 mt 1610 5327 L
+10891 5327 mt 10844 5327 L
+DO
+1564 5327 mt 10891 5327 L
+10891 5327 mt 10891 5327 L
+SO
+1564 5248 mt 1610 5248 L
+10891 5248 mt 10844 5248 L
+DO
+1564 5248 mt 10891 5248 L
+10891 5248 mt 10891 5248 L
+SO
+1564 5178 mt 1610 5178 L
+10891 5178 mt 10844 5178 L
+DO
+1564 5178 mt 10891 5178 L
+10891 5178 mt 10891 5178 L
+SO
+1564 5178 mt 1657 5178 L
+10891 5178 mt 10797 5178 L
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+1305 5222 mt 
+(10) s
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 80 FMSR
+
+1438 5148 mt 
+(-3) s
+1564 4715 mt 1610 4715 L
+10891 4715 mt 10844 4715 L
+DO
+1564 4715 mt 10891 4715 L
+10891 4715 mt 10891 4715 L
+SO
+1564 4444 mt 1610 4444 L
+10891 4444 mt 10844 4444 L
+DO
+1564 4444 mt 10891 4444 L
+10891 4444 mt 10891 4444 L
+SO
+1564 4252 mt 1610 4252 L
+10891 4252 mt 10844 4252 L
+DO
+1564 4252 mt 10891 4252 L
+10891 4252 mt 10891 4252 L
+SO
+1564 4103 mt 1610 4103 L
+10891 4103 mt 10844 4103 L
+DO
+1564 4103 mt 10891 4103 L
+10891 4103 mt 10891 4103 L
+SO
+1564 3982 mt 1610 3982 L
+10891 3982 mt 10844 3982 L
+DO
+1564 3982 mt 10891 3982 L
+10891 3982 mt 10891 3982 L
+SO
+1564 3879 mt 1610 3879 L
+10891 3879 mt 10844 3879 L
+DO
+1564 3879 mt 10891 3879 L
+10891 3879 mt 10891 3879 L
+SO
+1564 3789 mt 1610 3789 L
+10891 3789 mt 10844 3789 L
+DO
+1564 3789 mt 10891 3789 L
+10891 3789 mt 10891 3789 L
+SO
+1564 3711 mt 1610 3711 L
+10891 3711 mt 10844 3711 L
+DO
+1564 3711 mt 10891 3711 L
+10891 3711 mt 10891 3711 L
+SO
+1564 3641 mt 1610 3641 L
+10891 3641 mt 10844 3641 L
+DO
+1564 3641 mt 10891 3641 L
+10891 3641 mt 10891 3641 L
+SO
+1564 3641 mt 1657 3641 L
+10891 3641 mt 10797 3641 L
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+1305 3685 mt 
+(10) s
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 80 FMSR
+
+1438 3611 mt 
+(-2) s
+1564 3178 mt 1610 3178 L
+10891 3178 mt 10844 3178 L
+DO
+1564 3178 mt 10891 3178 L
+10891 3178 mt 10891 3178 L
+SO
+1564 2907 mt 1610 2907 L
+10891 2907 mt 10844 2907 L
+DO
+1564 2907 mt 10891 2907 L
+10891 2907 mt 10891 2907 L
+SO
+1564 2715 mt 1610 2715 L
+10891 2715 mt 10844 2715 L
+DO
+1564 2715 mt 10891 2715 L
+10891 2715 mt 10891 2715 L
+SO
+1564 2566 mt 1610 2566 L
+10891 2566 mt 10844 2566 L
+DO
+1564 2566 mt 10891 2566 L
+10891 2566 mt 10891 2566 L
+SO
+1564 2444 mt 1610 2444 L
+10891 2444 mt 10844 2444 L
+DO
+1564 2444 mt 10891 2444 L
+10891 2444 mt 10891 2444 L
+SO
+1564 2341 mt 1610 2341 L
+10891 2341 mt 10844 2341 L
+DO
+1564 2341 mt 10891 2341 L
+10891 2341 mt 10891 2341 L
+SO
+1564 2252 mt 1610 2252 L
+10891 2252 mt 10844 2252 L
+DO
+1564 2252 mt 10891 2252 L
+10891 2252 mt 10891 2252 L
+SO
+1564 2173 mt 1610 2173 L
+10891 2173 mt 10844 2173 L
+DO
+1564 2173 mt 10891 2173 L
+10891 2173 mt 10891 2173 L
+SO
+1564 2103 mt 1610 2103 L
+10891 2103 mt 10844 2103 L
+DO
+1564 2103 mt 10891 2103 L
+10891 2103 mt 10891 2103 L
+SO
+1564 2103 mt 1657 2103 L
+10891 2103 mt 10797 2103 L
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+1305 2147 mt 
+(10) s
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 80 FMSR
+
+1438 2073 mt 
+(-1) s
+1564 1640 mt 1610 1640 L
+10891 1640 mt 10844 1640 L
+DO
+1564 1640 mt 10891 1640 L
+10891 1640 mt 10891 1640 L
+SO
+1564 1369 mt 1610 1369 L
+10891 1369 mt 10844 1369 L
+DO
+1564 1369 mt 10891 1369 L
+10891 1369 mt 10891 1369 L
+SO
+1564 1177 mt 1610 1177 L
+10891 1177 mt 10844 1177 L
+DO
+1564 1177 mt 10891 1177 L
+10891 1177 mt 10891 1177 L
+SO
+1564 1028 mt 1610 1028 L
+10891 1028 mt 10844 1028 L
+DO
+1564 1028 mt 10891 1028 L
+10891 1028 mt 10891 1028 L
+SO
+1564  907 mt 1610  907 L
+10891  907 mt 10844  907 L
+DO
+1564  907 mt 10891  907 L
+10891  907 mt 10891  907 L
+SO
+1564  804 mt 1610  804 L
+10891  804 mt 10844  804 L
+DO
+1564  804 mt 10891  804 L
+10891  804 mt 10891  804 L
+SO
+1564  714 mt 1610  714 L
+10891  714 mt 10844  714 L
+DO
+1564  714 mt 10891  714 L
+10891  714 mt 10891  714 L
+SO
+1564  636 mt 1610  636 L
+10891  636 mt 10844  636 L
+DO
+1564  636 mt 10891  636 L
+10891  636 mt 10891  636 L
+SO
+1564  566 mt 1610  566 L
+10891  566 mt 10844  566 L
+DO
+1564  566 mt 10891  566 L
+10891  566 mt 10891  566 L
+SO
+1564  566 mt 1657  566 L
+10891  566 mt 10797  566 L
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+1305  610 mt 
+(10) s
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 80 FMSR
+
+1438  536 mt 
+(0) s
+1564  566 mt 10891  566 L
+1564 6716 mt 10891 6716 L
+10891 6716 mt 10891  566 L
+1564 6716 mt 1564  566 L
+gs 1564 566 9328 6151 rc
+DA
+24 w
+/c8 { 1.000000 0.000000 0.000000 sr} bdef
+c8
+234 1611 233 1104 233 888 233 536 233 245 234 88 233 16 233 2 
+233 0 233 0 233 0 234 0 233 0 233 0 233 0 233 0 
+233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 24 MP stroke
+SO
+/c9 { 0.000000 0.000000 1.000000 sr} bdef
+c9
+234 1632 233 1300 233 889 233 530 233 251 234 84 233 17 233 2 
+233 0 233 0 233 0 234 0 233 0 233 0 233 0 233 0 
+233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 24 MP stroke
+gr
+
+24 w
+c9
+gs 1418 420 5656 4998 rc
+0 j
+69 119 -138 0 69 -119 1564 645 4 MP
+DP
+69 119 -138 0 69 -119 1797 645 4 MP
+DP
+69 119 -138 0 69 -119 2030 645 4 MP
+DP
+69 119 -138 0 69 -119 2263 645 4 MP
+DP
+69 119 -138 0 69 -119 2496 645 4 MP
+DP
+69 119 -138 0 69 -119 2729 645 4 MP
+DP
+69 119 -138 0 69 -119 2963 645 4 MP
+DP
+69 119 -138 0 69 -119 3196 645 4 MP
+DP
+69 119 -138 0 69 -119 3429 645 4 MP
+DP
+69 119 -138 0 69 -119 3662 645 4 MP
+DP
+69 119 -138 0 69 -119 3895 645 4 MP
+DP
+69 119 -138 0 69 -119 4128 645 4 MP
+DP
+69 119 -138 0 69 -119 4362 645 4 MP
+DP
+69 119 -138 0 69 -119 4595 645 4 MP
+DP
+69 119 -138 0 69 -119 4828 645 4 MP
+DP
+69 119 -138 0 69 -119 5061 645 4 MP
+DP
+69 119 -138 0 69 -119 5294 647 4 MP
+DP
+69 119 -138 0 69 -119 5527 664 4 MP
+DP
+69 119 -138 0 69 -119 5761 748 4 MP
+DP
+69 119 -138 0 69 -119 5994 999 4 MP
+DP
+69 119 -138 0 69 -119 6227 1529 4 MP
+DP
+69 119 -138 0 69 -119 6460 2418 4 MP
+DP
+69 119 -138 0 69 -119 6693 3718 4 MP
+DP
+69 119 -138 0 69 -119 6927 5350 4 MP
+DP
+gr
+
+gs 1564 566 9328 6151 rc
+DA
+c8
+234 1192 233 909 233 642 233 440 233 245 234 111 233 42 233 10 
+233 2 233 0 233 0 234 0 233 0 233 0 233 0 233 0 
+233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 24 MP stroke
+SO
+c9
+234 1109 233 911 233 657 233 431 233 246 234 114 233 41 233 10 
+233 1 233 0 233 0 234 0 233 0 233 0 233 0 233 0 
+233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 24 MP stroke
+gr
+
+gs 1418 420 5656 3813 rc
+0 j
+-69 119 -69 -119 138 0 1495 606 4 MP
+DP
+-69 119 -69 -119 138 0 1728 606 4 MP
+DP
+-69 119 -69 -119 138 0 1961 606 4 MP
+DP
+-69 119 -69 -119 138 0 2194 606 4 MP
+DP
+-69 119 -69 -119 138 0 2427 606 4 MP
+DP
+-69 119 -69 -119 138 0 2660 606 4 MP
+DP
+-69 119 -69 -119 138 0 2894 606 4 MP
+DP
+-69 119 -69 -119 138 0 3127 606 4 MP
+DP
+-69 119 -69 -119 138 0 3360 606 4 MP
+DP
+-69 119 -69 -119 138 0 3593 606 4 MP
+DP
+-69 119 -69 -119 138 0 3826 606 4 MP
+DP
+-69 119 -69 -119 138 0 4059 606 4 MP
+DP
+-69 119 -69 -119 138 0 4293 606 4 MP
+DP
+-69 119 -69 -119 138 0 4526 606 4 MP
+DP
+-69 119 -69 -119 138 0 4759 606 4 MP
+DP
+-69 119 -69 -119 138 0 4992 607 4 MP
+DP
+-69 119 -69 -119 138 0 5225 617 4 MP
+DP
+-69 119 -69 -119 138 0 5458 658 4 MP
+DP
+-69 119 -69 -119 138 0 5692 772 4 MP
+DP
+-69 119 -69 -119 138 0 5925 1018 4 MP
+DP
+-69 119 -69 -119 138 0 6158 1449 4 MP
+DP
+-69 119 -69 -119 138 0 6391 2106 4 MP
+DP
+-69 119 -69 -119 138 0 6624 3017 4 MP
+DP
+-69 119 -69 -119 138 0 6858 4126 4 MP
+DP
+gr
+
+gs 1564 566 9328 6151 rc
+DA
+c8
+233 958 234 779 233 567 233 455 233 297 233 179 234 97 233 41 
+233 17 233 4 233 0 233 0 234 0 233 0 233 0 233 0 
+233 0 233 0 234 0 233 0 233 0 233 0 233 0 233 0 
+1564 566 25 MP stroke
+SO
+c9
+233 942 234 724 233 598 233 439 233 298 233 182 234 96 233 43 
+233 14 233 5 233 0 233 0 234 0 233 0 233 0 233 0 
+233 0 233 0 234 0 233 0 233 0 233 0 233 0 233 0 
+1564 566 25 MP stroke
+gr
+
+gs 1418 420 5889 3634 rc
+0 j
+0 -94 -94 0 0 94 94 0 1517 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 1750 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 1983 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 2216 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 2449 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 2682 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 2916 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 3149 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 3382 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 3615 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 3848 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 4081 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 4315 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 4548 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 4781 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 5014 524 5 MP
+DP
+0 -94 -94 0 0 94 94 0 5247 538 5 MP
+DP
+0 -94 -94 0 0 94 94 0 5480 581 5 MP
+DP
+0 -94 -94 0 0 94 94 0 5714 677 5 MP
+DP
+0 -94 -94 0 0 94 94 0 5947 859 5 MP
+DP
+0 -94 -94 0 0 94 94 0 6180 1157 5 MP
+DP
+0 -94 -94 0 0 94 94 0 6413 1596 5 MP
+DP
+0 -94 -94 0 0 94 94 0 6646 2194 5 MP
+DP
+0 -94 -94 0 0 94 94 0 6880 2918 5 MP
+DP
+0 -94 -94 0 0 94 94 0 7113 3860 5 MP
+DP
+gr
+
+gs 1564 566 9328 6151 rc
+DA
+c8
+233 622 233 481 233 485 233 398 234 326 233 275 233 195 233 147 
+233 109 234 71 233 44 233 27 233 15 233 8 233 3 234 1 
+233 0 233 0 233 0 233 0 233 0 234 0 233 0 233 0 
+233 0 233 0 233 0 1564 566 28 MP stroke
+SO
+c9
+233 605 233 529 233 456 233 386 234 304 233 261 233 203 233 153 
+233 108 234 73 233 46 233 26 233 14 233 6 233 3 234 1 
+233 0 233 0 233 0 233 0 233 0 234 0 233 0 233 0 
+233 0 233 0 233 0 1564 566 28 MP stroke
+gr
+
+gs 1418 420 6588 3467 rc
+1504  566 mt 1624  566 L
+1564  506 mt 1564  626 L
+1737  566 mt 1857  566 L
+1797  506 mt 1797  626 L
+1970  566 mt 2090  566 L
+2030  506 mt 2030  626 L
+2203  566 mt 2323  566 L
+2263  506 mt 2263  626 L
+2436  566 mt 2556  566 L
+2496  506 mt 2496  626 L
+2669  566 mt 2789  566 L
+2729  506 mt 2729  626 L
+2903  566 mt 3023  566 L
+2963  506 mt 2963  626 L
+3136  566 mt 3256  566 L
+3196  506 mt 3196  626 L
+3369  566 mt 3489  566 L
+3429  506 mt 3429  626 L
+3602  566 mt 3722  566 L
+3662  506 mt 3662  626 L
+3835  566 mt 3955  566 L
+3895  506 mt 3895  626 L
+4068  566 mt 4188  566 L
+4128  506 mt 4128  626 L
+4302  567 mt 4422  567 L
+4362  507 mt 4362  627 L
+4535  570 mt 4655  570 L
+4595  510 mt 4595  630 L
+4768  576 mt 4888  576 L
+4828  516 mt 4828  636 L
+5001  590 mt 5121  590 L
+5061  530 mt 5061  650 L
+5234  616 mt 5354  616 L
+5294  556 mt 5294  676 L
+5467  662 mt 5587  662 L
+5527  602 mt 5527  722 L
+5701  735 mt 5821  735 L
+5761  675 mt 5761  795 L
+5934  843 mt 6054  843 L
+5994  783 mt 5994  903 L
+6167  996 mt 6287  996 L
+6227  936 mt 6227 1056 L
+6400 1199 mt 6520 1199 L
+6460 1139 mt 6460 1259 L
+6633 1460 mt 6753 1460 L
+6693 1400 mt 6693 1520 L
+6867 1764 mt 6987 1764 L
+6927 1704 mt 6927 1824 L
+7100 2150 mt 7220 2150 L
+7160 2090 mt 7160 2210 L
+7333 2606 mt 7453 2606 L
+7393 2546 mt 7393 2666 L
+7566 3135 mt 7686 3135 L
+7626 3075 mt 7626 3195 L
+7799 3740 mt 7919 3740 L
+7859 3680 mt 7859 3800 L
+gr
+
+gs 1564 566 9328 6151 rc
+DA
+c8
+233 462 233 467 234 305 233 362 233 277 233 250 233 219 233 185 
+234 168 233 125 233 112 233 87 233 62 234 46 233 38 233 19 
+233 16 233 10 233 5 234 4 233 3 233 1 233 0 233 0 
+233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 32 MP stroke
+SO
+c9
+233 442 233 404 234 365 233 328 233 291 233 257 233 222 233 190 
+234 152 233 134 233 108 233 85 233 65 234 49 233 34 233 23 
+233 16 233 9 233 6 234 3 233 2 233 1 233 0 233 0 
+233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 32 MP stroke
+gr
+
+gs 1418 420 7521 3479 rc
+0 j
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 1513 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 1746 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 1979 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 2212 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 2445 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 2678 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 2912 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 3145 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 3378 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 3611 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 3844 537 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 4077 539 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 4311 542 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 4544 548 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 4777 557 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 5010 573 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 5243 596 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 5476 630 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 5710 679 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 5943 744 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 6176 829 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 6409 937 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 6642 1071 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 6876 1223 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 7109 1413 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 7342 1635 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 7575 1892 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 7808 2183 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 8041 2511 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 8275 2876 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 8508 3280 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 8741 3722 13 MP
+DP
+gr
+
+gs 1564 566 9328 6151 rc
+DA
+c8
+233 281 233 294 233 262 233 288 234 246 233 237 233 177 233 228 
+233 170 233 136 234 127 233 123 233 100 233 98 233 70 233 70 
+234 53 233 46 233 42 233 27 233 19 234 20 233 14 233 12 
+233 6 233 4 233 4 234 2 233 1 233 2 233 1 233 0 
+233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 40 MP stroke
+SO
+c9
+233 314 233 294 233 274 233 256 234 237 233 219 233 201 233 183 
+233 166 233 150 234 134 233 119 233 104 233 91 233 78 233 66 
+234 53 233 46 233 38 233 30 233 24 234 18 233 13 233 10 
+233 7 233 5 233 4 234 2 233 1 233 1 233 1 233 0 
+233 0 234 0 233 0 233 0 233 0 233 0 233 0 1564 566 40 MP stroke
+gr
+
+gs 1418 420 9386 3432 rc
+1504  566 mt 1624  566 L
+1564  506 mt 1564  626 L
+1737  566 mt 1857  566 L
+1797  506 mt 1797  626 L
+1970  566 mt 2090  566 L
+2030  506 mt 2030  626 L
+2203  566 mt 2323  566 L
+2263  506 mt 2263  626 L
+2436  566 mt 2556  566 L
+2496  506 mt 2496  626 L
+2669  566 mt 2789  566 L
+2729  506 mt 2729  626 L
+2903  566 mt 3023  566 L
+2963  506 mt 2963  626 L
+3136  566 mt 3256  566 L
+3196  506 mt 3196  626 L
+3369  566 mt 3489  566 L
+3429  506 mt 3429  626 L
+3602  567 mt 3722  567 L
+3662  507 mt 3662  627 L
+3835  568 mt 3955  568 L
+3895  508 mt 3895  628 L
+4068  569 mt 4188  569 L
+4128  509 mt 4128  629 L
+4302  571 mt 4422  571 L
+4362  511 mt 4362  631 L
+4535  575 mt 4655  575 L
+4595  515 mt 4595  635 L
+4768  580 mt 4888  580 L
+4828  520 mt 4828  640 L
+5001  587 mt 5121  587 L
+5061  527 mt 5061  647 L
+5234  597 mt 5354  597 L
+5294  537 mt 5294  657 L
+5467  610 mt 5587  610 L
+5527  550 mt 5527  670 L
+5701  628 mt 5821  628 L
+5761  568 mt 5761  688 L
+5934  652 mt 6054  652 L
+5994  592 mt 5994  712 L
+6167  682 mt 6287  682 L
+6227  622 mt 6227  742 L
+6400  720 mt 6520  720 L
+6460  660 mt 6460  780 L
+6633  766 mt 6753  766 L
+6693  706 mt 6693  826 L
+6867  819 mt 6987  819 L
+6927  759 mt 6927  879 L
+7100  885 mt 7220  885 L
+7160  825 mt 7160  945 L
+7333  963 mt 7453  963 L
+7393  903 mt 7393 1023 L
+7566 1054 mt 7686 1054 L
+7626  994 mt 7626 1114 L
+7799 1158 mt 7919 1158 L
+7859 1098 mt 7859 1218 L
+8032 1277 mt 8152 1277 L
+8092 1217 mt 8092 1337 L
+8266 1411 mt 8386 1411 L
+8326 1351 mt 8326 1471 L
+8499 1561 mt 8619 1561 L
+8559 1501 mt 8559 1621 L
+8732 1727 mt 8852 1727 L
+8792 1667 mt 8792 1787 L
+8965 1910 mt 9085 1910 L
+9025 1850 mt 9025 1970 L
+9198 2111 mt 9318 2111 L
+9258 2051 mt 9258 2171 L
+9431 2330 mt 9551 2330 L
+9491 2270 mt 9491 2390 L
+9665 2567 mt 9785 2567 L
+9725 2507 mt 9725 2627 L
+9898 2823 mt 10018 2823 L
+9958 2763 mt 9958 2883 L
+10131 3097 mt 10251 3097 L
+10191 3037 mt 10191 3157 L
+10364 3391 mt 10484 3391 L
+10424 3331 mt 10424 3451 L
+10597 3705 mt 10717 3705 L
+10657 3645 mt 10657 3765 L
+1522  524 mt 1606  608 L
+1606  524 mt 1522  608 L
+1755  524 mt 1839  608 L
+1839  524 mt 1755  608 L
+1988  524 mt 2072  608 L
+2072  524 mt 1988  608 L
+2221  524 mt 2305  608 L
+2305  524 mt 2221  608 L
+2454  524 mt 2538  608 L
+2538  524 mt 2454  608 L
+2687  524 mt 2771  608 L
+2771  524 mt 2687  608 L
+2921  524 mt 3005  608 L
+3005  524 mt 2921  608 L
+3154  524 mt 3238  608 L
+3238  524 mt 3154  608 L
+3387  524 mt 3471  608 L
+3471  524 mt 3387  608 L
+3620  525 mt 3704  609 L
+3704  525 mt 3620  609 L
+3853  526 mt 3937  610 L
+3937  526 mt 3853  610 L
+4086  527 mt 4170  611 L
+4170  527 mt 4086  611 L
+4320  529 mt 4404  613 L
+4404  529 mt 4320  613 L
+4553  533 mt 4637  617 L
+4637  533 mt 4553  617 L
+4786  538 mt 4870  622 L
+4870  538 mt 4786  622 L
+5019  545 mt 5103  629 L
+5103  545 mt 5019  629 L
+5252  555 mt 5336  639 L
+5336  555 mt 5252  639 L
+5485  568 mt 5569  652 L
+5569  568 mt 5485  652 L
+5719  586 mt 5803  670 L
+5803  586 mt 5719  670 L
+5952  610 mt 6036  694 L
+6036  610 mt 5952  694 L
+6185  640 mt 6269  724 L
+6269  640 mt 6185  724 L
+6418  678 mt 6502  762 L
+6502  678 mt 6418  762 L
+6651  724 mt 6735  808 L
+6735  724 mt 6651  808 L
+6885  777 mt 6969  861 L
+6969  777 mt 6885  861 L
+7118  843 mt 7202  927 L
+7202  843 mt 7118  927 L
+7351  921 mt 7435 1005 L
+7435  921 mt 7351 1005 L
+7584 1012 mt 7668 1096 L
+7668 1012 mt 7584 1096 L
+7817 1116 mt 7901 1200 L
+7901 1116 mt 7817 1200 L
+8050 1235 mt 8134 1319 L
+8134 1235 mt 8050 1319 L
+8284 1369 mt 8368 1453 L
+8368 1369 mt 8284 1453 L
+8517 1519 mt 8601 1603 L
+8601 1519 mt 8517 1603 L
+8750 1685 mt 8834 1769 L
+8834 1685 mt 8750 1769 L
+8983 1868 mt 9067 1952 L
+9067 1868 mt 8983 1952 L
+9216 2069 mt 9300 2153 L
+9300 2069 mt 9216 2153 L
+9449 2288 mt 9533 2372 L
+9533 2288 mt 9449 2372 L
+9683 2525 mt 9767 2609 L
+9767 2525 mt 9683 2609 L
+9916 2781 mt 10000 2865 L
+10000 2781 mt 9916 2865 L
+10149 3055 mt 10233 3139 L
+10233 3055 mt 10149 3139 L
+10382 3349 mt 10466 3433 L
+10466 3349 mt 10382 3433 L
+10615 3663 mt 10699 3747 L
+10699 3663 mt 10615 3747 L
+gr
+
+gs 1564 566 9328 6151 rc
+gr
+
+0 sg
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+6083 7004 mt 
+(SINR) s
+1223 3799 mt  -90 rotate
+(BLER) s
+90 rotate
+1547 6759 mt 
+( ) s
+10875  608 mt 
+( ) s
+6 w
+1 sg
+0 2058 1696 0 0 -2058 1601 6684 4 MP
+PP
+-1696 0 0 2058 1696 0 0 -2058 1601 6684 5 MP stroke
+4 w
+DO
+SO
+6 w
+0 sg
+1601 4626 mt 3297 4626 L
+1601 6684 mt 3297 6684 L
+3297 6684 mt 3297 4626 L
+1601 6684 mt 1601 4626 L
+1601 6684 mt 3297 6684 L
+1601 6684 mt 1601 4626 L
+1601 4626 mt 3297 4626 L
+1601 6684 mt 3297 6684 L
+3297 6684 mt 3297 4626 L
+1601 6684 mt 1601 4626 L
+2073 4773 mt 
+(TB = 6000 \(AWGN\)) s
+gs 1601 4626 1697 2059 rc
+DA
+24 w
+c8
+363 0 1673 4731 2 MP stroke
+SO
+gr
+
+24 w
+c8
+0 sg
+2073 4941 mt 
+(TB = 6000 \(estimated\)) s
+gs 1601 4626 1697 2059 rc
+c9
+363 0 1673 4899 2 MP stroke
+gs 1708 4753 293 293 rc
+0 j
+69 119 -138 0 69 -119 1854 4978 4 MP
+DP
+gr
+
+gr
+
+c9
+0 sg
+2073 5109 mt 
+(TB = 4000 \(AWGN\)) s
+gs 1601 4626 1697 2059 rc
+DA
+c8
+363 0 1673 5067 2 MP stroke
+SO
+gr
+
+c8
+0 sg
+2073 5277 mt 
+(TB = 4000 \(estimated\)) s
+gs 1601 4626 1697 2059 rc
+c9
+363 0 1673 5235 2 MP stroke
+gs 1708 5089 293 293 rc
+0 j
+-69 119 -69 -119 138 0 1785 5275 4 MP
+DP
+gr
+
+gr
+
+c9
+0 sg
+2073 5445 mt 
+(TB = 2560 \(AWGN\)) s
+gs 1601 4626 1697 2059 rc
+DA
+c8
+363 0 1673 5403 2 MP stroke
+SO
+gr
+
+c8
+0 sg
+2073 5613 mt 
+(TB = 2560 \(estimated\)) s
+gs 1601 4626 1697 2059 rc
+c9
+363 0 1673 5571 2 MP stroke
+gs 1708 5425 293 293 rc
+0 j
+0 -94 -94 0 0 94 94 0 1807 5524 5 MP
+DP
+gr
+
+gr
+
+c9
+0 sg
+2073 5782 mt 
+(TB = 1024 \(AWGN\)) s
+gs 1601 4626 1697 2059 rc
+DA
+c8
+363 0 1673 5739 2 MP stroke
+SO
+gr
+
+c8
+0 sg
+2073 5950 mt 
+(TB = 1024 \(estimated\)) s
+gs 1601 4626 1697 2059 rc
+c9
+363 0 1673 5907 2 MP stroke
+gs 1708 5761 293 293 rc
+1794 5907 mt 1914 5907 L
+1854 5847 mt 1854 5967 L
+gr
+
+gr
+
+c9
+0 sg
+2073 6118 mt 
+(TB = 512 \(AWGN\)) s
+gs 1601 4626 1697 2059 rc
+DA
+c8
+363 0 1673 6075 2 MP stroke
+SO
+gr
+
+c8
+0 sg
+2073 6286 mt 
+(TB = 512 \(estimated\)) s
+gs 1601 4626 1697 2059 rc
+c9
+363 0 1673 6242 2 MP stroke
+gs 1708 6096 293 293 rc
+0 j
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 1803 6212 13 MP
+DP
+gr
+
+gr
+
+c9
+0 sg
+2073 6454 mt 
+(TB = 256 \(AWGN\)) s
+gs 1601 4626 1697 2059 rc
+DA
+c8
+363 0 1673 6410 2 MP stroke
+SO
+gr
+
+c8
+0 sg
+2073 6622 mt 
+(TB = 256 \(estimated\)) s
+gs 1601 4626 1697 2059 rc
+c9
+363 0 1673 6578 2 MP stroke
+gr
+
+c9
+gs 1708 6432 293 293 rc
+1794 6578 mt 1914 6578 L
+1854 6518 mt 1854 6638 L
+1812 6536 mt 1896 6620 L
+1896 6536 mt 1812 6620 L
+gr
+
+gs 1601 4626 1697 2059 rc
+6 w
+gr
+
+6 w
+
+end %%Color Dict
+
+eplot
+%%EndObject
+
+epage
+end
+
+showpage
+
+%%Trailer
+%%EOF
+
+cleartomark
+countdictstack exch sub { end } repeat
+restore grestore
+%
+% End Imported PIC File: /home/mmiozzo/ns3/lena/ns-3-lena-pem/src/lte/doc/source/figures/MCS_12.eps
+%%EndDocument
+%
+% Ellipse
+45.000 slw
+n 9585 3600 324 324 0 360 DrawEllipse gs col4 s gr
+
+% Ellipse
+n 9540 1530 324 324 0 360 DrawEllipse gs col4 s gr
+
+% Ellipse
+n 9540 2160 324 324 0 360 DrawEllipse gs col4 s gr
+
+/Helvetica-Bold ff 349.25 scf sf
+9855 1215 m
+gs 1 -1 sc (E) col4 sh gr
+/Helvetica-Bold ff 349.25 scf sf
+9990 2205 m
+gs 1 -1 sc (F) col4 sh gr
+/Helvetica-Bold ff 349.25 scf sf
+9945 4005 m
+gs 1 -1 sc (G) col4 sh gr
+% here ends figure;
+pagefooter
+showpage
+%%Trailer
+%EOF
Binary file src/lte/doc/source/figures/MCS_13_16.pdf has changed
Binary file src/lte/doc/source/figures/MCS_13_16.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/lte/doc/source/figures/MCS_14_test.eps	Fri May 11 16:42:40 2012 +0200
@@ -0,0 +1,1641 @@
+%!PS-Adobe-2.0 EPSF-2.0
+%%Title: /home/mmiozzo/ns3/lena/ns-3-lena-pem/src/lte/doc/source/figures/MCS_14_test.fig
+%%Creator: fig2dev Version 3.2 Patchlevel 5a
+%%CreationDate: Tue Jan 10 17:48:10 2012
+%%BoundingBox: 0 0 1095 718
+%Magnification: 1.0000
+%%EndComments
+%%BeginProlog
+/$F2psDict 200 dict def
+$F2psDict begin
+$F2psDict /mtrx matrix put
+/col-1 {0 setgray} bind def
+/col0 {0.000 0.000 0.000 srgb} bind def
+/col1 {0.000 0.000 1.000 srgb} bind def
+/col2 {0.000 1.000 0.000 srgb} bind def
+/col3 {0.000 1.000 1.000 srgb} bind def
+/col4 {1.000 0.000 0.000 srgb} bind def
+/col5 {1.000 0.000 1.000 srgb} bind def
+/col6 {1.000 1.000 0.000 srgb} bind def
+/col7 {1.000 1.000 1.000 srgb} bind def
+/col8 {0.000 0.000 0.560 srgb} bind def
+/col9 {0.000 0.000 0.690 srgb} bind def
+/col10 {0.000 0.000 0.820 srgb} bind def
+/col11 {0.530 0.810 1.000 srgb} bind def
+/col12 {0.000 0.560 0.000 srgb} bind def
+/col13 {0.000 0.690 0.000 srgb} bind def
+/col14 {0.000 0.820 0.000 srgb} bind def
+/col15 {0.000 0.560 0.560 srgb} bind def
+/col16 {0.000 0.690 0.690 srgb} bind def
+/col17 {0.000 0.820 0.820 srgb} bind def
+/col18 {0.560 0.000 0.000 srgb} bind def
+/col19 {0.690 0.000 0.000 srgb} bind def
+/col20 {0.820 0.000 0.000 srgb} bind def
+/col21 {0.560 0.000 0.560 srgb} bind def
+/col22 {0.690 0.000 0.690 srgb} bind def
+/col23 {0.820 0.000 0.820 srgb} bind def
+/col24 {0.500 0.190 0.000 srgb} bind def
+/col25 {0.630 0.250 0.000 srgb} bind def
+/col26 {0.750 0.380 0.000 srgb} bind def
+/col27 {1.000 0.500 0.500 srgb} bind def
+/col28 {1.000 0.630 0.630 srgb} bind def
+/col29 {1.000 0.750 0.750 srgb} bind def
+/col30 {1.000 0.880 0.880 srgb} bind def
+/col31 {1.000 0.840 0.000 srgb} bind def
+
+end
+
+/cp {closepath} bind def
+/ef {eofill} bind def
+/gr {grestore} bind def
+/gs {gsave} bind def
+/sa {save} bind def
+/rs {restore} bind def
+/l {lineto} bind def
+/m {moveto} bind def
+/rm {rmoveto} bind def
+/n {newpath} bind def
+/s {stroke} bind def
+/sh {show} bind def
+/slc {setlinecap} bind def
+/slj {setlinejoin} bind def
+/slw {setlinewidth} bind def
+/srgb {setrgbcolor} bind def
+/rot {rotate} bind def
+/sc {scale} bind def
+/sd {setdash} bind def
+/ff {findfont} bind def
+/sf {setfont} bind def
+/scf {scalefont} bind def
+/sw {stringwidth} bind def
+/tr {translate} bind def
+/tnt {dup dup currentrgbcolor
+  4 -2 roll dup 1 exch sub 3 -1 roll mul add
+  4 -2 roll dup 1 exch sub 3 -1 roll mul add
+  4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb}
+  bind def
+/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul
+  4 -2 roll mul srgb} bind def
+ /DrawEllipse {
+	/endangle exch def
+	/startangle exch def
+	/yrad exch def
+	/xrad exch def
+	/y exch def
+	/x exch def
+	/savematrix mtrx currentmatrix def
+	x y tr xrad yrad sc 0 0 1 startangle endangle arc
+	closepath
+	savematrix setmatrix
+	} def
+
+/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def
+/$F2psEnd {$F2psEnteredState restore end} def
+
+/pageheader {
+save
+newpath 0 718 moveto 0 0 lineto 1095 0 lineto 1095 718 lineto closepath clip newpath
+-2.8 748.3 translate
+1 -1 scale
+$F2psBegin
+10 setmiterlimit
+0 slj 0 slc
+ 0.06299 0.06299 sc
+} bind def
+/pagefooter {
+$F2psEnd
+restore
+} bind def
+%%EndProlog
+pageheader
+%
+% Fig objects follow
+%
+% 
+% here starts figure with depth 51
+% Polyline
+%
+% pen to black in case this eps object doesn't set color first
+0 0 0 setrgbcolor
+% Begin Imported EPS File: /home/mmiozzo/ns3/lena/ns-3-lena-pem/src/lte/doc/source/figures/MCS_14.eps
+%%BeginDocument: /home/mmiozzo/ns3/lena/ns-3-lena-pem/src/lte/doc/source/figures/MCS_14.eps
+%
+n gs
+45 495 tr
+17.335329 -18.100159 sc
+0 -629 tr
+203 -106 tr
+sa
+n -203 106 m 799 106 l 799 735 l -203 735 l cp clip n
+countdictstack
+mark
+/showpage {} def
+% EPS file follows:
+%!PS-Adobe-3.0 EPSF-3.0
+%%Creator: MATLAB, The Mathworks, Inc. Version 7.8.0.347 (R2009a). Operating System: Microsoft Windows XP.
+%%Title: C:\Documents and Settings\Marco Miozzo\My Documents\MATLAB\Final\MCS_27_allTBsizes\MCS_14.eps
+%%CreationDate: 01/10/2012  17:33:16
+%%DocumentNeededFonts: Helvetica
+%%DocumentProcessColors: Cyan Magenta Yellow Black
+%%LanguageLevel: 2
+%%Pages: 1
+%%BoundingBox:  -203   106   799   735
+%%EndComments
+
+%%BeginProlog
+% MathWorks dictionary
+/MathWorks 160 dict begin
+% definition operators
+/bdef {bind def} bind def
+/ldef {load def} bind def
+/xdef {exch def} bdef
+/xstore {exch store} bdef
+% operator abbreviations
+/c  /clip ldef
+/cc /concat ldef
+/cp /closepath ldef
+/gr /grestore ldef
+/gs /gsave ldef
+/mt /moveto ldef
+/np /newpath ldef
+/cm /currentmatrix ldef
+/sm /setmatrix ldef
+/rm /rmoveto ldef
+/rl /rlineto ldef
+/s {show newpath} bdef
+/sc {setcmykcolor} bdef
+/sr /setrgbcolor ldef
+/sg /setgray ldef
+/w /setlinewidth ldef
+/j /setlinejoin ldef
+/cap /setlinecap ldef
+/rc {rectclip} bdef
+/rf {rectfill} bdef
+% page state control
+/pgsv () def
+/bpage {/pgsv save def} bdef
+/epage {pgsv restore} bdef
+/bplot /gsave ldef
+/eplot {stroke grestore} bdef
+% orientation switch
+/portraitMode 0 def /landscapeMode 1 def /rotateMode 2 def
+% coordinate system mappings
+/dpi2point 0 def
+% font control
+/FontSize 0 def
+/FMS {/FontSize xstore findfont [FontSize 0 0 FontSize neg 0 0]
+  makefont setfont} bdef
+/ISOLatin1Encoding where {pop /WindowsLatin1Encoding 256 array bdef
+ISOLatin1Encoding WindowsLatin1Encoding copy pop
+/.notdef/.notdef/quotesinglbase/florin/quotedblbase/ellipsis/dagger
+/daggerdbl/circumflex/perthousand/Scaron/guilsinglleft/OE/.notdef/.notdef
+/.notdef/.notdef/quoteleft/quoteright/quotedblleft/quotedblright/bullet
+/endash/emdash/tilde/trademark/scaron/guilsinglright/oe/.notdef/.notdef
+/Ydieresis WindowsLatin1Encoding 128 32 getinterval astore pop}
+{/WindowsLatin1Encoding StandardEncoding bdef} ifelse
+/reencode {exch dup where {pop load} {pop StandardEncoding} ifelse
+  exch dup 3 1 roll findfont dup length dict begin
+  { 1 index /FID ne {def}{pop pop} ifelse } forall
+  /Encoding exch def currentdict end definefont pop} bdef
+/isroman {findfont /CharStrings get /Agrave known} bdef
+/FMSR {3 1 roll 1 index dup isroman {reencode} {pop pop} ifelse
+  exch FMS} bdef
+/csm {1 dpi2point div -1 dpi2point div scale neg translate
+ dup landscapeMode eq {pop -90 rotate}
+  {rotateMode eq {90 rotate} if} ifelse} bdef
+% line types: solid, dotted, dashed, dotdash
+/SO { [] 0 setdash } bdef
+/DO { [.5 dpi2point mul 4 dpi2point mul] 0 setdash } bdef
+/DA { [6 dpi2point mul] 0 setdash } bdef
+/DD { [.5 dpi2point mul 4 dpi2point mul 6 dpi2point mul 4
+  dpi2point mul] 0 setdash } bdef
+% macros for lines and objects
+/L {lineto stroke} bdef
+/MP {3 1 roll moveto 1 sub {rlineto} repeat} bdef
+/AP {{rlineto} repeat} bdef
+/PDlw -1 def
+/W {/PDlw currentlinewidth def setlinewidth} def
+/PP {closepath eofill} bdef
+/DP {closepath stroke} bdef
+/MR {4 -2 roll moveto dup  0 exch rlineto exch 0 rlineto
+  neg 0 exch rlineto closepath} bdef
+/FR {MR stroke} bdef
+/PR {MR fill} bdef
+/L1i {{currentfile picstr readhexstring pop} image} bdef
+/tMatrix matrix def
+/MakeOval {newpath tMatrix currentmatrix pop translate scale
+0 0 1 0 360 arc tMatrix setmatrix} bdef
+/FO {MakeOval stroke} bdef
+/PO {MakeOval fill} bdef
+/PD {currentlinewidth 2 div 0 360 arc fill
+   PDlw -1 eq not {PDlw w /PDlw -1 def} if} def
+/FA {newpath tMatrix currentmatrix pop translate scale
+  0 0 1 5 -2 roll arc tMatrix setmatrix stroke} bdef
+/PA {newpath tMatrix currentmatrix pop	translate 0 0 moveto scale
+  0 0 1 5 -2 roll arc closepath tMatrix setmatrix fill} bdef
+/FAn {newpath tMatrix currentmatrix pop translate scale
+  0 0 1 5 -2 roll arcn tMatrix setmatrix stroke} bdef
+/PAn {newpath tMatrix currentmatrix pop translate 0 0 moveto scale
+  0 0 1 5 -2 roll arcn closepath tMatrix setmatrix fill} bdef
+/vradius 0 def /hradius 0 def /lry 0 def
+/lrx 0 def /uly 0 def /ulx 0 def /rad 0 def
+/MRR {/vradius xdef /hradius xdef /lry xdef /lrx xdef /uly xdef
+  /ulx xdef newpath tMatrix currentmatrix pop ulx hradius add uly
+  vradius add translate hradius vradius scale 0 0 1 180 270 arc 
+  tMatrix setmatrix lrx hradius sub uly vradius add translate
+  hradius vradius scale 0 0 1 270 360 arc tMatrix setmatrix
+  lrx hradius sub lry vradius sub translate hradius vradius scale
+  0 0 1 0 90 arc tMatrix setmatrix ulx hradius add lry vradius sub
+  translate hradius vradius scale 0 0 1 90 180 arc tMatrix setmatrix
+  closepath} bdef
+/FRR {MRR stroke } bdef
+/PRR {MRR fill } bdef
+/MlrRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lry uly sub 2 div def
+  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
+  rad rad scale 0 0 1 90 270 arc tMatrix setmatrix lrx rad sub lry rad
+  sub translate rad rad scale 0 0 1 270 90 arc tMatrix setmatrix
+  closepath} bdef
+/FlrRR {MlrRR stroke } bdef
+/PlrRR {MlrRR fill } bdef
+/MtbRR {/lry xdef /lrx xdef /uly xdef /ulx xdef /rad lrx ulx sub 2 div def
+  newpath tMatrix currentmatrix pop ulx rad add uly rad add translate
+  rad rad scale 0 0 1 180 360 arc tMatrix setmatrix lrx rad sub lry rad
+  sub translate rad rad scale 0 0 1 0 180 arc tMatrix setmatrix
+  closepath} bdef
+/FtbRR {MtbRR stroke } bdef
+/PtbRR {MtbRR fill } bdef
+/stri 6 array def /dtri 6 array def
+/smat 6 array def /dmat 6 array def
+/tmat1 6 array def /tmat2 6 array def /dif 3 array def
+/asub {/ind2 exch def /ind1 exch def dup dup
+  ind1 get exch ind2 get sub exch } bdef
+/tri_to_matrix {
+  2 0 asub 3 1 asub 4 0 asub 5 1 asub
+  dup 0 get exch 1 get 7 -1 roll astore } bdef
+/compute_transform {
+  dmat dtri tri_to_matrix tmat1 invertmatrix 
+  smat stri tri_to_matrix tmat2 concatmatrix } bdef
+/ds {stri astore pop} bdef
+/dt {dtri astore pop} bdef
+/db {2 copy /cols xdef /rows xdef mul dup 3 mul string
+  currentfile 
+  3 index 0 eq {/ASCIIHexDecode filter}
+  {/ASCII85Decode filter 3 index 2 eq {/RunLengthDecode filter} if }
+  ifelse exch readstring pop
+  dup 0 3 index getinterval /rbmap xdef
+  dup 2 index dup getinterval /gbmap xdef
+  1 index dup 2 mul exch getinterval /bbmap xdef pop pop}bdef
+/it {gs np dtri aload pop moveto lineto lineto cp c
+  cols rows 8 compute_transform 
+  rbmap gbmap bbmap true 3 colorimage gr}bdef
+/il {newpath moveto lineto stroke}bdef
+currentdict end def
+%%EndProlog
+
+%%BeginSetup
+MathWorks begin
+
+0 cap
+
+end
+%%EndSetup
+
+%%Page: 1 1
+%%BeginPageSetup
+%%PageBoundingBox:  -203   106   799   735
+MathWorks begin
+bpage
+%%EndPageSetup
+
+%%BeginObject: obj1
+bplot
+
+/dpi2point 12 def
+portraitMode -2436 8820 csm
+
+    0     0 12034  7546 rc
+85 dict begin %Colortable dictionary
+/c0 { 0.000000 0.000000 0.000000 sr} bdef
+/c1 { 1.000000 1.000000 1.000000 sr} bdef
+/c2 { 0.900000 0.000000 0.000000 sr} bdef
+/c3 { 0.000000 0.820000 0.000000 sr} bdef
+/c4 { 0.000000 0.000000 0.800000 sr} bdef
+/c5 { 0.910000 0.820000 0.320000 sr} bdef
+/c6 { 1.000000 0.260000 0.820000 sr} bdef
+/c7 { 0.000000 0.820000 0.820000 sr} bdef
+c0
+1 j
+1 sg
+   0    0 12035 7547 rf
+6 w
+0 6150 9327 0 0 -6150 1564 6716 4 MP
+PP
+-9327 0 0 6150 9327 0 0 -6150 1564 6716 5 MP stroke
+4 w
+DO
+0 sg
+1564 6716 mt 1564  566 L
+1564  566 mt 1564  566 L
+3118 6716 mt 3118  566 L
+3118  566 mt 3118  566 L
+4673 6716 mt 4673  566 L
+4673  566 mt 4673  566 L
+6227 6716 mt 6227  566 L
+6227  566 mt 6227  566 L
+7782 6716 mt 7782  566 L
+7782  566 mt 7782  566 L
+9336 6716 mt 9336  566 L
+9336  566 mt 9336  566 L
+10891 6716 mt 10891  566 L
+10891  566 mt 10891  566 L
+1564 6716 mt 10891 6716 L
+10891 6716 mt 10891 6716 L
+1564 4666 mt 10891 4666 L
+10891 4666 mt 10891 4666 L
+1564 2616 mt 10891 2616 L
+10891 2616 mt 10891 2616 L
+1564  566 mt 10891  566 L
+10891  566 mt 10891  566 L
+SO
+6 w
+1564  566 mt 10891  566 L
+1564 6716 mt 10891 6716 L
+10891 6716 mt 10891  566 L
+1564 6716 mt 1564  566 L
+1564 6716 mt 10891 6716 L
+1564 6716 mt 1564  566 L
+1564 6716 mt 1564 6622 L
+1564  566 mt 1564  659 L
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+1531 6861 mt 
+(4) s
+3118 6716 mt 3118 6622 L
+3118  566 mt 3118  659 L
+3085 6861 mt 
+(5) s
+4673 6716 mt 4673 6622 L
+4673  566 mt 4673  659 L
+4640 6861 mt 
+(6) s
+6227 6716 mt 6227 6622 L
+6227  566 mt 6227  659 L
+6194 6861 mt 
+(7) s
+7782 6716 mt 7782 6622 L
+7782  566 mt 7782  659 L
+7749 6861 mt 
+(8) s
+9336 6716 mt 9336 6622 L
+9336  566 mt 9336  659 L
+9303 6861 mt 
+(9) s
+10891 6716 mt 10891 6622 L
+10891  566 mt 10891  659 L
+10825 6861 mt 
+(10) s
+1564 6716 mt 1610 6716 L
+10891 6716 mt 10844 6716 L
+DO
+1564 6716 mt 10891 6716 L
+10891 6716 mt 10891 6716 L
+SO
+1564 6716 mt 1657 6716 L
+10891 6716 mt 10797 6716 L
+1305 6760 mt 
+(10) s
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 80 FMSR
+
+1438 6686 mt 
+(-3) s
+1564 6098 mt 1610 6098 L
+10891 6098 mt 10844 6098 L
+DO
+1564 6098 mt 10891 6098 L
+10891 6098 mt 10891 6098 L
+SO
+1564 5737 mt 1610 5737 L
+10891 5737 mt 10844 5737 L
+DO
+1564 5737 mt 10891 5737 L
+10891 5737 mt 10891 5737 L
+SO
+1564 5481 mt 1610 5481 L
+10891 5481 mt 10844 5481 L
+DO
+1564 5481 mt 10891 5481 L
+10891 5481 mt 10891 5481 L
+SO
+1564 5283 mt 1610 5283 L
+10891 5283 mt 10844 5283 L
+DO
+1564 5283 mt 10891 5283 L
+10891 5283 mt 10891 5283 L
+SO
+1564 5120 mt 1610 5120 L
+10891 5120 mt 10844 5120 L
+DO
+1564 5120 mt 10891 5120 L
+10891 5120 mt 10891 5120 L
+SO
+1564 4983 mt 1610 4983 L
+10891 4983 mt 10844 4983 L
+DO
+1564 4983 mt 10891 4983 L
+10891 4983 mt 10891 4983 L
+SO
+1564 4864 mt 1610 4864 L
+10891 4864 mt 10844 4864 L
+DO
+1564 4864 mt 10891 4864 L
+10891 4864 mt 10891 4864 L
+SO
+1564 4759 mt 1610 4759 L
+10891 4759 mt 10844 4759 L
+DO
+1564 4759 mt 10891 4759 L
+10891 4759 mt 10891 4759 L
+SO
+1564 4666 mt 1610 4666 L
+10891 4666 mt 10844 4666 L
+DO
+1564 4666 mt 10891 4666 L
+10891 4666 mt 10891 4666 L
+SO
+1564 4666 mt 1657 4666 L
+10891 4666 mt 10797 4666 L
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+1305 4710 mt 
+(10) s
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 80 FMSR
+
+1438 4636 mt 
+(-2) s
+1564 4048 mt 1610 4048 L
+10891 4048 mt 10844 4048 L
+DO
+1564 4048 mt 10891 4048 L
+10891 4048 mt 10891 4048 L
+SO
+1564 3687 mt 1610 3687 L
+10891 3687 mt 10844 3687 L
+DO
+1564 3687 mt 10891 3687 L
+10891 3687 mt 10891 3687 L
+SO
+1564 3431 mt 1610 3431 L
+10891 3431 mt 10844 3431 L
+DO
+1564 3431 mt 10891 3431 L
+10891 3431 mt 10891 3431 L
+SO
+1564 3233 mt 1610 3233 L
+10891 3233 mt 10844 3233 L
+DO
+1564 3233 mt 10891 3233 L
+10891 3233 mt 10891 3233 L
+SO
+1564 3070 mt 1610 3070 L
+10891 3070 mt 10844 3070 L
+DO
+1564 3070 mt 10891 3070 L
+10891 3070 mt 10891 3070 L
+SO
+1564 2933 mt 1610 2933 L
+10891 2933 mt 10844 2933 L
+DO
+1564 2933 mt 10891 2933 L
+10891 2933 mt 10891 2933 L
+SO
+1564 2814 mt 1610 2814 L
+10891 2814 mt 10844 2814 L
+DO
+1564 2814 mt 10891 2814 L
+10891 2814 mt 10891 2814 L
+SO
+1564 2709 mt 1610 2709 L
+10891 2709 mt 10844 2709 L
+DO
+1564 2709 mt 10891 2709 L
+10891 2709 mt 10891 2709 L
+SO
+1564 2616 mt 1610 2616 L
+10891 2616 mt 10844 2616 L
+DO
+1564 2616 mt 10891 2616 L
+10891 2616 mt 10891 2616 L
+SO
+1564 2616 mt 1657 2616 L
+10891 2616 mt 10797 2616 L
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+1305 2660 mt 
+(10) s
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 80 FMSR
+
+1438 2586 mt 
+(-1) s
+1564 1998 mt 1610 1998 L
+10891 1998 mt 10844 1998 L
+DO
+1564 1998 mt 10891 1998 L
+10891 1998 mt 10891 1998 L
+SO
+1564 1637 mt 1610 1637 L
+10891 1637 mt 10844 1637 L
+DO
+1564 1637 mt 10891 1637 L
+10891 1637 mt 10891 1637 L
+SO
+1564 1381 mt 1610 1381 L
+10891 1381 mt 10844 1381 L
+DO
+1564 1381 mt 10891 1381 L
+10891 1381 mt 10891 1381 L
+SO
+1564 1183 mt 1610 1183 L
+10891 1183 mt 10844 1183 L
+DO
+1564 1183 mt 10891 1183 L
+10891 1183 mt 10891 1183 L
+SO
+1564 1020 mt 1610 1020 L
+10891 1020 mt 10844 1020 L
+DO
+1564 1020 mt 10891 1020 L
+10891 1020 mt 10891 1020 L
+SO
+1564  883 mt 1610  883 L
+10891  883 mt 10844  883 L
+DO
+1564  883 mt 10891  883 L
+10891  883 mt 10891  883 L
+SO
+1564  764 mt 1610  764 L
+10891  764 mt 10844  764 L
+DO
+1564  764 mt 10891  764 L
+10891  764 mt 10891  764 L
+SO
+1564  659 mt 1610  659 L
+10891  659 mt 10844  659 L
+DO
+1564  659 mt 10891  659 L
+10891  659 mt 10891  659 L
+SO
+1564  566 mt 1610  566 L
+10891  566 mt 10844  566 L
+DO
+1564  566 mt 10891  566 L
+10891  566 mt 10891  566 L
+SO
+1564  566 mt 1657  566 L
+10891  566 mt 10797  566 L
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+1305  610 mt 
+(10) s
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 80 FMSR
+
+1438  536 mt 
+(0) s
+1564  566 mt 10891  566 L
+1564 6716 mt 10891 6716 L
+10891 6716 mt 10891  566 L
+1564 6716 mt 1564  566 L
+gs 1564 565 9328 6151 rc
+DA
+24 w
+/c8 { 1.000000 0.000000 0.000000 sr} bdef
+c8
+155 2213 156 1361 155 890 156 532 155 227 155 63 156 13 155 0 
+156 0 155 0 156 0 155 0 156 0 155 0 155 0 156 0 
+155 0 156 0 155 0 156 0 155 0 156 0 155 0 156 0 
+155 0 155 0 156 0 155 0 156 0 155 0 156 0 155 0 
+156 0 155 0 155 0 1564 566 36 MP stroke
+SO
+/c9 { 0.000000 0.000000 1.000000 sr} bdef
+c9
+155 1941 156 1413 155 929 156 521 155 225 155 67 156 11 155 1 
+156 0 155 0 156 0 155 0 156 0 155 0 155 0 156 0 
+155 0 156 0 155 0 156 0 155 0 156 0 155 0 156 0 
+155 0 155 0 156 0 155 0 156 0 155 0 156 0 155 0 
+156 0 155 0 155 0 1564 566 36 MP stroke
+gr
+
+24 w
+c9
+gs 1418 420 5733 5401 rc
+0 j
+69 119 -138 0 69 -119 1564 645 4 MP
+DP
+69 119 -138 0 69 -119 1719 645 4 MP
+DP
+69 119 -138 0 69 -119 1874 645 4 MP
+DP
+69 119 -138 0 69 -119 2030 645 4 MP
+DP
+69 119 -138 0 69 -119 2185 645 4 MP
+DP
+69 119 -138 0 69 -119 2341 645 4 MP
+DP
+69 119 -138 0 69 -119 2496 645 4 MP
+DP
+69 119 -138 0 69 -119 2652 645 4 MP
+DP
+69 119 -138 0 69 -119 2807 645 4 MP
+DP
+69 119 -138 0 69 -119 2963 645 4 MP
+DP
+69 119 -138 0 69 -119 3118 645 4 MP
+DP
+69 119 -138 0 69 -119 3273 645 4 MP
+DP
+69 119 -138 0 69 -119 3429 645 4 MP
+DP
+69 119 -138 0 69 -119 3584 645 4 MP
+DP
+69 119 -138 0 69 -119 3740 645 4 MP
+DP
+69 119 -138 0 69 -119 3895 645 4 MP
+DP
+69 119 -138 0 69 -119 4051 645 4 MP
+DP
+69 119 -138 0 69 -119 4206 645 4 MP
+DP
+69 119 -138 0 69 -119 4362 645 4 MP
+DP
+69 119 -138 0 69 -119 4517 645 4 MP
+DP
+69 119 -138 0 69 -119 4673 645 4 MP
+DP
+69 119 -138 0 69 -119 4828 645 4 MP
+DP
+69 119 -138 0 69 -119 4983 645 4 MP
+DP
+69 119 -138 0 69 -119 5139 645 4 MP
+DP
+69 119 -138 0 69 -119 5294 645 4 MP
+DP
+69 119 -138 0 69 -119 5450 645 4 MP
+DP
+69 119 -138 0 69 -119 5605 645 4 MP
+DP
+69 119 -138 0 69 -119 5761 645 4 MP
+DP
+69 119 -138 0 69 -119 5916 646 4 MP
+DP
+69 119 -138 0 69 -119 6072 657 4 MP
+DP
+69 119 -138 0 69 -119 6227 724 4 MP
+DP
+69 119 -138 0 69 -119 6382 949 4 MP
+DP
+69 119 -138 0 69 -119 6538 1470 4 MP
+DP
+69 119 -138 0 69 -119 6693 2399 4 MP
+DP
+69 119 -138 0 69 -119 6849 3812 4 MP
+DP
+69 119 -138 0 69 -119 7004 5753 4 MP
+DP
+gr
+
+gs 1564 565 9328 6151 rc
+DA
+c8
+155 1227 156 1029 155 769 156 487 155 261 155 118 156 37 155 7 
+156 2 155 0 156 0 155 0 156 0 155 0 155 0 156 0 
+155 0 156 0 155 0 156 0 155 0 156 0 155 0 156 0 
+155 0 155 0 156 0 155 0 156 0 155 0 156 0 155 0 
+156 0 155 0 155 0 1564 566 36 MP stroke
+SO
+c9
+155 1421 156 1078 155 762 156 484 155 265 155 115 156 38 155 8 
+156 1 155 0 156 0 155 0 156 0 155 0 155 0 156 0 
+155 0 156 0 155 0 156 0 155 0 156 0 155 0 156 0 
+155 0 155 0 156 0 155 0 156 0 155 0 156 0 155 0 
+156 0 155 0 155 0 1564 566 36 MP stroke
+gr
+
+gs 1418 420 5733 4465 rc
+0 j
+-69 119 -69 -119 138 0 1495 606 4 MP
+DP
+-69 119 -69 -119 138 0 1650 606 4 MP
+DP
+-69 119 -69 -119 138 0 1805 606 4 MP
+DP
+-69 119 -69 -119 138 0 1961 606 4 MP
+DP
+-69 119 -69 -119 138 0 2116 606 4 MP
+DP
+-69 119 -69 -119 138 0 2272 606 4 MP
+DP
+-69 119 -69 -119 138 0 2427 606 4 MP
+DP
+-69 119 -69 -119 138 0 2583 606 4 MP
+DP
+-69 119 -69 -119 138 0 2738 606 4 MP
+DP
+-69 119 -69 -119 138 0 2894 606 4 MP
+DP
+-69 119 -69 -119 138 0 3049 606 4 MP
+DP
+-69 119 -69 -119 138 0 3204 606 4 MP
+DP
+-69 119 -69 -119 138 0 3360 606 4 MP
+DP
+-69 119 -69 -119 138 0 3515 606 4 MP
+DP
+-69 119 -69 -119 138 0 3671 606 4 MP
+DP
+-69 119 -69 -119 138 0 3826 606 4 MP
+DP
+-69 119 -69 -119 138 0 3982 606 4 MP
+DP
+-69 119 -69 -119 138 0 4137 606 4 MP
+DP
+-69 119 -69 -119 138 0 4293 606 4 MP
+DP
+-69 119 -69 -119 138 0 4448 606 4 MP
+DP
+-69 119 -69 -119 138 0 4604 606 4 MP
+DP
+-69 119 -69 -119 138 0 4759 606 4 MP
+DP
+-69 119 -69 -119 138 0 4914 606 4 MP
+DP
+-69 119 -69 -119 138 0 5070 606 4 MP
+DP
+-69 119 -69 -119 138 0 5225 606 4 MP
+DP
+-69 119 -69 -119 138 0 5381 606 4 MP
+DP
+-69 119 -69 -119 138 0 5536 606 4 MP
+DP
+-69 119 -69 -119 138 0 5692 607 4 MP
+DP
+-69 119 -69 -119 138 0 5847 615 4 MP
+DP
+-69 119 -69 -119 138 0 6003 653 4 MP
+DP
+-69 119 -69 -119 138 0 6158 768 4 MP
+DP
+-69 119 -69 -119 138 0 6313 1033 4 MP
+DP
+-69 119 -69 -119 138 0 6469 1517 4 MP
+DP
+-69 119 -69 -119 138 0 6624 2279 4 MP
+DP
+-69 119 -69 -119 138 0 6780 3357 4 MP
+DP
+-69 119 -69 -119 138 0 6935 4778 4 MP
+DP
+gr
+
+gs 1564 565 9328 6151 rc
+DA
+c8
+155 1072 156 1101 155 997 156 617 155 477 156 307 155 166 155 85 
+156 36 155 12 156 2 155 0 156 0 155 0 156 0 155 0 
+155 0 156 0 155 0 156 0 155 0 156 0 155 0 156 0 
+155 0 156 0 155 0 155 0 156 0 155 0 156 0 155 0 
+156 0 155 0 156 0 155 0 155 0 1564 566 38 MP stroke
+SO
+c9
+155 1331 156 1096 155 870 156 659 155 467 156 304 155 174 155 85 
+156 34 155 10 156 3 155 0 156 0 155 0 156 0 155 0 
+155 0 156 0 155 0 156 0 155 0 156 0 155 0 156 0 
+155 0 156 0 155 0 155 0 156 0 155 0 156 0 155 0 
+156 0 155 0 156 0 155 0 155 0 1564 566 38 MP stroke
+gr
+
+gs 1418 420 6044 5326 rc
+0 j
+0 -94 -94 0 0 94 94 0 1517 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 1672 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 1827 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 1983 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 2138 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 2294 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 2449 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 2605 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 2760 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 2916 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 3071 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 3226 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 3382 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 3537 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 3693 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 3848 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 4004 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 4159 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 4315 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 4470 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 4626 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 4781 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 4936 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 5092 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 5247 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 5403 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 5558 519 5 MP
+DP
+0 -94 -94 0 0 94 94 0 5714 522 5 MP
+DP
+0 -94 -94 0 0 94 94 0 5869 532 5 MP
+DP
+0 -94 -94 0 0 94 94 0 6025 566 5 MP
+DP
+0 -94 -94 0 0 94 94 0 6180 651 5 MP
+DP
+0 -94 -94 0 0 94 94 0 6335 825 5 MP
+DP
+0 -94 -94 0 0 94 94 0 6491 1129 5 MP
+DP
+0 -94 -94 0 0 94 94 0 6646 1596 5 MP
+DP
+0 -94 -94 0 0 94 94 0 6802 2255 5 MP
+DP
+0 -94 -94 0 0 94 94 0 6957 3125 5 MP
+DP
+0 -94 -94 0 0 94 94 0 7113 4221 5 MP
+DP
+0 -94 -94 0 0 94 94 0 7268 5552 5 MP
+DP
+gr
+
+gs 1564 565 9328 6151 rc
+DA
+c8
+155 792 156 656 155 666 156 595 155 485 156 430 155 307 156 256 
+155 204 156 156 155 96 155 66 156 40 155 18 156 14 155 7 
+156 2 155 1 156 0 155 0 155 0 156 0 155 0 156 0 
+155 0 156 0 155 0 156 0 155 0 156 0 155 0 155 0 
+156 0 155 0 156 0 155 0 156 0 155 0 156 0 155 0 
+155 0 1564 566 42 MP stroke
+SO
+c9
+155 828 156 738 155 651 156 565 155 483 156 404 155 330 156 262 
+155 200 156 146 155 102 155 66 156 40 155 22 156 12 155 5 
+156 2 155 1 156 0 155 0 155 0 156 0 155 0 156 0 
+155 0 156 0 155 0 156 0 155 0 156 0 155 0 155 0 
+156 0 155 0 156 0 155 0 156 0 155 0 156 0 155 0 
+155 0 1564 566 42 MP stroke
+gr
+
+gs 1418 420 6666 5150 rc
+1504  566 mt 1624  566 L
+1564  506 mt 1564  626 L
+1659  566 mt 1779  566 L
+1719  506 mt 1719  626 L
+1814  566 mt 1934  566 L
+1874  506 mt 1874  626 L
+1970  566 mt 2090  566 L
+2030  506 mt 2030  626 L
+2125  566 mt 2245  566 L
+2185  506 mt 2185  626 L
+2281  566 mt 2401  566 L
+2341  506 mt 2341  626 L
+2436  566 mt 2556  566 L
+2496  506 mt 2496  626 L
+2592  566 mt 2712  566 L
+2652  506 mt 2652  626 L
+2747  566 mt 2867  566 L
+2807  506 mt 2807  626 L
+2903  566 mt 3023  566 L
+2963  506 mt 2963  626 L
+3058  566 mt 3178  566 L
+3118  506 mt 3118  626 L
+3213  566 mt 3333  566 L
+3273  506 mt 3273  626 L
+3369  566 mt 3489  566 L
+3429  506 mt 3429  626 L
+3524  566 mt 3644  566 L
+3584  506 mt 3584  626 L
+3680  566 mt 3800  566 L
+3740  506 mt 3740  626 L
+3835  566 mt 3955  566 L
+3895  506 mt 3895  626 L
+3991  566 mt 4111  566 L
+4051  506 mt 4051  626 L
+4146  566 mt 4266  566 L
+4206  506 mt 4206  626 L
+4302  566 mt 4422  566 L
+4362  506 mt 4362  626 L
+4457  566 mt 4577  566 L
+4517  506 mt 4517  626 L
+4613  566 mt 4733  566 L
+4673  506 mt 4673  626 L
+4768  566 mt 4888  566 L
+4828  506 mt 4828  626 L
+4923  566 mt 5043  566 L
+4983  506 mt 4983  626 L
+5079  566 mt 5199  566 L
+5139  506 mt 5139  626 L
+5234  567 mt 5354  567 L
+5294  507 mt 5294  627 L
+5390  569 mt 5510  569 L
+5450  509 mt 5450  629 L
+5545  574 mt 5665  574 L
+5605  514 mt 5605  634 L
+5701  586 mt 5821  586 L
+5761  526 mt 5761  646 L
+5856  608 mt 5976  608 L
+5916  548 mt 5916  668 L
+6012  648 mt 6132  648 L
+6072  588 mt 6072  708 L
+6167  714 mt 6287  714 L
+6227  654 mt 6227  774 L
+6322  816 mt 6442  816 L
+6382  756 mt 6382  876 L
+6478  962 mt 6598  962 L
+6538  902 mt 6538 1022 L
+6633 1162 mt 6753 1162 L
+6693 1102 mt 6693 1222 L
+6789 1424 mt 6909 1424 L
+6849 1364 mt 6849 1484 L
+6944 1754 mt 7064 1754 L
+7004 1694 mt 7004 1814 L
+7100 2158 mt 7220 2158 L
+7160 2098 mt 7160 2218 L
+7255 2641 mt 7375 2641 L
+7315 2581 mt 7315 2701 L
+7411 3206 mt 7531 3206 L
+7471 3146 mt 7471 3266 L
+7566 3857 mt 7686 3857 L
+7626 3797 mt 7626 3917 L
+7722 4595 mt 7842 4595 L
+7782 4535 mt 7782 4655 L
+7877 5423 mt 7997 5423 L
+7937 5363 mt 7937 5483 L
+gr
+
+gs 1564 565 9328 6151 rc
+DA
+c8
+156 565 155 539 156 524 155 469 155 379 156 361 155 318 156 278 
+155 191 156 179 155 151 156 119 155 103 156 79 155 51 155 42 
+156 29 155 17 156 13 155 4 156 3 155 1 156 1 155 1 
+155 0 156 0 155 0 156 0 155 0 156 0 155 0 156 0 
+155 0 156 0 155 0 155 0 156 0 155 0 156 0 155 0 
+156 0 155 0 156 0 155 0 155 0 1564 566 46 MP stroke
+SO
+c9
+156 559 155 513 156 467 155 423 155 380 156 337 155 297 156 257 
+155 220 156 186 155 152 156 124 155 97 156 74 155 55 155 39 
+156 27 155 18 156 11 155 7 156 3 155 3 156 1 155 0 
+155 0 156 0 155 0 156 0 155 0 156 0 155 0 156 0 
+155 0 156 0 155 0 155 0 156 0 155 0 156 0 155 0 
+156 0 155 0 156 0 155 0 155 0 1564 566 46 MP stroke
+gr
+
+gs 1418 420 7288 4543 rc
+0 j
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 1513 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 1668 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 1823 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 1979 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 2134 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 2290 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 2445 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 2601 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 2756 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 2912 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 3067 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 3222 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 3378 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 3533 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 3689 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 3844 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 4000 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 4155 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 4311 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 4466 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 4622 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 4777 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 4932 536 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 5088 537 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 5243 540 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 5399 543 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 5554 550 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 5710 561 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 5865 579 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 6021 606 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 6176 645 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 6331 700 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 6487 774 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 6642 871 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 6798 995 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 6953 1147 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 7109 1333 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 7264 1553 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 7420 1810 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 7575 2107 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 7731 2444 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 7886 2824 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 8041 3247 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 8197 3714 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 8352 4227 13 MP
+DP
+-21 -30 21 -30 -34 0 -17 -30 -17 30 -34 0 21 30 -21 30 
+34 0 17 30 17 -30 34 0 8508 4786 13 MP
+DP
+gr
+
+gs 1564 565 9328 6151 rc
+DA
+c8
+155 267 156 465 155 427 155 334 156 330 155 207 156 302 155 247 
+156 234 155 230 156 181 155 171 155 140 156 136 155 106 156 86 
+155 85 156 81 155 56 156 50 155 44 156 28 155 23 155 16 
+156 17 155 12 156 6 155 5 156 6 155 2 156 3 155 1 
+155 0 156 0 155 0 156 0 155 0 156 0 155 0 156 0 
+155 0 156 0 155 0 155 0 156 0 155 0 156 0 155 0 
+156 0 155 0 156 0 155 0 155 0 1564 566 54 MP stroke
+SO
+c9
+155 389 156 368 155 346 155 325 156 304 155 283 156 262 155 242 
+156 221 155 203 156 183 155 165 155 147 156 130 155 114 156 98 
+155 85 156 72 155 60 156 49 155 40 156 32 155 24 155 19 
+156 14 155 11 156 7 155 6 156 3 155 2 156 2 155 1 
+155 1 156 0 155 0 156 0 155 0 156 0 155 0 156 0 
+155 0 156 0 155 0 155 0 156 0 155 0 156 0 155 0 
+156 0 155 0 156 0 155 0 155 0 1564 566 54 MP stroke
+gr
+
+gs 1418 420 8531 4501 rc
+1504  566 mt 1624  566 L
+1564  506 mt 1564  626 L
+1659  566 mt 1779  566 L
+1719  506 mt 1719  626 L
+1814  566 mt 1934  566 L
+1874  506 mt 1874  626 L
+1970  566 mt 2090  566 L
+2030  506 mt 2030  626 L
+2125  566 mt 2245  566 L
+2185  506 mt 2185  626 L
+2281  566 mt 2401  566 L
+2341  506 mt 2341  626 L
+2436  566 mt 2556  566 L
+2496  506 mt 2496  626 L
+2592  566 mt 2712  566 L
+2652  506 mt 2652  626 L
+2747  566 mt 2867  566 L
+2807  506 mt 2807  626 L
+2903  566 mt 3023  566 L
+2963  506 mt 2963  626 L
+3058  566 mt 3178  566 L
+3118  506 mt 3118  626 L
+3213  566 mt 3333  566 L
+3273  506 mt 3273  626 L
+3369  566 mt 3489  566 L
+3429  506 mt 3429  626 L
+3524  566 mt 3644  566 L
+3584  506 mt 3584  626 L
+3680  566 mt 3800  566 L
+3740  506 mt 3740  626 L
+3835  566 mt 3955  566 L
+3895  506 mt 3895  626 L
+3991  566 mt 4111  566 L
+4051  506 mt 4051  626 L
+4146  566 mt 4266  566 L
+4206  506 mt 4206  626 L
+4302  566 mt 4422  566 L
+4362  506 mt 4362  626 L
+4457  566 mt 4577  566 L
+4517  506 mt 4517  626 L
+4613  566 mt 4733  566 L
+4673  506 mt 4673  626 L
+4768  567 mt 4888  567 L
+4828  507 mt 4828  627 L
+4923  568 mt 5043  568 L
+4983  508 mt 4983  628 L
+5079  570 mt 5199  570 L
+5139  510 mt 5139  630 L
+5234  572 mt 5354  572 L
+5294  512 mt 5294  632 L
+5390  575 mt 5510  575 L
+5450  515 mt 5450  635 L
+5545  581 mt 5665  581 L
+5605  521 mt 5605  641 L
+5701  588 mt 5821  588 L
+5761  528 mt 5761  648 L
+5856  599 mt 5976  599 L
+5916  539 mt 5916  659 L
+6012  613 mt 6132  613 L
+6072  553 mt 6072  673 L
+6167  632 mt 6287  632 L
+6227  572 mt 6227  692 L
+6322  656 mt 6442  656 L
+6382  596 mt 6382  716 L
+6478  688 mt 6598  688 L
+6538  628 mt 6538  748 L
+6633  728 mt 6753  728 L
+6693  668 mt 6693  788 L
+6789  777 mt 6909  777 L
+6849  717 mt 6849  837 L
+6944  837 mt 7064  837 L
+7004  777 mt 7004  897 L
+7100  909 mt 7220  909 L
+7160  849 mt 7160  969 L
+7255  994 mt 7375  994 L
+7315  934 mt 7315 1054 L
+7411 1092 mt 7531 1092 L
+7471 1032 mt 7471 1152 L
+7566 1206 mt 7686 1206 L
+7626 1146 mt 7626 1266 L
+7722 1336 mt 7842 1336 L
+7782 1276 mt 7782 1396 L
+7877 1483 mt 7997 1483 L
+7937 1423 mt 7937 1543 L
+8032 1648 mt 8152 1648 L
+8092 1588 mt 8092 1708 L
+8188 1831 mt 8308 1831 L
+8248 1771 mt 8248 1891 L
+8343 2034 mt 8463 2034 L
+8403 1974 mt 8403 2094 L
+8499 2255 mt 8619 2255 L
+8559 2195 mt 8559 2315 L
+8654 2497 mt 8774 2497 L
+8714 2437 mt 8714 2557 L
+8810 2759 mt 8930 2759 L
+8870 2699 mt 8870 2819 L
+8965 3042 mt 9085 3042 L
+9025 2982 mt 9025 3102 L
+9121 3346 mt 9241 3346 L
+9181 3286 mt 9181 3406 L
+9276 3671 mt 9396 3671 L
+9336 3611 mt 9336 3731 L
+9431 4017 mt 9551 4017 L
+9491 3957 mt 9491 4077 L
+9587 4385 mt 9707 4385 L
+9647 4325 mt 9647 4445 L
+9742 4774 mt 9862 4774 L
+9802 4714 mt 9802 4834 L
+1522  524 mt 1606  608 L
+1606  524 mt 1522  608 L
+1677  524 mt 1761  608 L
+1761  524 mt 1677  608 L
+1832  524 mt 1916  608 L
+1916  524 mt 1832  608 L
+1988  524 mt 2072  608 L
+2072  524 mt 1988  608 L
+2143  524 mt 2227  608 L
+2227  524 mt 2143  608 L
+2299  524 mt 2383  608 L
+2383  524 mt 2299  608 L
+2454  524 mt 2538  608 L
+2538  524 mt 2454  608 L
+2610  524 mt 2694  608 L
+2694  524 mt 2610  608 L
+2765  524 mt 2849  608 L
+2849  524 mt 2765  608 L
+2921  524 mt 3005  608 L
+3005  524 mt 2921  608 L
+3076  524 mt 3160  608 L
+3160  524 mt 3076  608 L
+3231  524 mt 3315  608 L
+3315  524 mt 3231  608 L
+3387  524 mt 3471  608 L
+3471  524 mt 3387  608 L
+3542  524 mt 3626  608 L
+3626  524 mt 3542  608 L
+3698  524 mt 3782  608 L
+3782  524 mt 3698  608 L
+3853  524 mt 3937  608 L
+3937  524 mt 3853  608 L
+4009  524 mt 4093  608 L
+4093  524 mt 4009  608 L
+4164  524 mt 4248  608 L
+4248  524 mt 4164  608 L
+4320  524 mt 4404  608 L
+4404  524 mt 4320  608 L
+4475  524 mt 4559  608 L
+4559  524 mt 4475  608 L
+4631  524 mt 4715  608 L
+4715  524 mt 4631  608 L
+4786  525 mt 4870  609 L
+4870  525 mt 4786  609 L
+4941  526 mt 5025  610 L
+5025  526 mt 4941  610 L
+5097  528 mt 5181  612 L
+5181  528 mt 5097  612 L
+5252  530 mt 5336  614 L
+5336  530 mt 5252  614 L
+5408  533 mt 5492  617 L
+5492  533 mt 5408  617 L
+5563  539 mt 5647  623 L
+5647  539 mt 5563  623 L
+5719  546 mt 5803  630 L
+5803  546 mt 5719  630 L
+5874  557 mt 5958  641 L
+5958  557 mt 5874  641 L
+6030  571 mt 6114  655 L
+6114  571 mt 6030  655 L
+6185  590 mt 6269  674 L
+6269  590 mt 6185  674 L
+6340  614 mt 6424  698 L
+6424  614 mt 6340  698 L
+6496  646 mt 6580  730 L
+6580  646 mt 6496  730 L
+6651  686 mt 6735  770 L
+6735  686 mt 6651  770 L
+6807  735 mt 6891  819 L
+6891  735 mt 6807  819 L
+6962  795 mt 7046  879 L
+7046  795 mt 6962  879 L
+7118  867 mt 7202  951 L
+7202  867 mt 7118  951 L
+7273  952 mt 7357 1036 L
+7357  952 mt 7273 1036 L
+7429 1050 mt 7513 1134 L
+7513 1050 mt 7429 1134 L
+7584 1164 mt 7668 1248 L
+7668 1164 mt 7584 1248 L
+7740 1294 mt 7824 1378 L
+7824 1294 mt 7740 1378 L
+7895 1441 mt 7979 1525 L
+7979 1441 mt 7895 1525 L
+8050 1606 mt 8134 1690 L
+8134 1606 mt 8050 1690 L
+8206 1789 mt 8290 1873 L
+8290 1789 mt 8206 1873 L
+8361 1992 mt 8445 2076 L
+8445 1992 mt 8361 2076 L
+8517 2213 mt 8601 2297 L
+8601 2213 mt 8517 2297 L
+8672 2455 mt 8756 2539 L
+8756 2455 mt 8672 2539 L
+8828 2717 mt 8912 2801 L
+8912 2717 mt 8828 2801 L
+8983 3000 mt 9067 3084 L
+9067 3000 mt 8983 3084 L
+9139 3304 mt 9223 3388 L
+9223 3304 mt 9139 3388 L
+9294 3629 mt 9378 3713 L
+9378 3629 mt 9294 3713 L
+9449 3975 mt 9533 4059 L
+9533 3975 mt 9449 4059 L
+9605 4343 mt 9689 4427 L
+9689 4343 mt 9605 4427 L
+9760 4732 mt 9844 4816 L
+9844 4732 mt 9760 4816 L
+gr
+
+gs 1564 565 9328 6151 rc
+gr
+
+0 sg
+%%IncludeResource: font Helvetica
+/Helvetica /WindowsLatin1Encoding 120 FMSR
+
+6083 7004 mt 
+(SINR) s
+1223 3799 mt  -90 rotate
+(BLER) s
+90 rotate
+1547 6758 mt 
+( ) s
+10875  607 mt 
+( ) s
+6 w
+1 sg
+0 2058 1696 0 0 -2058 1601 6675 4 MP
+PP
+-1696 0 0 2058 1696 0 0 -2058 1601 6675 5 MP stroke
+4 w
+DO
+SO
+6 w
+0 sg
+1601 4617 mt 3297 4617 L
+1601 6675 mt 3297 6675 L
+3297 6675 mt 3297 4617 L
+1601 6675 mt 1601 4617 L
+1601 6675 mt 3297 6675 L
+1601 6675 mt 1601 4617 L
+1601 4617 mt 3297 4617 L
+1601 6675 mt 3297 6675 L
+3297 6675 mt 3297 4617 L
+1601 6675 mt 1601 4617 L
+2073 4764 mt 
+(TB = 6000 \(AWGN\)) s
+gs 1601 4617 1697 2059 rc