We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpPrograms › Simulating Social Force
Page Index Toggle Pages: 1
Simulating Social Force (Read 522 times)
Simulating Social Force
Mar 17th, 2010, 2:50am
 
Hello,

I need to write a program that simulates people movement and I need help. I want to generate several groups of people who will be given different targets. That bit I can do. However, there is another requirement and that is that they cant collide with each other and have to avoid walls and I have no idea how to do that. Please point me in the right direction.

Thanks,
Re: Simulating Social Force
Reply #1 - Mar 17th, 2010, 3:51am
 
I think this topic belongs into the program rather the syntax section, but one of the modorators will take care, I'd guess....

Anyway: Start out with the "collision" examples of the reference, which should give you an idea of how you can check the "collision" of spheres (or circles) with each other by testing that their minimum distance is not smaller than twice their radius.
For "general" walls it is a little bit more  complicated. If they are only horizontal or vertical, you can check the according coordinates (x or y) rather easy (again check that the position is at least "radius" away).
Page Index Toggle Pages: 1