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
32d22cac
Commit
32d22cac
authored
Jul 21, 2021
by
Loris Croce
Browse files
clean constructors geoarea
parent
2cc28d85
Pipeline
#37890
passed with stages
in 3 minutes and 41 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/main/java/fr/inrae/agriterix/simulator/Flow.java
View file @
32d22cac
package
fr.inrae.agriterix.simulator
;
import
org.apache.commons.lang3.RandomStringUtils
;
import
java.util.*
;
public
class
Flow
{
...
...
@@ -47,7 +49,7 @@ public class Flow {
private
Stocks
quantities
;
private
List
<
Product
>
outputs
;
private
Ratio
ratio
;
private
String
id
;
private
String
label
;
public
Flow
(
List
<
Input
>
inputs
,
Stocks
quantities
,
List
<
Product
>
outputType
,
Ratio
ratio
)
{
this
.
inputs
=
inputs
;
...
...
@@ -55,16 +57,16 @@ public class Flow {
this
.
outputs
=
outputType
;
this
.
ratio
=
ratio
;
// workaround
this
.
id
=
"id"
;
this
.
label
=
RandomStringUtils
.
randomAlphanumeric
(
10
)
;
}
public
Flow
(
List
<
Input
>
inputs
,
Stocks
quantities
,
List
<
Product
>
outputType
,
Ratio
ratio
,
String
id
)
{
String
label
)
{
this
.
inputs
=
inputs
;
this
.
quantities
=
quantities
;
this
.
outputs
=
outputType
;
this
.
ratio
=
ratio
;
this
.
id
=
id
;
this
.
label
=
label
;
}
public
int
inputsSize
()
{
...
...
@@ -118,16 +120,16 @@ public class Flow {
+
"}\n"
;
}
public
String
get
Id
()
{
return
id
;
public
String
get
Label
()
{
return
label
;
}
public
List
<
Product
>
getOutputs
()
{
return
outputs
;
}
public
void
set
Id
(
String
id
)
{
this
.
id
=
id
;
public
void
set
Label
(
String
label
)
{
this
.
label
=
label
;
}
public
Stocks
produce
()
{
...
...
src/main/java/fr/inrae/agriterix/simulator/GeoArea.java
View file @
32d22cac
...
...
@@ -13,7 +13,7 @@ public class GeoArea {
public
GeoArea
(
List
<
Flow
>
flows
,
List
<
Patch
>
patches
)
{
this
.
patches
=
patches
;
this
.
flows
=
flows
;
this
.
label
=
"geoArea"
;
this
.
label
=
RandomStringUtils
.
randomAlphanumeric
(
10
)
;
}
public
GeoArea
(
List
<
Flow
>
flows
,
List
<
Patch
>
patches
,
String
label
)
{
...
...
@@ -34,12 +34,6 @@ public class GeoArea {
this
.
label
=
label
;
}
public
GeoArea
(
Float
surface
)
{
this
.
patches
=
new
ArrayList
<>();
this
.
flows
=
new
ArrayList
<>();
this
.
label
=
RandomStringUtils
.
randomAlphanumeric
(
10
);
}
public
GeoArea
(
String
label
)
{
this
.
patches
=
new
ArrayList
<>();
this
.
flows
=
new
ArrayList
<>();
...
...
src/main/java/fr/inrae/agriterix/simulator/dynamics/DynamicsLogger.java
View file @
32d22cac
...
...
@@ -44,7 +44,7 @@ public class DynamicsLogger {
}
public
void
logEvolutions
(
int
timestep
,
Flow
flow
,
String
category
,
Product
product
,
Float
value
)
{
logger
.
info
(
timestep
+
separator
+
category
+
separator
+
flow
.
get
Id
()
+
separator
+
product
logger
.
info
(
timestep
+
separator
+
category
+
separator
+
flow
.
get
Label
()
+
separator
+
product
+
separator
+
value
);
}
}
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