-
Notifications
You must be signed in to change notification settings - Fork 0
/
Simulation.h
30 lines (28 loc) · 992 Bytes
/
Simulation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include <queue>
#include "Packet.h"
class Simulation {
private:
const double time_total = 100000;
double time_current = 0, time_arrival = 0;
double time_pkts_system_total = 0, time_pkts_queue_total = 0, sum_n_pkt_system = 0;
unsigned int n_pkt_total = 0, n_pkt_dropped = 0;
std :: queue<Packet> packets;
bool is_queue_full();
bool is_arrival();
double generate_interarrival();
double generate_service();
double get_time_departure();
void update_time_current();
void set_next_departure();
void add_packet(double);
void handle_arrival_event(double);
void handle_depart_event();
public:
Simulation(double, double, unsigned int);
unsigned int system_capacity;
double lambda, mu;
double probability_dropped_pkt;
double avg_n_pkt_system, avg_time_pkt_system, avg_time_pkt_queue;
void simulate();
};