10.05.2013 Views

Tema 5 - dccia

Tema 5 - dccia

Tema 5 - dccia

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.

Fundamentos IA 5. Satisfacción de Restricciones<br />

@DCCIA<br />

Backtracking básico<br />

• Inicialización de la raíz del árbol de búsqueda<br />

i= 0; modo = forward; S = {}<br />

Acciones si el estado actual es consistente<br />

Si modo = forward entonces<br />

FinSi<br />

i=i+1;<br />

(1.1) V + i = nuevo_candidato(S, E, c, l, a)<br />

Si V + i ≠∅entonces<br />

Sino<br />

S= S ∪ expandir(S, V + i )<br />

Si i=n entonces salir_con_éxito<br />

sino ir a <br />

FinSi<br />

modo = backtracking FinSi<br />

Acciones si se detecta inconsistencia<br />

Si modo = backtracking entonces<br />

FinSi<br />

Si i= 0 entonces salir_con_fracaso<br />

Sino<br />

i= i-1<br />

S = cambiar(S, V +<br />

i )<br />

modo = forward<br />

ir a (1.1)<br />

FinSi<br />

14

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

Saved successfully!

Ooh no, something went wrong!