Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
buzz_basic [2016/04/12 21:59] – [Development, Compilation and Deployment of Buzz Scripts] ilpincy | buzz_basic [2016/04/17 03:07] (current) – [Development, Compilation and Deployment of Buzz Scripts] ilpincy | ||
---|---|---|---|
Line 1: | Line 1: | ||
===== Basic Buzz Concepts ===== | ===== Basic Buzz Concepts ===== | ||
- | ==== Development, | + | ==== Development, |
- | **A dynamic extension language.** Buzz is a [[https:// | + | **A dynamic extension language.** Buzz is a [[https:// |
- | {{ : | + | {{ : |
**The bytecode and the BVM.** A Buzz script is compiled through the [[buzz_toolset# | **The bytecode and the BVM.** A Buzz script is compiled through the [[buzz_toolset# | ||
Line 15: | Line 15: | ||
==== A Swarm as a Programmable Machine ==== | ==== A Swarm as a Programmable Machine ==== | ||
+ | {{ : | ||
- | **Discrete swarm, step-wise execution.** A swarm is seen as a discrete collection of robots. Each robot independently executes the BVM and the uploaded copy of the bytecode. In the current implementation of Buzz, the bytecode must be the same for every robot (i.e., the robots execute the same script). | + | **Discrete swarm.** A swarm is seen as a discrete collection of robots. Each robot independently executes the BVM and the uploaded copy of the bytecode. In the current implementation of Buzz, the bytecode must be the same for every robot (i.e., the robots execute the same script). |
- | **Communication model.** The robots are assumed capable of exchanging information through //situated communication// | + | **Step-wise execution.** The execution of a script proceeds in //steps//. The time length of a step is defined by the designer who installs Buzz on a robot. Each step is composed of a number of phases: sensor reading, received message processing, execution of a portion of script, message broadcast, and actuation. The length of a step must be chosen so that all phases terminate before the next step is to be started. |
+ | |||
+ | **Communication model.** The robots are assumed capable of exchanging information through //situated communication// | ||
+ | |||
+ | ==== A Typical Buzz Script ==== | ||
+ | |||
+ | The [[buzz_syntax_bnf|Buzz syntax]] is inspired to well-known languages such as [[https:// | ||
+ | |||
+ | In principle, a Buzz script can be organized in any way one likes. Typically, however, a number of standard functions are present, because they need to be called by the underlying system to proceed with the execution. These functions take care of initialization, | ||
+ | |||
+ | <code buzz> | ||
+ | # Executed once at init time. | ||
+ | function init() { | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | # Executed at each time step. | ||
+ | function step() { | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | # Executed once when the robot (or the simulator) is reset. | ||
+ | function reset() { | ||
+ | ... | ||
+ | } | ||
+ | |||
+ | # Executed once at the end of experiment. | ||
+ | function destroy() { | ||
+ | ... | ||
+ | } | ||
+ | </ |