netlogo change color of a link line - netlogo

The color of a link line seems to be gray how could I change it? (global?)
I searched already at the netlogo dict http://ccl.northwestern.edu/netlogo/docs/dictionary.html but didn't found anything about it.

color is a built-in variable of links just as it is the case for turtles, see here.
So this will change the color for all links:
ask links [set color red]

Related

How to generate Material Design Color set of selected color programmatically?

Question 1.
Let's assume the selected color is #a85c40.
Now, how can we generate the Material color with some nearby shade from that picked color. The nearby material shade will be like shade 800.
Question 2.
How to generate a colors sets of all colors with shade500 ?
You can use this tool to generate the colors.
You can use the colorScheme: property of the ThemeData() and pass a ColorScheme() object where you can set all the desired properties.
This video explains it https://www.youtube.com/watch?v=ZUi3hppgG2s

Netlogo - change shape color

Can I change the color of the shape?
It the shape that I have generated as polygon
I tried
crt 1[
set shape "myPoligon" ;works
set heading 0 ;works
set size 10 ;works
set color red ;doesn`t work
]
Check out the shapes manual: https://ccl.northwestern.edu/netlogo/docs/shapes.html#colors
Basically, when designing shapes you can use any color the shape editor provides. Below the color grid you will find a chooser named "Color that changes:". Here you define a color value, that adjusts according to the color variable of the turtle. All other colors of your shape will not change. By default the color "Gray" is selected. That means all "Gray" polygons and lines of your shape will not be displayed gray. Instead the color is defined by the color variable of the turtle. You can also verify this with the preview shapes at the bottom of the shape editor. They switch colors automatically and indicate areas of your shape that can be changed by setting the color variable of a turtle.

Netlogo: Is it possible to change the size and font of the label attached to a turtle?

I only know the color of the turtle label can be changed. How about the size, position and font(such as if i wanna BOLD it). Thank you
I don't know about position and font. But you can change the size with right-click on the world (where the turtles live) and change the font size there.
Here are some pages that deal with label changes: change label color and another that deals with labels of patches and a model in which the position of the labels is changed.

Dynamic turtle creation in netlogo

I am new to netlogo and was hoping if someone can help me with how to create turtles based on the user input.
In the interface tab i have a slider whose value ranges between 2 & 10. Depending on the value defined by the user using this slider, that many number of turtles should be created.
I tried using multiple if statements but there is a problem in the succeeding steps.
if (slider-value = 2) [create2]
if (slider-value = 3) [create3]
if (slider-value = 4) [create4]
if (slider-value = 5) [create5]
After creating the turtles using the above if conditions, i have to assign some rules to each individual turtle, and i tried again using multiple if statements. But it doesn't seem to work.
Can someone suggest a way, would really appreciate the help.
Thanks in advance!
Regards
You could more simply use the slider thus
create-turtles slider-value [
;things you want the turtles to do for example
set heading 4 * random 90
set shape "turtle"
set color green + random-normal 0 4
]
is this what you are looking for?
I recommend a switch statement.
A switch statement cycles through all your possible commands ,typically with an int. And then selects the match command.
So for example I could make a switch statement that when user inputs the up arrow. the int 1 is the input. this is matched to a command that tells the turtle to move up so many pixels/units/cubes.
I hope that helps.

How do i set the pixel size of patches? [duplicate]

This question already has answers here:
Is the placement of set patch-size within my code correct and is set the right command to use?
(2 answers)
Closed 8 years ago.
I need to be able to draw out roads in the u.i. It is therefore important that I am able to adjust the size of the patches that I use to do this. Please could somebody give an example of source code that I may use to achieve this? cheers
No source code as such but you can make the roads more than one patch wide or give the patches a width variable maybe using pcolor for
visualization.
Ask patches with[road?][set pcolor brown + width]