New Features in 2.0


Download

New Features

StarLogo README

Welcome to StarLogo 2.0b1!


We've been working hard for quite a while on lots of new features and bug fixes for StarLogo. The biggest news is that StarLogo is now fully native for PowerPC's. No more wierd extensions or memory limitations.

Here's a list of the all of the new features since 1.5:

  • PowerPC native StarLogo (will not run on 68K macs). Requires 8 megs of RAM to run. (So, that 8 meg 6100 just won't do.)

  • 68K native StarLogo (will not run on PPC macs). Requires 5.5 megs of RAM to run.


  • Settings Control Panel

    This lets you control:

    the screen size (1x1 - 251x251),
    the size of of the patches (2x2, 4x4, 8x8, 16x16),
    the maximum number of turtles,
    the number of turtle variables,
    the number of patch variables,
    and the turtle stack size.
    Changes are made when you click OK from the dialog box.
    Changing any of these parameters erases all turtles and patches.

  • Paint Tools

    We now include the ability to paint on the StarLogo window.
    You can paint with patch color or with turtles.
    There are 10 different paint tools:
    pencil, eraser, line, rectangle, oval, filled rectangle, filled oval, polygon, paint bucket, and eye dropper.
    There is also a color palette where you can pick from any one of the 140 basic StarLogo colors.

  • Turtle Shapes

    In 8x8 and 16x16 mode, turtles have shapes. There are 240 shapes. Shape 0 is the turtle shape and Shape 1 is the original StarLogo square turtle. Shapes 2-239 are customizable, though StarLogo will come with a library about 100-150 shapes.

    There is a shapes palette where you can choose shapes and edit them. If you edit a shape, a dialog will pop up with the paint tools. You can then edit the 8x8 and 16x16 versions of the shape. In addition, the color palette includes an extra transparent color, so you can have the background of the patches show through.

    If you have selected a shape from the shapes palette, you can run the mouse over the turtles on the screen and change their shape.

    There are several new primitives for shapes:

    shape, shape-of, shape-at, setshape, setshape-of, setshape-at, psetshape, psetshape-of, psetshape-at, osetshape-of, osetshape-at

  • You can now drag turtles on the StarLogo graphics window.

  • Turtle Monitors

    If you double-click on a turtle in the StarLogo graphics window, a turtle monitor will pop up. You can view the state variables of the turtles and edit them from the turtle monitor. If the turtle dies while the monitor is open, it will go black and say that the turtle is dead. If the turtle is reborn (the same who) the window will open up again. Turtle monitors update every 0.5 seconds while anything is running.

  • Turtle/Patch Iterators

    In order to make things like gravity and bird flocking easier to program, we've introduced turtle and patch iterators to allow you to ask a turtle or patch to iterate over their fellow turtles and patches and either sum, max, min, who-max or who-min their values.

    There are several new commands:

    Summing: These return the total value of the lists when evaluated for every turtle. If there is no turtle that satisfies the condition, it returns 0.

    sum-of-turtles [color], sum-of-turtles-with [color = red] [xcor]

    Minimizing: These return the minimum value of the lists when evaluated for every turtle. If there is no turtle that satisfies the condition, it returns maxnum.

    min-of-turtles [color], min-of-turtles-with [color = red] [xcor]

    (This one is useful for doing gravity:
    setforce min-of-turtles [(mass * mass-of myself) / ((distance xcor-of myself ycor-of myself) * (distance xcor-of myself ycor-of myself))] )

    Note: inside all of these instruction lists, you may use the variable "myself" to refer to the turtle who called min-of-turtles, etc...

    Maximizing: These return the maximum value of the lists when evaluated for every turtle. If there is no turtle that satisfies the condition, it returns minnum.

    max-of-turtles [color], max-of-turtles-with [color = red] [xcor]

    Minimizing: These return the turtle with the minimum value of the lists when evaluated for every turtle. If there is no turtle that satisfies the condition, it returns -1. who-min-of-turtles [color], who-min-of-turtles-with [color = red] [xcor]

    Maximizing: These return the turtle with the maximum value of the lists when evaluated for every turtle. If there is no turtle that satisfies the condition, it returns -1.

    who-max-of-turtles [color], who-max-of-turtles-with [color = red] [xcor]

    Counting: These return the number of turtles that satisfy the condition.

    count-turtles, count-turtles-here, count-turtles-at, count-turtles-with [color = red]

    Picking a Turtle: These return a turtle id that meets the condition.

    one-of-turtles, one-of-turtles-with [color = red], one-of-turtles-here, one-of-turtles-at

    Patch Commands: These commands also exist for patches.

    sum-of-patches [pc], sum-of-patches-with [pc = blue] [count-turtles-here], min-of-patches [pc], min-of-patches-with [pc = blue] [count-turtles-here], max-of-patches [pc], max-of-patches-with [pc = blue] [count-turtles-here],

  • Breeds

    Turtles can now have breeds, which you can use to distinguish groups of turtles from one another. You declare the breeds in a breeds [rats mice] line similar to turtles-own and patches-own, and get quite a few "new" functions.

    create-rats, ask-rats [fd 1], breed, breed-of, breed-at, setbreed, setbreed-of, setbreed-at, osetbreed-of, osetbreed-at, sum-of-rats [color], sum-of-rats-with [color = red] [xcor], count-rats, count-rats-here, count-rats-at, count-rats-with [color = red], one-of-rats, one-of-rats-with [color = red], min-of-rats [color], max-of-rats [color], who-min-of-rats [color], who-max-of-rats [color], min-of-rats-with [color = red] [xcor], max-of-rats-with [color = red] [ycor], who-min-of-rats-with [color = red] [xcor], who-max-of-rats-with [color = red] [ycor]

    Example:

    breeds [frogs birds]

    to breeds-example
    ca
    create-frogs 10
    create-birds 25
    seth 0
    ask-frogs [setc green]
    ask-birds [setc white]
    end

  • Command Renaming

    We've renamed a few commands, as you can see. All of the old names will still work, but you should switch to the new names:

    Old Name New Name
    --------------- ------------------
    turtle-total count-turtles
    turtle-here one-of-turtles-here
    turtle-at one-of-turtles-at
    turtles-here count-turtles-here
    turtles-at count-turtles-at
    pc-count count-pc
    color-count count-color
    pc-count-range count-pc-range
    color-count-range count-color-range

  • New Interface Look

    Thanks to the help of Bjarne Tveskov, we have new icons for the toolbars and a look for the interface widgets.

  • Sprout: It's just like hatch, but the patch does the creating. The turtle is created with the same color of the patch, but all other variables are 0.

    Example: if pc = blue [sprout [stamp black fd 5]]

  • State Values

    You can now assign a state value to a variable, ie. hot or cold, instead of 1 or 2. Here's the syntax:

    globals [foo [high low]]
    turtles-own [size [small big] energy [dead alive]]
    patches-own [particle [dirt dust]]
    By putting a list of names after the variable in the variable lists you can associate those enumerated names with values.

    ie. setparticle dust
    setsize big
    if foo = high [print "really-high!]

  • New Project File Types

    We've modified StarLogo to save all information into a project file when you save your work. This means that when you open a project, all of the state that existed when you saved will be loaded in. (ie. patch colors, the turtles and their variable values, patch variables, etc...) There are new commands for importing and exporting pieces of a project if you want to do development with different backgrounds or different sets of turtles, etc...

    You can import turtles, patches, turtles and patches, a picture (color pictures too!), code, and the info window.

    You can export turtles, patches, turtles and patches, a picture, code, the info window, the plot window and the output window.

  • New Sample Projects

    We've added quite a few sample projects and modified the old ones to use the new features of StarLogo 2.0.

  • Support for Color cameras (like the Color QuickCam) connected via Quicktime.

  • Removed support for 640x400 16 color grayscale monitors.

  • Removed TCP/IP support.

  • A few bug fixes for little problems from 1.5. Division for PPC's is now as accurate as the 68K version.

  • Mouse-xcor, mouse-ycor and mouse-down? now work for turtles.

  • Tail recursion support for observer, patches and turtles.
    You can now do:

    to recurse :x
    ifelse :x = 0 [stop] [fd :x recurse :x - 1]
    end
    and it identifies the tail recursion. StarLogo also identifies tail calls when the recursion calls another procedure.






  • Projects | Documentation | Download | Users | Mailing Lists | Information

    Last Modified: 2/5/97


    To give feedback, send mail to starlogo-request@media.mit.edu