breve Documentation: version 1.9 | ||
---|---|---|
<< previous | Chapter 1. Introduction | next >> |
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.
![]() | For 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. |
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 |
/usr/local
on a UNIX system, for example), but be sure to set your
BREVE_CLASS_PATH
accordingly.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:
Space bar: pause/unpause the simulation
F1: run simulation forward one iteration
Left mouse: rotate simulation, and select objects (described below)
Right mouse: simulation menu, or contextual menu for currently selected object (described below)
Shift + left mouse: select and drag objects in the simulation
F2 + left mouse: zoom in and out of the simulation
Escape: to quit the simulation, or access the breve command prompt
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).
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.
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.
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.
<< previous | breve Documentation table of contents | next >> |
Installing and Running the breve Application on Mac OS X | up | "steve" Language Reference |