sat-loo-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 
37 NS_LOG_COMPONENT_DEFINE("sat-loo-example");
38 
39 int
40 main(int argc, char* argv[])
41 {
43  LogComponentEnable("sat-loo-example", LOG_LEVEL_INFO);
44  LogComponentEnable("SatLooModel", LOG_LEVEL_INFO);
45 
47  Config::SetDefault("ns3::SatEnvVariables::SimulationCampaignName", StringValue("example-loo"));
48  Config::SetDefault("ns3::SatEnvVariables::SimulationTag", StringValue(""));
49  Config::SetDefault("ns3::SatEnvVariables::EnableSimulationOutputOverwrite", BooleanValue(true));
50 
52  Ptr<SatLooConf> looConf = CreateObject<SatLooConf>();
53 
55  Ptr<SatLooModel> looFaderLineOfSight = CreateObject<SatLooModel>(looConf, 3, 0, 0);
56  Ptr<SatLooModel> looFaderLightShadowing = CreateObject<SatLooModel>(looConf, 3, 0, 1);
57  Ptr<SatLooModel> looFaderHeavyShadowing = CreateObject<SatLooModel>(looConf, 3, 0, 2);
58 
60  for (uint32_t i = 0; i < 1000; i++)
61  {
62  Simulator::Schedule(Time(300000 + i * 500000),
64  looFaderLineOfSight);
65  Simulator::Schedule(Time(500000 + i * 500000),
67  looFaderLightShadowing);
68  Simulator::Schedule(Time(700000 + i * 500000),
70  looFaderHeavyShadowing);
71  }
72 
73  Simulator::Run();
74  Simulator::Destroy();
75 
76  return 0;
77 }
double GetChannelGainDb()
Function for returning the channel gain in dB.
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.