use of org.openlca.core.model.Parameter in project olca-modules by GreenDelta.
the class Parameters method create.
static Parameter create(InputParameterRow row, ParameterScope scope) {
Parameter p = new Parameter();
p.refId = UUID.randomUUID().toString();
p.name = row.name();
p.isInputParameter = true;
p.scope = scope;
p.value = row.value();
p.description = row.comment();
p.uncertainty = Uncertainties.of(row.value(), row.uncertainty());
return p;
}
use of org.openlca.core.model.Parameter in project olca-modules by GreenDelta.
the class Parameters method fetchFromProperties.
private static void fetchFromProperties(List<Property> properties, List<Parameter> parameters, ImportConfig config) {
for (Property property : properties) {
if (!canCreate(property.variableName, parameters))
continue;
Parameter olcaParam = new Parameter();
olcaParam.name = property.variableName;
olcaParam.scope = ParameterScope.PROCESS;
olcaParam.value = property.amount;
olcaParam.description = property.unit;
String formula = property.mathematicalRelation;
if (config.withParameterFormulas && isValid(formula, config)) {
olcaParam.formula = formula.trim();
olcaParam.isInputParameter = false;
} else
olcaParam.isInputParameter = true;
parameters.add(olcaParam);
}
}
use of org.openlca.core.model.Parameter in project olca-modules by GreenDelta.
the class Parameters method fetchProcessParameters.
private static void fetchProcessParameters(DataSet ds, List<Parameter> parameters, ImportConfig config) {
for (spold2.Parameter param : Spold2.getParameters(ds)) {
if (!canCreate(param.variableName, parameters))
continue;
Parameter olcaParam = new Parameter();
parameters.add(olcaParam);
olcaParam.description = param.unitName;
olcaParam.name = param.variableName;
setScope(param, olcaParam);
olcaParam.value = param.amount;
olcaParam.uncertainty = UncertaintyConverter.toOpenLCA(param.uncertainty, 1);
String formula = param.mathematicalRelation;
if (config.withParameterFormulas && isValid(formula, config)) {
olcaParam.formula = formula.trim();
olcaParam.isInputParameter = false;
} else {
olcaParam.isInputParameter = true;
}
}
}
use of org.openlca.core.model.Parameter in project olca-modules by GreenDelta.
the class Parameters method fetchFromExchange.
private static void fetchFromExchange(Exchange exchange, List<Parameter> params, ImportConfig config) {
if (!canCreate(exchange.variableName, params))
return;
Parameter olcaParam = new Parameter();
olcaParam.name = exchange.variableName;
olcaParam.scope = ParameterScope.PROCESS;
olcaParam.value = exchange.amount;
olcaParam.description = exchange.unit;
String formula = exchange.mathematicalRelation;
if (config.withParameterFormulas && isValid(formula, config)) {
olcaParam.formula = formula.trim();
olcaParam.isInputParameter = false;
} else
olcaParam.isInputParameter = true;
params.add(olcaParam);
}
use of org.openlca.core.model.Parameter in project olca-modules by GreenDelta.
the class Parameters method fetchFromProductionVolume.
private static void fetchFromProductionVolume(IntermediateExchange exchange, List<Parameter> params, ImportConfig config) {
String varName = exchange.productionVolumeVariableName;
Double amount = exchange.productionVolumeAmount;
String formula = exchange.productionVolumeMathematicalRelation;
if (!canCreate(exchange.productionVolumeVariableName, params))
return;
Parameter param = new Parameter();
param.name = varName;
param.scope = ParameterScope.PROCESS;
param.value = amount == null ? 0d : amount;
if (config.withParameterFormulas && isValid(formula, config)) {
param.formula = formula.trim();
param.isInputParameter = false;
} else
param.isInputParameter = true;
params.add(param);
}
Aggregations