buzz_basic

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
buzz_basic [2016/04/13 04:06] – [Development, Compilation and Deployment of Buzz Scripts] ilpincybuzz_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, Compilation and Deployment of Buzz Scripts ====+==== Development, Compilationand Deployment of Buzz Scripts ====
  
-**A dynamic extension language.** Buzz is a [[https://en.wikipedia.org/wiki/Dynamic_programming_language|dynamic language]] that allows one to express complex swarm behaviors with concise scripts. Buzz is designed as an //extension language//. The task of an extension language is to allow the programmer to work at a higher level of abstraction with respect to that of the underlying system. [[buzz_c_cpp|Thanks to its C interface, Buzz can be used with any kind of robot software that can interoperate with C or C++]]. This makes it very simple to install Buzz on practically any existing robot, and also integrate it with frameworks such as [[http://www.ros.org/|Robot Operating System]].+**A dynamic extension language.** Buzz is a [[https://en.wikipedia.org/wiki/Dynamic_programming_language|dynamic language]] that allows one to express complex swarm behaviors with concise scripts. Buzz is designed as an //extension language//. The task of an extension language is to allow the programmer to work at a higher level of abstraction with respect to that of the underlying system. Thanks to its [[buzz_c_cpp|C interface]], Buzz can be used with any kind of robot software that can interoperate with C or C++. This makes it very simple to install Buzz on practically any existing robot, and also integrate it with frameworks such as [[http://www.ros.org/|Robot Operating System]].
  
-{{ :deployment.png?nolink&450 |}}+{{ :deployment.png?nolink&500 |}}
  
 **The bytecode and the BVM.** A Buzz script is compiled through the [[buzz_toolset#bzzc|bzzc]] compiler into bytecode. The bytecode is then uploaded on each robot in the swarm, and executed by every robot individually. The execution is performed by the [[buzz_vm|Buzz Virtual Machine (BVM)]], which is installed on every robot in the swarm. **The bytecode and the BVM.** A Buzz script is compiled through the [[buzz_toolset#bzzc|bzzc]] compiler into bytecode. The bytecode is then uploaded on each robot in the swarm, and executed by every robot individually. The execution is performed by the [[buzz_vm|Buzz Virtual Machine (BVM)]], which is installed on every robot in the swarm.
Line 15: Line 15:
 ==== A Swarm as a Programmable Machine ==== ==== A Swarm as a Programmable Machine ====
  
-{{ :swarmmachine.png?nolink |}}+{{ :swarmmachine.png?nolink&550 |}}
  
 **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). **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).
Line 22: Line 22:
  
 **Communication model.** The robots are assumed capable of exchanging information through //situated communication//. Situated communication is a form of gossip-based information exchange in which, upon receiving a message, a robot is capable of estimating the relative location of the message source. Situated communication is instrumental to many basic swarm behaviors such as pattern formation, flocking, segregation, and chain formation. **Communication model.** The robots are assumed capable of exchanging information through //situated communication//. Situated communication is a form of gossip-based information exchange in which, upon receiving a message, a robot is capable of estimating the relative location of the message source. Situated communication is instrumental to many basic swarm behaviors such as pattern formation, flocking, segregation, and chain formation.
 +
 +==== A Typical Buzz Script ====
 +
 +The [[buzz_syntax_bnf|Buzz syntax]] is inspired to well-known languages such as [[https://www.javascript.com/|JavaScript]], [[https://www.python.org/|Python]], and [[http://www.lua.org/|Lua]] (see also the [[buzz_syntax_cheatsheet|Buzz syntax cheatsheet]]).
 +
 +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, memory cleanup, reset, and stepping. To ensure standardization across different robots, it is considered standard to include into a Buzz script at least these four functions as shown below.
 +
 +<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() {
 +   ...
 +}
 +</code>
  • buzz_basic.1460520371.txt.gz
  • Last modified: 2016/04/13 04:06
  • by ilpincy