|
WinSANAL the Tool for ALGORITHM VISUALIZATION Programmers, as well as programming teachers,
Algorithm Animation
main page IntroductionWinSANAL is a system for algorithm visualization. Its destination is to present the operation of algorithms related to creating and modifying organized data sets or structures such as numerical sequences, arrays, lists and graphs. What is in fact subject to visualization it is data in chosen graphical representation. The system is endowed with a mechanism for smooth data projecting that makes easier observing changes that occur in the visualized program. It has also facilities for modifying data values interactively while the program is run. It is possible to interact with graphical elements as well as to use a symbolic form of data. WinSANAL has been created in the Software Group of the Institute of Computer Science of the Silesian Technical University since 1996. By the construction advantage has been taken of the experiences gained in 1989-1996 while the previous system called SANAL was developped. WinSANAL has the form of a specialized procedure library. It is going to have facilities thanks to that it will be easier to animate user's programs (i.e. to prepare them for display - what we call a projection). The user can also get advantage of readytorun library presentations. How the visualization of a program is performedOur algorithm animation system cooperates with the program that implements the algorithm put to visualization. The system watches the values of variables chosen by the user. When during the execution of the program some of them changes, the system reads out the value and puts it to necessary transformations. Subsequently, it generates the final image which corresponds to the value. See the picture showing the architecture of an algorithm animation system. Preparing a program for a projectionThe algorithm to be presented should be supplied in the form of a program written in C or C++. Preparing an algorithm animation is a twostage process. In the first dtage, after having decided what and how should be depicted during projection, one inserts WinSANAL service function calls to the program source code. In the second stage so called configuration script is prepared. It informs the system what transformations are to be applied to the values of individual variables. For a modified and compiled algorithm various visualization schemes can be applied simply by providing a proper configuration script. In the present WinSANAL version all the process of preparing programs for projection is to be done by hand. However, a great deal of operations can be performed mechanically by using existing standard configuration files. Means of graphical presentationThe system is equipped with an extensive set of means of graphical presentation as well as of translation of data. For presenting individual elements we use so called grels - standardized graphical elements. Among others, grels in the form of simple geometrical figures (such as rectangles or ellipses) are available, as well as bitmap grels (i.e. ones displayed in the form of a bitmap). Objects destined to represent character or text variables, as well as vertices and edges of graph structures, can be used, too. Images of complex data structures can be constructed by using linked sets of basic grels. The repertoire of grels is open - the user can create new kinds of them by himself. Translation of data values to grel aspects corresponding to them is done by internal translators. Translator categories that are available now are able to do simple (for example linear, sinusoidal) functional transformations, thresholding, value comparisons and so on. Translators may be also used to form trajectories which should be followed by moving elements (default trajectories are rectilinear). Interaction with the userDuring a presentation the user may actively interfere with the execution of the program under observation. He or she may modify the values of variables presented on the screen, either by influencing with images that represent the values, or by writing new data in a traditional symbolic form. This purpose serve adequate dialog boxes. It is also possible to interactively adjust the content, rate, graphical windows layout and other parameters of the show to the user's needs. Library of programs ready for projectionTogether with the WinSANAL system a library of ready for presentation programs is delivered. The programs implement classical algorithms of the area of sorting, finding, numeric calculations, developmental systems, automated translation and others. Selected samples may be seen here. Development directionsAt present we intensively work upon a next version of the system. Our aim is to reduce the effort necessary to prepare programs for projection. Several modules are under construction. One of them provides facilities for choosing graphical representation for watched variables as well as for defining desired way of transforming values of variables into adequate aspects of graphical elements. Another module ensures that calls to functions that inform the system on the changes of watched variables values are automatically inserted to the program. We hope that dataflow analysis - a technique used among others in compiler construction - will be useful in performing such a task.
|
This site is a part of personal pages of Jaroslaw Francik. Go
back to his
home page
|