soheirpuzzle11
To embed this model in another Web site, use the following link:
<iframe src="http://modelingcommons.org/browse/one_model/3000?embedded=true" />
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
WHAT IS IT?
This example demonstrates a means of using the TIE command to make turtle labels you can position how you want them.
NetLogo always positions turtle labels the same way, in the lower right corner of the turtle's bounding box, and right jusified.
You can sometimes adjust horizontal positioning of labels to your liking by using labels with space characters in them, e.g.:
| set label " foo"
| set label "foo "
This example demonstrates a technique that gives you even more control.
HOW IT WORKS
Instead of setting the label on our turtle directly, we make a second turtle, attach a label to it, position it how we want, and use the TIE command to attach the second turtle so when the first turtle moves, the second turtle comes with it.
We use a directed link from the first turtle to the second turtle, so the "tie" relationship is one-way, so we're free to move the label around without affecting the main turtle.
HOW TO USE IT
Press SETUP, then GO. You can adjust the BANNER-ANGLE and BANNER-DISTANCE sliders as the model runs.
NETLOGO FEATURES
Note the use of the TIE primitive.
RELATED MODELS
Halo Example
Comments and Questions
breed [circles circle] breed [banners banner] to setup clear-all set-default-shape circles "circle" create-circles 40 [ setxy random-xcor random-ycor set size 2 + random 1 ; attach-banner who set label who ] end to go ask turtles [ fd 2 ] tick end
There is only one version of this model, created over 13 years ago by soheir othman.
Attached files
No files
This model does not have any ancestors.
This model does not have any descendants.