src/buildings/test/buildings-pathloss-test.cc
author Marco Miozzo <marco.miozzo@cttc.es>
Mon, 03 Jun 2013 17:01:52 +0200
changeset 10080 1b36e2276e15
parent 9266 d26408b17360
child 10081 f0879d02aafd
permissions -rw-r--r--
Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     1
/* -*-  Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     2
/*
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     3
 * Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     4
 *
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License version 2 as
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     7
 * published by the Free Software Foundation;
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     8
 *
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    12
 * GNU General Public License for more details.
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    13
 *
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    17
 *
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    18
 * Author: Marco Miozzo <marco.miozzo@cttc.es>
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
    19
 *         Nicola Baldo <nbaldo@cttc.es>
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    20
 */
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    21
8248
986f7db9f056 Move Buildings related class to buildings folder
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8245
diff changeset
    22
#include <ns3/simulator.h>
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    23
8248
986f7db9f056 Move Buildings related class to buildings folder
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8245
diff changeset
    24
#include <ns3/log.h>
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    25
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
    26
#include <ns3/buildings-helper.h>
8822
49d3a0979d43 fixed Bug 1439 - exclude headers for tests from installation
Nicola Baldo <nbaldo@cttc.es>
parents: 8769
diff changeset
    27
#include <ns3/string.h>
49d3a0979d43 fixed Bug 1439 - exclude headers for tests from installation
Nicola Baldo <nbaldo@cttc.es>
parents: 8769
diff changeset
    28
#include <ns3/double.h>
8193
4aa1c097a00e LtePathlossModelTestSuite on-going work
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8192
diff changeset
    29
#include <ns3/building.h>
8208
20a270bed353 Basic compound test implemented (single pathloss models, no combination)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8206
diff changeset
    30
#include <ns3/enum.h>
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
    31
#include <ns3/constant-position-mobility-model.h>
8248
986f7db9f056 Move Buildings related class to buildings folder
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8245
diff changeset
    32
8822
49d3a0979d43 fixed Bug 1439 - exclude headers for tests from installation
Nicola Baldo <nbaldo@cttc.es>
parents: 8769
diff changeset
    33
#include "buildings-pathloss-test.h"
49d3a0979d43 fixed Bug 1439 - exclude headers for tests from installation
Nicola Baldo <nbaldo@cttc.es>
parents: 8769
diff changeset
    34
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    35
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
    36
8248
986f7db9f056 Move Buildings related class to buildings folder
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8245
diff changeset
    37
NS_LOG_COMPONENT_DEFINE ("BuildingsPathlossTest");
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    38
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
    39
