<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ko">
	<id>http://junhoahn.kr/noriwiki/index.php?action=history&amp;feed=atom&amp;title=TBA%2A</id>
	<title>TBA* - 편집 역사</title>
	<link rel="self" type="application/atom+xml" href="http://junhoahn.kr/noriwiki/index.php?action=history&amp;feed=atom&amp;title=TBA%2A"/>
	<link rel="alternate" type="text/html" href="http://junhoahn.kr/noriwiki/index.php?title=TBA*&amp;action=history"/>
	<updated>2026-05-14T20:51:48Z</updated>
	<subtitle>이 문서의 편집 역사</subtitle>
	<generator>MediaWiki 1.43.0</generator>
	<entry>
		<id>http://junhoahn.kr/noriwiki/index.php?title=TBA*&amp;diff=821&amp;oldid=prev</id>
		<title>Ahn9807: 새 문서: 분류: 경로 탐색  가운데  == 개요 == A*는 목적지까지의 경로를 찾아야만, 탐색이 종료된다. 실시간 게임에서 이러한 과정을 기다리기는 너무 오래 결릴 수도 있음으로, 경로 탐색이 끝나기 전에 납득할 만한 경로를 주는 알고리즘이 TBA* (Time-Bounded A*)이다.   Real-time이며 Optimal하다.   == 알고리즘 == 가운데 A*...</title>
		<link rel="alternate" type="text/html" href="http://junhoahn.kr/noriwiki/index.php?title=TBA*&amp;diff=821&amp;oldid=prev"/>
		<updated>2023-02-25T10:50:53Z</updated>

		<summary type="html">&lt;p&gt;새 문서: &lt;a href=&quot;/noriwiki/index.php?title=%EB%B6%84%EB%A5%98:%EA%B2%BD%EB%A1%9C_%ED%83%90%EC%83%89&quot; title=&quot;분류:경로 탐색&quot;&gt;분류: 경로 탐색&lt;/a&gt;  &lt;a href=&quot;/noriwiki/index.php?title=%ED%8C%8C%EC%9D%BC:TBA*.png&quot; title=&quot;파일:TBA*.png&quot;&gt;프레임없음|가운데&lt;/a&gt;  == 개요 == A*는 목적지까지의 경로를 찾아야만, 탐색이 종료된다. 실시간 게임에서 이러한 과정을 기다리기는 너무 오래 결릴 수도 있음으로, 경로 탐색이 끝나기 전에 납득할 만한 경로를 주는 알고리즘이 TBA* (Time-Bounded A*)이다.   Real-time이며 Optimal하다.   == 알고리즘 == &lt;a href=&quot;/noriwiki/index.php?title=%ED%8C%8C%EC%9D%BC:TBA_Star.png&quot; title=&quot;파일:TBA Star.png&quot;&gt;프레임없음|가운데&lt;/a&gt; A*...&lt;/p&gt;
