sat-rayleigh-example.cc
Go to the documentation of this file.
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2014 Magister Solutions
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: Frans Laakso <frans.laakso@magister.fi>
19  *
20  */
21 
22 #include "ns3/core-module.h"
23 #include "ns3/satellite-module.h"
24 
25 using namespace ns3;
26 
36 NS_LOG_COMPONENT_DEFINE("sat-rayleigh-example");
37 
38 int
39 main(int argc, char* argv[])
40 {
42  LogComponentEnable("sat-rayleigh-example", LOG_LEVEL_INFO);
43  LogComponentEnable("SatRayleighModel", LOG_LEVEL_INFO);
44 
46  Config::SetDefault("ns3::SatEnvVariables::SimulationCampaignName",
47  StringValue("example-rayleigh"));
48  Config::SetDefault("ns3::SatEnvVariables::SimulationTag", StringValue(""));
49  Config::SetDefault("ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(true));
50 
52  Ptr<SatRayleighConf> rayleighConf = CreateObject<SatRayleighConf>();
53  Ptr<SatRayleighModel> rayleighFader = CreateObject<SatRayleighModel>(rayleighConf, 0, 0);
54 
56  for (uint32_t i = 0; i < 1000; i++)
57  {
58  Simulator::Schedule(Time(500000 + i * 500000),
60  rayleighFader);
61  }
62 
63  Simulator::Run();
64  Simulator::Destroy();
65 
66  return 0;
67 }
double GetChannelGainDb()
Function for returning the channel gain in dB.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.