-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_TTI.m
23 lines (18 loc) · 1.1 KB
/
check_TTI.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
function BS_UE = check_TTI(BS_UE,current_TTI)
type = BS_UE.traffic_model.type;
if strcmp(type,'CAM')
if ~mod(current_TTI-1 - BS_UE.traffic_model.iit_offset,500) && current_TTI > BS_UE.traffic_model.iit_offset
BS_UE.traffic_model.packet = generate_packet(BS_UE.traffic_model.packet_max,current_TTI,type);
BS_UE.traffic_model.packet_counter = 1;
BS_UE.traffic_model.packet_buffer = BS_UE.traffic_model.packet;
end
if current_TTI > BS_UE.traffic_model.iit_offset +1
if ~mod(current_TTI-1-BS_UE.traffic_model.iit_offset,100) && BS_UE.traffic_model.packet_counter <=5
BS_UE.traffic_model.packet = generate_packet(BS_UE.traffic_model.packet_min,current_TTI,type);
BS_UE.traffic_model.packet_counter = BS_UE.traffic_model.packet_counter+1;
BS_UE.traffic_model.packet_buffer = BS_UE.traffic_model.packet;
end
end
BS_UE.traffic_model.bit_count = get_buffer_length(BS_UE.traffic_model);
end
end