Go to Alexandria's home page
The Library of Alexandria

Mechasphere

Basic Usage

Alexandria Home | Up One Level | Home | Download | Usage | Modeling | Programming

This section is intended to teach the basics of using the Mechasphere program to execute and review existing models. If you want to download the latest version of the program, visit the Download page. If you want to know more about how to create your own models, visit the Modeling section. If you want to dig into the code to understand or extend it, visit the Programming section.

Table of Contents

Introduction
Main Menu
    The Menu Bar
    CPU Utilization
    System Configuration
Planet Viewer
    Upon Opening
    Main Toolbar
    "Capture" Toolbar
    Satellite View
    Interacting with Particles
History Reviewer
    Why Capture?
    The Controls
    Sequence Toolbar
    Playback Toolbar
    Viewer
Experiment Schedule
Your Feedback

Back up to the table of contents Introduction

What does this program do? It allows you to run artificial intelligence (AI) experiments in a digital "Petri dish" by loading existing planet models, executing them, and optionally saving periodic snapshots of the action for later review.

Back up to the table of contents Main Menu


Figure: Main Menu

When you launch Mechasphere.exe, this is the first screen you see. It serves as a launch point for all the other features. The most essential piece is the menu itself, but you see here two other useful features: CPU utilization and system configuration.

Back up to section header The Menu Bar

The menu bar contains the following menus:

Back up to section header CPU utilization

Mechasphere and other rich AI simulations tend to be CPU hogs. Fortunately, as you'll see with the Planet Viewer and History Reviewer, you can control several variables to trade processor time for performance.

Like the Windows Task Manager in Windows XP, this is a simple utility that calculates what percentage of the CPU's time is used by all user applications, including Mechasphere. And like with the Task Manager, it calculates this by seeing what percent of the CPU's time is taken up -- it's always running at 100%, actually -- by the "idle process", a part of Windows that runs whenever no other processes are waiting for processor time and assuming the rest of the time is taken up by the rest of the processes.

It should be noted that I haven't tested what this tool reflects on a multiprocessor computer. If that's an issue for you, I'd encourage you to just ignore this meter. Better yet, compare its output to what you see on your system and let me know.

Back up to section header System Configuration

The settings seen in the group boxes below the CPU utilziation meter are meant to control what settings you'll see when you open new instances of the Planet Viewer. You'll be able to override the defaults in each of those, but it can be a real annoyance to have to do this every time.

Settings are saved immediately as you change them, so you will not find any explicit "save" or "load" buttons.

The "Automatically open most recent design" check box simply indicates that, if checked, the most recently opened (through the Main Menu) planet model should be automatically opened again when this program is restarted. This is great if you work regularly on the same planet model.

If you are interested in further automation of settings, you'll find them located in the "config.xml" file.

I'll be honest and admit I didn't feel like doing this the "right" way and making a separate dialog for settings. I'm sure Microsoft's UI gurus would be appalled. Still, this serves the purpose and is unambiguous, so I hope I can be forgiven for this expedient.

Of course, you can minimize this window if it gets in your way. But if you do want to keep the window open for the menu and / or CPU utilization meter but do not want to see these options, try the Tools | Show Options menu item. It toggles the showing and hiding of the options. When this menu item is unchecked, you'll see the Main Menu window looking like the following:


Figure: Main Menu with settings hidden

Back up to the table of contents Planet Viewer

The Planet Viewer is the main workhorse of this system. It loads and embodies a planet model and makes it visible to you in its "satellite view", as shown below. From here, you can set the world in motion and watch as the action unfolds. You can also opt to set it going unattended but capturing snapshots at various intervals for later review.


Figure: Planet Viewer

Back up to section header Upon Opening

You can't select a planet to open from this window. You do so from the Main Menu or the Experiment Scheduler.

When this window does open, you may see an error message if the file is not found or if there is an error in it. If it's the latter, you should be able to click the "Reopen" button once you correct the problem.

If it does successfully open, you'll see the satellite view zoomed to a level appropriate to roughly fit the planet in the window. You can override this zoom level from this point on, of course.

You'll also see that the settings reflected on the toolbars match the defaults on the Main Menu. Again, you can alter these and even click the "Save as Default" button to make these settings be used by new instances of the Planet Viewer you choose to open from now on.

Back up to section header Main Toolbar

The main purpose of this toolbar, distinguished by the "Main:" label on the left, is to control the basic progress of execution of a planet. You'll find the following elements on it, from left to right:


Figure: Planet Viewer's main toolbar

Back up to section header "Capture" Toolbar

Some planets execute too slowly for one to clearly grasp what is going on as time passes. For this and various other reasons, I added in a feature to allow you to "capture" snapshots at any point in time during execution.

Snapshots are saved in the "Frames" subfolder. A folder is created with the same name as your planet mode (minus ".planet"). In it are created individual numbered subfolders for each sequence. Each time you open a new Planet Viewer or click the "Reopen" button, a new sequence is started and captured images will get placed in its new folder. Note that the folders do not get created for a sequence until the first attempt to capture an image from it, so don't expect to find a litter of empty folders.

The files are saved in the PNG format. Normally, I'm a fan of the GIF or JPEG formats, but in this case I found the best compression rates for the perfect quality of the files saved using PNGs. You should have no problem sharing individual snapshots with your colleagues or making them available via your web site.

The snapshot file is named as the point in time (e.g., "0000000000070.png" for clock tick 70). This means if you capture once every N ticks, expect the file names to skip by N numbers. This also means if you change settings while paused and hit "Now" again, the previously captured snapshot at this point in time will be overwritten.

Note that, while you can, you probably should not change capture settings during an individual run, as this may give you and others studying a run headaches as they run into the abrupt shifts in frame rates, zoom levels, etc.

