Extensions (for NetLogo 4.0)
Bundled extensions
The source code for the Array, Table, GoGo, Profiler, GIS, Sample, and
Sound extensions is included with NetLogo 4.0.5. Look in the
extensions directory in your NetLogo installation.
Palette
This extension
allows you to create multi-color gradients using rgb color lists.
Additionally you can use or browse
ColorBrewer color schemes.
Info and download:
Palette extension for NetLogo 4.0
Speech
This Mac OS X-only extension provides speech-synthesis capabilities
to NetLogo. It is implemented with a Mac OS X
text-to-speech class library called
A Humble Narrator.
Download:
Speech extension for NetLogo 4.0
User Submitted Extensions
These extensions are contributions from the user community and are not included with NetLogo. These extensions are authored by the individual contributor and are not checked by the CCL staff.
Shell (by Eric Russell)
Unzip the following archive to your extensions folder, and you can do things like:
(Mac) observer> show shell:exec "ls"
(Windows) observer> show (shell:exec "cmd" "/c" "dir")
The included commands are:
- shell:pwd => reports current working directory
- shell:cd <directory> => change current working directory
(relative to current directory unless <directory> begins with a drive
letter on Windows or a forward slash on Mac/Unix)
- shell:getenv <name> => reports value of environment variable
- shell:setenv <name> <value> => sets environment variable
- shell:exec <command>
(shell:exec <command> <param> ...) => execute command synchronously and
report a string of the results it prints to stdout
- shell:fork <command>
(shell:fork <command> <param> ...) => execute command asynchronously and
discard the results
The source code and makefile are included.
Download:
Shell Extension
Modified Profiler Extension (by Roger Peppe)
This is an updated version of the profiler extension bundled with
NetLogo.
I measured it as approximately 10 times faster than the old one.
I'm sure there's still room for improvement, though!
I also changed it to replace the inclusive- and exclusive-time primitives
with the single reporter, profiler:report-values,
which reports a data structure containing all of the profiler information.
(Note that these improvements to the 4.0 profiler have been incorporated into the profiler
extension that ships with NetLogo 4.1.)
Download:
Modified Profiler Extension
Modified Array Extension (by Roger Peppe)
This updated version of the array extension bundled with
NetLogo contains a few changes made to make certain operations more efficient:
- a primitive for quickly creating an array
populated with a single object, rather having to first create a list
- a primitive to allow extension (growing) of the array by
setting the element one beyond the end of the array
- a primitive to make it easy and efficient to copy
subsections of an array to another array
Download:
Modified Array Extension
Strings (by James Steiner)
This provides NetLogo versions of a few standard Java string reporters:
- upper-case ( ... )
- lower-case ( ... )
- trim (removes leading and trailing whitespace)
- starts-with (* true if the first string matches the start of the second string)
- ends-with (* likewise, but matches the end of the second string)
- explode (convert string to a list of characters)
- rex-split (split string to a list, on the given regular expression pattern)
- rex-replace-first (replaces the first match of the pattern in the string with another string)
- rex-replace-all (like replace-first, but replaces all pattern matches)
- rex-match (reports true if the pattern exactly matches the string)
- from-file (** reports the entire file contents as a single string)
- message-digest-5 (reports the md5 hash of the string)
- hash-code (reports the integer hash code of the string)
* this are in-fix operators, i.e. if my-string string:starts-with prefix [ print true ]
** from-file seems to only work well with absolute file paths, as it doesn't seem to hook into the current-directory as expected/hoped.
Download:
String extension
Multiple Random Number Generator (by David O'Sullivan)
Usage is:
- rngs: initialise resets everything, deleting all existing random number
generators (RNGs) in the extension
- rngs: set-seed initialises a RNG that will be referred
to by the supplied id number, with the supplied (positive integer) seed
value. A seed value of 0 will be initialised from the system clock
- rngs: random-float returns a random float between 0 and the
specified range from the RNG with the supplied id. This can only be
called if rngs:set-seed has previously been used to create the specified RNG
Download:
Multiple random number generator extension
Priority Queue (by Roger Peppe)
Provides a priority queue type:
- pq:new (reporter) - create and return a new priority queue.
- pq:add q p item (command) - add item with priority p (a number) to the priority queue q.
- pq:remove q (reporter) - remove and return the item with the highest priority from tq. this gives an error if there are no items currently in the queue.
- pq:delete-item q item (command) - delete item from the queue. this operation takes O(n) time, where n is the number of items in the queue.
- pq:peek q (reporter) report the item in the queue with the highest priority, or raise an error if there are no items in the queue.
- pq:peek-priority q (reporter) - report the highest priority in the queue, or raise an error if there are no items in the queue. (actually i think in this version, this it not yet implemented).
- pq:length q (reporter) report the number of items in the queue q.
Download:
Priority Queue Extension
|