A Discrete-Event Network Simulator
API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
bs-uplink-scheduler.cc
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
2 /*
3  * Copyright (c) 2007,2008 INRIA
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: Jahanzeb Farooq <jahanzeb.farooq@sophia.inria.fr>
19  */
20 
21 #include "bs-uplink-scheduler.h"
22 #include "bs-net-device.h"
23 #include "ns3/simulator.h"
24 #include "cid.h"
25 #include "burst-profile-manager.h"
26 #include "ss-manager.h"
27 #include "ns3/log.h"
28 #include "ns3/uinteger.h"
29 #include "ss-record.h"
30 #include "service-flow.h"
31 #include "service-flow-record.h"
32 #include "bs-link-manager.h"
33 #include "bandwidth-manager.h"
34 
35 NS_LOG_COMPONENT_DEFINE ("UplinkScheduler");
36 
37 namespace ns3 {
38 
39 NS_OBJECT_ENSURE_REGISTERED (UplinkScheduler);
40 
41 UplinkScheduler::UplinkScheduler (void)
42  : m_bs (0),
43  m_timeStampIrInterval (Seconds (0)),
44  m_nrIrOppsAllocated (0),
45  m_isIrIntrvlAllocated (false),
46  m_isInvIrIntrvlAllocated (false),
47  m_dcdTimeStamp (Simulator::Now ()),
48  m_ucdTimeStamp (Simulator::Now ())
49 {
50 }
51 
52 UplinkScheduler::UplinkScheduler (Ptr<BaseStationNetDevice> bs)
53  : m_bs (bs),
54  m_timeStampIrInterval (Seconds (0)),
55  m_nrIrOppsAllocated (0),
56  m_isIrIntrvlAllocated (false),
57  m_isInvIrIntrvlAllocated (false),
58  m_dcdTimeStamp (Simulator::Now ()),
59  m_ucdTimeStamp (Simulator::Now ())
60 {
61 }
62 
63 UplinkScheduler::~UplinkScheduler (void)
64 {
65  m_bs = 0;
66  m_uplinkAllocations.clear ();
67 }
68 void
69 UplinkScheduler::InitOnce ()
70 {
71 
72 }
73 
74 TypeId
75 UplinkScheduler::GetTypeId (void)
76 {
77  static TypeId tid = TypeId ("ns3::UplinkScheduler")
78  .SetParent<Object> ()
79  ;
80  return tid;
81 }
82 
83 uint8_t
84 UplinkScheduler::GetNrIrOppsAllocated (void) const
85 {
86  return m_nrIrOppsAllocated;
87 }
88 
89 void
90 UplinkScheduler::SetNrIrOppsAllocated (uint8_t nrIrOppsAllocated)
91 {
92  m_nrIrOppsAllocated = nrIrOppsAllocated;
93 }
94 
95 bool
96 UplinkScheduler::GetIsIrIntrvlAllocated (void) const
97 {
98  return m_isIrIntrvlAllocated;
99 }
100 
101 void
102 UplinkScheduler::SetIsIrIntrvlAllocated (bool isIrIntrvlAllocated)
103 {
104 
105  m_isIrIntrvlAllocated = isIrIntrvlAllocated;
106 }
107 
108 bool
109 UplinkScheduler::GetIsInvIrIntrvlAllocated (void) const
110 {
111 
112  return m_isInvIrIntrvlAllocated;
113 }
114 
115 void
116 UplinkScheduler::SetIsInvIrIntrvlAllocated (bool isInvIrIntrvlAllocated)
117 {
118  m_isInvIrIntrvlAllocated = isInvIrIntrvlAllocated;
119 }
120 
121 Time
122 UplinkScheduler::GetDcdTimeStamp (void) const
123 {
124  return m_dcdTimeStamp;
125 }
126 
127 void
128 UplinkScheduler::SetDcdTimeStamp (Time dcdTimeStamp)
129 {
130  m_dcdTimeStamp = dcdTimeStamp;
131 }
132 
133 Time
134 UplinkScheduler::GetUcdTimeStamp (void) const
135 {
136  return m_ucdTimeStamp;
137 }
138 
139 void
140 UplinkScheduler::SetUcdTimeStamp (Time ucdTimeStamp)
141 {
142  m_ucdTimeStamp = ucdTimeStamp;
143 }
144 
145 std::list<OfdmUlMapIe>
146 UplinkScheduler::GetUplinkAllocations (void) const
147 {
148  return m_uplinkAllocations;
149 }
150 
151 Time
152 UplinkScheduler::GetTimeStampIrInterval (void)
153 {
154  return m_timeStampIrInterval;
155 }
156 
157 void
158 UplinkScheduler::SetTimeStampIrInterval (Time timeStampIrInterval)
159 {
160  m_timeStampIrInterval = timeStampIrInterval;
161 }
162 
163 Ptr<BaseStationNetDevice>
164 UplinkScheduler::GetBs (void)
165 {
166  return m_bs;
167 }
168 void
169 UplinkScheduler::SetBs (Ptr<BaseStationNetDevice> bs)
170 {
171  m_bs = bs;
172 }
173 } // namespace ns3
#define NS_LOG_COMPONENT_DEFINE(name)
Definition: log.h:122
Time Seconds(double seconds)
create ns3::Time instances in units of seconds.
Definition: nstime.h:586
Time Now(void)
create an ns3::Time instance which contains the current simulation time.
Definition: simulator.cc:286