A Discrete-Event Network Simulator
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
15using namespace ns3;
16
17void Print(ComponentCarrier cc);
18
19int
20main(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
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
43
45
46 // GtkConfigStore config;
47 // config.ConfigureAttributes ();
48
50 return 0;
51}
52
53void
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}
Parse command-line arguments.
ComponentCarrier Object, it defines a single Carrier This is the parent class for both ComponentCarri...
uint32_t GetDlEarfcn() const
uint16_t GetUlBandwidth() const
uint16_t GetDlBandwidth() const
uint32_t GetUlEarfcn() const
bool IsPrimary() const
Checks if the carrier is the primary carrier.
Smart pointer class similar to boost::intrusive_ptr.
static void Destroy()
Execute the events scheduled with ScheduleDestroy().
Definition simulator.cc:131
static void Run()
Run the simulation.
Definition simulator.cc:167
static void Stop()
Tell the Simulator the calling event should be the last one executed.
Definition simulator.cc:175
Hold an unsigned integer type.
Definition uinteger.h:34
void SetDefault(std::string name, const AttributeValue &value)
Definition config.cc:883
Ptr< T > CreateObject(Args &&... args)
Create an object by type, with varying number of constructor parameters.
Definition object.h:619
Time Seconds(double value)
Construct a Time in the indicated unit.
Definition nstime.h:1308
void Print(ComponentCarrier cc)
Every class exported by the ns3 library is enclosed in the ns3 namespace.