In my code, agents are positioned according to their internal ideas and external opinions. I want to see the agents whose inner idea and outer idea are the same along the middle diagonal line, so I want to separate the environment with 2 lines.
to updatePosition
resize-world -10 10 -10 10 ; x ve y ekseni sınırlarını genişlet
let axis-x (world-width - 5) ; substractşng 5 because getting a better visualation
let axis-y (world-height - 5) ; substractşng 5 because getting a better visualation
ask turtles [
;if the corresponding coordinate of Ai(internal idea of an agent) or Bi(external idea of an agent) of the agent is bigger than world border we limite it to world border.
let clamped-Ai Ai
let clamped-Bi Bi
if clamped-Ai > 5 [
set clamped-Ai 5
]
if clamped-Ai < -5 [
set clamped-Ai -5
]
if clamped-Bi > 5 [
set clamped-Bi 5
]
if clamped-Bi < -5 [
set clamped-Bi -5
]
let scaled-x (axis-x * clamped-Ai / 10)
let scaled-y (axis-y * clamped-Bi / 10)
; Turtlenin pozisyonunu güncelle
setxy scaled-x scaled-y
]
end
Not 100% sure what you are asking for, but patches or turtles on the diagonal have equal absolute coordinates.
Here is an example how to color patches on the diagonal. The
absreports the absolute value, which means that the negative sign is ignored.Same applies for turtles, just using
xcor/ycorinstead ofpxcor/pycor.If you are looking for something like a coordinate system you can find those by their
xcororycorbeing equal to 0. Here an example for turtles