How to set new turtles direction from average of 2 angles in netlogo -
I am trying to set a new title for the agent by calculating the average of 2 angles between. The new title for the agent should be changed to 27. The following is the code I use, but the way I want it does not work:
to change - turtle with leaders- [leader? ] if someone? Radius vision in the nearest leaders [Average-title-towards-the-leader-max-to-turn] End-Report Average-Title-per-Leaders Leaders Have Turtles with Leaders [Leader? ] Report the last-headline ([top]) report of the end-title [AB] report (A - (subtract-headings AB) / 2) Android 360 &
Really Need advice on this, thanks for the help
This removes trig but it works
Average-order from the report [AB] Let's switch to H (A - (decrease-headings AB) / 2) mod 360 let S. (A + B) / 2 AFL HK LT; S-Report [H] [Report]] Termination
In your code
Average-Title-of-the-leaders report Average-Title (<[Code] - Turtles of nearby leaders [Title] [Top]] Top
Mark II
Comments
Post a Comment