1.3. Installing and Running Command-Line breve on Mac OS X, Linux and Windows

The command-line version of breve allows you to run breve simulations on the command-line both with and without graphical display. The command-line version of breve is available for Mac OS X, Linux and Windows.

NoteFor Windows and Linux Users
 

In order to run the command-line breve on any of these platforms, you'll need to have OpenGL and GLUT libraries installed on your system. If you encounter problems running breve, you may need to install these libraries. They are free available from the internet.

1.3.1. Setting Up Your Environment

Before running breve, you'll need to set up the environment variable BREVE_CLASS_PATH. This variable must contain the location of the "lib/classes" directory included in the distribution. Setting this environment is done differently for different shells and platforms. Some examples are shown below. path to breve is the location of the breve distribution folder that you downloaded.
# tcsh users (Linux & OSX):
	setenv BREVE_CLASS_PATH /<path to breve>/lib/classes

# bash users (Linux & OSX):
	export BREVE_CLASS_PATH=/<path to breve>/lib/classes

# Windows console users:
	SET BREVE_CLASS_PATH=C:\<path to breve>\LIB\CLASSES
You may freely move around the files in the breve distribution (to install them in /usr/local on a UNIX system, for example), but be sure to set your BREVE_CLASS_PATH accordingly.

1.3.2. Running the Demo Simulations

Once your BREVE_CLASS_PATH environment variable is configured, you can get started by running breve with one of the included simulation files. Assuming that you are in the breve distribution directory, you can type:
% ./bin/breve ./demos/Swarm/ArrowSwarm.tz

This command will open a graphical display window containing the simulation, which is initially paused. To unpause the simulation, hit the space bar. When the simulation is running, the following controls can be useful:

The breve command prompt (which can be accessed using the escape key) can be used to execute commands in running simulations. "steve" commands are typed in at this prompt, and will be executed in the simulation's controller object. The steve language (and the controller object) are described in the next chapter (Chapter 2).

1.3.3. The Simulation Menu and Object Contextual Menus

Users can also interact with a running simulation via the simulation menu, which is accessed from the left mouse button, and through the contextual menus associated with objects in a simulation. To access a contextual menu for an object in the simulation, right-click on the object in the simulation display.

By default, the simulation menu and contextual menus are mostly empty. As you begin to customize simulations and construct your own, however, you will be able to add your own custom options to the simulation and contextual menus.

1.3.4. Viewing the Simulation Code

Simulations written in breve use the suffix ".tz" and are regular text files. You can open up the file in your favorite editor to see how it works:
% pico ./demos/Swarm/ArrowSwarm.tz 

If this is your first time running breve, it is recommended that you take the time to explore the demos and their code. By exploring the demos, you'll see how a number of breve's features are used and gain a basic understanding of how simulations are written.

1.3.5. Command-Line breve Without Graphical Display

If you wish to run a simulation without graphical display, you can use the program breve_cli. Follow the same setup directions described above (Section 1.3.1) in order to setup your environment, and then run the simulation:
% ./bin/breve_cli ./demos/Swarm/ArrowSwarm.tz

Textual output will be printed as usual, but no graphical window is shown. This feature is most useful for collecting data when user interaction and observation is unimportant.