A Discrete-Event Network Simulator
Home
Tutorials ▼
English
Documentation ▼
Installation
Manual
Models
Contributing
Wiki
Development ▼
API Docs
Issue Tracker
Merge Requests
API
Loading...
Searching...
No Matches
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
* SPDX-License-Identifier: GPL-2.0-only
5
*
6
* Author: Danilo Abrignani <danilo.abrignani@unibo.it>
7
*/
8
9
#include "ns3/cc-helper.h"
10
#include "ns3/component-carrier.h"
11
#include "ns3/core-module.h"
12
#include <ns3/buildings-helper.h>
13
// #include "ns3/config-store.h"
14
15
using namespace
ns3
;
16
17
void
Print
(
ComponentCarrier
cc);
18
19
int
20
main(
int
argc,
char
* argv[])
21
{
22
CommandLine
cmd
(__FILE__);
23
cmd
.Parse(argc, argv);
24
25
Config::SetDefault
(
"ns3::ComponentCarrier::UlBandwidth"
,
UintegerValue
(50));
26
Config::SetDefault
(
"ns3::ComponentCarrier::PrimaryCarrier"
,
BooleanValue
(
true
));
27
28
// Parse again so you can override default values from the command line
29
cmd
.Parse(argc, argv);
30
31
Ptr<CcHelper>
cch =
CreateObject<CcHelper>
();
32
cch->SetNumberOfComponentCarriers(2);
33
34
std::map<uint8_t, ComponentCarrier> ccm = cch->EquallySpacedCcs();
35
36
std::cout <<
" CcMap size "
<< ccm.size() << std::endl;
37
for
(
auto
it = ccm.begin(); it != ccm.end(); it++)
38
{
39
Print
(it->second);
40
}
41
42
Simulator::Stop
(
Seconds
(1.05));
43
44
Simulator::Run
();
45
46
// GtkConfigStore config;
47
// config.ConfigureAttributes ();
48
49
Simulator::Destroy
();
50
return
0;
51
}
52
53
void
54
Print
(
ComponentCarrier
cc)
55
{
56
std::cout <<
" UlBandwidth "
<< uint16_t(cc.
GetUlBandwidth
()) <<
" DlBandwidth "
57
<< uint16_t(cc.
GetDlBandwidth
()) <<
" Dl Earfcn "
<< cc.
GetDlEarfcn
() <<
" Ul Earfcn "
58
<< cc.
GetUlEarfcn
() <<
" - Is this the Primary Channel? "
<< cc.
IsPrimary
()
59
<< std::endl;
60
}
ns3::BooleanValue
Definition
boolean.h:26
ns3::CommandLine
Parse command-line arguments.
Definition
command-line.h:221
ns3::ComponentCarrier
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
Definition
component-carrier.h:28
ns3::ComponentCarrier::GetDlEarfcn
uint32_t GetDlEarfcn() const
Definition
component-carrier.cc:156
ns3::ComponentCarrier::GetUlBandwidth
uint16_t GetUlBandwidth() const
Definition
component-carrier.cc:102
ns3::ComponentCarrier::GetDlBandwidth
uint16_t GetDlBandwidth() const
Definition
component-carrier.cc:129
ns3::ComponentCarrier::GetUlEarfcn
uint32_t GetUlEarfcn() const
Definition
component-carrier.cc:169
ns3::ComponentCarrier::IsPrimary
bool IsPrimary() const
Checks if the carrier is the primary carrier.
Definition
component-carrier.cc:208
ns3::Ptr
Smart pointer class similar to boost::intrusive_ptr.
Definition
mpi-test-fixtures.h:37
ns3::Simulator::Destroy
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition
simulator.cc:131
ns3::Simulator::Run
static void Run()
Run the simulation.
Definition
simulator.cc:167
ns3::Simulator::Stop
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition
simulator.cc:175
ns3::UintegerValue
Hold an unsigned integer type.
Definition
uinteger.h:34
ns3::Config::SetDefault
void SetDefault(std::string name, const AttributeValue &value)
Definition
config.cc:883
ns3::CreateObject
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition
object.h:619
ns3::Seconds
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition
nstime.h:1308
Print
void Print(ComponentCarrier cc)
Definition
lena-cc-helper.cc:54
ns3
Every class exported by the ns3 library is enclosed in the ns3 namespace.
second.cmd
cmd
Definition
second.py:29
src
lte
examples
lena-cc-helper.cc
Generated on Fri Nov 8 2024 13:59:02 for ns-3 by
1.11.0