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
bfa3eb65
Commit
bfa3eb65
authored
Jul 08, 2021
by
Loris Croce
Browse files
out directory
parent
bfdb1f53
Pipeline
#37219
failed with stages
in 6 minutes and 12 seconds
Changes
5
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
config/transitions.xml
View file @
bfa3eb65
<concurrent-hash-map>
<entry>
<string>
Verger
</string>
<fr.inrae.agriterix.simulator.Product>
<label>
Seigle
</label>
<unit>
Kg
</unit>
<tags/>
<yield>
1.0
</yield>
</fr.inrae.agriterix.simulator.Product>
<concurrent-hash-map>
<entry>
<string>
Verger
</string>
<double>
0.2
</double>
</entry>
<entry>
<string>
Légumes
</string>
<double>
0.3
</double>
</entry>
<entry>
<string>
Fourrage
</string>
<double>
0.3
</double>
</entry>
<entry>
<string>
Maïs
</string>
<double>
0.1
</double>
</entry>
<entry>
<string>
Blé
</string>
<double>
0.1
</double>
</entry>
</concurrent-hash-map>
</entry>
<entry>
<string>
Légumes
</string>
<concurrent-hash-map>
<entry>
<string>
Verger
</string>
<double>
0.5
</double>
</entry>
<entry>
<string>
Légumes
</string>
<double>
0.2
</double>
</entry>
<entry>
<string>
Fourrage
</string>
<double>
0.1
</double>
</entry>
<entry>
<string>
Maïs
</string>
<double>
0.1
</double>
</entry>
<entry>
<string>
Blé
</string>
<double>
0.1
</double>
<fr.inrae.agriterix.simulator.Product
reference=
"../../../fr.inrae.agriterix.simulator.Product"
/>
<double>
0.4
</double>
</entry>
</concurrent-hash-map>
</entry>
<entry>
<string>
Fourrage
</string>
<concurrent-hash-map>
<entry>
<string>
Verger
</string>
<fr.inrae.agriterix.simulator.Product>
<label>
Orge
</label>
<unit>
Kg
</unit>
<tags/>
<yield>
1.0
</yield>
</fr.inrae.agriterix.simulator.Product>
<double>
0.3
</double>
</entry>
<entry>
<string>
Légumes
</string>
<double>
0.1
</double>
</entry>
<entry>
<string>
Fourrage
</string>
<double>
0.2
</double>
</entry>
<entry>
<string>
Maïs
</string>
<double>
0.1
</double>
</entry>
<entry>
<string>
Blé
</string>
<fr.inrae.agriterix.simulator.Product>
<label>
Blé
</label>
<unit>
Kg
</unit>
<tags/>
<yield>
1.0
</yield>
</fr.inrae.agriterix.simulator.Product>
<double>
0.3
</double>
</entry>
</concurrent-hash-map>
</entry>
<entry>
<
string>
Maïs
</string
>
<
fr.inrae.agriterix.simulator.Product
reference=
"../../entry/concurrent-hash-map/entry[2]/fr.inrae.agriterix.simulator.Product"
/
>
<concurrent-hash-map>
<entry>
<
string>
Verger
</string
>
<
fr.inrae.agriterix.simulator.Product
reference=
"../../../../entry/fr.inrae.agriterix.simulator.Product"
/
>
<double>
0.2
</double>
</entry>
<entry>
<string>
Légumes
</string>
<double>
0.2
</double>
</entry>
<entry>
<string>
Fourrage
</string>
<double>
0.3
</double>
<fr.inrae.agriterix.simulator.Product
reference=
"../../../../entry/concurrent-hash-map/entry[2]/fr.inrae.agriterix.simulator.Product"
/>
<double>
0.6
</double>
</entry>
<entry>
<
string>
Maïs
</string
>
<
fr.inrae.agriterix.simulator.Product
reference=
"../../../../entry/concurrent-hash-map/entry[3]/fr.inrae.agriterix.simulator.Product"
/
>
<double>
0.2
</double>
</entry>
<entry>
<string>
Blé
</string>
<double>
0.1
</double>
</entry>
</concurrent-hash-map>
</entry>
<entry>
<
string>
Blé
</string
>
<
fr.inrae.agriterix.simulator.Product
reference=
"../../entry/concurrent-hash-map/entry[3]/fr.inrae.agriterix.simulator.Product"
/
>
<concurrent-hash-map>
<entry>
<
string>
Verger
</string
>
<
fr.inrae.agriterix.simulator.Product
reference=
"../../../../entry/fr.inrae.agriterix.simulator.Product"
/
>
<double>
0.1
</double>
</entry>
<entry>
<
string>
Légumes
</string
>
<
fr.inrae.agriterix.simulator.Product
reference=
"../../../../entry/concurrent-hash-map/entry[2]/fr.inrae.agriterix.simulator.Product"
/
>
<double>
0.1
</double>
</entry>
<entry>
<string>
Fourrage
</string>
<double>
0.1
</double>
</entry>
<entry>
<string>
Maïs
</string>
<double>
0.3
</double>
</entry>
<entry>
<string>
Blé
</string>
<double>
0.4
</double>
<fr.inrae.agriterix.simulator.Product
reference=
"../../../../entry/concurrent-hash-map/entry[3]/fr.inrae.agriterix.simulator.Product"
/>
<double>
0.8
</double>
</entry>
</concurrent-hash-map>
</entry>
...
...
src/main/java/fr/inrae/agriterix/simulator/Simulator.java
View file @
bfa3eb65
...
...
@@ -176,9 +176,9 @@ public class Simulator {
}
public
void
serialize
(
String
filename
)
throws
IOException
{
Files
.
createDirectories
(
Paths
.
get
(
"out/"
));
Files
.
createDirectories
(
Paths
.
get
(
"out/"
+
timestamp
));
serializeXML
(
Files
.
newOutputStream
(
Paths
.
get
(
"out/"
+
timestamp
+
"/"
+
filename
)));
Files
.
createDirectories
(
Paths
.
get
(
"
data/
out/"
));
Files
.
createDirectories
(
Paths
.
get
(
"
data/
out/"
+
timestamp
));
serializeXML
(
Files
.
newOutputStream
(
Paths
.
get
(
"
data/
out/"
+
timestamp
+
"/"
+
filename
)));
}
public
void
serializeXML
(
OutputStream
output
)
{
...
...
@@ -186,7 +186,7 @@ public class Simulator {
}
public
String
getTimestampDirectory
()
{
return
"out/"
+
timestamp
+
"/"
;
return
"
data/
out/"
+
timestamp
+
"/"
;
}
public
SimulationContext
getContext
()
{
...
...
@@ -203,7 +203,7 @@ public class Simulator {
FileOutputStream
fos
;
file
=
new
File
(
"db"
,
"patches.cbor"
);
file
=
new
File
(
"db"
,
"
data/out/"
+
timestamp
+
"/
patches.cbor"
);
arrayBuilder
=
cborBuilder
.
addArray
();
fos
=
new
FileOutputStream
(
file
);
...
...
src/main/java/fr/inrae/agriterix/simulator/dynamics/DynamicsLogger.java
View file @
bfa3eb65
...
...
@@ -17,11 +17,12 @@ public class DynamicsLogger {
private
FileHandler
fileHandler
;
private
Logger
logger
;
private
String
separator
=
", "
;
private
String
path
=
"data/out"
;
public
DynamicsLogger
(
String
className
,
String
timeStamp
)
{
try
{
Files
.
createDirectories
(
Paths
.
get
(
"out/"
+
timeStamp
+
"/logs/"
));
fileHandler
=
new
FileHandler
(
"out/"
+
timeStamp
+
"/logs/"
+
className
+
".csv"
,
false
);
Files
.
createDirectories
(
Paths
.
get
(
"
data/
out/"
+
timeStamp
+
"/logs/"
));
fileHandler
=
new
FileHandler
(
"
data/
out/"
+
timeStamp
+
"/logs/"
+
className
+
".csv"
,
false
);
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
...
...
src/test/java/fr/inrae/agriterix/simulator/SimulatorMinimalTest.java
View file @
bfa3eb65
...
...
@@ -298,7 +298,7 @@ public class SimulatorMinimalTest {
@After
public
void
cleanup
()
throws
IOException
{
Path
current
=
FileSystems
.
getDefault
().
getPath
(
"out"
);
Path
current
=
FileSystems
.
getDefault
().
getPath
(
"
data/
out"
);
Files
.
walk
(
current
)
.
sorted
(
Comparator
.
reverseOrder
())
.
map
(
Path:
:
toFile
)
...
...
src/test/java/fr/inrae/agriterix/simulator/SimulatorTest.java
View file @
bfa3eb65
...
...
@@ -241,7 +241,7 @@ public class SimulatorTest {
}
String
xml
=
xStream
.
toXML
(
transitions
);
FileOutputStream
fileOutputStream
=
new
FileOutputStream
(
"config/transitions.xml"
);
FileOutputStream
fileOutputStream
=
new
FileOutputStream
(
"
data/in/
config/transitions.xml"
);
fileOutputStream
.
write
(
xml
.
getBytes
(
StandardCharsets
.
UTF_8
));
// FileInputStream fileInputStream = new FileInputStream("config/transitions.xml");
// Map<Product, Map<Product, Double>> transitionsM = (Map<Product, Map<Product, Double>>) xStream
...
...
@@ -263,7 +263,7 @@ public class SimulatorTest {
@After
public
void
cleanup
()
throws
IOException
{
Path
current
=
FileSystems
.
getDefault
().
getPath
(
"out"
);
Path
current
=
FileSystems
.
getDefault
().
getPath
(
"
data/
out"
);
Files
.
walk
(
current
)
.
sorted
(
Comparator
.
reverseOrder
())
.
map
(
Path:
:
toFile
)
...
...
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