im trying to create a model with two agent sets. a retailer and a customer set. customer agents need to access to the price of the closest member of the retailer set and compare its price with their own preference price and make a purchase if the offered price by the retailer is lower than the preferred price. i tried to define the variable price-here for customers so i can transfer the value of price of the closest retailer to the customer and make the comparison.i wonder what syntax i should used to make this transfer? i have created a simple model here so i can get the hang of the process.
breed [ retailers retailer]
breed [ customers customer]
directed-link-breed [info-links info-link]
directed-link-breed [purchase-links purchase-link]
retailers-own [
price
inventory
]
customers-own [
price-here
prefered-price
]
to setup
create-retailers 10 [ setxy random-pxcor random-pycor
set color blue
set price random 10
set inventory 10
]
create-customers 20 [ setxy random-pxcor random-pycor
set color red
set prefered-price random 7 ]
end
to go
foreach sort customers [x -> ask x[
create-info-link-from min-one-of retailers [ distance myself ]
]]
end