A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Portuguese
Docs ▼
Wiki
Manual
Models
Develop ▼
API
Bugs
API
src
lte
examples
lena-cc-helper.cc
Go to the documentation of this file.
1
/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2
/*
3
* Copyright (c) 2015 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: Danilo Abrignani <danilo.abrignani@unibo.it>
19
*/
20
21
22
#include "ns3/core-module.h"
23
#include "ns3/config-store.h"
24
#include <ns3/buildings-helper.h>
25
#include "ns3/component-carrier.h"
26
#include "ns3/cc-helper.h"
27
28
using namespace
ns3
;
29
30
31
void
Print
(
ComponentCarrier
cc);
32
33
int
main (
int
argc,
char
*argv[])
34
{
35
CommandLine
cmd
;
36
cmd
.Parse (argc, argv);
37
38
Config::SetDefault
(
"ns3::ComponentCarrier::UlBandwidth"
,
UintegerValue
(50));
39
Config::SetDefault
(
"ns3::ComponentCarrier::PrimaryCarrier"
,
BooleanValue
(
true
));
40
41
// Parse again so you can override default values from the command line
42
cmd
.Parse (argc, argv);
43
44
Ptr<CcHelper>
cch = CreateObject<CcHelper> ();
45
cch->
SetNumberOfComponentCarriers
(2);
46
47
std::map< uint8_t, ComponentCarrier > ccm = cch->
EquallySpacedCcs
();
48
49
std::map< uint8_t, ComponentCarrier >::iterator it;
50
51
std::cout <<
" CcMap size "
<< ccm.size () << std::endl;
52
for
(it = ccm.begin (); it !=ccm.end (); it++)
53
{
54
Print
(it->second);
55
}
56
57
58
Simulator::Stop
(
Seconds
(1.05));
59
60
Simulator::Run
();
61
62
// GtkConfigStore config;
63
// config.ConfigureAttributes ();
64
65
Simulator::Destroy
();
66
return
0;
67
}
68
69
void
Print
(
ComponentCarrier
cc)
70
{
71
std::cout <<
" UlBandwidth "
<< uint16_t (cc.
GetUlBandwidth
())
72
<<
" DlBandwidth "
<< uint16_t (cc.
GetDlBandwidth
())
73
<<
" Dl Earfcn "
<< cc.
GetDlEarfcn
()
74
<<
" Ul Earfcn "
<< cc.
GetUlEarfcn
()
75
<<
" - Is this the Primary Channel? "
<< cc.
IsPrimary
()
76
<< std::endl;
77
}
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:73
ns3::BooleanValue
AttributeValue implementation for Boolean.
Definition:
boolean.h:36
ns3::ComponentCarrier::GetDlBandwidth
uint8_t GetDlBandwidth() const
Definition:
component-carrier.cc:137
ns3::ComponentCarrier::GetUlEarfcn
uint32_t GetUlEarfcn() const
Definition:
component-carrier.cc:177
ns3::Simulator::Run
static void Run(void)
Run the simulation.
Definition:
simulator.cc:226
second.cmd
cmd
Definition:
second.py:35
ns3::ComponentCarrier
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
Definition:
component-carrier.h:45
ns3::CcHelper::EquallySpacedCcs
std::map< uint8_t, ComponentCarrier > EquallySpacedCcs()
EquallySpacedCcs() create a valid std::map< uint8_t, Ptr<ComponentCarrier> > The Primary Component Ca...
Definition:
cc-helper.cc:172
ns3::ComponentCarrier::GetUlBandwidth
uint8_t GetUlBandwidth() const
Definition:
component-carrier.cc:110
ns3::UintegerValue
Hold an unsigned integer type.
Definition:
uinteger.h:44
ns3::CcHelper::SetNumberOfComponentCarriers
void SetNumberOfComponentCarriers(uint16_t nCc)
Set number of CCs.
Definition:
cc-helper.cc:110
ns3::CommandLine
Parse command-line arguments.
Definition:
command-line.h:213
ns3::Simulator::Destroy
static void Destroy(void)
Execute the events scheduled with ScheduleDestroy().
Definition:
simulator.cc:190
ns3::ComponentCarrier::IsPrimary
bool IsPrimary() const
Checks if the carrier is the primary carrier.
Definition:
component-carrier.cc:216
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
ns3::Simulator::Stop
static void Stop(void)
Tell the Simulator the calling event should be the last one executed.
Definition:
simulator.cc:234
Print
void Print(ComponentCarrier cc)
Definition:
lena-cc-helper.cc:69
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition:
nstime.h:1014
ns3::Config::SetDefault
void SetDefault(std::string name, const AttributeValue &value)
Definition:
config.cc:782
ns3::ComponentCarrier::GetDlEarfcn
uint32_t GetDlEarfcn() const
Definition:
component-carrier.cc:164
Generated on Wed Nov 7 2018 10:01:58 for ns-3 by
1.8.14