Autonomous Agent

What I learned this week made me reconsider the assignment I made in week2. Using an autonomous agent to recreate the effect of a knot might be interesting. (I want to use createGraphics to add another layer of canvas, then I'll be able to draw some other elements without keeping the track of them. But it didn't work, could anyone give me some suggestions?)

I also combined the autonomous agent with webgl and the things I made last semester to form a  fun effect of the diamond tracker.(It also remains some fault, the movement of the model is not as  same as the  target)