I have created a world that has a blue side and green side with a border in the middle in which I have created two sets of agents one being blue-population and other being green-population, however I cant seem to keep the blue-population in the blue side and like wise with the green, this is the code I am working with:
to setup_world
clear-all
reset-ticks
ask patches with [pxcor < 0] [ set pcolor blue ]
ask patches with [pxcor > 0] [ set pcolor green ]
set border patches with [(pxcor = 0 and abs (pycor) >= 0)]
ask border [ set pcolor white]
end
to setup_agents
clear-turtles create-humans blue_population [
setxy random-xcor random-ycor
ifelse xcor >= 0
[set continent 1]
[set continent 2]
set virus? false
set dead false
set antibodies 0
set color yellow
set size 10
set shape "blue person"
]
create-humans green_population [
setxy random-xcor random-ycor
ifelse xcor >= 0
[set continent 1]
[set continent 2]
set color yellow
set size 10
set shape "green person"
set shape "person"
set virus? false
set dead false
set antibodies 0
;]
end
I was hoping by creating continents I was able to keep them to a specific side but does not seem to work, I feel as I am not using the right constraints, anyone can provide me any insight on how this can be resolved ?