29.08.2013 Views

Spel(l) - Liacs

Spel(l) - Liacs

Spel(l) - Liacs

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

AI—<strong>Spel</strong>(l)en α-β-algoritme — code<br />

function MaxWaarde(toestand,α,β)<br />

if toestand is eindtoestand then return Utility(toestand)<br />

(of cut-off test, en gebruik evaluatie-functie)<br />

for s in Opvolgers(toestand) do<br />

α ← max(α,MinWaarde(s,α,β))<br />

if α ≥ β then return β<br />

return α<br />

Analoog de functie MinWaarde, zie boek (voor een iets andere<br />

formulering). Normaal geldt α < β; α geeft de beste<br />

waarde voor MAX op het huidige pad, en β voor MIN.<br />

De variabelen α en β zijn locaal.<br />

Buitenste aanroep: MaxWaarde(huidigetoestand,−∞,+∞).<br />

21

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!