基於三度空間的路徑規劃來製作電腦程式除錯訊息動畫

No Thumbnail Available

Date

2011

Journal Title

Journal ISSN

Volume Title

Publisher

Abstract

一般而言,程式設計師在撰寫程式時,常會需要使用或維護別人所寫的程式碼,此時就會遇到理解程式碼的問題。雖然程式設計師閱讀相關的設計文件可以幫助了解程式的運作,但有可能會遇到文件過期的問題,所以通常程式設計師會先閱讀完設計文件,然後在除錯模式下於程式中插入中斷點,藉由觀察中斷點之間變數的變化以及呼叫過的函式路徑,來理解程式運作的方式以及原理。近年來雖然已經有一些軟體視覺化工具可以透過圖形來視覺化程式內部的資料以幫助程式設計師除錯,但它們在實用上還有許多限制,使得軟體視覺化工具無法成為程式設計人員每天使用的工具之一。因此我們提出一個軟體視覺化除錯工具xDIVA[1]來幫助程式設計師進行除錯。xDIVA使用3D的圖形、顏色和動畫來視覺化除錯資訊。讓使用者以理想的視覺化隱喻(Visualization Metaphor(VM))來視覺化變數和資料結構。 xDIVA的動畫系統的呈現方式是將使用者決定的兩中斷點的狀態畫面中加上插補(interpolation),其中VM的移動方式為計算出兩中斷點中所有VM之個別的位移量,並於在每次畫面更新時將需要移動的VM分別移動了長度為( 總位移量 / 動畫中的總畫面數 )的距離,然而這樣的動畫系統在VM移動時容易穿透其他VM,而造成觀看上的混淆。所以本論文提出一套方法減少xDIVA動畫的視覺混淆,在動畫補間產生前計算出VM移動的路徑以避免移動中與其他VM產生重疊,也就是在VM的位移中加入路徑尋找的概念。此方法提供兩種靜態路徑尋找: a. Astar演算法 、 b. VGRAPH演算法,Astar演算法計算出的結果會與原先的路徑較接近,但是產生的速度較慢, VGRAPH演算法產生路徑的方式較快但是計算結果與原先路徑的差異較大。由於採用靜態路徑尋找,VM於實際移動中還是有機會跟其他移動的VM重疊,所以本論文另外提出一個動態修正路徑的方法避免碰撞,使得使用者能從中選擇適合的演算法產生易於觀察的動畫。
Generally speaking, a programmer usually needs to use or maintain the code which is written by someone else. Before he/she is capable of modifying the code, he/she must understand the program. Several entities can help understanding a program. For example, a design document, if available, can greatly help the understanding of a program. However, a design document might be out of date or inconsistent to the code. Tracing the source code is often used as a last resort. It is common to trace a program by debugger. The programmers set break points inside the program and then execute the program in debug mode to observe the change of variable values in order to understand how does the program work. In recent years, although there have been some software visualization tools to visualize the data structure in the program by graphic and try to help programmers debugging, but these tool have many restrictions on the practical use which make the programmer not use these visualization tool every day. Therefore, we propose a visualization debugging tool xDIVA[1] to help programmers debugging. xDIVA use 3D graphics, color and animation to visual debugging information. xDIVA allows the user choosing the desired visual metaphor (Visualization Metaphor (VM)) to visualize variables and data structures. xDIVA animation system to generate interpolated frames between key frames, where key frames are snapshots of the 3D scene at breakpoints. The VM moving in the animation which may pass through other VM, this situation will cause the visual confusion when programmer watching the animation. To solve this problem, this paper presents a method to reduce the visual confusion xDIVA animation by giving a collision-free path to the moving VM. We provide two static path-finding algorithm: A*(Astar) and VGRAPH for user to generate a path for VM. The path computed by A* is similar to the original way by interpolation, but it take much more time in computing; the path generated by VGRAPH is very different from the original path but It’s computing time is less than A*.The environment in DIVA is 3D, so the path generated by static path-finding algorithm still have chance to collide with dynamic object. Therefore, we propose a dynamic path-modifying algorithm to solve the problem.

Description

Keywords

軟體視覺化, 路徑尋找, software visualization, path-finding

Citation

Collections

Endorsement

Review

Supplemented By

Referenced By