OcelotProject / Ocelot

Ocelot is open-source linking for life cycle assessment. See https://ocelot.space/ for more information.
Other
25 stars 7 forks source link

Consequential: Handle and validate constrained markets #24

Open cmutel opened 8 years ago

cmutel commented 8 years ago

Checks and, if necessary, corrects the pre-defined linking between multi-output datasets, constrained markets, and marginal consumption activities.

This linking rule ensures the correct linking between producing activities with multiple reference products, the corresponding marginal consumption activities, and their markets. Activities with multiple reference products need to have an ActivityLink to their corresponding consumer. The markets for these activities need to have matching conditional, negative by-products with an ActivityLink to the same consumer as described in the Data Quality Guideslines, Section 14.4.2 and Figure 14.4.

The task CorrectMarketConstraintsForMultiOutputSuppliers examines all markets. For each multi-output (MO) dataset, supplying to the uploaded market and each reference product of the MO dataset it is checked, if the market has a corresponding conditional by- product. In this case, the task calculates the related compensation amount and stores it in a table (method TryGetCompensationCalculationData()). If this amount cannot be calculated due to missing amounts necessary for the calculation, a warning is added to the log.

In the next phase, the task checks, for each conditional by-product in the table, if the stored compensation amount equals the amount of the by-product within a precision of 0.01%. If this is not the case, it corrects the amount and adds a warning to the log (method CheckCompensationAmounts()).