-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
26 lines (20 loc) · 799 Bytes
/
main.py
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
from Simulate import Simulator
import csv
import sys
path = sys.argv[1]
tq = int(sys.argv[2])
Simulation = Simulator(tq)
with open(path) as csvfile:
process = csv.reader(csvfile, delimiter=',', quotechar='|')
next(process)
for row in process:
pid=int(row[0])
arrival = int(row[1])
burst = int(row[2])
Simulation.ProcessAdd(pid,arrival,burst)
print('---------------------------------------------\nAdding the process to the process List\n---------------------------------------------')
for process in Simulation.list:
print(process)
print('---------------------------------------------\n Simulation \n---------------------------------------------')
Simulation.Scheduling()
print('---------------------------------------------')