Extensions
Authoring and Sharing
Interested in adding some new functionality to NetLogo by creating your own extension? Have an extension you made and want to add it to the Extension Manager? See the extension authoring page to get started.
Using Extensions
To use an extension in a model, add the extensions keyword at the beginning
of the Code tab, before declaring any breeds or variables.
extensions is followed by a pair of square brackets containing a list of
extension names. For example:
extensions [sound speech]Using extensions instructs NetLogo to make the specified extensions’
commands and reporters available in the current model, just as if they were
built-in NetLogo primitives. An extension must be installed for the
extensions keyword to take effect.
Where extensions are located
NetLogo will look for extensions in several places:
- In the folder of the current model
- The
extensionsfolder within your installation of NetLogo. For typical NetLogo installations:- On Mac OS X:
/Applications/NetLogo 7.0.1/extensions - On 64-bit Windows with 64-bit NetLogo or 32-bit Windows with 32-bit
NetLogo:
C:\Program Files\NetLogo 7.0.1\extensions - On 64-bit Windows with 32-bit NetLogo:
C:\Program Files (x86)\NetLogo 7.0.1\extensions - On Linux: the
bin/extensionssubdirectory of the NetLogo directory extracted from the installation.tgz
- On Mac OS X:
- This subfolder (relative to your home directory):
- On Mac OS X:
Library/Application Support/NetLogo - On Windows:
AppData\NetLogo - On Linux:
.netlogo
- On Mac OS X:
- The
.bundledsubfolder of theextensionsfolder mentioned in Item 2 (for example,/Applications/NetLogo 7.0.1/extensions/.bundledon Mac OS X).
The easiest way to install new extensions is to use the Extension Manager. If an extension you want to use is not available through the Extension Manager, you will have to manually download it and place it into a location described by Item 1 or Item 2 above. Manually modifying the contents of Item 3 and Item 4 above is not supported.
The order listed above is the priority the Extension Manager will use. This
means that if the Extension Manager finds a requested extension for a model
manually installed in the extensions folder, it will not check the extensions
library to see if there are any updated versions to install. As such, you’re
locked in to the manually installed version until you decide to remove it. Also,
any extensions you install through the Extension Manager will override the
bundled extensions that come with NetLogo. This means you can update the bundled
extensions if fixes for them come out after the NetLogo release with which they
were bundled, you don’t have to wait for a full NetLogo release to get updates.
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 sound extension is stored in a folder called
sound with a file inside called sound.jar.
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.