CityScope / CS_Simulation_GAMA

Agent Based Simulation platform for CityScope
GNU General Public License v3.0
30 stars 21 forks source link

Models break when the initial state of the table has cells with no height #144

Closed crisjf closed 3 years ago

crisjf commented 3 years ago

The line: geometry shape <- envelope(geogrid); breaks when the geogrid object has no height. In general, the height will not be specified in GEOGRID, so we need to make sure the model does not crash if this is the case.

I created a table called dungeona to test this. This table has some cells with height and some cells without height. dungeonmaster happens to have all cells with height initially.

crisjf commented 3 years ago

@RELNO you might also want to take a look at this

agrignard commented 3 years ago

How can I reproduce it? How do I produce a grid with no height? I don't understand how it can impact the envelope function

RELNO commented 3 years ago

@crisjf

In general, the height will not be specified in GEOGRID

I actually think it does, see https://cityio.media.mit.edu/api/table/dungeonmaster/GEOGRID

crisjf commented 3 years ago

@agrignard point the model to the table dungeona

@RELNO, see this table: https://cityio.media.mit.edu/api/table/dungeona/GEOGRID

RELNO commented 3 years ago

@crisjf -- I do see height attr, am I missing something?

crisjf commented 3 years ago

Not all of them have height, which breaks the envelope function.

image

I think this has to do with the table constructor allowing for some types not to declare a height. See the example below, where Park does not have a height.

image

crisjf commented 3 years ago

I'm gonna close this for now. The error is still there with dungeona but I've tried to reproduce it with three other fresh tables and I've gotten no error so far.