1

I have the following in netlogo

ask m-depts [ ; this check the values of turtles against some set numbers 
ifelse 
 (m- k >= 5) and (m-t >= 3) and (m-c >= 3 ) and (m-s >= 4) and (m-b >= 3) and (m-d >= 0) [
move-to one-of patches with [pcolor = yellow]  
] [
 ifelse 
 (m-k >= 5) and (m-t  >= 5) and (m-c  >= 5 ) and (m-s >= 5) and (m-b >= 3) and (m-d >= 1) [
move-to one-of patches with [pcolor = green]    
] [
  action-m-depts
] ]]]
]

1st I want to add some conditions (set ……… ) if the turtle will move to yellow and also some other condition if it will move to green eg

 If pcolor = yellow [
    set m-k m-k + 0.5
    set m-t m-t + 1 
    ] ; 
 If pcolor = green [
    set m-k m-k + 0.8
    set m-t m-t + 2 
  ] ; etc  otherwise do action-m-depts (defined elsewhere)

2nd For the next move (ticks) I want to fix the turtle to wait at the patch eg (for yellow patch, wait for 5 years (5 ticks) and for green patch wait for 2 year (2 ticks). How should I incorporate the two issues in this model?

Sam
  • 7,252
  • 16
  • 46
  • 65
lubida1
  • 49
  • 3
  • also asked at http://netlogo-users.18673.x6.nabble.com/Setting-variables-in-Netlogo-ifelse-function-and-making-turtle-to-wait-in-the-patch-td5004733.html and http://netlogo-users.18673.x6.nabble.com/Setting-variables-in-Netlogo-ifelse-function-and-making-turtle-to-wait-in-the-patch-before-move-out-td5004726.html – Seth Tisue Apr 28 '14 at 23:39

1 Answers1

0

The code you have for the first part looks good to me. Have you tried it? I say go for it!

The second part is very similar to netlogo: how to make turtles stop for a set number of ticks then continue and Making turtles wait x number of ticks — check out those answers.

Community
  • 1
  • 1
Seth Tisue
  • 29,985
  • 11
  • 82
  • 149