Charles' netlogo page

For the past few years I have been using an ABM modeling language called NetLogo. I have found it to be, for me, just the right balance between ease of use and complexity. Over that time I have written several procedures that might be useful to others, and two language extensions, one for handling directories, pathdir, and the other containing some numerical analysis tools for finding roots and minima, numanal. I have linked to them below. Feel free to use them in your own work - but no guarantees!

 

Extensions:

pathdir -
an extension for working with directories in NetLogo. pathdir provides tools for finding the current working, user and model directories; creating, moving, renaming, identifying and deleting directories; and listing the contents of directories. pathdir also allows one to find the size and modification date of files. The downloads and documentation may be found at

https://github.com/cstaelin/Pathdir-Extension

See the README.md file for full documentation. pathdir now works only with NetLogo v5.0 and pathdir for NetLogo v4.1 has been depreciated.

numanal -
an extension providing a number of primitives for finding the roots and minima of single variable equations, the minima of multi-variable equations, and the roots of systems of n equations in n variables. 

For single variable equations the primitives include the Brent algorithms for finding the minimum and the root.  For single equations in several variables the primitives include the simplex algorithm for finding the minimum.  Finally, for systems of n equations in n unknowns, the primitives include the Newton and Broyden algorithms for finding the n-dimensional root.  The downloads and documentation may be found here.

stats-

The “stats” extension provides basic statistical functions for data generated within NetLogo models.  stats maintains an internal data table of observations on an arbitrary number of variables and allows the user to find such statistics for the data as the means, medians, quantiles, percentiles, standard deviations, and variance-covariance and correlation matrices; to regress one or more variables on another; and to forecast the value of any variable into the future based on past observations.  Regression statistics include R2, Adjusted R2,  F and the probability of F, and for each of the coefficients, the standard error, T statistic and probability of the T statistic.  stats also provides the areas under the normal, student, binomial and Chi-Square distributions, and their inverses.

Although stats can be used to analyze the overall results of a run of a model, it is intended mostly for the use of “smart” agents who gather and analyze data in order to make decisions.  Agents can maintain their private data tables, or use tables shared as globals, or both.

The downloads and documentation may be found here.

Useful procedures:

simplex -
a procedure that minimizes a multivariate function using the Simplex method. The procedure was adapted from Numerical Recipes in C, 2nd ed, 1992. Our simplex comes in two forms. The first variant (simply "simplex") provides an unconstrained minimization - the elements of the solution vector can be positive, negative or zero. The second variant ("constrained-simplex") forces the solution vector to have all positive or zero elements. (In economics, we normally do not allow prices or quantities to be negative.) The procedure takes as an argument a reference to the procedure containing the function to be minimized . Thus it can be used with arbitrary functions. Other arguments include a list containing an initial guess of the solution, the initial size of the simplex, and a solution tolerance. The final solution vector is returned as a list. The downloads and documentation may be found here.

(Note: since the time these procedures were written as reporters in NetLogo, I have incorporated the simplex procedures in the numanal extension described above. The extension is written in java and is therefore both much faster and more likely to be robust. The numanal extension, however, only works with NetLogo version 5.)