use of org.openlca.core.model.DQScore in project olca-app by GreenDelta.
the class DataQualityShell method createRowData.
private void createRowData(Composite composite, DQIndicator indicator) {
Collections.sort(indicator.scores);
for (DQScore score : indicator.scores) {
DataQualityCell dataCell = new DataQualityCell(this, indicator, score);
dataCell.createComponents(composite, toolkit);
dataCells.add(dataCell);
}
}
use of org.openlca.core.model.DQScore in project olca-app by GreenDelta.
the class DataQualityShell method calculateGeometricSD.
private double calculateGeometricSD() {
double varSum = 0;
for (DQIndicator indicator : system.indicators) {
DQScore selectedScore = getSelection(indicator);
if (selectedScore == null)
selectedScore = indicator.scores.get(indicator.scores.size() - 1);
double factor = selectedScore.uncertainty;
varSum += Math.pow(Math.log(factor), 2);
}
varSum += Math.pow(Math.log(getBaseValue()), 2);
return Math.exp(Math.sqrt(varSum));
}
use of org.openlca.core.model.DQScore in project olca-app by GreenDelta.
the class QualityPanel method getSelection.
public String getSelection() {
boolean anySelected = false;
int[] values = new int[system.indicators.size()];
for (DQIndicator indicator : system.indicators) {
DQScore selection = getSelection(indicator);
int value = 0;
if (selection != null) {
value = selection.position;
anySelected = true;
}
values[indicator.position - 1] = value;
}
if (!anySelected)
return null;
return system.toString(values);
}
use of org.openlca.core.model.DQScore in project olca-app by GreenDelta.
the class QualityPanel method createRowData.
private void createRowData(Composite comp, DQIndicator indicator) {
Collections.sort(indicator.scores);
for (DQScore score : indicator.scores) {
QualityCell dataCell = new QualityCell(this, indicator, score);
dataCell.create(comp, tk);
cells.add(dataCell);
}
}
use of org.openlca.core.model.DQScore in project olca-modules by GreenDelta.
the class DQSystemWriter method writeScores.
private void writeScores(DQIndicator indicator, JsonObject json) {
JsonArray scores = new JsonArray();
for (DQScore s : indicator.scores) {
var obj = new JsonObject();
Json.put(obj, "position", s.position);
Json.put(obj, "label", s.label);
Json.put(obj, "description", s.description);
Json.put(obj, "uncertainty", s.uncertainty);
scores.add(obj);
}
Json.put(json, "scores", scores);
}
Aggregations