Commit 999bc744 authored by Loris Croce's avatar Loris Croce
Browse files

update with cartobio generated patches

parent 21b4df6f
Pipeline #41023 passed with stages
in 4 minutes and 55 seconds
......@@ -101,6 +101,11 @@ public class Generator {
int id_expl = ((Long) feature.getAttribute("id_expl")).intValue();
String codecult = (String) feature.getAttribute("codecultco");
Double surface = (Double) feature.getAttribute("surf_ilot");
CulturalPractice practice = CulturalPractice.I;
Double bio = ((Double) feature.getAttribute("BIO"));
if (bio == 1.0) {
practice = CulturalPractice.O;
}
int patch_id = Integer.parseInt((String) feature.getAttribute("ID_PARCEL"));
// Store the product if needed, retrieve it otherwise
Product product;
......@@ -119,7 +124,7 @@ public class Generator {
farmersID.put(id_expl, farmer);
}
// Create and add the patch to the area
Patch patch = new Patch(area, surface.floatValue(), CulturalPractice.I, product, farmer.getFarm(), patch_id);
Patch patch = new Patch(area, surface.floatValue(), practice, product, farmer.getFarm(), patch_id);
patches.add(patch);
area.getPatches().add(patch);
}
......
......@@ -322,7 +322,6 @@ public class Simulator {
}
// fixit crashed
public static void main(String[] args) throws Exception {
Options options = new Options();
Option inputFile = new Option("i", "input", true, "Simulation input file");
......
......@@ -3,7 +3,6 @@ package fr.inrae.agriterix.simulator.dynamics;
import fr.inrae.agriterix.simulator.*;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment