Dimi
Dimi

Reputation: 541

reconfiguring the model with the use of at least two breeds

so what i want to do is to reconfigure the model with the use of at least two breeds and than try to change the breed while the simulation is running. many thanks .

to setup
  ca
  reset-ticks
  create-turtles nBugs [set color red set size 2]
end

to go
 tick
 if ticks >= nCycles [stop]
 foreach sort turtles
  [ ?1 ->
    ask ?1

      [ set xcor xcor + random 3 - 1
        set ycor ycor + random 3 - 1

        if random-float 1 < 0.1 [set size size + 0.5]
        ifelse ycor <= 0 [set color yellow]
                         [set color blue]


        type "I'm agent " type who type " and I'm in " type xcor type ", " print ycor
      ]
  ] ;comment IF using simple ask

end

Upvotes: 1

Views: 32

Answers (1)

mattsap
mattsap

Reputation: 3806

If you're only asking about how to change the breed during run-time, you can just assign the breed variable to the new breed.

ask turtle 0 [ set breed some-other-breed]

Upvotes: 1

Related Questions