author | Marco Miozzo <marco.miozzo@cttc.es> |
Mon, 03 Jun 2013 17:01:52 +0200 | |
changeset 10080 | 1b36e2276e15 |
parent 9562 | 691b97de80ed |
permissions | -rw-r--r-- |
7886 | 1 |
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */ |
2 |
/* |
|
3 |
* Copyright (c) 2011 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC) |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License version 2 as |
|
7 |
* published by the Free Software Foundation; |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
|
17 |
* |
|
18 |
* Author: Manuel Requena <manuel.requena@cttc.es> |
|
19 |
*/ |
|
20 |
||
21 |
||
22 |
#include "ns3/core-module.h" |
|
23 |
#include "ns3/network-module.h" |
|
24 |
#include "ns3/mobility-module.h" |
|
25 |
#include "ns3/lte-module.h" |
|
7951
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
26 |
#include "ns3/config-store.h" |
10080
1b36e2276e15
Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9562
diff
changeset
|
27 |
#include <ns3/buildings-helper.h> |
7948 | 28 |
//#include "ns3/gtk-config-store.h" |
8429 | 29 |
|
7886 | 30 |
using namespace ns3; |
31 |
||
32 |
int main (int argc, char *argv[]) |
|
7951
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
33 |
{ |
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
34 |
CommandLine cmd; |
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
35 |
cmd.Parse (argc, argv); |
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
36 |
|
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
37 |
// to save a template default attribute file run it like this: |
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
38 |
// ./waf --command-template="%s --ns3::ConfigStore::Filename=input-defaults.txt --ns3::ConfigStore::Mode=Save --ns3::ConfigStore::FileFormat=RawText" --run src/lte/examples/lena-first-sim |
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
39 |
// |
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
40 |
// to load a previously created default attribute file |
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
41 |
// ./waf --command-template="%s --ns3::ConfigStore::Filename=input-defaults.txt --ns3::ConfigStore::Mode=Load --ns3::ConfigStore::FileFormat=RawText" --run src/lte/examples/lena-first-sim |
7969
1b162a42b331
refined inter-cell-interference example
Nicola Baldo <nbaldo@cttc.es>
parents:
7951
diff
changeset
|
42 |
|
7951
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
43 |
ConfigStore inputConfig; |
ccc70861daa0
restored input file functionality removed by changeset 6950:7a7b4ad007b0
Nicola Baldo <nbaldo@cttc.es>
parents:
7948
diff
changeset
|
44 |
inputConfig.ConfigureDefaults (); |
8149 | 45 |
|
8429 | 46 |
// Parse again so you can override default values from the command line |
7969
1b162a42b331
refined inter-cell-interference example
Nicola Baldo <nbaldo@cttc.es>
parents:
7951
diff
changeset
|
47 |
cmd.Parse (argc, argv); |
8149 | 48 |
|
8460
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8429
diff
changeset
|
49 |
Ptr<LteHelper> lteHelper = CreateObject<LteHelper> (); |
9386
24df31b77b25
PhyStats calculator implementation. All code needed added to LteHelper. Prototype order changed in order to respect cellId,IMSI, rnti
Jaume Nin
parents:
9337
diff
changeset
|
50 |
|
8429 | 51 |
// Uncomment to enable logging |
9386
24df31b77b25
PhyStats calculator implementation. All code needed added to LteHelper. Prototype order changed in order to respect cellId,IMSI, rnti
Jaume Nin
parents:
9337
diff
changeset
|
52 |
// lteHelper->EnableLogComponents (); |
8149 | 53 |
|
7886 | 54 |
// Create Nodes: eNodeB and UE |
55 |
NodeContainer enbNodes; |
|
56 |
NodeContainer ueNodes; |
|
57 |
enbNodes.Create (1); |
|
7934
0f09fc707a8c
Convert UL-CQI from IdealControlMessage to PhySap Primitive
mmiozzo
parents:
7931
diff
changeset
|
58 |
ueNodes.Create (1); |
7886 | 59 |
|
60 |
// Install Mobility Model |
|
61 |
MobilityHelper mobility; |
|
10080
1b36e2276e15
Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9562
diff
changeset
|
62 |
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); |
7886 | 63 |
mobility.Install (enbNodes); |
10080
1b36e2276e15
Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9562
diff
changeset
|
64 |
BuildingsHelper::Install (enbNodes); |
1b36e2276e15
Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9562
diff
changeset
|
65 |
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel"); |
7886 | 66 |
mobility.Install (ueNodes); |
10080
1b36e2276e15
Move from BuildingsMobilityModel to BuildingMobilityInfo source, tests and examples
Marco Miozzo <marco.miozzo@cttc.es>
parents:
9562
diff
changeset
|
67 |
BuildingsHelper::Install (ueNodes); |
7886 | 68 |
|
69 |
// Create Devices and install them in the Nodes (eNB and UE) |
|
70 |
NetDeviceContainer enbDevs; |
|
71 |
NetDeviceContainer ueDevs; |
|
8429 | 72 |
// Default scheduler is PF, uncomment to use RR |
8460
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8429
diff
changeset
|
73 |
//lteHelper->SetSchedulerType ("ns3::RrFfMacScheduler"); |
8429 | 74 |
|
8460
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8429
diff
changeset
|
75 |
enbDevs = lteHelper->InstallEnbDevice (enbNodes); |
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8429
diff
changeset
|
76 |
ueDevs = lteHelper->InstallUeDevice (ueNodes); |
7886 | 77 |
|
78 |
// Attach a UE to a eNB |
|
8460
fbb53bda0ec7
renamed LenaHelper --> LteHelper
Nicola Baldo <nbaldo@cttc.es>
parents:
8429
diff
changeset
|
79 |
lteHelper->Attach (ueDevs, enbDevs.Get (0)); |
7886 | 80 |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8540
diff
changeset
|
81 |
// Activate a data radio bearer |
7886 | 82 |
enum EpsBearer::Qci q = EpsBearer::GBR_CONV_VOICE; |
83 |
EpsBearer bearer (q); |
|
9337
ae7126b266ce
revised LTE protocol stack for new RRC model
Nicola Baldo <nbaldo@cttc.es>
parents:
8540
diff
changeset
|
84 |
lteHelper->ActivateDataRadioBearer (ueDevs, bearer); |
9524
74fa21d85a52
enable traces correctly in lena-simple
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
85 |
lteHelper->EnableTraces (); |
74fa21d85a52
enable traces correctly in lena-simple
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
86 |
|
74fa21d85a52
enable traces correctly in lena-simple
Nicola Baldo <nbaldo@cttc.es>
parents:
9497
diff
changeset
|
87 |
Simulator::Stop (Seconds (1.05)); |
7886 | 88 |
|
7943
db21a8048ab9
PfFfMacScheduler update reception of UL-CQI coherently with previous allocation
mmiozzo
parents:
7934
diff
changeset
|
89 |
Simulator::Run (); |
7903
eed953cd94a0
Fix some typos and bugs on the attribute to map implementation
jnin
parents:
7895
diff
changeset
|
90 |
|
9388 | 91 |
// GtkConfigStore config; |
92 |
// config.ConfigureAttributes (); |
|
7948 | 93 |
|
7886 | 94 |
Simulator::Destroy (); |
95 |
return 0; |
|
96 |
} |