#Netlogo linux code
for the NetLogo code (which we will talk about later). If you use parameters like 3,3 or 4,4, it looks a lot like a Normal distribution, but won't have any out-of-bounds values (it scales from 0 to 1, so it may have to be moved/scaled like you would a normal). If ev ery-thing works properly, one windo w with three tabs should open. Let b median (list 0 (random-normal 0.5 0.1) 1)Īnswering very late to add another option for future seekers.Īnother option if you're looking for a distribution that is bell-shaped like a normal distribution, but bounded, the Beta distribution can be a good choice. Run the experiment using Netlogo (we did this in the terminal in Linux using the headless version of. If you would like to run NetLogo on a Chromebook or in a web browser, please. Analysing Netlogo Simulations Using Netlogo. Otherwise the median is y.įor example, here is the random number in your example clamped to the range : to test Most computers can run NetLogo (see system requirements). If y is less than 0, then the median will be 0. It works because if y is greater than 1, then the median will be 1. Where y is the random number (or put in an expression), 0 is the minimum, and 1 is the maximum. The Linux operating system and the LibreOffice suite are well-known examples, but a lot of the tools used daily by modellers are also open-source. My favorite trick is this: set x median (list 0 (y) 1) It works like NetLogo’s Models Library dialogue but shows every NetLogo model publicly available on GitHub instead. Multiple versions of NetLogo can be installed on the same computer installing a new one doesn’t remove the old one. If you would like to run NetLogo on a Chromebook or in a web browser, please see if NetLogo Web will meet your needs.
#Netlogo linux download
You can get a triangle-shaped distribution of results very simply just by summing two calls to random-float: observer> clear-plot set-plot-pen-interval 0.01 set-plot-x-range 0 1 Download NetLogo Most computers can run NetLogo (see system requirements ). NetLogo (Wilensky 1999) is a user-friendly simulation platform commonly used for agent-based modeling in social and natural sciences. Observer> clear-plot set-plot-pen-interval 0.01 set-plot-x-range -0.1 1.1Īnother solution is to ask yourself whether you really need a bell curve, or whether a triangle-shaped distribution would be just fine. This avoids the spikes at the boundaries: to-report random-normal-in-bounds Observer> histogram n-values 1000000 Īnother possible solution, as Marzy describes in the question itself, is to discard any out-of-bounds results random-normal gives you and just keeping trying again until you get an in-bounds result. Note that this approach creates spikes at the boundaries of the range: observer> clear-plot set-plot-pen-interval 0.01 set-plot-x-range -0.1 1.1
One possible solution is to clamp the output of random-normal within boundaries, as in Matt's answer. As you've discovered, random-normal can be problematic because the result you get back can be literally any number.