-
Notifications
You must be signed in to change notification settings - Fork 1
/
Simulator.h
36 lines (30 loc) · 842 Bytes
/
Simulator.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
31
32
33
34
35
36
//
// Created by Zhou Yitao on 2018-12-04.
//
#ifndef HIERARCHICALSCHEDULING_SIMULATOR_H
#define HIERARCHICALSCHEDULING_SIMULATOR_H
#include "Scheduler.h"
#include "Flow.h"
#include "Utility.h"
using namespace std;
class Simulator {
private:
int currentRound;
int currentCycle;
Scheduler scheduler;
vector<Flow> flows;
vector<Packet> packets;
int currentPacketIndex;
int packetNum; // current num of packets in sim.
vector<int> packetNumRecord;
public:
Simulator(vector<Flow>, vector<Packet>);
int calDepartureRound(int, int);
vector<Packet> runRound();
// serve package counter, count package from scheduler output
Packet runCycle();
int numOfFlows();
int numOfPackets();
const vector<int> &getPacketNumRecord() const;
};
#endif //HIERARCHICALSCHEDULING_SIMULATOR_H