juliana
juliana

Reputation: 101

How to sprout turtles if consists 2 set of breed

how to sprout all turtles for this case, if i want them locate only on blue patches.

breed [type1s type1]
breed [type2s type2]

to setup      
  create-type1s  population 
    [ set color white  
      set size 1 ]

  create-type2s ((percent_of_leader / 100) * population ) 
    [ set color black 
      set size 1] 
end  

Before this, I only use below code. is there other way to sprout turtle for above case?

to setup
  ask n-of population patches with [ pcolor = blue]
  [ sprout 1
    [ set color white
      set size 1]]
end

Appreciate if someone can help

Upvotes: 1

Views: 777

Answers (1)

Mars
Mars

Reputation: 8854

You can use sprout-type1s to sprout turtles of the type1 breed. This is a version of NetLogo's sprout-<breeds> command.

(Tip: You can guess that the command that you want, if it exists, would either involve a special way of calling sprout, or a command with a related name. So a good strategy would be to look in in the NetLogo Dictionary that's part of the Help system, searching for commands with names similar to "sprout", or scanning through the command names in the patches or turtles sections near the top of the dictionary.)

Upvotes: 2

Related Questions