You may be trying to learn too much all at once by writing a big program all at once.
Start by writing a really small program; get it working; attempt to make a very small improvement to it, and get that working; and so on. If at any point you get stuck, come here, show your code with has at most one thing broken about it, and ask one question about the one issue in particular that you're currently stuck on. That's the most effective way to get help.
A few random coding tips:
This isn't valid code:
setxy pxcor = halfedge pycor = halfedge
setxy
expects two numbers, but you're passing it two booleans: pxcor = halfedge
is true or false, and pycor = halfedge
is true or false, too. I think you might mean just setxy halfedge halfedge
.
agents with [self != myself]
can be replaced with simply other agents
.