Академический Документы
Профессиональный Документы
Культура Документы
Algoritmos
Time-Bounded A*
Real-Time Bounded A*
Time-Bounded Adaptive A*
Learning Real-Time A*
Real-Time Adaptive A*
Departamento de Computacao
Universidade de Braslia
Conteudo
1 Introducao
Algoritmo A*
Limitacoes do A* e suas solucoes
2 Game Time Model
3 Algoritmo Time-Bounded A*
4 Algoritmo Real-Time Bounded A*
5 Algoritmo Time Bounded Adaptive A*
6 RTAA - Real-Time Adaptive A*
LRTA e RTAA, o que muda?
7 Conclusao
Conteudo
1 Introducao
Algoritmo A*
Limitacoes do A* e suas solucoes
2 Game Time Model
3 Algoritmo Time-Bounded A*
4 Algoritmo Real-Time Bounded A*
5 Algoritmo Time Bounded Adaptive A*
6 RTAA - Real-Time Adaptive A*
LRTA e RTAA, o que muda?
7 Conclusao
Algoritmo A*
Algoritmo A*
A*
Busca heurstica que avalia os nos a partir da combinacao do custo
de chegar ao no e o custo do no ao objetivo.
Algoritmo A*
Algoritmo A*
Avaliacao de custo
f (n) = g (n) + h(n)
Onde:
f (n) e o custo estimado da solucao mais barata atraves de n;
g (n) fornece o custo do caminho do no inicial ao no n;
h(n) e o custo estimado do caminho mais barato de r ate o
objetivo.
Algoritmo A*
Limitacoes do Algoritmo A*
Variacoes do Algoritmo A*
Conteudo
1 Introducao
Algoritmo A*
Limitacoes do A* e suas solucoes
2 Game Time Model
3 Algoritmo Time-Bounded A*
4 Algoritmo Real-Time Bounded A*
5 Algoritmo Time Bounded Adaptive A*
6 RTAA - Real-Time Adaptive A*
LRTA e RTAA, o que muda?
7 Conclusao
Caractersticas:
Tempo e particionado em intervalos uniformes
Agente pode executar um movimento durante cada slot de
tempo
Busca e Movimentacao podem ser realizados em paralelo
Objetivo: mover o agente da posicao inicial para o objetivo no
menor numero de intervalos
Jogos
Ciclos de jogos de alguns milisegundos
Cada personagem executa um movimento ao final de cada
ciclo
Aparencia de continuidade
Conteudo
1 Introducao
Algoritmo A*
Limitacoes do A* e suas solucoes
2 Game Time Model
3 Algoritmo Time-Bounded A*
4 Algoritmo Real-Time Bounded A*
5 Algoritmo Time Bounded Adaptive A*
6 RTAA - Real-Time Adaptive A*
LRTA e RTAA, o que muda?
7 Conclusao
Notacao
Busca:
(S, A): grafo nao orientado onde S sao estados e A sao arestas
Succ(s) = {t|(s, t) A}: sucessores de s S (vizinhos)
c : A 7 R+ : funcao de custo que associa um custo a cada
aresta
sstart S: estado inicial
sgoal S: estado objetivo
Utilizacao da Distancia de Manhattan
Notacao
A*:
OPEN: lista de prioridades de estados
g (s): custo de sstart ate s atual
h(s): valor aproximado do custo de s ate sgoal
f (s) = g (s) + h(s)
parent(s): aponta para o pai de s na areade de busca
sroot : raiz da arvore de busca ou sstart
H(s): user-provided h value
h value consistende bi-implica que h(sgoal ) = 0 e
h(s) c(s, t) + h(t) para todos os estados s S e
t Succ(s)
Ideia
TBA*: Time-Bounded A*
TBA*: Time-Bounded A*
TBA*: Time-Bounded A*
TBA*: Time-Bounded A*
Conteudo
1 Introducao
Algoritmo A*
Limitacoes do A* e suas solucoes
2 Game Time Model
3 Algoritmo Time-Bounded A*
4 Algoritmo Real-Time Bounded A*
5 Algoritmo Time Bounded Adaptive A*
6 RTAA - Real-Time Adaptive A*
LRTA e RTAA, o que muda?
7 Conclusao
Ideia geral
Conteudo
1 Introducao
Algoritmo A*
Limitacoes do A* e suas solucoes
2 Game Time Model
3 Algoritmo Time-Bounded A*
4 Algoritmo Real-Time Bounded A*
5 Algoritmo Time Bounded Adaptive A*
6 RTAA - Real-Time Adaptive A*
LRTA e RTAA, o que muda?
7 Conclusao
Motivacao e Proposta
Motivacao:
No RTBA, a cada nova busca, todas as informacoes de buscas
anteriores sao perdidas.
Porem, algoritmo de tempo real atualizam o valor de h.
Solucao proposta:
TBAA* trabalha de forma semelhanta ao RTBA* porem
atualia o h value das celulas de forma semelhante ao que
acontece com AA* e RTAA*.
A cada vez que TBAA* inicia um nova busca, ele ataliza o
h value de todos os estados gerados por buscas anteriores
atribuindo h(s) := f (sbbest ) g (s)
Atualizacao acontece quando o h-value e necessario pela
busca atual pela primeira vez (para evitar a computacao do
que nao sera necessario posteriormente).
Ulisses Rodrigues Afonseca Marcos Fagundes Caetano ComNet/CIC/UnB
Algoritmos Time-Bounded A* Real-Time Bounded A* Time-Bounded Adaptive A* Learning Real-Time A* Real-Time Adaptive A
Introducao Game Time Model Algoritmo Time-Bounded A* Algoritmo Real-Time Bounded A* Algoritmo Time Bounded Adaptiv
Conteudo
1 Introducao
Algoritmo A*
Limitacoes do A* e suas solucoes
2 Game Time Model
3 Algoritmo Time-Bounded A*
4 Algoritmo Real-Time Bounded A*
5 Algoritmo Time Bounded Adaptive A*
6 RTAA - Real-Time Adaptive A*
LRTA e RTAA, o que muda?
7 Conclusao
Motivacao
Algoritmo aplicado
em situacoes em
que o tempo gasto
em processamento
e crtico;
Aplicacoes de
tempo real;
Jogos: diversos
componentes
movimentam-se ao
mesmo tempo;
its lookahead number of states to expand at most, an integer larger than zero
movements number of actions to execute at most, an integer larger than zero
curr scurr current state of the agent, a state [USER]
art c current action costs, a float for every state-action pair [USER]
rly Algoritmo RTAA
h current (consistent) heuristics, a float for every state [USER]
g g-values, a float for every state [A*]
ate CLOSED closed list of A* (= all expanded states), a set of states [A*]
he s state that A* was about to expand when it terminated, a state [A*]
of procedure realtime adaptive astar():
ch {01} while (scurr ! GOAL) do
{02} lookahead := any desired integer greater than zero;
(= {03} astar();
{04} if s = FAILURE then
{05} return FAILURE;
{06} for all s CLOSED do
{07} h[s] := g[s] + h[s] g[s];
{08} movements := any desired integer greater than zero;
{09} while (scurr != s AND movements > 0) do
{10} a := the action in A(scurr ) on the cost-minimal trajectory from scurr to s;
{11} scurr := succ(scurr , a);
{12} movements := movements 1;
he {13} for any desired number of times (including zero) do
re {14} increase any desired c[s, a] where s S and a A(s);
{15} if any increased c[s, a] is on the cost-minimal trajectory from s curr to s then
ng {16} break;
A* {17} return SUCCESS;
es.
m Figure 1: Real-Time Adaptive A*
en
ly Ulisses Rodrigues Afonseca Marcos Fagundes Caetano ComNet/CIC/UnB
ch AlgoritmosdueTime-Bounded
to an empty A* open list,Bounded
Real-Time in which case there isAdaptive
A* Time-Bounded no finite-cost tra-
A* Learning Real-Time A* Real-Time Adaptive A
Introducao Game Time Model Algoritmo Time-Bounded A* Algoritmo Real-Time Bounded A* Algoritmo Time Bounded Adaptiv
8 7 6 5 4 8 7 6 52 9 41 7 3 3 3 3 4 5
7 6 6 3 3 2 1 7 6 3 3 2 1
3 9 4 9
7 6 5 4 3 7 6 5 4 32 9 1 1 1 1
6 7 8 1 1 0 6 7 8 1 1 0
3 8 1 7 2 7 3 7 4 7
6 5 4 3 2 6 5 5 4 4 3 2
3 8 2 6 3 3 0 5 1 7 3 3 8 7 6 5 4
5 4 6 3 3 2 1 5 7 6 6 3 3 2 1
2 6 1 4 0 2 1 1 1 7 2 9 1 1 7 6 5 4 3
4 6 3 7 2 8 1 1 0 6 7 8 1 1 0 3 7 1 3
6 7 4 4 3 2
2 9 1 7 2 7 3 7
8 7 6 5 4 8 7 6 5 4 3 3 1 3 0 1
7 6 3 3 2 1 1
2 9 1 7 2 7 1 7 0 5 1 5 2 5
7 6 6 5 4 3 7 6 5 5 4 4 3 3 1 1 1 1
6 7 8 1 1 0
1 7 0 5 3 7 3 7 2 5 3 5
6 6 5 7 4 4 3 2 6 7 4 4 3 2 2
Figure 8: Test Ter
2 9 1 7 3 3 3 3 4 Figure
5 7: RTAA* with lookahead = 4
7 6 6 3 3 2 1 7 6 3 3 2 1
2 9 1 1 1 1
6 7 8 1 1 0 6 7 8 1 1 0 there is only one goal cell.1 All se
the same way. They differ onlyas priority
in thequeues
numberand of now break ti
cell expansi
Ulisses Rodrigues Afonseca Marcos Fagundes Caetano
8 7 6 5 4 which is larger for forwardf-values in favor
A* searches (23)of cellsfor
than with
ComNet/CIC/UnB larger
RTAA*
Algoritmos Time-Bounded A* Real-Time Bounded A* and larger forAdaptive
Time-Bounded RTAA* A*(20) athan
good
Learning fortie-breaking
LRTA*
Real-Time A* (19).strategy)
The first
Real-Time and reA
prop
Adaptive
89 Algoritmo
Introducao Game Time Model 166040.29 [2355.33] A* 2102.91
Time-Bounded 11324.72 Bounded
Algoritmo Real-Time [246.94] A*5.39 86883.98
Algoritmo [1077.54]
Time Bounded Adaptiv4
348072.76 [7021.57] 1791.19 5611.09 [80.43] 3.13 203645.42 [3782.37] 11
D* Lite
LRTA e RTAA, o que muda? 47458.83 [581.03] 1776.24 5637.46 [77.03] 3.17 37291.83 [378.20] 2
Forward A* Search
1857468.48 [68324.90] 1732.07 5354.26 [76.91] 3.09 544065.45 [21565.61] 31
Performance - RTAA* Backward A* Search
5245087.82 [93697.15] 1795.72 5535.05 [77.09] 3.08 1698163.04 [31051.10] 94
250000
total number of cell expansions = (b)
tal number of cell expan
trajectory cost = (d)
total search time = (f) proportional, as expected
200000 RTAA* with lookaheads
finity indeed increases th
the same lookaheads per
150000
ship to LRTA*. Conseq
number of cell expansion
with the same lookaheads
100000
much faster than LRTA*
in smaller total search tim
50000
RTAA* with lookahead o
head follow the same traj
0
if they break ties in the s
0 10 20 30 40 50 60
lookahead of Real-Time Adaptive A* (RTAA*) = (a)
70 80 90
and total number of ce
mately equal, as suggeste
Figure 9: Performance of Real-Time Adaptive A*
Ulisses Rodrigues Afonseca Marcos Fagundes Caetano One advantage of RTAA* is tha
ComNet/CIC/UnB
Algoritmos Time-Bounded A* Real-Time Bounded A* Time-Bounded Adaptive A* Learning fully chosen
Real-Time A* lookahead is smallA
Real-Time Adaptive
Introducao Game Time Model Algoritmo Time-Bounded A* Algoritmo Real-Time Bounded A* Algoritmo Time Bounded Adaptiv
Conteudo
1 Introducao
Algoritmo A*
Limitacoes do A* e suas solucoes
2 Game Time Model
3 Algoritmo Time-Bounded A*
4 Algoritmo Real-Time Bounded A*
5 Algoritmo Time Bounded Adaptive A*
6 RTAA - Real-Time Adaptive A*
LRTA e RTAA, o que muda?
7 Conclusao
Conclusao