&lt;p&gt;&lt;b&gt;새 문서&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[분류: 경로 탐색]]&lt;br /&gt;
&lt;br /&gt;
[[파일:TBA*.png|프레임없음|가운데]]&lt;br /&gt;
&lt;br /&gt;
== 개요 ==&lt;br /&gt;
A*는 목적지까지의 경로를 찾아야만, 탐색이 종료된다. 실시간 게임에서 이러한 과정을 기다리기는 너무 오래 결릴 수도 있음으로, 경로 탐색이 끝나기 전에 납득할 만한 경로를 주는 알고리즘이 TBA* (Time-Bounded A*)이다. &lt;br /&gt;
&lt;br /&gt;
Real-time이며 Optimal하다. &lt;br /&gt;
&lt;br /&gt;
== 알고리즘 ==&lt;br /&gt;
[[파일:TBA Star.png|프레임없음|가운데]]&lt;br /&gt;
[[A*]]알고리즘을 이용하면서 경로를 만든다. 그러나 경로를 만들던 도중에 현재 생각되는 최선의 위치라고 생각되는 Path를 탐색하고 움직임에 반영시킨다. 그러면서 한정된 자원 (NS _ 탐색할 수 있는 노드의 개수, NT - 탐색할 수 있는 경로의 깊이)를 이용하여 Path를 계속 추적하고 현재 AI가 움직이는 Path와 새로운 Path가 겹치는 지점이 있으면, 새로운 패스를 반영하고 아니면 현재 패스를 백트래킹시킨다. 그 외의 경우에는 현재 패스를 따라가게 된다. 여기서 NS와 NT는 컴퓨터 속도에 따라서 자유롭게 설정 가능하다. &lt;br /&gt;
&lt;br /&gt;
결국 기본적으로는 A*와 같지만, 중간에 산출되는 결과물을 AI가 이용할 수 있도록 추가하는 과정이 있는 알고리즘이다. &lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
==Pseudocode==&lt;br /&gt;
The following [[pseudocode]] describes the algorithm:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;pascal&amp;quot; start=&amp;quot;1&amp;quot;&amp;gt;&lt;br /&gt;
function reconstruct_path(cameFrom, current)&lt;br /&gt;
    total_path := {current}&lt;br /&gt;
    while current in cameFrom.Keys:&lt;br /&gt;
        current := cameFrom[current]&lt;br /&gt;
        total_path.prepend(current)&lt;br /&gt;
    return total_path&lt;br /&gt;
&lt;br /&gt;
// A* finds a path from start to goal.&lt;br /&gt;
// h is the heuristic function. h(n) estimates the cost to reach goal from node n.&lt;br /&gt;
function A_Star(start, goal, h)&lt;br /&gt;
    // The set of discovered nodes that may need to be (re-)expanded.&lt;br /&gt;
    // Initially, only the start node is known.&lt;br /&gt;
    // This is usually implemented as a min-heap or priority queue rather than a hash-set.&lt;br /&gt;
    openSet := {start}&lt;br /&gt;
&lt;br /&gt;
    // For node n, cameFrom[n] is the node immediately preceding it on the cheapest path from start&lt;br /&gt;
    // to n currently known.&lt;br /&gt;
    cameFrom := an empty map&lt;br /&gt;
&lt;br /&gt;
    // For node n, gScore[n] is the cost of the cheapest path from start to n currently known.&lt;br /&gt;
    gScore := map with default value of Infinity&lt;br /&gt;
    gScore[start] := 0&lt;br /&gt;
&lt;br /&gt;
    // For node n, fScore[n] := gScore[n] + h(n). fScore[n] represents our current best guess as to&lt;br /&gt;
    // how short a path from start to finish can be if it goes through n.&lt;br /&gt;
    fScore := map with default value of Infinity&lt;br /&gt;
    fScore[start] := h(start)&lt;br /&gt;
&lt;br /&gt;
    while openSet is not empty&lt;br /&gt;
        // This operation can occur in O(1) time if openSet is a min-heap or a priority queue&lt;br /&gt;
        current := the node in openSet having the lowest fScore[] value&lt;br /&gt;
        if current = goal&lt;br /&gt;
            return reconstruct_path(cameFrom, current)&lt;br /&gt;
&lt;br /&gt;
        openSet.Remove(current)&lt;br /&gt;
        for each neighbor of current&lt;br /&gt;
            // d(current,neighbor) is the weight of the edge from current to neighbor&lt;br /&gt;
            // tentative_gScore is the distance from start to the neighbor through current&lt;br /&gt;
            tentative_gScore := gScore[current] + d(current, neighbor)&lt;br /&gt;
            if tentative_gScore &amp;lt; gScore[neighbor]&lt;br /&gt;
                // This path to neighbor is better than any previous one. Record it!&lt;br /&gt;
                cameFrom[neighbor] := current&lt;br /&gt;
                gScore[neighbor] := tentative_gScore&lt;br /&gt;
                fScore[neighbor] := gScore[neighbor] + h(neighbor)&lt;br /&gt;
                if neighbor not in openSet&lt;br /&gt;
                    openSet.add(neighbor)&lt;br /&gt;
&lt;br /&gt;
    // Open set is empty but goal was never reached&lt;br /&gt;
    return failure&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ahn9807</name></author>
	</entry>
</feed>