-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
54 lines (43 loc) · 1.21 KB
/
main.cpp
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//
// main.cpp
// lab2
//
// Created by Nishad Krishnan on 2015-03-07.
// Copyright (c) 2015 Nish. All rights reserved.
//
#include <iostream>
#include <string>
#include <sstream>
#include "ABP.h"
#include "ShiftingBuffer.h"
#include "GBN.h"
using namespace std;
int main(int argc, const char * argv[]) {
double ber = stod(string(argv[1]));
double dTFactor = stod(string(argv[2]));
double roundtripDelay = stod(string(argv[3]));
/*double ber = 0.0;
double dTFactor = 2.5;
double roundtripDelay = 10;*/
bool nak;
std::istringstream(argv[4]) >> std::boolalpha >> nak;
string protocolType = string(argv[5]);
if (protocolType.compare("GBN") == 0)
RunGBNSimulation(ber, dTFactor, roundtripDelay);
else
RunSimulation(ber, dTFactor, roundtripDelay, nak);
/*ShiftingBuffer buffer(4);
buffer.Push(4);
buffer.Push(0);
buffer.Push(1);
buffer.Push(2);
buffer.PrintBuffer();
buffer.Shift(buffer.FindRN(0));
buffer.Fill();
buffer.PrintBuffer();*/
//std::cout << buffer.GetValue(3) << std::endl;
/*int i = buffer.FindRN(0);
std::cout << i << std::endl;
buffer.Shift(i);
buffer.PrintBuffer();*/
}