The "capture" toolbar controls how the viewer captures images. It assumes that what you capture is not necessarily what you see in the viewer itself. Following are the features available on this toolbar from left to right:


Figure: Planet Viewer's "capture" toolbar

Back up to section header Satellite View

I refer to the currently only way of viewing a planet as the "satellite view" because I like to think of what you see through the viewer as a "ground" to look down upon with a layer of stuff floating just above it. In the Planet Viewer, you can pan and zoom on the world in fairly straightforward ways.

The scroll bar above the viewer allows you to adjust the zoom level up or down. The currently selected level is indicated in the label at left (e.g., "Zoom (12x)"). Rather than go with the more common view of zoom levels expressed in percents, I settled on this more simple concept of multiples of the lowest level (1x).

When zoomed in such that some of the image is truncated by the window, it's easy to "pan" the image -- to bring other parts not currently visible into view. You can use the scroll bars to the left and below, of course, but you can also right-click the viewer and drag. Once you start dragging, the cursor will disappear while you continue to hold the right mouse button down.

Back up to section header Interacting with Particles

It's nice to think that one can tee up an experiment and have it proceed forward by itself, but sometimes it's just easier to get past stumbling blocks in a design or test out hypotheses by manipulating objects directly and without having to change the planet model or reload.

You can left-click on any particle and thus drag it. This can be done while action is paused or during execution. You can even impart a velocity on the particle by releasing it while your mouse is in motion, as opposed to stopping over some point and then releasing the mouse button. The exception to this is particles with fixed positions. You can move these, but they will never continue to move in any direction once you release the mouse button. I often take advantage of this by using fixed-position particles as "paddles" for bumping against objects of interest.

Back up to the table of contents History Reviewer

Once you've executed a planet model in the Planet Viewer and captured snapshots along the way, you can easily view the saved PNG files with an image viewer, but I tailored the History Reviewer to suit a broader range of needs related to Mechasphere projects. You can step through individual images like a slide show or have the whole thing animated at whatever speed you wish and even watch it in reverse.

Back up to section header Why Capture?

One huge benefit to capturing snapshots during execution is that one can review animations at a much faster rate when they're just image files than during an actual run of a planet, which involves so much calculation. And you can't skip steps during planet execution in order to increase animation speed, which you can do here in review, further making it so the speed of the animation can be as slow or fast as one wishes.

Another distinct benefit is repeatability. While most basic experiments will act the same no matter how many times one executes a planet, you or I may eventually implement decision-making components that operate in separate processes or threads, which would result in experiments not being precisely repeatable. Being able to go back in time over and over again in the reviewer and have a guarantee that what one witnesses never changes is valuable for proper study.

Note that you can run the "MechasphereReviewer.exe" program directly without the need to load the Main Menu. And you can run as many copies as you wish.

Back up to section header The Controls

Following is a screen shot of the reviewer:


Figure: History Reviewer

The user interface is broken down into a "sequence" toolbar, a control toolbar, and the viewer itself.

Back up to section header Sequence Toolbar

Since snapshots are placed in a regular structure of folders, I thought it simpler to build this interface around a knowledge of its hierarchy instead of using a typical "browse" dialog to go find a sequence to play.


Figure: History Reviewer's sequence toolbar

The controls on this toolbar are, from left to right:

Selecting a sequence from the drop-down list causes it to be immediately loaded in the viewer.

Back up to section header Playback Toolbar

Once you've selected a sequence to review, you'll use this toolbar to control the viewer's behavior.


Figure: History Reviewer's playback toolbar

The controls on this toolbar are, from left to right:

Back up to section header Viewer

There's nothing particularly interesting you can do with the viewer. If you're wondering about zooming and panning, I just got lazy with this one and didn't bother implementing it. Perhaps I will in a later version.

Resist the occasional urge to grab a particle and drag it around. Remind yourself it's just a snapshot of a lost moment in time.

Back up to the table of contents Experiment Schedule

More and more I find myself wanting to run experiments unattended, capturing snapshots every few ticks of the clock, and reviewing the resulting animations later. Sometimes I would leave the machine to run for hours and find a gigabyte or more of disk space taken up by these snapshots. If I let it go long enough, it would eventually crash my computer by filling the hard drive. I decided I needed a way to limit how much hard drive space was eaten up by snapshots.

The solution was simple: make it so I could have an experiment stop after a certain amount of "time", measured in clock ticks, had passed. You'll see you can do this right in the Planet Viewer. But I also realized it might be worthwhile to schedule execution of experiments in batches. I settled on a somewhat easier to implement solution: the ability to save "schedules" and start executing them at will or all at once.

The result is illustrated below:


Figure: Experiment Schedule

There's not much to explain about this. There's a list of experiments, each of which references a planet model to run and various settings. You can reuse planet models in different experiments. What you're controlling, more than anything, is the various settings you can manually set in the Planet Viewer, especially the "stop after" setting, which is the key to limiting disk space usage.

The very act of editing the list and individual settings results in immediate saving of the schedule, so you'll not see any explicit "save" or "cancel" buttons.

I'll admit this dialog doesn't give you much that's new. If it's useful to you, go for it. I will probably add new features to improve its utility in the future, but my main focus for now is on documenting the system and adding new robotics and brain components.

Back up to the table of contents Your Feedback

This is a free product, so I don't intend to give a lot of tech support for it. Still, I'd like your feedback. What features would you find helpful to your own efforts? How are you using Mechasphere in your own research, classroom, etc.? Send me email to tell me all about your thoughts.


Go to Alexandria's home page Copyright © 2010 The Library of Alexandria. All rights reserved.
Produced in cooperation with Carnell Information Systems, Inc.