Writing breve Simulations With "steve"

Simulations in breve can be written using a language called "steve". steve is a simple language which aims to allow rapid construction of advanced simulations while avoiding a great deal of the programming overhead associated with constructing simulations in other languages.

[Tip] Don't Be Overwhelmed!

Writing simulations in steve is ultimately quite simple. Due to the number of features provided by the simulation engine, however, this documentation may seem at times overwhelming. Don't panic—make liberal use of the demo simulations provided with the environment and don't be put off if some of the features discussed here are difficult to understand.

"steve" is an object-oriented language. This means that programming in "steve" involves working with components called objects which contain data (variables) and behaviors (methods). In breve, objects can be either real, meaning they have a presence in the simulated world; or abstract meaning that they are used to store data or to perform computations, but do not appear in the simulated world. In order to define agents and their behaviors, one needs to construct these objects and behaviors using the "steve" language. The language is described in this chapter.

First, the classic "Hello, World" program is constructed in steve ([link]). Then, a simple multiagent 3D simulation written in steve is presented ([link]). This sample should give the basic idea of what a breve simulation looks like.

As discussed above, all agents in the simulated world are represented by programming objects. These objects are defined in terms of object templates called classes. The most important object, called the Controller is described in the section The Controller Object ([link]). The section Building Classes ([link]) describes how to construct basic classes in steve.

In order to define the data and behaviors of your classes, you'll need to be familiar with types ([link]) and expressions ([link]). The section Program Control Structures ([link]) discusses loops and conditional statements.

Finally, after learning how to program with steve, you'll want to explore the built-in breve class APIs to learn how to use the features of the breve engine in your simulations.