namespace ns3 {
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    40
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    41
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    42
/**
8248
986f7db9f056 Move Buildings related class to buildings folder
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8245
diff changeset
    43
 * Test 1.1 BuildingsPathlossModel Pathloss compound test
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    44
 */
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    45
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    46
/**
8210
cb2fc96c5534 Lte BuildingPathlossModel compound test polishing
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8209
diff changeset
    47
 * This TestSuite tests the BuildingPathlossModel by reproducing
cb2fc96c5534 Lte BuildingPathlossModel compound test polishing
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8209
diff changeset
    48
 * several communication scenarios 
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    49
 */
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    50
8211
1f846c65ed78 Bug-fix BuildingPathlossModel update unit of distance in OH model and in its test
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8210
diff changeset
    51
8248
986f7db9f056 Move Buildings related class to buildings folder
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8245
diff changeset
    52
BuildingsPathlossTestSuite::BuildingsPathlossTestSuite ()
986f7db9f056 Move Buildings related class to buildings folder
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8245
diff changeset
    53
  : TestSuite ("buildings-pathloss-test", SYSTEM)
8211
1f846c65ed78 Bug-fix BuildingPathlossModel update unit of distance in OH model and in its test
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8210
diff changeset
    54
{
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
    55
8248
986f7db9f056 Move Buildings related class to buildings folder
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8245
diff changeset
    56
  LogComponentEnable ("BuildingsPathlossTest", LOG_LEVEL_ALL);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    57
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    58
  double freq = 869e6;  // E_UTRA BAND #5 see table 5.5-1 of 36.101
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    59
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
    60
  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, LargeCity, 137.93, "OH Urban Large city"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    61
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
    62
  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, SmallCity, 137.88, "OH Urban small city"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    63
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
    64
  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, SubUrbanEnvironment, LargeCity, 128.03, "loss OH SubUrban"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    65
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
    66
  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, OpenAreasEnvironment, LargeCity, 110.21, "loss OH OpenAreas"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    67
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
    68
  // Test #2 COST231 Model (1500 < freq < 2000~2170 MHz) (Macro<->UE)
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    69
8208
20a270bed353 Basic compound test implemented (single pathloss models, no combination)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8206
diff changeset
    70
  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    71
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
    72
  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, LargeCity, 148.55, "COST231 Urban Large city"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    73
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
    74
  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, SmallCity, 150.64, "COST231 Urban small city and suburban"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    75
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
    76
  // Test #3 2.6 GHz model (Macro<->UE)
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    77
8208
20a270bed353 Basic compound test implemented (single pathloss models, no combination)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8206
diff changeset
    78
  freq = 2.620e9; // E_UTRA BAND #7 see table 5.5-1 of 36.101
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    79
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
    80
  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 2, UrbanEnvironment, SmallCity, 121.83, "2.6GHz model"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    81
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
    82
  // Test #4 ITU1411 LOS model (Macro<->UE)
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    83
8208
20a270bed353 Basic compound test implemented (single pathloss models, no combination)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8206
diff changeset
    84
  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
    85
  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 3, UrbanEnvironment, LargeCity, 81.00, "ITU1411 LOS"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    86
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
    87
  // Test #5 ITU1411 NLOS model (Macro<->UE)
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    88
8208
20a270bed353 Basic compound test implemented (single pathloss models, no combination)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8206
diff changeset
    89
  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
    90
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
    91
  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 4, UrbanEnvironment, LargeCity, 143.69, "ITU1411 NLOS"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    92
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
    93
  // Test #6 ITUP1238 (HeNB <-> UE)
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    94
8208
20a270bed353 Basic compound test implemented (single pathloss models, no combination)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8206
diff changeset
    95
  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
    96
  AddTestCase (new BuildingsPathlossTestCase (freq, 5, 6, UrbanEnvironment, LargeCity, 88.3855, "ITUP1238"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    97
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
    98
  // Test #7 Outdoor -> Indoor OkumuraHata (Macro<->UE)
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
    99
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   100
  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   101
  // The loss is as in test #2 (large city) plus the building penetration loss
8211
1f846c65ed78 Bug-fix BuildingPathlossModel update unit of distance in OH model and in its test
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8210
diff changeset
   102
  // which for ConcreteWithWindows is equal to 7 dB -> 148.55 + 7 = 155.55
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
   103
  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 7, UrbanEnvironment, LargeCity, 155.55, "Okumura Hata Outdoor -> Indoor"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
   104
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   105
  // Test #8 Outdoor -> Indoor ITU1411 (Macro<->UE)
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   106
  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   107
  // The loss is as in test #4 plus the building penetration loss
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   108
  // which for ConcreteWithWindows is equal to 7 dB -> 81.000 + 7 = 88.000
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
   109
  AddTestCase (new BuildingsPathlossTestCase (freq, 1, 8, UrbanEnvironment, LargeCity, 88.000, "ITU1411 LOS Outdoor -> Indoor"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
   110
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   111
  // Test #9 Indoor -> Outdoor LOS (HeNB <-> UE)
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
   112
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   113
  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   114
  // The loss is similar of test #4 plus the building penetration loss
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   115
  // which for ConcreteWithWindows is equal to 7 dB and the height gain
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   116
  // (2 floors x 2 dB/floor = 4) -> 81.838 + 7 - 4 = 84.838
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
   117
  AddTestCase (new BuildingsPathlossTestCase (freq, 9, 10, UrbanEnvironment, LargeCity, 84.838, "ITU1411 LOS Indoor -> Outdoor"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
   118
8210
cb2fc96c5534 Lte BuildingPathlossModel compound test polishing
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8209
diff changeset
   119
  // Test #10 Indoor -> Outdoor NLOS (HeNB <-> UE)
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
   120
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   121
  freq = 2.1140e9; // E_UTRA BAND #1 see table 5.5-1 of 36.101
8215
f0114df556fc Minor changes to comments in lte-test-pathloss-model
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8213
diff changeset
   122
  // The loss is similar as in test #4 plus the building penetration loss
8209
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   123
  // which for ConcreteWithWindows is equal to 7 dB and the height gain
7a795d377e61 Finalized pathloss model compound test: passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8208
diff changeset
   124
  // (2 floors x 2 dB/floor = 4) -> 180.90 + 7 - 4 = 183.90
9266
d26408b17360 bug 1563: get rid of default argument value in AddTestCase
Nicola Baldo <nbaldo@cttc.es>
parents: 8822
diff changeset
   125
  AddTestCase (new BuildingsPathlossTestCase (freq, 9, 11, UrbanEnvironment, LargeCity, 183.90, "ITU1411 NLOS Indoor -> Outdoor"), TestCase::QUICK);
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
   126
8213
7746b2e4bffc BuildingPathlossModel system test finalized and passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8211
diff changeset
   127
7746b2e4bffc BuildingPathlossModel system test finalized and passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8211
diff changeset
   128
}
7746b2e4bffc BuildingPathlossModel system test finalized and passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8211
diff changeset
   129
7746b2e4bffc BuildingPathlossModel system test finalized and passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8211
diff changeset
   130
7746b2e4bffc BuildingPathlossModel system test finalized and passed
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8211
diff changeset
   131
8248
986f7db9f056 Move Buildings related class to buildings folder
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8245
diff changeset
   132
static BuildingsPathlossTestSuite buildingsPathlossTestSuite;
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   133
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   134
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   135
/**
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   136
 * TestCase
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   137
 */
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   138
8734
403c6e61d201 decouple most propagation models from buildings module
Nicola Baldo <nbaldo@cttc.es>
parents: 8661
diff changeset
   139
BuildingsPathlossTestCase::BuildingsPathlossTestCase (double freq, uint16_t m1, uint16_t m2, EnvironmentType env, CitySize city, double refValue, std::string name)
8192
0d4ca39493cb LtePathlossModelTestSuite first draft (compile and run)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8191
diff changeset
   140
  : TestCase ("LOSS calculation: " + name),
8208
20a270bed353 Basic compound test implemented (single pathloss models, no combination)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8206
diff changeset
   141
    m_freq (freq),
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   142
    m_mobilityModelIndex1 (m1),
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   143
    m_mobilityModelIndex2 (m2),
8208
20a270bed353 Basic compound test implemented (single pathloss models, no combination)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8206
diff changeset
   144
    m_env (env),
20a270bed353 Basic compound test implemented (single pathloss models, no combination)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8206
diff changeset
   145
    m_city (city),
8192
0d4ca39493cb LtePathlossModelTestSuite first draft (compile and run)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8191
diff changeset
   146
    m_lossRef (refValue)
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   147
{
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   148
}
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   149
8248
986f7db9f056 Move Buildings related class to buildings folder
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8245
diff changeset
   150
BuildingsPathlossTestCase::~BuildingsPathlossTestCase ()
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   151
{
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   152
}
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   153
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   154
void
8248
986f7db9f056 Move Buildings related class to buildings folder
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8245
diff changeset
   155
BuildingsPathlossTestCase::DoRun (void)
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   156
{
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   157
  NS_LOG_FUNCTION (this);
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   158
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   159
  // the building basically occupies the negative x plane, so any node
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   160
  // in this area will fall in the building 
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   161
  Ptr<Building> building1 = CreateObject<Building> ();
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   162
  building1->SetBoundaries (Box (-3000, -1, -4000, 4000.0, 0.0, 12));
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   163
  building1->SetBuildingType (Building::Residential);
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   164
  building1->SetExtWallsType (Building::ConcreteWithWindows);
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   165
  building1->SetNFloors (3);
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   166
  
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   167
  Ptr<MobilityModel> mma = CreateMobilityModel (m_mobilityModelIndex1);
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   168
  Ptr<MobilityModel> mmb = CreateMobilityModel (m_mobilityModelIndex2);
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   169
8643
3c7d21485f21 Update BuildingPropagationLossModel for working in Hybrid and Simple modes
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8344
diff changeset
   170
  Ptr<HybridBuildingsPropagationLossModel> propagationLossModel = CreateObject<HybridBuildingsPropagationLossModel> ();
8317
2ec35f16dc11 buildings does not depend on spectrum any more
Nicola Baldo <nbaldo@cttc.es>
parents: 8253
diff changeset
   171
  propagationLossModel->SetAttribute ("Frequency", DoubleValue (m_freq));
2ec35f16dc11 buildings does not depend on spectrum any more
Nicola Baldo <nbaldo@cttc.es>
parents: 8253
diff changeset
   172
  propagationLossModel->SetAttribute ("Environment", EnumValue (m_env));
2ec35f16dc11 buildings does not depend on spectrum any more
Nicola Baldo <nbaldo@cttc.es>
parents: 8253
diff changeset
   173
  propagationLossModel->SetAttribute ("CitySize", EnumValue (m_city));
8233
0b9d402b3b1d Update pathloss test for removing shadowing component
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8215
diff changeset
   174
  // cancel shadowing effect
8317
2ec35f16dc11 buildings does not depend on spectrum any more
Nicola Baldo <nbaldo@cttc.es>
parents: 8253
diff changeset
   175
  propagationLossModel->SetAttribute ("ShadowSigmaOutdoor", DoubleValue (0.0));
2ec35f16dc11 buildings does not depend on spectrum any more
Nicola Baldo <nbaldo@cttc.es>
parents: 8253
diff changeset
   176
  propagationLossModel->SetAttribute ("ShadowSigmaIndoor", DoubleValue (0.0));
2ec35f16dc11 buildings does not depend on spectrum any more
Nicola Baldo <nbaldo@cttc.es>
parents: 8253
diff changeset
   177
  propagationLossModel->SetAttribute ("ShadowSigmaExtWalls", DoubleValue (0.0));
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
   178
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   179
  double loss = propagationLossModel->GetLoss (mma, mmb);
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   180
8192
0d4ca39493cb LtePathlossModelTestSuite first draft (compile and run)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8191
diff changeset
   181
  NS_LOG_INFO ("Calculated loss: " << loss);
0d4ca39493cb LtePathlossModelTestSuite first draft (compile and run)
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8191
diff changeset
   182
  NS_LOG_INFO ("Theoretical loss: " << m_lossRef);
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   183
 
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
   184
  NS_TEST_ASSERT_MSG_EQ_TOL (loss, m_lossRef, 0.1, "Wrong loss !");
8344
334bc41a98de buildings-pathloss-test now passing valgrind test
Nicola Baldo <nbaldo@cttc.es>
parents: 8332
diff changeset
   185
  Simulator::Destroy ();
8189
dde497458c54 Add pathloss test
Marco Miozzo <marco.miozzo@cttc.es>
parents:
diff changeset
   186
}
8211
1f846c65ed78 Bug-fix BuildingPathlossModel update unit of distance in OH model and in its test
Marco Miozzo <marco.miozzo@cttc.es>
parents: 8210
diff changeset
   187
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   188
Ptr<MobilityModel>
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   189
BuildingsPathlossTestCase::CreateMobilityModel (uint16_t index)
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   190
{
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   191
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   192
  /*
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   193
   * The purpose of this method is to defer the creation of the
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   194
   * MobilityModel instances to when DoRun() is called. In a previous
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   195
   * version, MobilityModel instances where created directly in the
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   196
   * constructor of the test suite, which caused subtle bugs due to
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   197
   * "static initialization order fiasco". An example of such a subtle
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   198
   * bug is that logging via NS_LOG failed for some modules.
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   199
   * 
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   200
   */
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   201
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   202
  double hm = 1;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   203
  double hb = 30;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   204
  double henbHeight = 10.0;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   205
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   206
  Ptr<MobilityModel> mm;
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   207
  
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   208
  switch (index)
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   209
    {
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   210
    case 1:
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   211
      mm = CreateObject<ConstantPositionMobilityModel> ();
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   212
      mm->SetPosition (Vector (0.0, 0.0, hb));
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   213
      break;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   214
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   215
    case 2:
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   216
      mm = CreateObject<ConstantPositionMobilityModel> ();
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   217
      mm->SetPosition (Vector (2000, 0.0, hm));
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   218
      break;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   219
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   220
    case 3:
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   221
      mm = CreateObject<ConstantPositionMobilityModel> ();
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   222
      mm->SetPosition (Vector (100, 0.0, hm));
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   223
      break;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   224
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   225
    case 4:
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   226
      mm = CreateObject<ConstantPositionMobilityModel> ();
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   227
      mm->SetPosition (Vector (900, 0.0, hm));
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
   228
      break;
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   229
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   230
    case 5:
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   231
      mm = CreateObject<ConstantPositionMobilityModel> ();
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   232
      mm->SetPosition (Vector (-5, 0.0, hm));
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   233
      break;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   234
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   235
    case 6:
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   236
      mm = CreateObject<ConstantPositionMobilityModel> ();
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   237
      mm->SetPosition (Vector (-5, 30, henbHeight));
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   238
      break;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   239
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   240
    case 7:
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   241
      mm = CreateObject<ConstantPositionMobilityModel> ();
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   242
      mm->SetPosition (Vector (-2000, 0.0, hm));
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   243
      break;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   244
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   245
    case 8:
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   246
      mm = CreateObject<ConstantPositionMobilityModel> ();
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   247
      mm->SetPosition (Vector (-100, 0.0, hm));
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   248
      break;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   249
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   250
    case 9:
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   251
      mm = CreateObject<ConstantPositionMobilityModel> ();
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   252
      mm->SetPosition (Vector (0, 0.0, hm));
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   253
      break;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   254
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   255
    case 10:
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   256
      mm = CreateObject<ConstantPositionMobilityModel> ();
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   257
      mm->SetPosition (Vector (-100, 0.0, henbHeight));
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   258
      break;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   259
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   260
    case 11:
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   261
      mm = CreateObject<ConstantPositionMobilityModel> ();
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   262
      mm->SetPosition (Vector (-500, 0.0, henbHeight));
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   263
      break;
8332
c6d3c7862cfb Style fixed in buildings module
mmiozzo
parents: 8318
diff changeset
   264
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   265
    default:
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   266
      mm = 0;
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   267
      break;
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   268
    }
10080
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   269
  Ptr<MobilityBuildingInfo> buildingInfo = CreateObject<MobilityBuildingInfo> ();
1b36e2276e15 Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents: 9266
diff changeset
   270
  mm->AggregateObject (buildingInfo); // operation usually done by BuildingsHelper::Install
8769
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   271
  BuildingsHelper::MakeConsistent (mm); 
292e9e8345cf remove BuildingsMobilityModel setters that don't allow consistency checking
Nicola Baldo <nbaldo@cttc.es>
parents: 8734
diff changeset
   272
  return mm;
8318
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   273
}
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   274
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   275
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   276
368cccf883a6 fixes bug LENA-174: NS_LOG does not work for some log component with test-runner
Nicola Baldo <nbaldo@cttc.es>
parents: 8317
diff changeset
   277
} // namespace ns3