General > Off Topic

A point on movement in Darwin Bots

<< < (4/7) > >>

PurpleYouko:
Could work but you have to include the threshold check at some point otherwise you get diffusion from low to high sometimes.

 :D  PY  :D

shvarz:
How?  Could you explain?

PurpleYouko:
In my code above, a particular cell only accepts "bleeding" from an adjacent cell if the value in the adjacent cell is greater than its own. This may or may not save on computing since it requires conditional statements.

In my code I can easily adjust the threshold (cell value difference) so that nothing happens when the two are almost the same or so that nothing happens when they are 10 apart or 100 or whatever. I normally set it to about 2 or 3. This way the e-grid tends to even out a lot better than if a cell grabs a percentage of the value from all surrounding cells regardless of values in them.

Make sense or am I still not explaining it well enough?

 :D  PY  :D

Numsgil:
You're basically checking the direction of osmosis.  You don't want to go from low concentration areas to high concentration areas.

shvarz:
I don't think it will.  I just don't see how.  If stuff moves in both directions, then by definition more will move from higher concentrations than from lower.

Say you have two cells, A with 300 of something and B with 30 of something.  When one third moves in both directions you get:
30 moves from A to B
3 moves from B to A

Final result:
A: 300-30+3=273
B: 30-3+30=57

If you start with both cells having 30, then it will be:
A: 30-3+3=30
B: 30-3+3=30

So it works.  No nead for threshold conditions.  Am I missing something?

Whether computationally it will be better to exclude from calculations cells with similar values, that I don't know.  You are programmers, you figure it out.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version