TerraME / terrame

TerraME is a programming environment for spatial dynamical modelling
www.terrame.org
GNU Lesser General Public License v3.0
35 stars 13 forks source link

Check neighborhood of cell #2305

Closed avancinirodrigo closed 4 years ago

avancinirodrigo commented 4 years ago

Create a test to check cell neighbors. Show it in a map from a file and xdim.

cell = Cell{state = "empty"}

cs = CellularSpace{xdim = 10, instance = cell}

cell = cs:get(5, 5)
cell.state = "selected"

cs:get(cell.x, cell.y - 1).state = "full"
cs:get(cell.x + 1, cell.y + 1).state = "full"

print(cs:get(cell.x + 1, cell.y + 1))

Map{
     target = cs,
     select = "state",
     value = {"empty", "full", "selected"},
     color = {"white", "blue", "black"}
}
pedro-andrade-inpe commented 4 years ago

Do not forget to update the documentation.