This first experience of developing a multiagent model is simplistic but remains nonetheless complete and enables us to understand and grasp the main concepts and techniques useful for defining models and simulations. So as to accomplish this, the reader will be instructed in the development of a simple model which will be expanded upon later. The final aim is for such an individual to be able to write their own models and simulate them within NetLogo by the end of the chapter. Purpose of the chapter This chapter aims to help readers new to programming to discover the NetLogo modeling and simulation platform in an educational manner. Finally, the jump command is executed resulting in a jump of a number of steps corresponding to the result given by the random command with 2 as its input variable. Next, the random command is executed with the value 2 as a variable. In practice, this leads to first executing the square root of 4, with the other instructions being put on hold, while the value of their respective variables is being calculated. Therefore, for the jump random sqrt 4 command, the evaluator begins by reading the jump command, which receives the single variable random, which receives the single variable sqrt, which, in turn, receives the single variable 4. To this rule is added that of the left–right analysis of instructions. Thus, the jump command followed by the variable 10 which makes the turtle move by 10 steps is written as follows: jump 10.
A command must always be placed before any eventual There is only one single syntactic rule used in Logo: that of prefix notation. This choice is also found in other programming languages such as Caml4 or Python5. Even though this might be slightly perturbing for those used to other programming languages, the choice to not require direct input was made as it is closer to the way that non-programmers think. Type assignment is done based on the data used in the instructions.
Finally, Logo is flexible as it does not require the direct input of the figures used. This modularity allows for the construction of large projects. The language is modular, which means that commands can be grouped to form more complex sequences that can be made into new terms and are combined to form the complete program. the jump 10 command results in the turtle moving by 10 steps), which will send back an error message if the command cannot be carried out. These commands are interpreted by Logo as an order (e.g. Logo is an interpreted programming language, which means that each line (containing a particular command) inputted by the user is immediately executed. It is from the observation of this fact that the premise for Logo came about, a language that was intuitive for the learner and close to natural language as a result of being interactive, modular and flexible. However, none of the programming languages available at the time were adapted for use by young learners. With the advent of the first computers in the 1980s, researchers began to ask themselves about their utility within an educational context: how were computers to be used to enable the teaching of dynamic and complex worlds? Computers needed to be a medium that bridged the difference between the learner’s need for knowledge and the world to be explored, which implied a need for a language permitting the learner and the computer to communicate. Papert was largely inspired by the constructivism of Jean Pigaet with whom he had worked several years before. This language was created in 1967 by a collaborative effort between Wallace Feurzeig and Seymour Papert. Īgent-based Spatial Simulation with NetLogo 1 This stems both from its graphical interface and the programming language used,Ĭhapter written by Frédéric A MBLARD, Eric D AUDÉ, Benoît G AUDOU, Arnaud G RIGNARD, Guillaume H UTZLER, Christophe L ANG, Nicolas M ARILLEAU, Jean-Marc N ICOD, David S HEEREN and Patrick TAILLANDIER. A little history When NetLogo is presented in workshops, the first advantage expressed is that of how easy it is to pick up and use. The history of Logo allows for a partial understanding of NetLogo’s philosophy. It is the latter that has had the greatest influence on the programming language used by NetLogo, known as Logo3, which was itself inspired by the Lisp programming language family.
Developed at the Center for Connected Learning, the software currently draws from StarLogoT1, which is available for Mac OSX, and StarLogo2, which was developed at MIT’s Media Laboratory. Introduction NetLogo is a programming environment which allows for the construction and exploration of agent-based models.