USACE / go-consequences

A lightweight consequences computational engine written in Go
MIT License
14 stars 11 forks source link

The default case should point back to the occupancy type specifically. #70

Closed HenryGeorgist closed 3 years ago

HenryGeorgist commented 3 years ago

https://github.com/USACE/go-consequences/blob/c7b4a9fe1e1ff392ba7041f3293616c4c58cbb46/structures/occupancytypes.go#L71 lines 71 and 88 should be replaced with these lines:

result, ok := o.StructureDFF.DamageFunctions[h.Parameters()] if ok { return result } return o.StructureDFF.DamageFunctions[hazards.Default]

122 and 139 should look similarly except that it should be more like o.ContentDFF.DamageFunctions[h.Parameters()]