Available Animations

Why are the "current animations" so outdated?

A perceptive user has asked why the file date of most of the animations in the "current animations ZIP archive" is so far outdated. Most animations are several years old, so how can I claim that "something new is happening with ANIMAL"?

There are actually some good (and some not-so-good) reasons for this being as it is…

  • The animations in the ZIP archives have been hand-crafted, a painstaking and comparatively slow process of (usually) a couple of hours. As such, there is no "code" available that can produce or reproduce the exact animations.
  • The ZIP is a convenience service that outlines some of the things that ANIMAL can do. However, some of the more current things are missing, and this especially concerns the Generator Framework that allows you to create animations on-the-fly, with just a few mouse clicks and entering the data to work upon. (Assuming that an appropriate generator exists, that is).
  • Since the introduction of the Generator Framework, it would be easy to generate an (almost) arbitrary number of example animation, by the simple expedient of entering different parameter values to the generator. However, to me, this would feel a bit like "cheating", as it means I can drive up the "number of available animations" to any arbitrary value, given enough mouse clicks (and time).
  • Thinking about it, I could have generated one example animation for each generator and included this in the (old) ZIP archives. However, this simply never occurred to me, since the current approach of generating animations is so easy. Thus, the new content is not "included".

In case that you are wondering how to generate animations "with just a few mouse clicks and entering the data to work upon", please follow these simple steps, as outlined in the "How to create animations using a generator" page:

  1. Start ANIMAL.
  2. Select the File menu and choose the Generate… option. After a few seconds, a new window opens that seems to include only one node.
  3. Double-click the Generators tree node to open the first level of the generator tree, containing the natural languages used for explanations (given by their ISO code, i.e., en for English, de for German etc.). Double-click the language you prefer.
  4. Similar to step 3, double-click nodes to select the underlying programming language (e.g., Java), algorithm type (e.g., Sorting) and concrete algorithm (e.g., Insertion Sort). You now see a list of available generators. Choose one by clicking on it, reading the description in the window to the right, and then click Confirm below.
  5. Configure the run-time parameters of the algorithm. These will be either primitive values - the data the algorithm works on - or graphical properties - adjusting how elements are shown, for example by changing colours. Click Confirm again when you are done.
  6. Select a file to save the animation to and click Confirm. Alternatively, ignore the file dialog and click Confirm directly to ask ANIMAL to open the animation at once.

When you closely look at the Generator window, you will see that more than 300 different algorithm generators are shipped with ANIMAL. Imagine how large the example animation ZIP file would be if I included at least one animation from each generator…!

New Feature: Automatic Counting of Accessing

Version 2.3.30 of ANIMAL introduces a new, easy to use yet expressive feature: automatic visualization of read- and write-accesses to data structures at the animation author's request!

For an example, see the following screenshot taken from an (unspectacular) execution of Selection Sort:

Screenshot 2 11 13 12 14 PM-2

The interesting information here are the two bars indicating the number of assignments and (read) accesses on the array, so far - 6 and 42, respectively.

You might ask yourself what the animation author has to do to get this functionality… Well - the answer is: not much!

Here is the complete code, which will be explained in a moment:

    counter = lang.newCounter(array); // array holds a reference to the actual array.
    CounterProperties cp = new CounterProperties();
    cp.set(AnimationPropertiesKeys.FILLED_PROPERTYtrue);
    cp.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.BLUE);
    view = lang.newCounterView(counter, 200, 100, cp, true, true);

First, we create a new counter on the array used to hold the values. This creates a new counter that will now monitor read and write accesses to the array.

Then, we create and specify the visual properties of the counter. It shall be filled (line 3) and the actual fill color shall be 4 (line 4).

Finally, we create a view for the counter. This receives the counter itself (created in line 1), the x and y coordinate, the counter properties created in line 2, and two final boolean parameters indicating whether we want to see the numeric value and/or the bars. Here, we want to see both, and thus pass in true twice. And… that's it! All future accesses to the array will now be counted and visualized, until you use view.hide(); to hide the complete visualization from the end user.

© Dr. Guido Rößling 1998-today — Datenschutzerklärung