Commit 32d22cac authored by Loris Croce's avatar Loris Croce
Browse files

clean constructors geoarea

parent 2cc28d85
Pipeline #37890 passed with stages
in 3 minutes and 41 seconds
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 getId() {
return id;
public String getLabel() {
return label;
}
public List<Product> getOutputs() {
return outputs;
}
public void setId(String id) {
this.id = id;
public void setLabel(String label) {
this.label = label;
}
public Stocks produce() {
......
......@@ -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<>();
......
......@@ -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.getId() + separator + product
logger.info(timestep + separator + category + separator + flow.getLabel() + separator + product
+ separator + value);
}
}
Supports Markdown
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