Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Agriterix
simulator
Commits
999bc744
Commit
999bc744
authored
Sep 17, 2021
by
Loris Croce
Browse files
update with cartobio generated patches
parent
21b4df6f
Pipeline
#41023
passed with stages
in 4 minutes and 55 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/fr/inrae/agriterix/generator/Generator.java
View file @
999bc744
...
...
@@ -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
(),
CulturalP
ractice
.
I
,
product
,
farmer
.
getFarm
(),
patch_id
);
Patch
patch
=
new
Patch
(
area
,
surface
.
floatValue
(),
p
ractice
,
product
,
farmer
.
getFarm
(),
patch_id
);
patches
.
add
(
patch
);
area
.
getPatches
().
add
(
patch
);
}
...
...
src/main/java/fr/inrae/agriterix/simulator/Simulator.java
View file @
999bc744
...
...
@@ -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"
);
...
...
src/main/java/fr/inrae/agriterix/simulator/dynamics/StateDynamics.java
View file @
999bc744
...
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment