A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
lena-cc-helper.cc
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 Centre Tecnologic de Telecomunicacions de Catalunya (CTTC)
3
*
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License version 2 as
6
* published by the Free Software Foundation;
7
*
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
12
*
13
* You should have received a copy of the GNU General Public License
14
* along with this program; if not, write to the Free Software
15
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
*
17
* Author: Danilo Abrignani <danilo.abrignani@unibo.it>
18
*/
19
20
#include "ns3/cc-helper.h"
21
#include "ns3/component-carrier.h"
22
#include "ns3/core-module.h"
23
#include <ns3/buildings-helper.h>
24
// #include "ns3/config-store.h"
25
26
using namespace
ns3
;
27
28
void
Print
(
ComponentCarrier
cc);
29
30
int
31
main(
int
argc,
char
* argv[])
32
{
33
CommandLine
cmd
(__FILE__);
34
cmd
.Parse(argc, argv);
35
36
Config::SetDefault
(
"ns3::ComponentCarrier::UlBandwidth"
,
UintegerValue
(50));
37
Config::SetDefault
(
"ns3::ComponentCarrier::PrimaryCarrier"
,
BooleanValue
(
true
));
38
39
// Parse again so you can override default values from the command line
40
cmd
.Parse(argc, argv);
41
42
Ptr<CcHelper>
cch = CreateObject<CcHelper>();
43
cch->SetNumberOfComponentCarriers(2);
44
45
std::map<uint8_t, ComponentCarrier> ccm = cch->EquallySpacedCcs();
46
47
std::cout <<
" CcMap size "
<< ccm.size() << std::endl;
48
for
(
auto
it = ccm.begin(); it != ccm.end(); it++)
49
{
50
Print
(it->second);
51
}
52
53
Simulator::Stop
(
Seconds
(1.05));
54
55
Simulator::Run
();
56
57
// GtkConfigStore config;
58
// config.ConfigureAttributes ();
59
60
Simulator::Destroy
();
61
return
0;
62
}
63
64
void
65
Print
(
ComponentCarrier
cc)
66
{
67
std::cout <<
" UlBandwidth "
<< uint16_t(cc.
GetUlBandwidth
()) <<
" DlBandwidth "
68
<< uint16_t(cc.
GetDlBandwidth
()) <<
" Dl Earfcn "
<< cc.
GetDlEarfcn
() <<
" Ul Earfcn "
69
<< cc.
GetUlEarfcn
() <<
" - Is this the Primary Channel? "
<< cc.
IsPrimary
()
70
<< std::endl;
71
}
ns3::BooleanValue
Definition:
boolean.h:37
ns3::CommandLine
Parse command-line arguments.
Definition:
command-line.h:232
ns3::ComponentCarrier
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
Definition:
component-carrier.h:39
ns3::ComponentCarrier::GetDlEarfcn
uint32_t GetDlEarfcn() const
Definition:
component-carrier.cc:167
ns3::ComponentCarrier::GetUlBandwidth
uint16_t GetUlBandwidth() const
Definition:
component-carrier.cc:113
ns3::ComponentCarrier::GetDlBandwidth
uint16_t GetDlBandwidth() const
Definition:
component-carrier.cc:140
ns3::ComponentCarrier::GetUlEarfcn
uint32_t GetUlEarfcn() const
Definition:
component-carrier.cc:180
ns3::ComponentCarrier::IsPrimary
bool IsPrimary() const
Checks if the carrier is the primary carrier.
Definition:
component-carrier.cc:219
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition:
ptr.h:77
ns3::Simulator::Destroy
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition:
simulator.cc:142
ns3::Simulator::Run
static void Run()
Run the simulation.
Definition:
simulator.cc:178
ns3::Simulator::Stop
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition:
simulator.cc:186
ns3::UintegerValue
Hold an unsigned integer type.
Definition:
uinteger.h:45
ns3::Config::SetDefault
void SetDefault(std::string name, const AttributeValue &value)
Definition:
config.cc:890
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition:
nstime.h:1326
Print
void Print(ComponentCarrier cc)
Definition:
lena-cc-helper.cc:65
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
second.cmd
cmd
Definition:
second.py:40
src
lte
examples
lena-cc-helper.cc
Generated on Sun Mar 3 2024 17:11:01 for ns-3 by
1.9.1