So far interface patches are built with made up output in the following format...
{
"crops": [1,2],
"pathogens": [0,1],
"helicoverpa": [
{"crop":1, "pathogen": 0, "genotype":1, "resistance": 30},
{"crop":2, "pathogen": 0, "genotype":1, "resistance": 30}
]
}
This is an array of the crop species as numbers for each patch, and the same for pathogens. The size of these arrays defines the number and arrangement of patches.
Then the Helicoverpa array contains every individual. I've used the crop and pathogen values for each individual to place them in the correct patch -will that always work? Maybe we just need a horizontal and vertical patch id value instead so we can give each individual a coordinate like placement...
{
"crops": [1,2],
"crop_ids": [1,2] ,
"pathogens": [0,1],
"pathogen_ids" : [1,2],
"helicoverpa": [
{"c_id": 1, "p_id":1, "genotype":1, "resistance": 0.8}
]
}
The individuals also have genotype and resistance values to define their colour and size. The types of numbers you give me can be whatever size you think best - I can fiddle with the styling based on those numbers after.
From Brad:
Just looking through the current output now and trying to get a handle on the json. Sorry if I'm missing the point here somewhere! Would the following output format work?
{
"crops": [1, 2, 3],
"pathogens": [1, 2, 3],
"helicoverpa": [
{"crop":1, "pathogen": 1, "xloc":1, "yloc":2, "path_allele_1":1, "path_allele_2":2, "crop_allele_1":1, "crop_allele_2":1},
{"crop":2, "pathogen": 1, "xloc":2, "yloc":2, "path_allele_1":2, "path_allele_2":2, "crop_allele_1":3, "crop_allele_2":1}
]
}
I assume that the top "crops" and "pathogens" is the set of crops and pathogens available on the landscape? I'm totally happy to fill this in any way that works best for you -- here's what information we have:
LAND: pathogen and crop on each cell in location x and y.
PEST: Each individual pest: ID, sex, x-loc, y-loc, 2 pathogen alleles, 2 crop alleles.
Sorry, I think I'm just confused as to how the information produced in the toy matches with the json format!