μ»΄ν¨ν° μμ€ν μΌλ° νꡬ νλ - νλ‘μΈμ€ μ€μΌμ€λ¬ ꡬννκΈ°
Β μ»΄ν¨ν° μΌλ° μμ λ λ°°μ΄ νλ‘μΈμ€ μ€μΌμ€λ¬λ₯Ό, μ κ° νμ νλ°νκ² μ°κ΅¬ λ° νλ‘μ νΈλ₯Ό μ§ννκ³ μλ λΆμΌμΈ νλ‘κ·Έλλ°μΌλ‘ λ§λ€μ΄ 보면 μ΄λ¨κΉ νμ¬ PythonμΌλ‘ ꡬννμ΅λλ€.
μ€μ λ‘ μ€λΉ ν, νλ‘μΈμ€ λμ°©/μ’ λ£/μ μ μ ꡬννκ³ , νμΌ schedulers.pyμμ λνμ μΈ μ€μΌμ€λ¬ μκ³ λ¦¬μ¦μΈ FIFO(μ€λΉ νμμ λ€μ΄μ¨ μμλλ‘ pop), SJF(μ€λΉ νμ νλ‘μΈμ€λ₯Ό μ€ν μκ° κΈ°μ€μΌλ‘ μ λ ¬νμ¬ μ μ ), HRRN(μ€λΉ νμ κ° νλ‘μΈμ€ μ°μ μμλ₯Ό κ³μ°νμ¬ μ μ )μ ꡬννμ΅λλ€.
νλ‘κ·Έλ¨μ μ€ννλ©΄ μκ°μ λ°λΌ κ° νλ‘μΈμ€μ μμ(start)κ³Ό μ’ λ£(termination)λ₯Ό 보μ¬μ£Όλ©°, λͺ¨λ νλ‘μΈμ€κ° μ’ λ£λ λ€ κ° νλ‘μΈμ€μ λκΈ° μκ°(wait time)κ³Ό λ°ν μκ°(termination time)μ μΆλ ₯νκ³ νκ· λκΈ° μκ°(AWT), νκ· λ°ν μκ°(ATT)μ κ³μ°ν΄ 보μ¬μ€λλ€.
νλ‘μΈμ€ λͺ©λ‘μ ν¨μ¨μ μΈ κ°λ°κ³Ό μ¬μ©μ μν΄μ JSON ν¬λ§·μΌλ‘ νμΌμ μ μ₯λ κ²μ λ‘λ©ν©λλ€. κ°κ°μ νλ‘μΈμ€ μ€λΈμ νΈλ μ»΄ν¨ν° μμ€ν μΌλ° μκ°μ μ μΈλ¬Όμμμ²λΌ, κ°κ°μ νλ‘μΈμ€ λ²νΈ(id), λμ°© μκ°(arrival), μ€ν μκ°(execution)μ κ°μ§λλ€.
μ μΈλ¬Όμμ μ μλ νμ κ°λλ‘ νλ‘μΈμ€ λͺ©λ‘μ λ§λ€κ³ κ° μκ³ λ¦¬μ¦μ μ€ννμ λ, μμ μκ°μ κ³μ°νλ κ²°κ³Όμ λμΌν μΆλ ₯μ΄ λμμ λΏλ―νμ΅λλ€. μ€μ λ‘ μ€μΌμ€λ¬μ λμμ ꡬννλ κ° μκ³ λ¦¬μ¦μ νλ¦μ λν΄μ λ μ½κ² μ΄ν΄ν μ μμμ΅λλ€. μμΌλ‘ λΌμ΄λ λ‘λΉκ³Ό κ°μ λ€λ₯Έ μκ³ λ¦¬μ¦κΉμ§ μ§μνλλ‘ λ§λ€κ³ , vue.js λ±μ μλ°μ€ν¬λ¦½νΈ νλ‘ νΈμλ νλ μμν¬λ₯Ό μ¬μ©ν΄ μ²λ¦¬λ₯Ό μκ°νν΄ λ€λ₯Έ νμλ€μ΄λ (곧 μκΈΈ) νλ°°λ€μ΄ νλ‘μΈμ€ μ€μΌμ€λ¬λ₯Ό λ μ½κ² μ΄ν΄ν μ μκ² ν κ²μ λλ€.Β
./process.json
μ μλμ κ°μ΄ μ€νν νλ‘μΈμ€ λͺ©λ‘μ μ μ₯ν©λλ€.
[
{ "id": 0, "arrival": 0, "execution": 9 },
{ "id": 1, "arrival": 1, "execution": 6 },
{ "id": 2, "arrival": 2, "execution": 2 },
{ "id": 3, "arrival": 3, "execution": 4 }
]
μμμ κ°κ° id
λ νλ‘μΈμ€ λ²νΈ, arrival
μ λμ°© μκ°, execution
μ μ€ν(μ²λ¦¬) μκ°μ λ»ν©λλ€.
μμ νλ‘μΈμ€ | λμ°© μκ° | μ€ν μκ° |
---|---|---|
p0 | 0 | 9 |
p1 | 1 | 6 |
p2 | 2 | 2 |
p3 | 3 | 4 |
t=0
p0 started
t=1
t=2
t=3
t=4
t=5
t=6
t=7
t=8
t=9
p0 terminated
p1 started
t=10
t=11
t=12
t=13
t=14
t=15
p1 terminated
p2 started
t=16
t=17
p2 terminated
p3 started
t=18
t=19
t=20
t=21
p3 terminated
=== results ===
#p0, wait time: 0, termination time: 9
#p1, wait time: 8, termination time: 14
#p2, wait time: 13, termination time: 15
#p3, wait time: 14, termination time: 18
AWT: 8.75
ATT: 14.0
νλ‘μΈμ€ | λκΈ° μκ° | λ°ν μκ° |
---|---|---|
p0 | 0 | 9 |
p1 | 8 | 14 |
p2 | 13 | 15 |
p3 | 14 | 18 |
νκ· λκΈ° μκ° | νκ· λ°ν μκ° |
---|---|
8.75 | 14.0 |
t=0
p0 started
t=1
t=2
t=3
t=4
t=5
t=6
t=7
t=8
t=9
p0 terminated
p2 started
t=10
t=11
p2 terminated
p3 started
t=12
t=13
t=14
t=15
p3 terminated
p1 started
t=16
t=17
t=18
t=19
t=20
t=21
p1 terminated
=== results ===
#p0, wait time: 0, termination time: 9
#p1, wait time: 14, termination time: 20
#p2, wait time: 7, termination time: 9
#p3, wait time: 8, termination time: 12
AWT: 7.25
ATT: 12.5
νλ‘μΈμ€ | λκΈ° μκ° | λ°ν μκ° |
---|---|---|
p0 | 0 | 9 |
p1 | 14 | 20 |
p2 | 7 | 9 |
p3 | 8 | 12 |
νκ· λκΈ° μκ° | νκ· λ°ν μκ° |
---|---|
7.25 | 12.5 |
t=0
p0 started
t=1
t=2
t=3
t=4
t=5
t=6
t=7
t=8
t=9
p0 terminated
p2 started
t=10
t=11
p2 terminated
p3 started
t=12
t=13
t=14
t=15
p3 terminated
p1 started
t=16
t=17
t=18
t=19
t=20
t=21
p1 terminated
=== results ===
#p0, wait time: 0, termination time: 9
#p1, wait time: 14, termination time: 20
#p2, wait time: 7, termination time: 9
#p3, wait time: 8, termination time: 12
AWT: 7.25
ATT: 12.5
νλ‘μΈμ€ | λκΈ° μκ° | λ°ν μκ° |
---|---|---|
p0 | 0 | 9 |
p1 | 14 | 20 |
p2 | 7 | 9 |
p3 | 8 | 12 |
νκ· λκΈ° μκ° | νκ· λ°ν μκ° |
---|---|
7.25 | 12.5 |