-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNote_Kelompok-2_UTS.YAML
203 lines (174 loc) · 4.46 KB
/
Note_Kelompok-2_UTS.YAML
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
Simulation Scheduling Algorithms - OS (UTS)
# Konsep
==============================================
Scheduling Algorithm:
1. FCFS (First Come First Served)
2. SJF (Shortest Job First)
3. SRT (Shortest Remaining Time)
4. Priority Scheduling
5. RR (Round Robin)
Input:
1. Process name: string
2. Burst time: int
3. arrive time: int
4. priority: int (Priority Scheduling)
5. quantum: int (RR)
fitur:
in the table:
1. start time: waktu mulai ketika dieksekusi oleh CPU
2. return/finish time: waktu selesai eksekusi
3. turnaround time = finish time - arrive time
4. waiting time = turnaround time - burst time
5. response time = start time - Arrival time
off table:
6. total time = waktu terakhir execute
7. throughput = total time / n process
8. average start time = sum start time / n process
9. average turnaround time = sum turnaround time / n process
10. average waiting time = sum waiting time / n process
11. average response time = sum response time / n process
12. gantt chart
ex:
________ __ __________ ______________ ______ ____
|___P1___|P2|____P0____|______P4______|__P3__|_P5_|
0 4 5 10 17 20 22
Simulation:
1. input data
2. process algorithm, choice (5 scheduling algorithm)
3. output fitur, tiap algoritma menampilkan informasi output berupa fitur in table, fitur off table, dan gantt chart
note: bahasa python
# Test Case
==============================================
# input test case dengan data file .txt
# contoh format data
# jumlah_data {1}
# nama_proses burst_time arrive_time priority {jumlah data}
# quantum {1}
""" data.txt
2
P0 3 5 2
P1 0 4 3
3
"""
6
P0 3 5 2
P1 0 4 3
P2 1 1 2
P3 5 3 4
P4 3 7 3
P5 8 2 1
2
# Design
==============================================
Process
- name: string
- burst_time: int
- arrive_time: int
- priority: int
- start_time: int
- finish_time: int
- turnaround_time: int
- waiting_time: int
- response_time: int
- burst_time_remaining: int
- isQueued: Boolean
- isCompleted: Boolean
+ *setter(): for all atribute
+ *getter(): for all atribute
+ getDict()
SchedulingAlgorithm
- processes: list of object
- ready_queues: list of object
- remaining_process: int
- completed_processes: list of object
- current_time: int
- n: int
- run_time: int
- temp_process: object
- gantt_chart: list of object
- delay: int
+ *getter(): for all atribute
+ setReadyQueues()
+ getRunningProcess()
+ setCompletedProcess()
+ checkDelay()
+ executeNonPreemptive()
+ executePreemptive()
FCFSAlgorithm
+ run()
+ printGanttChart()
SJFAlgorithm
+ getNextProcess()
+ run()
+ printGanttChart()
SRTAlgorithm
- tempProcess: Object
- tempTime: int
- ganttChartInfo: list of Object
+ calculate()
+ run()
+ printGanttChart()
PriorityAlgorithm
- tempProcess: Object
- tempTime: int
- ganttChartInfo: list of Object
+ run()
+ printGanttChart()
RRAlgorithm
- quantum: int
- queue: list of object
- exeProgramsCount: int
- ganttChartInfo: list of object
+ cekProsesBaru()
+ updateQueue()
+ run()
+ printGanttChart()
# Inheritance and Composite
==============================================
SchedulingAlgorithms has a Process
FCFS is a SchedulingAlgorithms
SJF is a SchedulingAlgorithms
SRT is a SchedulingAlgorithms
Priority is a SchedulingAlgorithms
PriorityPreemptive is a SchedulingAlgorithms
RR is a SchedulingAlgorithms
# COPY
==============================================
Scheduling Algorithm:
1. FCFS (First Come First Served)
2. SJF (Shortest Job First)
3. SRT (Shortest Remaining Time)
4. Priority Scheduling
5. RR (Round Robin)
Input:
1. Process name
2. Burst time
3. arrive time
4. priority
5. quantum
fitur:
in the table:
1. start time
2. response/finish time
4. turnaround time = finish time - arrive time
3. waiting time = turnaround time - burst time
off table:
5. total time = sum burst time
6. throughput = n process / total time
7. average start time = sum start time / n process
8. average turnaround time = sum turnaround time / n process
9. average waiting time = sum waiting time / n process
# Simulation
==============================================
CPU
arrive
- start -
burst
- finish -
delay - CPU start = waiting arrive time
arrive - start = waiting time
arrive - finish = turnaround time
start - finish = Burst time
start - finish + delay = delay time
delay
queue:- | process:- | terminate:- | complete:-