I'm new to Netlogo and have been using it to try to develop a small conceptual model for a volunteer transportation pickup service. The whole concept is that every predetermined amount of time, the turtle agents are "assigned a trip". This is symbolised in the model by their color changing to show one of 4 possible trip types. This "trip" then comes to an end when either the turtle covers the average distance for each type of trip or the number of service hours (the same for each) is depleted. After the trip is complete, the turtle color then changes back to an inactive state (white) and if they have more service hours the assignment is redone. The problem I'm having issues replicating is the trip assignment portion. I have my turtles moving in an arbitrary manner and also a portion of code that is recording their distance as they do so.
I am using this bit of code so far in my go step to achieve what I want:
every buffer-time [ ask drivers [ let trip-purpose-prob random-float 1 if trip-purpose-prob <= 0.34 [ set color red ] if trip-purpose-prob > 0.34 and trip-purpose-prob < 0.70 [ set color yellow] if trip-purpose-prob >= 0.70 and trip-purpose-prob < 0.96 [ set color green] if trip-purpose-prob > 0.97 [ set color blue] ] ]
When I use "every" it is counting the time in real life seconds when I have the time scale of the model based on ticks. Prior to using that it changed the status(color) initially on every run or tick of the go step and so had the turtle's color blinking non-stop.
My question then is: How would you suggest I put in a distance or time-frame limiter for this portion of the code? Any assistance would be greatly appreciated!