Loading...
Searching...
No Matches
satellite-channel-estimation-error-test.cc
Go to the documentation of this file.
1/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2013 Magister Solutions Ltd
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: Jani Puttonen <jani.puttonen@magister.fi>
19 */
20
26
29
30#include "ns3/boolean.h"
31#include "ns3/config.h"
32#include "ns3/log.h"
33#include "ns3/ptr.h"
34#include "ns3/singleton.h"
35#include "ns3/test.h"
36
37using namespace ns3;
38
43
45{
46 public:
49
50 private:
51 virtual void DoRun(void);
52};
53
55 : TestCase("Test FWD link SINR channel estimation error.")
56{
57}
58
62
63void
65{
66 // Set simulation output details
67 SatEnvVariables::GetInstance()->DoInitialize();
68 SatEnvVariables::GetInstance()->SetOutputVariables("test-sat-channel-estimation-error",
69 "fwd",
70 true);
71
72 Ptr<SatChannelEstimationErrorContainer> ceError =
73 Create<SatFwdLinkChannelEstimationErrorContainer>();
74
75 for (double in = -20.0; in < 20.0; in += 0.1)
76 {
77 double out = ceError->AddError(in);
78
79 std::cout << "SINR in: " << in << ", SINR out: " << out << std::endl;
80 }
81
82 SatEnvVariables::GetInstance()->DoDispose();
83}
84
90{
91 public:
94
95 private:
96 virtual void DoRun(void);
97};
98
100 : TestCase("Test RTN link SINR channel estimation error.")
101{
102}
103
107
108void
110{
111 // Set simulation output details
112 SatEnvVariables::GetInstance()->DoInitialize();
113 SatEnvVariables::GetInstance()->SetOutputVariables("test-sat-channel-estimation-error",
114 "rtn",
115 true);
116
117 Ptr<SatChannelEstimationErrorContainer> ceError =
118 Create<SatFwdLinkChannelEstimationErrorContainer>();
119
120 for (uint32_t wf = 3; wf <= 23; ++wf)
121 {
122 std::cout << "--- WF: " << wf << std::endl;
123 for (double in = -20.0; in < 20.0; in += 0.1)
124 {
125 double out = ceError->AddError(in);
126
127 std::cout << "SINR in: " << in << ", SINR out: " << out << std::endl;
128 }
129 }
130 SatEnvVariables::GetInstance()->DoDispose();
131}
132
138{
139 public:
141};
142
144 : TestSuite("sat-channel-estimation-error-test", Type::UNIT)
145{
146 AddTestCase(new SatFwdChannelEstimationErrorTestCase, TestCase::Duration::QUICK);
147 AddTestCase(new SatRtnChannelEstimationErrorTestCase, TestCase::Duration::QUICK);
148}
149
150// Do allocate an instance of this TestSuite
Test suite for satellite channel estimation error.
Test case for FWD link channel estimation error.
Test case for RTN link channel estimation error.
static Ptr< SatEnvVariables > GetInstance()
SatArqSequenceNumber is handling the sequence numbers for the ARQ process.
static SatChannelEstimationErrorTestSuite satChannelEstimationErrorTestSuite