Closed missyschoenbaum closed 5 years ago
This documentation was done to explain zones when we were trying to improve zone calculations. I am thinking that Neil did improve zones during ADSM implementation, but not sure on specifics. GraphRepresentationforZonesRequirements.docx
Tim provided this
Here is some code for creating 10km zones around detected premises 14 days after initial detection and calculating the area under control for those zones. A data file with 10 iterations is attached too. Looks like the next steps for overlaying the zones with the population file and extracting the premises within zones are described here: https://gis.stackexchange.com/questions/63793/how-to-overlay-a-polygon-over-spatialpointsdataframe-and-preserving-the-spdf-dat. 10kzone_auc_Rcode.txt d14ip_10its.zip
Reading through these things make me think about the complexity of this question. The first one is easy enough. The subsequent detection, not so easy.
So a farm could start off on the edge of a zone. Then the next day, could be in the middle of an infected zone. Maybe the first attempt at this should be units under any zone, with raw output that would show day, zone, zone triggered by unit and it would have duplicates so that is apparent to the user. The raw output would at least give a dataset that could be manipulated. Then we are just having to link back in to the population and pull the body count to get animals, which could also be manipulated.
I can think of ways to refine this further, but this first step may be enough of a learning experience for the moment.
As expected, I have a few questions and concerns with this problem.
First off, what are we actually trying to accomplish here? I'm reading some contradictory wording in the original ticket. First you say "how many distinct units/animals are under a zone?" which indicates to me that you want each unit under a single zone. Later you state "figuring out units in zone, removing duplicates, summing units/animals." which does not make a lot of sense if you're counting units under a single zone - how can you have duplicates under a single zone? After reading GraphRepresentationforZonesRequirements.docx it occurred to me that you might be talking about groups of zones, but the way that zones are combined leads me to believe that duplicates would never be an issue.
Second off, what are you counting as a zone? Originally zones are drawn a a single concentric circle - but as more zones are added they are merged together (assuming we are using similar logic to the document). It would be impossible to count units under a specific zone at end of simulation if it had been merged with another. (see fig 1)
Fig 1
You talk about counting units under each zone for each day in the simulation. Currently we don't get the zones back until the C-Engine is done with the simulation, and my impression of the zones is that we get them back as "here are the locations of all zones, now you figure out what to do with them" (ie they are not marked in any way). We could count all the units under any zone after the simulation was complete. Otherwise if you really wanted to count units under each zone for each day of the simulation - we would have to get a hold of Neil, neither Bryan or I have enough C experience to add that kind of output.
What kind of output are you actually trying to give the users? We dont get inner and outer rings back from the C-Engine, we get the location of the center of each largest zone. Currently I think the best output we could do is a single integer "Units located in a zone at end of simulation" - I don't think this number would even be useful. I think this problem is going to be most limited by what the C-Engine outputs (or rather what is doesn't output).
Last concern, the count of units under each zone would not visually match the map we output. This is because zones drawn on our map are not longer dependent on user-sized zones. If a user were to go through a small simulation and count the units under blue zones on the output map it would not match whatever number we gave them - this might be very confusing.
I'm going to keep mulling over this - I'll make another comment if I think of anything else to add.
I think I am asking the wrong thing. Let me check with SME and see if I can clarify.
I have been thinking through this one. It is something that would have to happen as a hybrid - part database, part supplemental, part spatially generated. Even then, I think it would be some estimate, as we cannot duplicate exactly how zones combine and fill in the holes. That makes me think it might be easier to do in R, where the user cannot confuse this process with some outcome of the model.
So, I'm going to close.
This may have to happen in 2 parts: first to see if we can answer the question and second to see if we can deliver the answer in a viz.
Also, this might be something that is worth having the full dataset, so we could consider where to put it.
TO clarify the question, how many distinct units/animals are under a zone? This would require taking each detection point, using some geospatial tool to draw each zone, figuring out units in zone, removing duplicates, summing units/animals. This might be hard to test. Maybe the output could be part of it in some raw version.