Absorb



Description:This is the opposite of the generate pattern. Here something needs to absorb a stream of agents, for example a tunnel mouth absorbing vehicles, or a target absorbing electrons. The recommended approach is that the to-be-absorbed agents look for the absorber just ahead as they move. If the detect it, they erase themselves.

Real World Examples: "I want the cars moving to the right to disappear in the tunnel it sees to the right." "I want the frog to disappear when it goes directly over water."

PseudoCode: IF I see a certain agent in a certain direction, THEN I delete myself

AgentSheets Code:

Games/Simulations that use this pattern

 * Frogger
 * Space Invaders
 * Bridge Builder
 * Ultimate Pacman
 * Ant Foraging
 * Ecosystem, Predators and Prey Models