[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Path algorithm
From: |
paulbox |
Subject: |
RE: Path algorithm |
Date: |
Thu, 01 Mar 2001 22:39:18 -0700 |
If you have a way for a wet cell to decide if it's neighbor is a wet cell,
then you could have a recursive function that has each wet cell return a list
of its wet neighbors. The algorithm could start in any wet cell and spread
out until all wet cells who are somehow connected are a member of a common
list. This would not tell you how efficiently you could get from one to the
other, just tell you that they are in the same "blotch".
If you're in a static landscape, you may wish to simply establish lists of
connected cells in the beginning. If this "membership list" has to be
reassessed every time the fish make a query, you might think of a more
efficient way to manage this.
If you need to determine the best path from one wet cell to another, there is
a large body of literature in "least cost path" analysis. I would be happy to
provide some references if you're interested.
>===== Original Message From M Lang / S Railsback <address@hidden> =====
>I need an algorithm to see if you can get from one place in a Grid2D to
>another region of the grid.
>
>Say there are a patch of connected grid cells that are "safe" for my
>fish. The other cells are either wet or dry, and the fish can only move
>through wet cells. I need to determine for each wet cell whether or not
>there is a connection through the other wet cells to the "safe" patch.
>
>Does anyone have an efficient algorithm for this?
>
>Thanks
>
>Steve
>--
>address@hidden
>Lang, Railsback & Assoc.
>250 California Ave., Arcata CA 95521
>707-822-0453; Fax 822-1868
>
>Until July 1, 2001:
> Los Alamos, NM
> 505-661-4258
>
>
> ==================================
> Swarm-Modelling is for discussion of Simulation and Modelling techniques
> esp. using Swarm. For list administration needs (esp. [un]subscribing),
> please send a message to <address@hidden> with "help" in the
> body of the message.
> ==================================
////////////////////////////////////////
// Paul Box
// Geography and Earth Resources
// Utah State University
==================================
Swarm-Modelling is for discussion of Simulation and Modelling techniques
esp. using Swarm. For list administration needs (esp. [un]subscribing),
please send a message to <address@hidden> with "help" in the
body of the message.
==================================
- Path algorithm, M Lang / S Railsback, 2001/03/01
- RE: Path algorithm,
paulbox <=