LteAllocatorUtils.h Source File

Simu5G: LteAllocatorUtils.h Source File
Simu5G
LteAllocatorUtils.h
1//
2// Simu5G
3//
4// Copyright (C) 2012-2021 Giovanni Nardini, Giovanni Stea, Antonio Virdis et al. (University of Pisa)
5// Copyright (C) 2022-2026 Giovanni Nardini, Giovanni Stea et al. (University of Pisa)
6//
7// This file is part of a software released under the license included in file
8// "license.pdf". Please read LICENSE and README files before using it.
9// The above files and the present reference are part of the software itself,
10// and cannot be removed from it.
11//
12
13#ifndef LTEALLOCATORUTILS_H_
14#define LTEALLOCATORUTILS_H_
15
16namespace simu5g {
17
18//----------------------------------------------------------------------
19// STRUCT AND TYPE_DEF FOR allocatedRbsPerBand_
20//----------------------------------------------------------------------
21typedef std::map<MacNodeId, unsigned int> UeAllocatedBlocksMapA;
22typedef std::map<MacNodeId, unsigned int> UeAllocatedBytesMapA;
24struct AllocatedRbsPerBandInfo
25{
27 UeAllocatedBlocksMapA ueAllocatedRbsMap_;
29 UeAllocatedBytesMapA ueAllocatedBytesMap_;
30
32 unsigned int allocated_ = 0;
33
34 AllocatedRbsPerBandInfo()
35 {
36 }
37
38};
39
40typedef std::map<Band, AllocatedRbsPerBandInfo> AllocatedRbsPerBandMapA;
41
42//----------------------------------------------------------------------
43// STRUCT AND TYPE_DEF FOR allocatedRbsUe_
44//----------------------------------------------------------------------
45
46// Amount of bytes served by a single set of allocated blocks
47struct AllocationElem
48{
50 unsigned int resourceBlocks_;
52 unsigned int bytes_;
53};
54
55typedef std::list<AllocationElem> AllocationListA;
56typedef std::map<Band, AllocationListA> PerBandAllocationMapA;
57typedef std::map<Band, unsigned int> PerBandAllocatedRbsMapA;
58
60struct AllocatedRbsPerUeInfo
61{
63 unsigned int allocatedBlocks_ = 0;
65 unsigned int allocatedBytes_ = 0;
66
67 // amount of blocks allocated for this UE for each remote and for each band
68 std::map<Remote, PerBandAllocatedRbsMapA> ueAllocatedRbsMap_;
70 std::map<Remote, PerBandAllocationMapA> allocationMap_;
71 // amount of blocks allocated for this UE for each remote
72 std::map<Remote, unsigned int> antennaAllocatedRbs_;
73
74 // antennas available for this user
75 RemoteSet availableAntennaSet_;
76
77 // first available antenna
78 Remote currentAntenna_ = MACRO;
79
80 public:
81
82 AllocatedRbsPerUeInfo()
83 {
84 availableAntennaSet_.insert(MACRO);
85 }
86
87};
88
89typedef std::map<MacNodeId, AllocatedRbsPerUeInfo> AllocatedRbsPerUeMapA;
90
95{
96 EXCLUSIVE,
97 SHARED,
98 UNUSED,
99};
100
101} // namespace simu5g
102
103#endif /* LTEALLOCATORUTILS_H_ */
104
Definition AlertReceiver.h:24
AllocationUeType
Definition LteAllocatorUtils.h:95
UeAllocatedBlocksMapA ueAllocatedRbsMap_
Stores for each UE the amount of blocks allocated in the structure band.
Definition LteAllocatorUtils.h:27
unsigned int allocated_
Stores the amount of blocks allocated to every UE in the structure band.
Definition LteAllocatorUtils.h:32
UeAllocatedBytesMapA ueAllocatedBytesMap_
Stores for each UE the amount of bytes allocated in the structure band.
Definition LteAllocatorUtils.h:29
std::map< Remote, PerBandAllocationMapA > allocationMap_
When an allocation is performed, the amount of blocks requested and the amount of bytes is registered...
Definition LteAllocatorUtils.h:70
unsigned int allocatedBlocks_
Stores the amount of blocks allocated in every band by the structure UE.
Definition LteAllocatorUtils.h:63
unsigned int allocatedBytes_
Stores the amount of bytes allocated to every UE in the structure band.
Definition LteAllocatorUtils.h:65