Netlogo

Open a new NetLogo file, set the world window settings with the origin at the bottom left, a max-pxcor of 719 and and max-pycor of 359, and a patch size of 1. Save your NetLogo model in the same directory as the vegcover.asc file, and the following NetLogo code should do the trick. NetLogo is a user-friendly platform that can be very useful to start with (providing a lot of libraries and examples in various areas). Recently, I supervised an undergraduate student's. NetLogo was created by Uri Wilensky and is under continuous development at the Northwestern's Center for Connected Learning and Computer-Based Modeling.It is also important to acknowledge Seth Tisue, who 'worked meticulously to guarantee the quality of the NetLogo software' (Wilensky and Rand, 2015, p. Xxii) as lead developer for over a decade. Historically, NetLogo is the next generation of the series of multi-agent mod-eling languages including StarLogo Resnick & Wilensky, 1993 Resnick, 1994. NetLogo is a standalone application written in Java so it can run on all major computing platforms. After five years of development, NetLogo is a mature product that is stable and fast. NetLogo was designed with multiple audiences in mind, in particular: teaching children in the education community, and for domain experts without a programming background to model related phenomena. Many scientific articles have been published using NetLogo. The NetLogo environment enables exploration of emergent phenomena.

  1. Netlogon Fix
  2. Netlogo Web
  3. Netlogo Shapes
  4. Netlogon Error 5719

Common Netlogo Commands:


setxy x y

The turtle sets its x-coordinate to x and its y-coordinateto y.

Equivalent to set xcor x set ycor y, except it happens inone time step instead of two.

If x or y is outside the world, NetLogo will throwa runtime error.

ask agentset [commands]
ask agent [commands]

The specified agent or agentset runs the given commands.

ask turtles [ fd 1 ]
;; all turtles move forward one step
ask patches [ set pcolor red ]
;; all patches turn red
ask turtle 4 [ rt 90 ]
;; only the turtle with id 4 turns right

Note: only the observer can ask all turtles or all patches. Thisprevents you from inadvertently having all turtles ask all turtles orall patches ask all patches, which is a common mistake to make ifyou're not careful about which agents will run the code you arewriting.

Note: Only the agents that are in the agentset at the time theask begins run the commands.

clear-turtles

Kills all turtles.

Also resets the who numbering, so the next turtle created will beturtle 0.

die

The turtle or link dies.

create-turtles
crt
create-<breeds>

create-turtles number
create-turtles number [ commands ]
create-<breeds>number
create-<breeds>number [ commands ]

Creates number new turtles at the origin. New turtles haverandom integer headings and the color is randomly selected from the 14primary colors.

If the create-<breeds> form is used, the new turtlesare created as members of the given breed.

If commands are supplied, the new turtles immediately runthem. This is useful for giving the new turtles a different color,heading, or whatever. (The new turtles are created all at once then runone at a time, in random order.)

crt 100 [ fd 10 ] ;; makes a randomly spaced circle
breed [canaries canary]
breed [snakes snake]
to setup
clear-all
create-canaries 50 [ set color yellow ]
create-snakes 50 [ set color green ]
end

show

show value

Prints value in the Command Center, preceded by the callingagent, and followed by a carriage return. (The calling agent isincluded to help you keep track of what agents are producing whichlines of output.) Also, all strings have their quotes included similarto write.

set-default-shape

set-default-shape turtles string
set-default-shape breedstring

Netlogo

Specifies a default initial shape for all turtles, or for aparticular breed. When a turtle is created, or it changes breeds, itshape is set to the given shape.

This command doesn't affect existing turtles, only turtles youcreate afterwards.

The specified breed must be either turtles or a breed defined bythe breedkeyword, and the specified string must be the name of a currentlydefined shape.

In new models, the default shape for all turtles is 'default'.

Note that specifying a default shape does not prevent you fromchanging an individual turtle's shape later; turtles don't have to bestuck with their breed's default shape.

create-turtles 1
;; new turtle's shape is 'default'
create-cats 1
;; new turtle's shape is 'default'
set-default-shape turtles 'circle'
create-turtles 1
;; new turtle's shape is 'circle'create-cats 1
;; new turtle's shape is 'circle'
set-default-shape cats 'cat'
set-default-shape dogs 'dog'create-cats 1
;; new turtle's shape is 'cat'
ask cats [ set breed dogs ]
;; all cats become dogs, and automatically
;; change their shape to 'dog'

tick-advance

tick-advance number

Advances the tick counter by number. The input may be aninteger or a floating point number. (Some models divide ticks morefinely than by ones.) The input may not be negative.

See also tick,ticks,reset-ticks.


n-of

n-of sizeagentset
n-of sizelist

From an agentset, reports an agentset of size size randomlychosen from the input set, with no repeats.

From a list, reports a list of size size randomly chosenfrom the input set, with no repeats. The items in the result appear inthe same order that they appeared in the input list. (If you want themin random order, use shuffle on the result.)

It is an error for size to be greater than the size of theinput.

reset-ticks

reset-ticks

Resets the tick counter to zero.

See also tick,ticks,tick-advance.

if

if condition [ commands ]

Reporter must report a boolean (true or false) value.

If condition reports true, runs commands.

The reporter may report a different value for different agents, sosome agents may run commands and others don't.


ifelse

ifelse reporter [ commands1 ] [ commands2]

Reporter must report a boolean (true or false) value.

Netlogon Fix

If reporter reports true, runs commands1.

If reporter reports false, runs commands2.

The reporter may report a different value for different agents, sosome agents may run commands1 while others run commands2.

Netlogo 2d

See also if,ifelse-value.

patch-here

patch-here

patch-here reports the patch under the turtle.

Note that this reporter isn't available to a patch because a patchcan just say 'self'.

face

face agent

Set the caller's heading towards agent.

If wrapping is allowed by the topology and the wrapped distance(around the edges of the world) is shorter, face will use the wrappedpath.

If the caller and the agent are at the exact same position, thecaller's heading won't change.

facexy

facexy numbernumber

Set the caller's heading towards the point (x,y).

If wrapping is allowed by the topology and the wrapped distance(around the edges of the world) is shorter and wrapping is allowed,facexy will use the wrapped path.

If the caller is on the point (x,y), the caller's heading won'tchange.

Netlogo Web

random

random number

If number is positive, reports a random integer greaterthan or equal to 0, but strictly less than number.

Netlogo Shapes

If number is negative, reports a random integer less thanor equal to 0, but strictly greater than number.

If number is zero, the result is always 0 as well.

Netlogon Error 5719

Note: In versions of NetLogo prior to version 2.0, this primitivereported a floating point number if given a non-integer input. This isno longer the case. If you want a floating point answer, you must nowuse random-floatinstead.