Home Start Back Next End
  
44
dengan  melihat  kemungkinan-kemungkinan
action  yang tersedia, kemudian dengan
menggunakan action value e-greedy, action tersebut akan dipilih dan dijalankan. Akibat
dari
pemilihan
action
tersebut
agen
akan
mendapatkan
reward
langsung
(immediate
reward) dan mengobservasi state selanjutnya
?
s'
serta meng-update tabel
Q
(
s, a
dengan
rumus berikut:
?
?
Q
(s, a
)
?
r + ?
max Q
(s' , a')
a
'
Secara lebih rinci, berikut adalah pseudocode untuk algoritma Q-learning:
1. Set parameter ?, and environment reward (reward function)
2. Initialize the table entry
3. For each episode:
Q
ˆ
(s, a)
to zero
a. Select random initial state
b. Do while not reach goal state:
Select action
from
using e-greedy strategy for
the current state
Receive immediate reward
r
Observe the new state
s
'
Update the table entry for
Q
ˆ
(s, a)
as follows:
Q
ˆ
(s, a) ?
r + ?
max Q
ˆ
(s
'
,
a
'
)
a'
Set the next state as the current state
End Do
End For
Word to PDF Converter | Word to HTML Converter