would it be too much to ask to give details of the mathematics behind this model? This is amazing i'm thinking about trying one of my own in matlab, but a starting point would be nice :)
@spectrex1 Sure: Define P1 to be center of agent. Define P2 to be slightly ahead of him. Danger(p)= e^(-a*(|P1-p|+|P2-p|)). Where p=(x,y) is a 2d position and a is some scalar constant. Take derivative w.r.t. to p to get the gradient of this field at every point. An agent acts to minimize the danger, so in addition to his regular velocity, add a term that points opposite to the gradient of the total field caused by all agents.
Very pretty, but in real life when two people are trying to pass one another, they very often jiggle from left to right to figure out which side to pass. I didn't see that happen at all.
no that definitely DOES happen sometimes in the simulation! It was one of the reasons I liked it so much! Indeed I don't see it happen exactly in this demo... But one significant disadvantage I think to this is that they can't side step. People side step ALL the time...i.e. change COM position without affecting the direction. These guys have to change the direction first and then travel along it :(
this was great.i am a little sad that the more i look, the more ideas that i have in my head i find out are already done. :( i am not as original as i thought.
as long as you have the idea and they aren't ased off of anything that you've seen, then it is original. it doesn't matter if it's already been done, the idea is yours and thats it. nothing else matters.
yes its pygame. And its pretty efficient unless you are drawing the potential fields... (which is an n^2 operation in number of pixels). Otherwise i can have at least like 50 or 100 people walking without too much lag.
well every agent has an associated "danger function" that has elliptic shape extending in the direction he faces. Every agent in addition to walking to his target direction is trying to minimize the total danger at his position. So you take the sum of all gradients of all danger fields at agent's point, and this will give you direction of greatest danger increase. So just move opposite to that + add the vector of motion towards target
I guess it's something like:
a)Pedestrians walk straight forward
b)if they get into the red area, they change course slightly
c)if they get into the yellow area, they change course drastically
dumbzebra 5 months ago
@dumbzebra seems the advancing from the left had a yellow area as you describe but the others did not care
pzmtuthcvpvl 5 months ago
Wall of death fail!
birlibis2juggler 10 months ago
Why would two giant groups of people clash together at the same speed? XD
justinlovespastry 1 year ago
@justinlovespastry Pedestrian crossings
TheallCreator 2 weeks ago
would it be too much to ask to give details of the mathematics behind this model? This is amazing i'm thinking about trying one of my own in matlab, but a starting point would be nice :)
spectrex1 1 year ago
@spectrex1 Sure: Define P1 to be center of agent. Define P2 to be slightly ahead of him. Danger(p)= e^(-a*(|P1-p|+|P2-p|)). Where p=(x,y) is a 2d position and a is some scalar constant. Take derivative w.r.t. to p to get the gradient of this field at every point. An agent acts to minimize the danger, so in addition to his regular velocity, add a term that points opposite to the gradient of the total field caused by all agents.
badmephisto 1 year ago 2
@badmephisto thanks much appreciated, seems alright, i'll let you know how i get on and what marvellous things i create :)
spectrex1 1 year ago
@spectrex1 You can find code at pastebin.com SLASH meQcwfWw
The method of interest is gradDangerAt(x,y)
badmephisto 1 year ago
Watch this video, and in you mind, say, "Excuse me, pardon me, excuse me, pardon, pardon, coming through."
TheRedComa 1 year ago 5
So this is how they programmed the matrix XD
Excellent job. I love all of your programming videos and I hope you will make some more.
dorsenstein 2 years ago
Very pretty, but in real life when two people are trying to pass one another, they very often jiggle from left to right to figure out which side to pass. I didn't see that happen at all.
gresach 2 years ago
no that definitely DOES happen sometimes in the simulation! It was one of the reasons I liked it so much! Indeed I don't see it happen exactly in this demo... But one significant disadvantage I think to this is that they can't side step. People side step ALL the time...i.e. change COM position without affecting the direction. These guys have to change the direction first and then travel along it :(
badmephisto 2 years ago
Wow I remember seeing this a long time ago, and just recently I wanted to watch it again. Found it in related while watching your NN video :)
weetbixiron 2 years ago
I'd like to see potential field animation at last example
donmutti0 2 years ago
Impressive
RedSword69 2 years ago
very nice what language is this written in?
decay 2 years ago
Python, ftw.
badmephisto 2 years ago
cool
KevinLounsberry 2 years ago
very cool
patrick1020000 2 years ago
this was great.i am a little sad that the more i look, the more ideas that i have in my head i find out are already done. :( i am not as original as i thought.
josephohsnap 3 years ago 6
as long as you have the idea and they aren't ased off of anything that you've seen, then it is original. it doesn't matter if it's already been done, the idea is yours and thats it. nothing else matters.
tidusvssora 2 years ago
@josephohsnap tell ma about it man.. bloody tell me about it :)
serloinz 1 year ago
Wooo!! Great!! have you seen a little app called "bugtro"? Im pretty sure you will love it :) Congrats!!!
hyssp 4 years ago
Very nice video! Just a question, its written in pygame? How CPU intensive is the calculations?
commentitout 4 years ago
yes its pygame. And its pretty efficient unless you are drawing the potential fields... (which is an n^2 operation in number of pixels). Otherwise i can have at least like 50 or 100 people walking without too much lag.
badmephisto 4 years ago
You have loads of the same intrests as me :D
Rubik's cubes, programming, pen spinning.
KnowledgeReference 2 years ago
HI..v nice simulation. Can you elaborate the mathematical function and how does it work? Thank you
Loktantra 4 years ago
That was very interesting. Thanks for taking the time to explain!
eFFeeMMe 4 years ago
Good job! Can you post more information about how this works?
eFFeeMMe 4 years ago
well every agent has an associated "danger function" that has elliptic shape extending in the direction he faces. Every agent in addition to walking to his target direction is trying to minimize the total danger at his position. So you take the sum of all gradients of all danger fields at agent's point, and this will give you direction of greatest danger increase. So just move opposite to that + add the vector of motion towards target
badmephisto 4 years ago
That's darwinbots.
DonZabu 4 years ago
No It's not. :) My program has nothing to do with evolution, DNA, or natural selection. But yes, my agents are also circles with a direction line :)
badmephisto 4 years ago