Search in sources :

Example 1 with Modelling

use of org.openlca.ilcd.models.Modelling in project olca-modules by GreenDelta.

the class SystemExport method initModel.

private Model initModel() {
    Model model = new Model();
    Models.setOrigin(model, "openLCA");
    model.version = "1.1";
    model.locations = "../ILCDLocations.xml";
    DataSetInfo info = Models.forceDataSetInfo(model);
    info.uuid = system.refId;
    ModelName name = Models.forceModelName(model);
    name.name.add(LangString.of(system.name, config.lang));
    if (system.description != null) {
        info.comment.add(LangString.of(system.description, config.lang));
    }
    CategoryConverter conv = new CategoryConverter();
    Classification c = conv.getClassification(system.category);
    if (c != null)
        Models.forceClassifications(model).add(c);
    if (system.referenceProcess != null) {
        long refId = system.referenceProcess.id;
        QuantitativeReference qRef = Models.forceQuantitativeReference(model);
        qRef.refProcess = processIDs.getOrDefault(refId, -1);
    }
    Models.forcePublication(model).version = Version.asString(system.version);
    model.modelling = new Modelling();
    return model;
}
Also used : ModelName(org.openlca.ilcd.models.ModelName) Classification(org.openlca.ilcd.commons.Classification) Model(org.openlca.ilcd.models.Model) Modelling(org.openlca.ilcd.models.Modelling) DataSetInfo(org.openlca.ilcd.models.DataSetInfo) QuantitativeReference(org.openlca.ilcd.models.QuantitativeReference)

Aggregations

Classification (org.openlca.ilcd.commons.Classification)1 DataSetInfo (org.openlca.ilcd.models.DataSetInfo)1 Model (org.openlca.ilcd.models.Model)1 ModelName (org.openlca.ilcd.models.ModelName)1 Modelling (org.openlca.ilcd.models.Modelling)1 QuantitativeReference (org.openlca.ilcd.models.QuantitativeReference)1