In my program, each turtle (namely glucose and bacteria) has their own variable called mass. The setup procedure states that the initial mass of glucose and the bacteria is 1 mmol. The to-go procedure says that the glucose will be hydrolyzed and divided. Thus the glucose_mass will be different to the initial 1 mmol. The to-go procedure for the bacteria says that when the bacteria eats one glucose then the mass of the bacteria will grow from the initial 1 mmol plus the mass of the glucose (stochastic number determined in the to divide_hydrolyzed_glucose procedure) that it consumed times a fixed number (i.e. 0.3). I tried to use the command "of myself" to include the variable of another turtle into the bacteria turtle. However, it gives me an error saying that "OF expected this input to be a reporter block, but got a variable or anything instead".
Any comments or suggestions on this issue?
Breed [glucose a-glucose];; Food
Breed [bacteria a-bacteria] ;; Predator
glucose-own [glucose_mass]
Bacteria-own [Bacteria_mass]
to setup
;;;GLUCOSE;;;
set-default-shape glucose "circle"
Create-glucose (8) ;; Create the glucose available in mmol/d,
[set glucose_mass (1) ;; in mmol
]
;;; BACTERIA;;;
Create-Bacteria (8) ;; Create the clostridiales in mmol
[set Batceria_mass (1)
]
end
to go
ask glucose
[
Hydrolyse_glucose
Divide_hydrolyzed_glucose
]
ask Bacteria
[ Bacteria_eat_glucose]
to hydrolyse_glucose
if (glucose_mass < 200) [
set glucose_mass ((glucose_mass * 0.025 + random-float 32.975) / 24)
]
end
to divide_hydrolyzed_glucose
if (glucose_mass > 1)
[
set glucose_mass (glucose_mass / 2)
hatch 1
]
end
to Bacteria_eat_glucose
let prey one-of glucose-here
if prey != nobody
[ask prey [die]
set Bacteria_mass (Bacteria_mass + ((glucose_mass of myself) * 0.3))
]
end