Hi folks I want my patch variable WTD to increase by the amount in turtle context in procedure watering-decisions . But if I write minus (-) random-float it get changed. Showed constant value otherwise. Pls, help.
globals [TW well-depth]
Breed [farmers farmer]
farmers-own [ WA sw FW WR dws Logging salinity
]
patches-own [
GW wtd ] ;water table depth and Groundwater
to setup
clear-all
setup-farmers
ask patches [
set WTD depth-WT + 10
set GW Ground-water + random-float 5.005 + (100 / depth-wt)
]
reset-ticks
end
to setup-farmers
create-farmers num-farmers [move-to one-of patches
set shape "person"
set sw surface-water + random-float 5.0
set dws random 100 + distance-from-water-source
set wr minwater-requirement + random 10
set logging 0
set salinity 0
ask patches in-radius 1 [set pcolor green]
set color Brown
]
end
to go
ask farmers [
check-wa
**watering-decisions**
update-water]
tick
end
to check-wa
SET WA (sw / distance-from-water-source) + sum [gw] of patches in-radius
end
**to watering-decisions**
if watering-decision = "zero-intelligence"
[
if wr > 0 [set wa wa - random-float 3
set FW wa
set logging 0.5 * dws + wtd / 0.5
set salinity 1.5 * dws + wtd * 1.5
set logging logging + 0.005
set salinity salinity + 0.001
ask patches in-radius 1 [set pcolor green
**set wtd wtd - random-float 0.9** ]
set color red
]]
end
strong text