use of org.openlca.core.model.Flow in project olca-modules by GreenDelta.
the class ExchangeUseSearchTest method createSystem.
private void createSystem() {
ProductSystem system = new ProductSystem();
system.name = SYS_NAME;
system.referenceProcess = p;
system.referenceExchange = p.exchanges.get(0);
Flow linkFlow = p.exchanges.get(1).flow;
ProcessLink link = new ProcessLink();
link.providerId = p.id;
link.processId = q.id;
link.flowId = linkFlow.id;
system.processLinks.add(link);
system = new ProductSystemDao(db).insert(system);
modelStack.push(system);
}
use of org.openlca.core.model.Flow in project olca-modules by GreenDelta.
the class ExchangeUseSearchTest method addExchanges.
private void addExchanges() {
for (int i = 1; i < 4; i++) {
Flow flow = new Flow();
flow.name = "flow_" + 1;
flow = new FlowDao(db).insert(flow);
modelStack.push(flow);
Exchange ep = new Exchange();
ep.flow = flow;
ep.isInput = false;
p.exchanges.add(ep);
Exchange eq = ep.copy();
eq.isInput = true;
q.exchanges.add(eq);
}
}
use of org.openlca.core.model.Flow in project olca-modules by GreenDelta.
the class FlowPropertyFactorUseSearchTest method setup.
@Before
public void setup() {
flow = new Flow();
flow.name = "flow";
property = new FlowProperty();
property.name = "property";
factor = new FlowPropertyFactor();
factor.flowProperty = property;
flow.flowPropertyFactors.add(factor);
property = new FlowPropertyDao(database).insert(property);
flow = new FlowDao(database).insert(flow);
factor = flow.getFactor(property);
search = new FlowPropertyFactorUseSearch(flow, database);
}
use of org.openlca.core.model.Flow in project olca-modules by GreenDelta.
the class ProjectReferenceSearchTest method createProjectVariant.
private ProjectVariant createProjectVariant(String p1Name, String p2Name, String p3Name, long methodId) {
ProjectVariant variant = new ProjectVariant();
variant.productSystem = db.insert(new ProductSystem());
variant.parameterRedefs.add(createParameterRedef(p1Name, methodId));
variant.parameterRedefs.add(createParameterRedef(p2Name, p3Name + "*5"));
FlowPropertyFactor factor = new FlowPropertyFactor();
factor.flowProperty = db.insert(new FlowProperty());
variant.flowPropertyFactor = factor;
UnitGroup unitGroup = new UnitGroup();
Unit unit = new Unit();
unit.name = "unit";
unitGroup.units.add(unit);
unitGroup = db.insert(unitGroup);
unit = unitGroup.getUnit(unit.name);
variant.unit = unit;
Flow flow = new Flow();
flow.flowPropertyFactors.add(factor);
// don't add flow to expected references, just for persisting the factor
flow = db.insert(flow);
return variant;
}
use of org.openlca.core.model.Flow in project olca-modules by GreenDelta.
the class DataSetRef method setUriAndType.
private static void setUriAndType(RootEntity iModel, Ref ref) {
String uri = "../";
if (iModel instanceof Actor) {
ref.type = DataSetType.CONTACT;
uri += "contacts/";
} else if (iModel instanceof Source) {
ref.type = DataSetType.SOURCE;
uri += "sources/";
} else if (iModel instanceof UnitGroup) {
ref.type = DataSetType.UNIT_GROUP;
uri += "unitgroups/";
} else if (iModel instanceof FlowProperty) {
ref.type = DataSetType.FLOW_PROPERTY;
uri += "flowproperties/";
} else if (iModel instanceof Flow) {
ref.type = DataSetType.FLOW;
uri += "flows/";
} else if (iModel instanceof Process) {
ref.type = DataSetType.PROCESS;
uri += "processes/";
}
uri += iModel.refId;
ref.uri = uri + ".xml";
}
Aggregations