Search in sources :

Example 6 with DQScore

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);
    }
}
Also used : DQScore(org.openlca.core.model.DQScore)

Example 7 with DQScore

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));
}
Also used : DQScore(org.openlca.core.model.DQScore) DQIndicator(org.openlca.core.model.DQIndicator)

Example 8 with DQScore

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);
}
Also used : DQScore(org.openlca.core.model.DQScore) DQIndicator(org.openlca.core.model.DQIndicator)

Example 9 with DQScore

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);
    }
}
Also used : DQScore(org.openlca.core.model.DQScore)

Example 10 with DQScore

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);
}
Also used : JsonArray(com.google.gson.JsonArray) DQScore(org.openlca.core.model.DQScore) JsonObject(com.google.gson.JsonObject)

Aggregations

DQScore (org.openlca.core.model.DQScore)16 DQIndicator (org.openlca.core.model.DQIndicator)12 Button (org.eclipse.swt.widgets.Button)3 JsonArray (com.google.gson.JsonArray)2 JsonObject (com.google.gson.JsonObject)2 Text (org.eclipse.swt.widgets.Text)2 DQSystem (org.openlca.core.model.DQSystem)2 JsonElement (com.google.gson.JsonElement)1 ArrayList (java.util.ArrayList)1 Label (org.eclipse.swt.widgets.Label)1 DQSystemDao (org.openlca.core.database.DQSystemDao)1