NetLogo allows users to write new commands and reporters in Java and other languages and use them in their models. This section of the User Manual introduces this facility and shows how to use an extension in your model once you have obtained or made one.
Extensions created by members of the NetLogo community are available from https://github.com/NetLogo/NetLogo/wiki/Extensions.
For information on creating your own extensions, go here.
To use an extension in a model, add the
extensions keyword at the
beginning of the Code tab, before declaring any breeds or variables.
comes a list of extension names in square brackets. For example:
extensions [sound speech]
tells NetLogo to find and open the specified extension and makes the
custom commands and reporters found in the extension available to the
current model. You can use these commands and reporters just as if
they were built-in NetLogo primitives.
NetLogo will look for extensions in several places:
extensionsfolder in the same location as the NetLogo application.
Each NetLogo extension consists of a folder with the same name as the
extension, entirely in lower case. This folder must contain a JAR
file with the same name as the folder. For example the
extension is stored in a folder called
sound with a file
To install a NetLogo extension for use by any model, put the
extension's folder in the
extensions directory in
the NetLogo directory. Or, you can just keep the extension's
folder in the same folder as the model that uses it.
Some extensions depend on additional files. These files will be in the extension's folder along with the JAR file. The folder may also contain other files such as documentation and example models.