The openLCA core API

This document contains the documentation of the openLCA core API, automatically extracted from the Java documentation of the olca-modules repository (using the jmd tool). The headings of this document follow the structure of the API:

1. Packages (e.g. org.openlca.core.results)
2. Types (mainly classes), e.g. ContributionResult
3. Fields (e.g. techIndex) and methods (e.g. getFlows())

A heading TypeB > TypeA means that the following section is about TypeB which extends TypeA and, thus, has all the methods and fields that TypeA has. The heading fieldC : TypeD means that fieldC is an accessible field (a property) of type TypeD. Finally, a heading methodG(): TypeE means that methodG is a callable method that returns an instance of TypeE. The parameters of that method are directly listed after the heading in the same order as they need to be applied when calling the method. Methods that have the same name as their type (like TypeG()) are constructor methods which create a new instance of that type.

The openLCA core API is a plain Java API that should run on any Java Virtual Machine (JVM) >= v8. Thus, you could use it from any JVM language like Java, Scala, Kotlin, Clojure, Jython, etc. It is also fully exposed to the openLCA development tools within openLCA (Window > Developer tools > Python within openLCA). The Python scripting environment in openLCA uses Jython (a Python implementation that runs on the JVM). The following example shows how the usage of the elements package, type, field, and method:

# import the type 'FlowDao' from the package
# 'org.openlca.core.database'
from org.openlca.core.database import FlowDao

# create a new instance of "FlowDao" by calling
# its constructor method and passing a database
# instance as parameter
dao = FlowDao(db)

# get all flows by calling the method "getAll"
# on the instance of the FlowDao type
flows = dao.getAll()

# writing the value of the field "name" of the
# first flow to the logger output
log.info("Name of the first flow: {}", flows[0].name)

Package: org.openlca.core.database

BlockFetch

Provides the functionality for loading of data for a given set of IDs with a minimal amount of queries but with block sizes of ID sets that are not greater than the allowed maximum list size for queries (see {@link BaseDao#MAX_LIST_SIZE}).

BlockFetch()

Parameters:

• func : QueryFunction

undocumented

doFetch() : List<T>

Parameters:

• ids : List
• function : QueryFunction

Creates a new BlockFetch and runs the given query function.

doFetch() : List<T>

Parameters:

• ids : List

Split the given IDs into chunks with a size not greater than {@link Dao#MAX_LIST_SIZE}, run the queries and return the results.

DataProviderException > Exception

Exception which can be thrown by data operations.

DataProviderException()

Parameters:

• message : String

Creates a new instance

@param message The message of the exception

DataProviderException()

Parameters:

• message : String
• throwable : Throwable

Creates a new instance

@param message The message of the exception @param throwable The cause of the exception

DataProviderException()

Parameters:

• throwable : Throwable

Creates a new instance

@param throwable The cause of the exception

DatabaseException > RuntimeException

Unchecked exception for errors while invoking database operations. These exceptions are already logged and are only thrown so interested caller can handle exceptions

DatabaseException()

Parameters:

• message : String
• e : Throwable

undocumented

EntityCache

A loading cache for entities and descriptors. This cache is intended to be used for caching entities that are used very often (like unit groups or flow properties) and descriptors.

create() : EntityCache

Parameters:

• database : IDatabase

undocumented

get() : T

Parameters:

• clazz : Class
• id : long

undocumented

getAll() : Map<Long, T>

Parameters:

• clazz : Class
• ids : Collection

undocumented

invalidate() : void

Parameters:

• clazz : Class<?>
• id : long

undocumented

undocumented

invalidateAll() : void

Parameters:

• clazz : Class<?>
• ids : Collection

undocumented

refresh() : void

Parameters:

• clazz : Class<?>
• id : long

undocumented

FileStore

Provides structured access to files that are stored outside of a database. Such files can be shapefiles of LCIA methods, PDF documents of sources etc.

FileStore()

Parameters:

• rootFolder : File

undocumented

FileStore()

Parameters:

• db : IDatabase

undocumented

copyFolder() : void

Parameters:

• from : RootEntity
• to : RootEntity

undocumented

copyFolder() : void

Parameters:

• from : BaseDescriptor
• to : BaseDescriptor

undocumented

copyFolder() : void

Parameters:

• type : ModelType
• fromId : String
• toId : String

undocumented

deleteFolder() : void

Parameters:

• d : BaseDescriptor

undocumented

deleteFolder() : void

Parameters:

• e : RootEntity

undocumented

deleteFolder() : void

Parameters:

• type : ModelType
• id : String

undocumented

getFolder() : File

Parameters:

• d : BaseDescriptor

undocumented

getFolder() : File

Parameters:

• e : RootEntity

undocumented

getFolder() : File

Parameters:

• type : ModelType
• id : String

undocumented

getPath() : String

Parameters:

• type : ModelType

Returns the path/folder name for the given model type (e.g. ‘processes’, ‘flow_properties’ etc).

getPath() : String

Parameters:

• type : ModelType
• refId : String

undocumented

undocumented

IDatabase > Closeable, INotifiable

The common interface for openLCA databases.

createConnection() : Connection

Creates a native SQL connection to the underlying database. The connection should be closed from the respective client.

getEntityFactory() : EntityManagerFactory

Returns the entity manager factory from the database.

getFileStorageLocation() : File

Get a location where external files that belongs this database are stored (e.g. PDF or Word documents, shapefiles etc). If there is no such location for such files for this database, an implementation can just return null.

getName() : String

Returns the database name.

undocumented

ImpactMethodDao > CategorizedEntityDao

The DAO class for impact assessment methods.

ImpactMethodDao()

Parameters:

• database : IDatabase

undocumented

getCategoryDescriptors() : List<ImpactCategoryDescriptor>

Parameters:

• methodId : long

undocumented

getCategoryDescriptors() : List<ImpactCategoryDescriptor>

Parameters:

• methodId : String

undocumented

getNwSetDescriptors() : List<NwSetDescriptor>

Parameters:

• methodId : long

undocumented

getNwSetDescriptors() : List<NwSetDescriptor>

Parameters:

• methodId : String

undocumented

Query

A helper class for common queries.

getAll() : List<T>

Parameters:

• type : Class
• jpql : String

undocumented

getAll() : List<T>

Parameters:

• type : Class
• jpql : String
• params : Map<String, ? extends Object>

undocumented

getAllForName() : List<T>

Parameters:

• type : Class
• name : String

undocumented

getFirst() : T

Parameters:

• type : Class
• jpql : String
• params : Map<String, ? extends Object>

undocumented

getForName() : T

Parameters:

• type : Class
• name : String

Searches an entity of the given type with the given name. The type must have a string field ‘name’. If no such type is contained in the database, null is returned.

on() : Query

Parameters:

• database : IDatabase

undocumented

Package: org.openlca.core.database.mysql

DatabaseDescriptor

The descriptor of a database.

undocumented

undocumented

undocumented

setName() : void

Parameters:

• name : String

undocumented

setUpToDate() : void

Parameters:

• upToDate : boolean

undocumented

setVersion() : void

Parameters:

• version : int

undocumented

MySQLDatabase > Notifiable, IDatabase

IDatabase implementation for MySQL database. The URL schema is “jdbc:mysql://” [host] “:” [port] “/” [database]

MySQLDatabase()

Parameters:

• url : String
• user : String

undocumented

MySQLDatabase()

Parameters:

• url : String
• user : String
• persistenceUnit : String

undocumented

close() : void

Overridden method of supertype.

createConnection() : Connection

Overridden method of supertype.

getEntityFactory() : EntityManagerFactory

Overridden method of supertype.

getFileStorageLocation() : File

Overridden method of supertype.

getName() : String

Overridden method of supertype.

getVersion() : int

Overridden method of supertype.

setFileStorageLocation() : void

Parameters:

• fileStorageLocation : File

undocumented

Package: org.openlca.core.database.references

IReferenceSearch

Search of used entities within an entity.

undocumented

undocumented

findReferences() : List<Reference>

Parameters:

• id : long

Returns a list of descriptors of entities that are used in the entity with the given id

Parameters:

• entity : T

undocumented

findReferences() : List<Reference>

Parameters:

• entity : List

undocumented

Parameters:

• entity : Set

undocumented

Package: org.openlca.core.database.usage

ActorUseSearch > BaseUseSearch

Searches for the use of actors in other entities. Actors can be used in processes and projects.

ActorUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

CategoryUseSearch > BaseUseSearch

Searches for the use of currencies in other entities. Currencies can be used in processes.

CategoryUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

CurrencyUseSearch > BaseUseSearch

Searches for the use of currencies in other entities. Currencies can be used in processes and other currencies.

CurrencyUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

DQSystemUseSearch > BaseUseSearch

Searches for the use of data quality systems in other entities. DQSystems can be used in processes.

DQSystemUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

ExchangeUseSearch

Searches for the use of process exchanges in other entities. Exchanges of a process can be used in product systems as quantitative reference or in process links.

ExchangeUseSearch()

Parameters:

• database : IDatabase
• process : Process

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• exchange : Exchange

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• exchanges : List

undocumented

FlowPropertyFactorUseSearch

Searches for the usage of flow property factors of a given flow in other entities of the database.

FlowPropertyFactorUseSearch()

Parameters:

• flow : Flow
• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• factor : FlowPropertyFactor

undocumented

FlowPropertyUseSearch > BaseUseSearch

Searches for the use of flow properties in other entities. Flow properties can be used in flows (in flow property factors) and unit groups (as default flow property).

FlowPropertyUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

FlowUseSearch > BaseUseSearch

Searches for the use of flows in other entities. Flows can be used in processes and impact methods.

FlowUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

IUseSearch

Search of entities where another entity is used.

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• id : long

Returns a list of descriptors of entities where the given entity id is used.

Parameters:

• entity : T

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• entity : List

undocumented

Parameters:

• entity : Set

undocumented

ImpactMethodUseSearch > BaseUseSearch

Searches for the use of impact methods in other entities. Impact methods can be used in projects.

ImpactMethodUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

LocationUseSearch > BaseUseSearch

Searches for the use of locations in other entities. Locations can be used in flows and processes.

LocationUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

ParameterUsageTree

Calculates the usage tree for a parameter.

ParameterUsageTree()

Parameters:

• param : String

undocumented

undocumented

undocumented

build() : ParameterUsageTree

Parameters:

• param : String
• db : IDatabase

undocumented

ParameterUseSearch > BaseUseSearch

Searches for the use of parameters in other entities.

ParameterUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

ProcessUseSearch > BaseUseSearch

Searches for the use of processes in other entities. Processes can be used in product systems.

ProcessUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

SocialIndicatorUseSearch > BaseUseSearch

Searches for the use of currencies in other entities. Currencies can be used in processes.

SocialIndicatorUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

SourceUseSearch > BaseUseSearch

Searches for the use of sources in other entities. Sources can be used in processes.

SourceUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

UnitGroupUseSearch > BaseUseSearch

Searches for the use of unit groups in other entities. Unit groups can be used in flow properties.

UnitGroupUseSearch()

Parameters:

• database : IDatabase

undocumented

findUses() : List<CategorizedDescriptor>

Parameters:

• ids : Set

Overridden method of supertype.

UnitUseSearch

Searches for the usage of flow property factors of a given flow in other entities of the database.

UnitUseSearch()

Parameters:

• database : IDatabase

undocumented

Parameters:

• unit : Unit

undocumented

Package: org.openlca.core.math

CalculationSetup

A setup for a product system calculation.

CalculationSetup()

Parameters:

• type : CalculationType
• system : ProductSystem

Creates a new calculation setup for the given type and product system. It does not add the parameter redefinitions of the product system to this setup. Thus, you need to do this in a separate step.

undocumented

undocumented

numberOfRuns : int

Only valid for Monte Carlo Simulations

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

getUnit() : Unit

Get the unit of the quantitative reference of the product system. By default this is the reference unit of the underlying product system.

setAmount() : void

Parameters:

• amount : double

Optionally set another target amount for the calculation than the one defined in the product system.

setFlowPropertyFactor() : void

Parameters:

• flowPropertyFactor : FlowPropertyFactor

Optionally set another flow property factor for the calculation than the one defined in the product system.

setUnit() : void

Parameters:

• unit : Unit

Optionally set another unit for the calculation than the one defined in the product system.

CalculationType

The type of a calculation.

SIMPLE_CALCULATION

Calculates the total results for elementary flows, LCIA indicators, costs, etc. of a product system.

CONTRIBUTION_ANALYSIS

Includes the total result vectors of a simple calculation but calculates also the direct contributions of each process (or better process product in case of multi-output processes) to these total results.

UPSTREAM_ANALYSIS

Extends the contribution analysis by providing also the upstream results of each process (process product) in the product system. The upstream result contains the direct contributions of the respective process but also the result of the supply chain up to this process scaled to the demand of the process in the product system.

REGIONALIZED_CALCULATION

A regionalized calculation is a contribution analysis but with an LCIA method that supports regionalized characterization factors (via region specific parameters in formulas) and a product system with processes that have geographic information assigned (point, line, or polygon shapes).

MONTE_CARLO_SIMULATION

A Monte Carlo simulation generates for each run, of a given number of a given number of iterations, random values according to the uncertainty distributions of process inputs/outputs, parameters, characterization factors, etc. of a product system and then performs a simple calculation for that specific run.

DataStructures

Provides helper methods for creating matrix-like data structures that can be used in calculations (but also exports, validations, etc.).

createProductIndex() : TechIndex

Parameters:

• system : ProductSystem
• db : IDatabase

Creates a product index from the given product system.

interpreter() : FormulaInterpreter

Parameters:

• db : IDatabase
• setup : CalculationSetup
• techIndex : TechIndex

undocumented

matrixData() : MatrixData

Parameters:

• setup : CalculationSetup
• solver : IMatrixSolver
• mcache : MatrixCache
• subResults : Map<ProcessProduct, SimpleResult>

Create the matrix data for the calculation of the given setup.

parameterContexts() : Set<Long>

Parameters:

• setup : CalculationSetup
• techIndex : TechIndex

undocumented

LcaCalculator

This calculator does the low level matrix based LCA-calculation. Typically, you do not want to use this directly but a more high level calculator where you can directly throw in a calculation setup or project.

LcaCalculator()

Parameters:

• solver : IMatrixSolver
• data : MatrixData

undocumented

undocumented

undocumented

undocumented

getLoopFactor() : double

Parameters:

• A : IMatrix
• s : double[]
• techIndex : TechIndex

undocumented

getRealDemands() : double[]

Parameters:

• totalRequirements : double[]
• loopFactor : double

Calculate the real demand vector for the analysis.

getScalingVector() : double[]

Parameters:

• inverse : IMatrix
• techIndex : TechIndex

Calculates the scaling vector for the reference product i from the given inverse of the technology matrix:

s = d[i] .* Inverse[:, i]

where d is the demand vector and.

getTotalRequirements() : double[]

Parameters:

• techMatrix : IMatrix
• scalingVector : double[]

Calculates the total requirements of the respective product amounts to fulfill the demand of the product system:

tr = s .* diag(A)

where s is the scaling vector and A the technology matrix.

MatrixRowSorter

Sorts a quadratic matrix (the technology matrix in openLCA) so that rows with more entries are located at the bottom of the matrix.

MatrixRowSorter()

Parameters:

• original : IMatrix
• solver : IMatrixSolver

undocumented

undocumented

ReferenceAmount

Functions for getting the reference amount. The reference amount is the amount of a flow value converted to the reference unit and flow property of that flow. This is the value that is used in the calculations.

get() : double

Parameters:

• system : ProductSystem

Get the reference amount of the reference flow / quantitative reference of the given product system.

get() : double

Parameters:

• setup : CalculationSetup

Get the reference amount of the reference flow / quantitative reference of the given calculation setup.

get() : double

Parameters:

• e : Exchange

Get the reference amount of the given exchange.

Simulator

A Simulator runs Monte-Carlo simulations with a given calculation setup.

When running the Monte Carlo simulation on a product system s_r that has a sub-system (which again can have sub-systems etc.) we need to first run the number generation and calculation for that sub-system and integrate these results into the matrices of s_r in each iteration step of the simulation. In general, we have to do this for each relation s_i \prec s_j, where s_i is a sub-system of s_j, of all product systems S of the recursively expanded sub-system dependencies.

S is a strict partial ordered set as we do not allow cycles in the sub-system dependencies. Thus, we can define a linear order of all systems via topological sorting which maps each product system s_i to a position pos_i with pos_i < pos_j when s_i \prec s_j.

In the simulation, we then run the number generation and calculation for each sub-system starting from the lowest position in pos = [1 \dots n] where the top-most product system s_r has the position pos_r = n. Thus, in a simulation step a product system s_j can access and integrate the result of a sub-system s_i when s_i \prec s_j. With this, the number generation and calculation have to be done only once for each simulation step for each product system s_i \in S.

pinnedProducts : Set

A set of products for which upstream and direct contributions should be tracked during the simulation. These products must be part of the TechIndex.

create() : Simulator

Parameters:

• setup : CalculationSetup
• mcache : MatrixCache
• solver : IMatrixSolver

undocumented

undocumented

undocumented

getResult() : SimulationResult

Get the result of the simulation.

undocumented

nextRun() : SimpleResult

Generates random numbers and calculates the product system. Returns the simulation result if the calculation in this run finished without errors, otherwise null is returned (e.g. when the resulting matrix was singular). The returned result is appended to the result of the simulator (which you get via getResult(), so it does not need to be cached.

SystemCalculator

Calculates the results of a calculation setup or project. The same calculator can be used for different setups. The product systems of the setups may contain sub-systems. The calculator does not check if there are obvious errors like sub-system cycles etc.

SystemCalculator()

Parameters:

• cache : MatrixCache
• solver : IMatrixSolver

undocumented

calculate() : ProjectResult

Parameters:

• project : Project

undocumented

calculateContributions() : ContributionResult

Parameters:

• setup : CalculationSetup

undocumented

calculateFull() : FullResult

Parameters:

• setup : CalculationSetup

undocumented

calculateSimple() : SimpleResult

Parameters:

• setup : CalculationSetup

undocumented

Package: org.openlca.core.math.data_quality

ProcessingType

Lists the different types of how to process n.a. values in data quality calculation

undocumented

undocumented

Package: org.openlca.core.matrix

AllocationIndex

An instances of this class provides fast access to the allocation factors related to the products of a product system. It maps a product p and an exchange of flow i to the respective allocation factor \lambda_{p,i}:

Idx_{Alloc}: (p, i) \mapsto \lambda_{p,i}

create() : AllocationIndex

Parameters:

• db : IDatabase
• techIndex : TechIndex
• method : AllocationMethod

Creates a new allocation index for the given database, product index, and allocation method.

get() : double

Parameters:

• product : ProcessProduct
• exchangeID : long

Returns the allocation factor \lambda_{p,i} for the given product p and (ID of the exchange with the) flow i. It is very important that this method is only called with exchanges that can be allocated to a product output or waste input, which are: product inputs, waste outputs, or elementary flows.

CostVector

A cost vector contains the unscaled net-costs for a set of process-products. Unscaled means that these net-costs are related to the (allocated) product amount in the respective process. The vector is then scaled with the respective scaling factors in the result calculation.

asMatrix() : IMatrix

Parameters:

• solver : IMatrixSolver
• values : double[]

undocumented

DIndex

Maps a set of descriptors to an ordinal, zero-based index of type int. This class is used to map descriptors to matrix columns. Note that this implementation assumes that the descriptors describe existing objects in a database and thus have an ID > 0. Also, this class is not thread safe.

at() : D

Parameters:

• i : int

Get the descriptor at the given position or null when there is no descriptor at the given position.

contains() : boolean

Parameters:

• d : D

Returns true when the given descriptor is part of that index.

contains() : boolean

Parameters:

• id : long

Returns true when the descriptor with the given ID is part of that index.

content() : Set<D>

Returns the content of this index.

each() : void

Parameters:

• fn : IndexConsumer

Calls the given function for each descriptor in this index.

idAt() : long

Parameters:

• i : int

Get the ID of the descriptor at the given position.

ids() : long[]

Get the IDs of all descriptors that are in this index.

isEmpty() : boolean

Returns true if there is no content in this index.

of() : int

Parameters:

• d : D

Returns the position of the given descriptor. If the descriptor is not in the index, it returns -1.

of() : int

Parameters:

• id : long

Returns the position of the descriptor with the given ID. If the descriptor is not in the index, it returns -1.

put() : int

Parameters:

• d : D

Adds the given descriptor to this index if it is not yet contained and returns the index position of it.

putAll() : void

Parameters:

• it : Iterable

Adds all descriptors from the given collection to this index.

size() : int

Returns the number of descriptors in the index.

FastMatrixBuilder

A fast matrix builder that skips the product system linking layer …

FastMatrixBuilder()

Parameters:

• db : IDatabase
• setup : CalculationSetup

undocumented

undocumented

FlowIndex > DIndex

The row index \mathit{Idx}_B of the intervention matrix \mathbf{B}. It maps the (elementary) flows \mathit{F} of the processes in the product system to the k rows of \mathbf{B}.

\mathit{Idx}_B: \mathit{F} \mapsto [0 \dots k-1]

build() : FlowIndex

Parameters:

• cache : MatrixCache
• productIndex : TechIndex
• allocationMethod : AllocationMethod

undocumented

isInput() : boolean

Parameters:

• flow : FlowDescriptor

undocumented

isInput() : boolean

Parameters:

• flowId : long

undocumented

putInput() : int

Parameters:

• flow : FlowDescriptor

undocumented

putOutput() : int

Parameters:

• flow : FlowDescriptor

undocumented

ImpactFactorMatrix

A matrix with impact assessment factors where the flows are mapped to the columns and the impact categories are mapped to the rows. The factors should be negative in this matrix if the corresponding flow is an input flow.

ImpactFactorMatrix()

Parameters:

• rows : int
• columns : int

undocumented

apply() : void

Parameters:

• matrix : IMatrix

undocumented

createRealMatrix() : IMatrix

Parameters:

• solver : IMatrixSolver

undocumented

Parameters:

• row : int
• col : int

undocumented

undocumented

setEntry() : void

Parameters:

• row : int
• col : int
• cell : ImpactFactorCell

undocumented

simulate() : void

Parameters:

• matrix : IMatrix

undocumented

ImpactTable

The ImpactTable is the corresponding data type to the Inventory type but wraps a matrix of impact assessment factors.

undocumented

undocumented

undocumented

build() : ImpactTable

Parameters:

• cache : MatrixCache
• impactMethodId : long
• flowIndex : FlowIndex

undocumented

createMatrix() : IMatrix

Parameters:

• solver : IMatrixSolver

undocumented

createMatrix() : IMatrix

Parameters:

• solver : IMatrixSolver
• interpreter : FormulaInterpreter

undocumented

undocumented

simulate() : void

Parameters:

• matrix : IMatrix
• interpreter : FormulaInterpreter

Re-evaluates the parameters and formulas in the impact factor table (because they may changed), generates new values for the entries that have an uncertainty distribution and set these values to the entries of the given matrix. The given matrix and this impact table have to match exactly in size (so normally you first call createMatrix and than simulate).

IndexConsumer

Like the normal consumer function but with an index of the respective object as first argument.

Parameters:

• index : int
• obj : T

undocumented

InventoryConfig

A class for configuration objects that are passed into an inventory builder.

InventoryConfig()

Parameters:

• db : IDatabase
• techIndex : TechIndex

undocumented

undocumented

undocumented

undocumented

subResults : Map<ProcessProduct,SimpleResult>

Optional sub-system results of the product system.

undocumented

undocumented

withUncertainties : boolean

undocumented

A LinkingCallback is a function that can be injected into the creation of product systems links to control the linking process.

cancel() : boolean

Returns true if the linking process should be canceled.

select() : List<ProcessProduct>

Parameters:

• e : CalcExchange
• providerCandidates : List

This function is called when there are multiple possible providers for the given product input or waste output. The callback should select one or more providers from the given candidates. Returning null will lead to an undefined behavior. If exactly one provider is returned, the exchanges will be linked with this provider. When there are multiple providers returned, the linking process will select one option based on its own rules (e.g. this is what happens when the user selects continue with auto-select in the UI).

TODO: update doc

LongIndex

Maps arbitrary values of type long to an ordinal, zero-based index of type int. This class is used to map entity keys to matrix columns. The default value for a key that is not contained in this index is -1.

Parameters:

• key : long

undocumented

getIndex() : int

Parameters:

• key : long

Returns the index for the given key. Returns -1 if the key is not contained in the map.

Parameters:

• index : int

undocumented

getKeys() : long[]

Get the keys of this index in their respective order in this index.

undocumented

put() : int

Parameters:

• key : long

Adds the given key to the index. The value for the key is the current size of the index.

size() : int

Returns the number of entries in the index.

LongPair > Comparable

A LongPair saves just a pair of longs. We use this typically to efficiently store the IDs of a process and a product or waste flow as pair that we then use in indices to build matrix structures for the calculation. In this case, the first value should be always the process ID and the second the flow ID.

LongPair()

Parameters:

• first : long
• second : long

undocumented

undocumented

undocumented

compareTo() : int

Parameters:

• other : LongPair

Overridden method of supertype.

equals() : boolean

Parameters:

• first : long
• second : long

undocumented

equals() : boolean

Parameters:

• obj : Object

Overridden method of supertype.

hashCode() : int

Overridden method of supertype.

of() : LongPair

Parameters:

• first : long
• second : long

undocumented

toString() : String

Overridden method of supertype.

MatrixData

Contains the matrices of that are input of a calculation.

costVector : double[]

A cost vector contains the unscaled net-costs for a set of process-products. Unscaled means that these net-costs are related to the (allocated) product amount in the respective process. The vector is then scaled with the respective scaling factors in the result calculation. This vector is only available when LCC calculation should be done.

enviIndex : FlowIndex

The matrix index of the environmental/elementary flows (i.e. the row index of the intervention matrix; the column index of the impact matrix).

enviMatrix : IMatrix

The intervention matrix.

enviUncertainties : UMatrix

Contains the uncertainty distributions of the entries in the intervention matrix. This field is only used (not null) for uncertainty calculations.

impactIndex : DIndex

The matrix index of the LCIA categories (i.e. the row index of the impact matrix).

impactMatrix : IMatrix

The matrix with the characterization factors: LCIA categories * elementary flows.

techIndex : TechIndex

The matrix index of the product and waste flows of the technosphere (i.e. the row and column index of the technology matrix; the column index of the intervention matrix).

techMatrix : IMatrix

The technology matrix.

techUncertainties : UMatrix

Contains the uncertainty distributions of the entries in the technology matrix. This field is only used (not null) for uncertainty calculations.

simulate() : void

Parameters:

• interpreter : FormulaInterpreter

undocumented

NwSetTable

Stores the factors of a normalization and weighting set. As creating such a table is quite simple there is no separate builder class for reading this kind of data from a database but a factory method in this class.

applyBoth() : List<ImpactResult>

Parameters:

• results : List

Applies the normalization and weighting factors to the given impact assessment result. Returns a normalized and weighted result for each result item in the given list. The given list is not modified.

applyNormalisation() : List<ImpactResult>

Parameters:

• results : List

Applies the normalization factors to the given impact assessment result. Returns a normalized result for each result item in the given list. The given list is not modified.

applyWeighting() : List<ImpactResult>

Parameters:

• results : List

Applies the weighting factors to the given impact assessment result. Returns a weighted result for each result item in the given list. The given list is not modified.

build() : NwSetTable

Parameters:

• database : IDatabase
• nwSetId : long

Builds the table by reading the factors for the NW-set with the given ID from the given database.

getNormalisationFactor() : double

Parameters:

• impactCategoryId : long

Get the normalization factor for the given LCIA category.

getWeightingFactor() : double

Parameters:

• impactCategoryId : long

Get the weighting factor for the given LCIA category.

undocumented

undocumented

ParameterTable

A data structure for fast creation of formula interpreters for the parameters of a database.

forSimulation() : ParameterTable

Parameters:

• db : IDatabase
• contexts : Set
• redefs : Collection

Builds a parameter table suitable for creating formula interpreters in a Monte Carlo simulation.

interpreter() : FormulaInterpreter

Parameters:

• db : IDatabase
• contexts : Set
• redefs : Collection

Builds a formula interpreter for the global parameters and the local parameters of the given contexts (processes or LCIA methods). It also applies the given parameter redefinitions.

simulate() : FormulaInterpreter

Calculates new random values for the parameters in this table that have an uncertainty distribution assigned. It re-binds the values of theses parameters in the underlying interpreter with the generated values.

This is a data structure for searching a set of existing process links by provider and recipient processes.

Parameters:

undocumented

Parameters:

• processId : long

Returns all incoming links to the process with the given ID, i.e. all links where the process is recipient.

Parameters:

• processId : long

Returns all the links where the process with the given ID is either provider or recipient.

Parameters:

• processId : long

Returns all the outgoing links from the process with the given ID, i.e. all links where the process is provider.

ProcessProduct

In openLCA, we map the process-product pairs of a product system to the respective rows and columns of the matrices in the inventory model. Multi-output processes are split into multiple vectors that each are relate to a single process-product pair. This also includes waste treatment processes (where the treatment of waste is the product) and product systems that are sub-systems of other product systems (and are handled like processes in these systems with their quantitative reference as product).

flow : FlowDescriptor

The product flow of the process-product pair. Note that this can also be a waste flow (which is then an input of the process and the treatment of waste is the product of the process).

process : CategorizedDescriptor

The process of process-product pair. Note that this can be also the descriptor of a product system when it is a sub-system of another product system because in this case such systems are handled just like processes (they are mapped to the technology matrix mathbf{A} via the TechIndex etc.).

equals() : boolean

Parameters:

• obj : Object

Overridden method of supertype.

undocumented

hashCode() : int

Overridden method of supertype.

id() : long

Returns the ID of the underlying process or product system of this provider.

undocumented

of() : ProcessProduct

Parameters:

• entity : CategorizedDescriptor
• flow : FlowDescriptor

undocumented

of() : ProcessProduct

Parameters:

• process : Process
• flow : Flow

undocumented

of() : ProcessProduct

Parameters:

• system : ProductSystem

Creates a product where the given product system is the provider and the reference flow of the system the product.

undocumented

ProductSystemBuilder

Builds or auto-completes a product system according to a given configuration.

ProductSystemBuilder()

Parameters:

• matrixCache : MatrixCache

Create a new product system builder.

autoComplete() : void

Parameters:

• system : ProductSystem

Auto-completes the given product system starting with the reference process of the system and following all product inputs and waste outputs recursively to link them to a provider process. After this function the product system will contain an updated set of process IDs and process links. The meta-data of the product system are not changed. When you then want to save these updated process IDs and process links in the database you can call the {@link #saveLinks(ProductSystem)} function.

autoComplete() : void

Parameters:

• system : ProductSystem
• product : ProcessProduct

Does the same as {@link #autoComplete(ProductSystem)} but starts the linking at the given process product which can be arbitrary product in the supply chain of the given system.

build() : ProductSystem

Parameters:

• process : Process

Creates a new product system for the given process and runs the auto-complete functions with the linking configuration of this build. The returned system is not saved to the database.

Parameters:

• system : ProductSystem

Saves the updated process links and IDs of the given product system in the databases. Note that if the product system is already contained in the database (i.e. has an ID > 0) this function will not update the other meta-data of the system as it is intended to call this function after an {@link #autoComplete(ProductSystem)} call in this case.

TechIndex

The index \mathit{Idx}_A of the technology matrix \mathbf{A} of a product system. It maps the process-product pairs (or process-waste pairs) \mathit{P} of the product system to the respective n rows and columns of \mathbf{A}. If the product system contains other product systems as sub-systems, these systems are handled like processes and are also mapped as pair with their quantitative reference flow to that index (and also their processes etc.).

\mathit{Idx}_A: \mathit{P} \mapsto [0 \dots n-1]

TechIndex()

Parameters:

• refFlow : ProcessProduct

Creates a new technosphere index of a product system.

@param refFlow the reference product-output or waste-input as (processId, flowId) pair.

contains() : boolean

Parameters:

• processID : long
• flowID : long

Returns true when there is a product in this index with a process and flow of the given IDs.

content() : Set<ProcessProduct>

Returns all providers of this index.

each() : void

Parameters:

• fn : IndexConsumer

undocumented

getDemand() : double

The demand value. This is the amount of the reference flow given in the reference unit and flow property. The default value is 1.0.

getIndex() : int

Parameters:

• provider : ProcessProduct

Returns the ordinal index of the given provider (product-output or waste input).

Returns all exchanges (product-inputs and waste-outputs) that are linked to provider of this index.

Parameters:

• exchange : LongPair

Returns the linked provider (product-output or waste-input) for the given exchange (product-input or waste-output)

getProcessIds() : Set<Long>

Returns the IDs of all processes in this index (note that this can also can contain product system IDs if there are sub-systems in the product system).

getProvider() : ProcessProduct

Parameters:

• processID : long
• flowID : long

undocumented

getProviderAt() : ProcessProduct

Parameters:

• index : int

Returns the provider (product-output or waste-input) at the given index.

getProviders() : List<ProcessProduct>

Parameters:

• d : CategorizedDescriptor

Get all providers with the given descriptor of a process or product system as entity.

getProviders() : List<ProcessProduct>

Parameters:

• processId : long

Returns the providers (product-outputs and waste-inputs) for the process with the given ID.

TODO: do we need this anymore?

getRefFlow() : ProcessProduct

Get the reference product-output or waste-input of the product system described by this index.

Parameters:

• exchange : LongPair

Returns true if the given product-input or waste-output is linked to a provider of this index.

isProvider() : boolean

Parameters:

• processID : long

Returns true when there is a process or product system with the given ID part of this index.

put() : void

Parameters:

• provider : ProcessProduct

Adds the given provider (product-output or waste-input) to this index. Does nothing if it is already contained in this index.

Parameters:

• exchange : LongPair
• provider : ProcessProduct

@param exchange The linked product-input or waste-output as (processId, exchangeId) pair. @param provider The product-output or waste-input (provider) as (processId, flowId) pair.

setDemand() : void

Parameters:

• demand : double

The demand value. This is the amount of the reference flow given in the reference unit and flow property. The default value is 1.0.

size() : int

Returns the size of this index which is equal to the number of rows and columns in the related technology matrix.

UMatrix

An UMatrix is a matrix with uncertainty distributions.

UMatrix()

undocumented

Parameters:

• row : int
• col : int
• e : CalcExchange
• allocationFactor : double

Add the given Exchange to the uncertainty matrix. It is only added when it has an uncertainty distribution or formulas assigned. Thus, you should call this function for every exchange when building the inventory matrices as this function will decide whether an exchange should be added.

generate() : void

Parameters:

• m : IMatrix
• interpreter : FormulaInterpreter

Generates new values and sets them to the given matrix.

Package: org.openlca.core.matrix.cache

ConversionTable

A table that contains the conversion factors for units and flow property factors. (Note: A flow can have multiple flow properties and a flow property factor describes the flow specific conversion of a flow property to the reference flow property of a flow).

create() : ConversionTable

Parameters:

• db : IDatabase

undocumented

getCurrencyFactor() : double

Parameters:

• currencyID : long

Get the conversion factor of the currency with the given ID to the reference currency in the database.

getPropertyFactor() : double

Parameters:

• flowPropertyFactorId : long

Get the conversion factor of the given flow property factor to the reference flow property factor of a flow.

getUnitFactor() : double

Parameters:

• unitId : long

Get the conversion factor of the unit with the given ID to the reference unit of the unit group to which this unit belongs.

undocumented

FlowTable

A simple data structure that holds the flow types of the flows in a database.

create() : FlowTable

Parameters:

• database : IDatabase

undocumented

get() : FlowDescriptor

Parameters:

• flowID : long

undocumented

getFlowIds() : long[]

Get the IDs of all flows in this table.

getTypes() : TLongObjectHashMap<FlowType>

Parameters:

• db : IDatabase

Get a map with all ID -> FlowType pairs from the database.

Parameters:

• db : IDatabase

undocumented

type() : FlowType

Parameters:

• flowId : long

undocumented

ProcessTable

TODO: tests + doc

create() : ProcessTable

Parameters:

• db : IDatabase

undocumented

getProvider() : ProcessProduct

Parameters:

• id : long
• flowId : long

undocumented

getProviders() : List<ProcessProduct>

Parameters:

• flowId : long

Returns the list of providers that have the flow with the given ID as product output or waste input.

getProviders() : List<ProcessProduct>

Get all product or waste treatment providers from the database.

getType() : ProcessType

Parameters:

• processId : long

Returns the process type for the given process-ID.

Package: org.openlca.core.matrix.format

CCRMatrix > IMatrix

Implements a compressed-column representation of a sparse matrix. Note that this format is not editable. Calling set(row, col, val) will throw an exception.

columnPointers : int[]

The column pointers A.c that indicate where each column begins. The last component of A.c contains \text{nnz}(A) where \text{nnz}(A) is the number of non-zero entries in A.

columns : int

The total number of columns.

rowIndices : int[]

The row indices A.r of the non-zero entries A.val.

rows : int

The total number of rows.

values : double[]

The vector with non-zero entries A.val.

columns() : int

Overridden method of supertype.

copy() : IMatrix

Overridden method of supertype.

get() : double

Parameters:

• row : int
• col : int

Overridden method of supertype.

getColumn() : double[]

Parameters:

• i : int

Overridden method of supertype.

getRow() : double[]

Parameters:

• i : int

Overridden method of supertype.

of() : CCRMatrix

Parameters:

• other : IMatrix

undocumented

rows() : int

Overridden method of supertype.

set() : void

Parameters:

• row : int
• col : int
• val : double

Overridden method of supertype.

setValues() : void

Parameters:

• values : double[][]

Overridden method of supertype.

DenseMatrix > IMatrix

An implementation that uses a double precision array to store the data. Data are stored in column-major order.

DenseMatrix()

Parameters:

• rows : int
• columns : int

undocumented

columns() : int

Overridden method of supertype.

copy() : DenseMatrix

Overridden method of supertype.

get() : double

Parameters:

• row : int
• col : int

Overridden method of supertype.

getColumn() : double[]

Parameters:

• i : int

Overridden method of supertype.

undocumented

getRow() : double[]

Parameters:

• i : int

Overridden method of supertype.

rows() : int

Overridden method of supertype.

set() : void

Parameters:

• row : int
• col : int
• val : double

Overridden method of supertype.

HashPointMatrix > IMatrix

A sparse matrix implementation that uses primitive hash maps from the Trove project to store the data. Filling this matrix is fast with relatively low memory consumption.

Note that you have to make sure to set the respective row and column size when there are empty rows or columns.

undocumented

Parameters:

• rows : int
• cols : int

undocumented

HashPointMatrix()

Parameters:

• values : double[][]

undocumented

undocumented

undocumented

undocumented

columns() : int

Overridden method of supertype.

undocumented

copy() : HashPointMatrix

Overridden method of supertype.

get() : double

Parameters:

• row : int
• col : int

Overridden method of supertype.

getColumn() : double[]

Parameters:

• i : int

Overridden method of supertype.

undocumented

getRow() : double[]

Parameters:

• i : int

Overridden method of supertype.

iterate() : void

Parameters:

• fn : EntryFunction

Iterates over the non-zero values in this matrix.

multiply() : double[]

Parameters:

• v : double[]

Performs a matrix-vector multiplication with the given vector v.

rows() : int

Overridden method of supertype.

scaleColumns() : void

Parameters:

• v : double[]

Scales each column j of the matrix with the value v[j] of the given vector: M * diagm(v). The matrix is modified in-place.

set() : void

Parameters:

• row : int
• col : int
• val : double

Overridden method of supertype.

toString() : String

Overridden method of supertype.

IMatrix

Interface with the general matrix operations used in openLCA.

columns() : int

Returns the number of columns of the matrix.

copy() : IMatrix

Creates a copy of this matrix and returns it

get() : double

Parameters:

• row : int
• col : int

Get the value of the given row and column.

getColumn() : double[]

Parameters:

• i : int

Get the row values of the given column.

getRow() : double[]

Parameters:

• i : int

Get the column values of the given row.

rows() : int

Returns the number of rows of the matrix.

set() : void

Parameters:

• row : int
• col : int
• val : double

Set the entry in the given row and column to the given value.

setValues() : void

Parameters:

• values : double[][]

undocumented

MatrixBuilder

This is matrix builder that allows you to create a matrix just by filling the values and which can switch efficiently between a sparse and dense representation during this filling process. It does this by allocation a growing dense matrix block and fast array copying if the fill rate exceeds a specific value. See https://github.com/msrocka/blockm for further information.

undocumented

MatrixBuilder()

Parameters:

• maxSparseFileRate : double

undocumented

MatrixBuilder()

Parameters:

• maxSparseFileRate : double
• checkpoint : int

undocumented

Parameters:

• row : int
• col : int
• w : double

Let v be the current value at the cell $a_{row, col}. This function adds the given value w to$a_{row, col} so that:

a_{row, col} = v + w

Where v = 0 When there is no value at \$a_{row, col}.

undocumented

Parameters:

• rows : int
• cols : int

undocumented

set() : void

Parameters:

• row : int
• col : int
• val : double

Set the cell (row, col) to the given value.

SparseMatrixData > Serializable

A class that holds the data of a sparse matrix. This class is only used for mapping the data between native and Java functions.

undocumented

SparseMatrixData()

Parameters:

• matrix : HashPointMatrix

Copies the data from the given matrix to a new instance of this class.

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

Package: org.openlca.core.matrix.io

CsvOut

This class provides methods for writing matrices and related indices to CSV files. It has the following properties:

• existing files are overwritten
• the column separator is a comma: ,
• the file encoding is UTF-8
• the line separator is platform specific
• internal exceptions are rethrown as runtime exceptions, handling them is up to you

write() : void

Parameters:

• data : MatrixData
• folder : File

Write the given matrix data and indices as CSV files to the given folder.

write() : void

Parameters:

• result : BaseResult
• folder : File

Write the result to the given folder.

write() : void

Parameters:

• matrix : IMatrix
• file : File

Write the matrix to the given file.

write() : void

Parameters:

• idx : TechIndex
• file : File

Write the product index into the given file.

write() : void

Parameters:

• idx : FlowIndex
• file : File

Write the flow index into the given file.

write() : void

Parameters:

• idx : DIndex
• file : File

Write the LCIA category index into the given file.

writeCol() : void

Parameters:

• v : double[]
• file : File

Write the array as column vector to the given file.

MarketFormatWriter

Provides methods for writing matrices in the Matrix-Market format (see http://math.nist.gov/MatrixMarket/formats.html).

MarketFormatWriter()

Parameters:

• file : File
• matrix : IMatrix

undocumented

writeDense() : void

Writes the matrix in array format:
2. [number of rows] [number of columns]
3. each entry in a separate row in column-major order

See the Matrix-Market format specification for more details.

writeSparse() : void

Writes the matrix in coordinate format:
2. [number of rows] [number of columns] [number of entries]
3. entries in the form: [row index] [column index] [value]

See the Matrix-Market format specification for more details.

Reads a binary Matlab file (version?) with a matrix with 64 bit floating point numbers into a IMatrix.

Parameters:

• file : File
• solver : IMatrixSolver

undocumented

undocumented

setUseStreaming() : void

Parameters:

• useStreaming : boolean

undocumented

Package: org.openlca.core.matrix.io.olcamat

EnviIndexEntry

Contains the meta-data of a row of the intervention matrix A.

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

clone() : EnviIndexEntry

Overridden method of supertype.

Export > Runnable

Exports a matrix into the openLCA matrix (=olcamat) format.The olcamat format is still experimental so this may change in future.

Export()

Parameters:

• db : IDatabase
• dir : File

undocumented

Export()

Parameters:

• setup : CalculationSetup
• db : IDatabase
• dir : File

undocumented

undocumented

run() : void

Overridden method of supertype.

TechIndexEntry > EnviIndexEntry

Contains the meta-data of a row / column of the technology matrix A.

undocumented

undocumented

undocumented

undocumented

undocumented

clone() : TechIndexEntry

Overridden method of supertype.

Package: org.openlca.core.matrix.product.index

ProviderSearch

Searches for the best provider for a given product input or waste output in the database.

ProviderSearch()

Parameters:

• processTable : ProcessTable

undocumented

find() : ProcessProduct

Parameters:

• e : CalcExchange

Find the best provider for the given product input or waste output according to the search settings.

Parameters:

• list : List

Returns from the given list the product inputs or waste outputs that could be linked to a provider.

Package: org.openlca.core.matrix.solvers

DenseSolver > IMatrixSolver

A double precision solver that uses dense matrices and calls the respective

invert() : DenseMatrix

Parameters:

• a : IMatrix

Overridden method of supertype.

matrix() : IMatrix

Parameters:

• rows : int
• columns : int

Overridden method of supertype.

multiply() : double[]

Parameters:

• m : IMatrix
• x : double[]

Overridden method of supertype.

multiply() : DenseMatrix

Parameters:

• a : IMatrix
• b : IMatrix

Overridden method of supertype.

scaleColumns() : void

Parameters:

• m : IMatrix
• v : double[]

Overridden method of supertype.

solve() : double[]

Parameters:

• a : IMatrix
• idx : int
• d : double

Overridden method of supertype.

IMatrixSolver

Interface for linear algebra and matrix problems that we need to solve in openLCA. We provide different implementations for these functions also in other packages which are based on high performance libraries like Eigen and OpenBLAS.

invert() : IMatrix

Parameters:

• a : IMatrix

Calculates the inverse of the given matrix.

matrix() : IMatrix

Parameters:

• rows : int
• columns : int

Creates an instance of the default matrix type that can be used with this solver.

matrix() : IMatrix

Parameters:

• rows : int
• columns : int
• density : double

Creates a instance of a matrix type which may dependent on the given density of the matrix (which is the number of non-zero elements divided by the total number of elements. By default it just calls the {@link IMatrixSolver#matrix(int, int)} method but this can be overwritten when the solver supports dense and sparse matrix implementations.

multiply() : IMatrix

Parameters:

• a : IMatrix
• b : IMatrix

Returns the matrix product of the given matrices.

multiply() : double[]

Parameters:

• m : IMatrix
• v : double[]

Calculates a matrix-vector product. In openLCA we use this for example when we calculate the inventory result: g = B * s

scaleColumns() : void

Parameters:

• m : IMatrix
• v : double[]

Scales the columns of matrix m with the factors in v. This is equivalent to m * diag(v) but can be implemented in a more efficient way.

solve() : double[]

Parameters:

• a : IMatrix
• idx : int
• d : double

Solves the system of linear equations A * s = d. In openLCA this is used to calculate the scaling factors of an inventory where the vector d has just a single entry.

@param a the technology matrix A @param d the demand value (the entry in the vector d).

@param idx the index of the entry in the demand vector.

@return the calculated scaling vector s

Package: org.openlca.core.model

AbstractEntity

This is an abstract class for everything that is identified by an ID and can be stored in a database via JPA. Generally, the generation of the ID should be managed by JPA.

This class provides implementations for hashCode and equals that are based on the ID field.

undocumented

equals() : boolean

Parameters:

• obj : Object

Overridden method of supertype.

hashCode() : int

Overridden method of supertype.

toString() : String

Overridden method of supertype.

Actor > CategorizedEntity

An actor can be a person or an organisation.

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

clone() : Actor

Overridden method of supertype.

AllocationFactor > AbstractEntity, Cloneable

This type describes an allocation factor related to a product or waste flow of a multi-functional process. A multi-functional process has, in contrast to a mono-functional process, multiple product outputs, waste inputs, or both. Allocation factors can be used to transform a multi-functional process into a set of mono-functional processes (or more precisely into a set of mono-functional process vectors). This is done by splitting the amount m_{i,u} of each product input, waste output, or elementary flow i of the multi-functional process u into a value m_{i,j} for each product output or waste input j by applying an allocation factor \lambda_{j} respectively:

m_{i,j} = \lambda_{j} \ m_{i,u}

In openLCA, allocation factors for different allocation methods (physical, economic, causal allocation) can be stored for a process. While physical and economic allocation factors of a product j are the same for all product inputs, waste outputs, or elementary flows i, they can be different for each flow i in case of causal allocation (so \lambda_{i,j} in this case).

Furthermore, the value of an allocation factor is between 0 and 1, and the sum off all allocation factors related to each product j (and flow i in case of causal allocation) is 1:

0 \leq \lambda_{(i,)j} \leq 1 \ \text{and} \ \sum_j{\lambda_{(i,)j}} = 1

exchange : Exchange

If the factor is a causal allocation factor this field contains a reference to the exchange with flow i to which the allocation factor is related. Note that there can be multiple exchanges with the same flow i and different allocation factors.

method : AllocationMethod

The allocation method to which the factor is related (physical, economic, or causal).

productId : long

The ID of the product flow j to which this allocation factor is related. In case of waste treatment processes (processes with waste inputs) this can be also the ID of a waste flow.

value : double

The value of the allocation factor \lambda_{j} (or \lambda_{i,j} in case of causal allocation).

clone() : AllocationFactor

Overridden method of supertype.

AllocationMethod

An enumeration of the allocation methods that can be used in processes and calculation setups.

USE_DEFAULT

This is a flag, that is used for calculations only. It means that the respective default allocation method of a process should be used when building a product system. Note, that this is not a valid value for the default allocation method in a process.

CAUSAL

Causal allocation means that the user can define an allocation factor for each input or output separately per output product of a process.

ECONOMIC

Means that an economic flow property is used to calculate the allocation factors of a process.

NONE

Means that no allocation method should be used.

PHYSICAL

Means that a physical flow property is used to calculate the allocation factors of a process.

Callback

A simple callback interface for notification of model events; e.g. for imports and exports.

apply() : void

Parameters:

• message : Message
• data : RootEntity

Executes the callback function. This function follows the error-first pattern as known from Node.js but with a message object except of plain error.

CategorizedEntity > RootEntity

A categorized entity is a root entity with a category.

undocumented

Exchange > AbstractEntity

Exchanges are representing the inputs and outputs of flows in processes.

amount : double

The amount of the exchange.

amountFormula : String

An optional formula for the exchange amount. The evaluated value of this formula should be always stored in the amount field.

baseUncertainty : Double

An optional base uncertainty of the data quality entry (= Pedigree matrix entry).

undocumented

undocumented

undocumented

defaultProviderId : long

If the exchange is an product input or waste output this field can contain a process ID which produces the respective product or treats the waste flow. This field is used when processes are automatically linked in product system graphs. A value of zero means that no link is set.

undocumented

dqEntry : String

The base uncertainty of the data quality entry (= Pedigree matrix entry).

flow : Flow

The flow of the exchange.

flowPropertyFactor : FlowPropertyFactor

The flow property (quantity) in which the amount of the exchange is given. It is a “flow property factor” because it contains also the conversion factor to the reference quantity of the flow.

internalId : int

An id that is unique within the process, this id must not be changed after creation

isAvoided : boolean

Indicates whether an exchange is an avoided product or waste flow. An exchange with an avoided product flow must be set as an input and an avoided waste flow as an output in order to be handled correctly in the calculation.

isInput : boolean

Indicates whether the exchange is an input (= true) or output (= false).

uncertainty : Uncertainty

An optional uncertainty distribution of the exchange amount.

unit : Unit

The unit in which the exchange amount is given.

clone() : Exchange

Overridden method of supertype.

Parameters:

• flow : Flow

undocumented

from() : Exchange

Parameters:

• flow : Flow
• property : FlowProperty
• unit : Unit

undocumented

toString() : String

Overridden method of supertype.

FlowProperty > CategorizedEntity

Flow properties are quantities like mass, volume, etc.

undocumented

undocumented

clone() : FlowProperty

Overridden method of supertype.

FlowPropertyFactor > AbstractEntity

A conversion factor between two quantities of a flow.

undocumented

undocumented

clone() : FlowPropertyFactor

Overridden method of supertype.

FlowType

Enumeration of available flow types

undocumented

undocumented

undocumented

MappingFile > AbstractEntity

A mapping file is used to store mappings of entities from other data formats (like ILCD, EcoSpold etc.) to openLCA entities or the other way around. See the olca-io module for the use of such mapping files in imports and exports. We just store the name of the file as string and its content as BLOB (which normally contains the compressed content).

undocumented

undocumented

ModelType

Enumeration of the basic types in the openLCA domain model.

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

forModelClass() : ModelType

Parameters:

• clazz : Class<?>

undocumented

undocumented

undocumented

isOneOf() : boolean

Parameters:

• types : ModelType

undocumented

NwSet > RootEntity

Normalization and weighting set.

undocumented

undocumented

clone() : NwSet

Overridden method of supertype.

getFactor() : NwFactor

Parameters:

• category : ImpactCategory

undocumented

Parameter > CategorizedEntity

In openLCA, parameters can be defined in different scopes: global, process, or LCIA method. The parameter name can be used in formulas and, thus, need to conform to a specific syntax. Within a scope the parameter name should be unique (otherwise the evaluation is not deterministic). There are two types of parameters in openLCA: input parameters and dependent parameters. An input parameter can have an optional uncertainty distribution but not a formula. A dependent parameter can (should) have a formula (where also other parameters can be used) but no uncertainty distribution.

externalSource : String

A reference to an external source of the parameter (e.g. a shape file in a regionalized LCIA method).

formula : String

The formula of the parameter (only valid for dependent parameters).

isInputParameter : boolean

Indicates whether the parameter is an input parameter.

scope : ParameterScope

The scope of the parameter (global, process, LCIA method).

sourceType : String

If the parameter has an external source the type of this source can be specified in this field.

uncertainty : Uncertainty

The uncertainty distribution of the parameter value (only valid for input parameters).

value : double

The value of the parameter.

clone() : Parameter

Overridden method of supertype.

isValidName() : boolean

Parameters:

• name : String

Returns true if the given name is a valid identifier for a parameter. We allow the same rules as for Java identifiers.

toString() : String

Overridden method of supertype.

ParameterRedef > AbstractEntity

A redefinition of a parameter in a project or product systems. The redefinition defines a context for the redefinition which is the process or LCIA method for which the redefinition is valid. If there is no such context given it is a redefinition of a global parameter.

contextId : Long

The ID of the process or LCIA method for which the redefinition is valid. If the context ID is null it is a redefinition of a global parameter.

contextType : ModelType

The type of the context where the original parameter is defined (currently only processes or LCIA methods are possible). For global parameter redefinitions the context type is null.

name : String

The name of the parameter that should be redefined.

undocumented

undocumented

clone() : ParameterRedef

Overridden method of supertype.

ParameterScope

Parameters can be defined globally, in processes, or LCIA methods. They can be redefined in calculation setups on the project and product system level, but the initial definition is always only global, in processes, or LCIA methods.

undocumented

undocumented

undocumented

ProcessDocumentation > AbstractEntity, Cloneable

Contains the general documentation fields of a process that are not used for indexing, calculation, etc.

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

clone() : ProcessDocumentation

Overridden method of supertype.

ProcessGroup > Comparable

A group of process IDs with a name. The lower case name of the group is used as identifier for the equals, hash-code, and compare-functions.

undocumented

undocumented

compareTo() : int

Parameters:

• o : ProcessGroup

Overridden method of supertype.

equals() : boolean

Parameters:

• obj : Object

Overridden method of supertype.

hashCode() : int

Overridden method of supertype.

ProcessGroupSet > AbstractEntity

A set of process groups that can be stored in the database. The groups are stored in a binary format:

gzip(number_of_groups:n*n)

undocumented

getGroups() : List<ProcessGroup>

Get the process groups from the internal byte array presentation.

setGroups() : void

Parameters:

• groups : List

Sets the groups of this set by converting it to an internal byte array presentation.

A process link is a connection between a provider (which can be a process or product system) and a process in a product system.

exchangeId : long

ID of the product input or waste output that is linked to a provider.

flowId : long

ID of the flow that is an output of the one process and an input of the of the other process.

When true, the provider of this link is a product system.

processId : long

ID of the process that has a link to the provider (has a product input or waste output).

providerId : long

ID of the process or product system that is an provider of a product (has a product output) or a waste treatment (has a waste input). The pair (providerId, flowId) is used to index the matrices in the calculation.

Overridden method of supertype.

equals() : boolean

Parameters:

• obj : Object

Overridden method of supertype.

hashCode() : int

Overridden method of supertype.

RootEntity > AbstractEntity, Cloneable

A root entity is a stand alone entity in the application. It should have a name, description, and an UUID (reference ID). A root entity can contain other root entities via aggregation but the life cycle of the contained entities is then not coupled to the life cycle of the respective container (no cascade delete etc.). On the other side, the life cycle of non-root entities contained in root entities is coupled to the life cycle of the container.

Root entities must provide an implementation of clone with flat copies for contained root-entities and deep copies for contained non-root entities.

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

toString() : String

Overridden method of supertype.

Uncertainty

Represents the uncertainty distributions supported by openLCA. Three fields are reserved for distribution parameters. See the documentation of the respective fields to see which distribution parameters are stored in which fields for the respective distribution types. Each distribution parameter can take a value and additionally a formula.

undocumented

formula1 : String

A formula for the first distribution parameter {@link #parameter1}.

formula2 : String

A formula for the second distribution parameter {@link #parameter2}.

formula3 : String

A formula for the third distribution parameter {@link #parameter3}.

parameter1 : Double

The first parameter of the uncertainty distribution:
• Normal distribution: arithmetic mean value
• Lognormal distribution: geometric mean value
• Triangle distribution: min value
• Uniform distribution: min value
• None: mean / resulting amount

parameter2 : Double

The second parameter of the uncertainty distribution:
• Normal distribution: arithmetic standard deviation
• Lognormal distribution: geometric standard deviation
• Triangle distribution: most likely value (mode)
• Uniform distribution: max value

parameter3 : Double

The third parameter of the uncertainty distribution:
• Triangle distribution: max value

clone() : Uncertainty

Overridden method of supertype.

equals() : boolean

Parameters:

• obj : Object

Overridden method of supertype.

Parameters:

• s : String

undocumented

generator() : NumberGenerator

Creates a number generator of this uncertainty distribution.

hashCode() : int

Overridden method of supertype.

logNormal() : Uncertainty

Parameters:

• gmean : double
• gsd : double

Creates a log-normal distribution.

@param gmean the geometric mean. @param gsd the geometric standard deviation

none() : Uncertainty

Parameters:

• mean : double

Creates default distribution with type set to NONE and the first parameter set with the given mean value.

normal() : Uncertainty

Parameters:

• mean : double
• sd : double

Creates a normal distribution.

@param mean the arithmetic mean. @param sd the arithmetic standard deviation.

scale() : void

Parameters:

• factor : double

Scales the distribution parameters by the given factor. This multiplies every distribution parameter with the given factor. Except for the geometric standard deviation in log-normal distributions as this parameter is scale independent.

string() : String

Parameters:

• u : Uncertainty

A null-save method for getting the string representation of an uncertainty distribution.

toString() : String

Overridden method of supertype.

triangle() : Uncertainty

Parameters:

• min : double
• mode : double
• max : double

Creates a triangle distribution.

@param min The minimum value. @param mode The most likely value (the mode). @param max The maximum value.

uniform() : Uncertainty

Parameters:

• min : double
• max : double

Creates a uniform distribution.

@param min the minimum. @param max the maximum.

UnitGroup > CategorizedEntity

A set of {@link Unit} objects which are directly convertible into each other (e.g. units of mass: kg, g, mg…). A unit set has a reference unit with the conversion factor 1.0. The respective conversion factor of the other units is defined by the equation: f = [uRef] / [u] (with f: the conversion factor of the respective unit, [uRef] the equivalent amount in the reference unit, [u] the equivalent amount in the respective unit; e.g. f(kg) = 1.0 -> f(g) = 0.001).

undocumented

undocumented

undocumented

clone() : UnitGroup

Overridden method of supertype.

getUnit() : Unit

Parameters:

• name : String

Returns the unit with the specified name or synonym from this group.

Version

A helper class for handling versions of root entities in openLCA. We support the following version scheme major.minor.update but store the parts of the version number in a single field. This makes the version number easy to compare, automatically increment (the update part), and can be converted to the ILCD and ecoinvent version schemes.

For each version field we allow a value between 0 and 32767 so the minimum version number is 0.0.0 and the maximum number 32767.32767.32767. The exact data type for a version field would be a 2-byte positive integer (short). However, we use integers in the public methods of this class to avoid casting.

undocumented

Parameters:

• value : long

undocumented

Parameters:

• major : int
• minor : int
• update : int

undocumented

asString() : String

Parameters:

• version : long

undocumented

equals() : boolean

Parameters:

• obj : Object

Overridden method of supertype.

fromString() : Version

Parameters:

• s : String

Returns the version from the given string. The string can be an ILCD compatible version string with 3 parts (major.minor.update, e.g. 01.01.000) where the two last parts and leading zeros are optional. Thus valid version strings are for example: 1, 1.1, 01.01.001, 44.1.96

undocumented

undocumented

undocumented

undocumented

hashCode() : int

Overridden method of supertype.

incMajor() : void

Parameters:

• entity : RootEntity

undocumented

incMajor() : void

Increments the major part of the version which resets the minor and update part to 0.

incMinor() : void

Parameters:

• entity : RootEntity

undocumented

incMinor() : void

Increments the minor part of the version which resets the update part to 0.

incUpdate() : void

Parameters:

• entity : RootEntity

undocumented

incUpdate() : void

Increments the update part of the version. Normally this is automatically done by the persistence unit.

Parameters:

• major : int

undocumented

Parameters:

• minor : int

undocumented

Parameters:

• update : int

undocumented

toString() : String

Converts the version to an ILCD compatible version string with 3 parts: major.minor.update.

Parameters:

• major : int
• minor : int
• update : int

undocumented

Package: org.openlca.core.model.descriptors

BaseDescriptor

Descriptors are lightweight models containing only descriptive information of a corresponding entity.The intention of descriptors is to get these information fast from the database without loading the complete model. Therefore, the respective DAO classes should provide these.

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

equals() : boolean

Parameters:

• obj : Object

Overridden method of supertype.

hashCode() : int

Overridden method of supertype.

toString() : String

Overridden method of supertype.

ImpactCategoryDescriptor > BaseDescriptor

The descriptor class for impact assessment categories.

undocumented

undocumented

ImpactMethodDescriptor > CategorizedDescriptor

The descriptor class for impact assessment methods.

undocumented

Package: org.openlca.core.results

BaseResult > IResult

BaseResult is a common (abstract) super class of different result implementations. It mainly contains the indices that map objects from the database to the rows and columns of the result matrices.

flowIndex : FlowIndex

The row index \mathit{Idx}_B of the intervention matrix \mathbf{B}. It maps the (elementary) flows \mathit{F} of the processes in the product system to the k rows of \mathbf{B}.

\mathit{Idx}_B: \mathit{F} \mapsto [0 \dots k-1]

impactIndex : DIndex

The row index \mathit{Idx}_C of the matrix with the characterization factors \mathbf{C}. It maps the LCIA categories \mathit{C} to the l rows of \mathbf{C}.

\mathit{Idx}_C: \mathit{C} \mapsto [0 \dots l-1]

techIndex : TechIndex

The index \mathit{Idx}_A of the technology matrix \mathbf{A}. It maps the process-product pairs (or process-waste pairs) \mathit{P} of the product system to the respective n rows and columns of \mathbf{A}. If the product system contains other product systems as sub-systems, these systems are handled like processes and are also mapped as pair with their quantitative reference flow to that index (and also their processes etc.).

\mathit{Idx}_A: \mathit{P} \mapsto [0 \dots n-1]

getFlows() : Set<FlowDescriptor>

Overridden method of supertype.

getImpacts() : Set<ImpactCategoryDescriptor>

Overridden method of supertype.

getProcesses() : Set<CategorizedDescriptor>

Overridden method of supertype.

getProviders() : Set<ProcessProduct>

Get the process-product pairs (or process-waste pairs) \mathit{P} of the product system. If the product system contains other product systems as sub-systems, these systems are handled like processes and are also included as pairs with their quantitative reference flow.

hasFlowResults() : boolean

Overridden method of supertype.

hasImpactResults() : boolean

Overridden method of supertype.

isInput() : boolean

Parameters:

• flow : FlowDescriptor

Overridden method of supertype.

ContributionResult > SimpleResult

The ContributionResult extends the SimpleResult type. It also contains all direct contributions of the processes to the LCI and LCIA results. Additionally, it contains the contributions of the (elementary) flows to the LCIA results.

directCostResults : double[]

Contains the direct contributions \mathbf{k}_s of the process-product pairs to the total net-costs (\odot denotes element-wise multiplication):

\mathbf{k}_s = \mathbf{k} \odot \mathbf{s}

directFlowImpacts : IMatrix

A LCIA category * flow matrix that contains the direct contributions of the elementary flows to the LCIA result. This matrix can be calculated by column-wise scaling of the matrix with the characterization factors \mathbf{C} with the inventory result \mathbf{g}:

\mathbf{H} = \mathbf{C} \ \text{diag}(\mathbf{g})

directFlowResults : IMatrix

An elementary flow * process-product matrix that contains the direct contributions of the processes to the inventory result. This can be calculated by column-wise scaling of the intervention matrix \mathbf{B} with the scaling vector \mathbf{s}:

\mathbf{G} = \mathbf{B} \ \text{diag}(\mathbf{s})

directImpactResults : IMatrix

A LCIA category * process-product matrix that contains the direct contributions of the processes to the LCIA result. This can be calculated by a matrix-matrix multiplication of the direct inventory contributions \mathbf{G} with the matrix with the characterization factors \mathbf{C}:

\mathbf{H} = \mathbf{C} \ \mathbf{G}

impactFactors : IMatrix

A LCIA category * flow matrix \mathbf{C} the contains the characterization factors.

getDirectCostResult() : double

Parameters:

• product : ProcessProduct

Get the direct contribution of the given process-product pair j to the LCC result: \mathbf{k}_s[j].

getDirectCostResult() : double

Parameters:

• process : CategorizedDescriptor

Get the direct contribution of the given process j to the LCC result. When the process has multiple products it is the sum of the contributions of all of these process-product pairs.

getDirectFlowImpact() : double

Parameters:

• flow : FlowDescriptor
• impact : ImpactCategoryDescriptor

Get the direct contribution of the given elementary flow to the LCIA result of the given LCIA category.

getDirectFlowResult() : double

Parameters:

• product : ProcessProduct
• flow : FlowDescriptor

Get the direct contribution of the given process-product pair j to the inventory result of elementary flow i: \mathbf{G}[i,j].

getDirectFlowResult() : double

Parameters:

• process : CategorizedDescriptor
• flow : FlowDescriptor

Get the direct contribution of the given process j to the inventory result of elementary flow i. When the process has multiple products it is the sum of the contributions of all of these process-product pairs.

getDirectImpactResult() : double

Parameters:

• product : ProcessProduct
• impact : ImpactCategoryDescriptor

Get the direct contribution of the given process-product pair j to the LCIA category result j: \mathbf{D}[i,j].

getDirectImpactResult() : double

Parameters:

• process : CategorizedDescriptor
• impact : ImpactCategoryDescriptor

Get the direct contribution of the given process j to the LCIA category result i. When the process has multiple products it is the sum of the contributions of all of these process-product pairs.

getFlowContributions() : List<FlowResult>

Parameters:

• process : CategorizedDescriptor

Get the direct contributions of the given process j to the inventory result of all elementary flows in the product system.

getFlowContributions() : List<FlowResult>

Parameters:

• impact : ImpactCategoryDescriptor

Get the contributions of all elementary flows to the given LCA category.

getImpactContributions() : List<ImpactResult>

Parameters:

• process : CategoryDescriptor

Get the direct contributions of the given process j to the LCIA category results.

getProcessContributions() : ContributionSet<CategorizedDescriptor>

Parameters:

• flow : FlowDescriptor

Get the direct contributions of the processes in the system to the inventory result of the given flow.

getProcessContributions() : ContributionSet<CategorizedDescriptor>

Parameters:

• impact : ImpactCategoryDescriptor

Get the direct contributions of the processes in the system to the LCIA result of the given LCIA category.

getProcessCostContributions() : ContributionSet<CategorizedDescriptor>

Get the direct contributions of all processes to the LCC result.

hasCostResults() : boolean

Overridden method of supertype.

ContributionSet

A set of contributions to an overall result.

ContributionSet()

Parameters:

• contributions : List<ContributionItem>

undocumented

undocumented

undocumented

Parameters:

• item : T

undocumented

FullResult > ContributionResult

The FullResult extends the ContributionResult. It contains additionally the upstream contributions to LCI, LCIA, and LCC results where applicable.

loopFactor : double

The loop factor c_r indicates whether the reference process of the product system is part of a product loop (c_r \neq 1 when this is the case). It can be calculated via:

c_r = \frac{\mathbf{s}[r] \mathbf{A}[r,r]}{\mathbf{f}[r]}

Where r is the index of the reference product of the system. Some upstream results have to be corrected by c_r when c_r \neq 1 to avoid double counting of these loop contributions.

techMatrix : IMatrix

The scaled technology matrix \mathbf{A*} of the product system. In this matrix each column j is scaled by the respective scaling factor \mathbf{s}_j:

\mathbf{A*} = \mathbf{A} \ \text{diag}(\mathbf{s})

upstreamCostResults : IMatrix

A row vector the upstream contributions to the LCC result of each process-product pair in the product system.

\mathbf{k}_u = (\mathbf{k} \ \mathbf{A}^{-1}) \ \text{diag}(c_r \ \mathbf{t})

When the reference process itself is located in a loop the total requirements need to be multiplied with the loop factor c_r to avoid double counting of the loop contributions (as they are contained in \mathbf{A}^{-1} and \mathbf{t}).

upstreamFlowResults : IMatrix

An elementary flow * process-product matrix that contains the upstream contributions (including the direct contributions) of the processes to the inventory result. It can be calculated by column-wise scaling of the result of the matrix-matrix multiplication of the intervention matrix \mathbf{B} with the inverse of the technology matrix \mathbf{A} by the total requirements \mathbf{t}:

\mathbf{U} = (\mathbf{B} \ \mathbf{A}^{-1}) \ \text{diag}(c_r \ \mathbf{t})

When the reference process itself is located in a loop the total requirements need to be multiplied with the loop factor c_r to avoid double counting of the loop contributions (as they are contained in \mathbf{A}^{-1} and \mathbf{t}).

upstreamImpactResults : IMatrix

A LCIA category * process-product matrix that contains the upstream contributions (including the direct contributions) of the processes to the LCIA result. It can be calculated by a matrix-matrix multiplication of the characterization factor matrix \mathbf{C} with the upstream results of the elementary flows \mathbf{U}:

\mathbf{V} = \mathbf{C} \ \mathbf{U}

Calculate the upstream tree for the LCC result as added value.

getCostTree() : UpstreamTree

Calculate the upstream tree for the LCC result as costs.

Parameters:

Get the contribution share of the outgoing process product (provider) to the product input (recipient) of the given link and the calculated product system. The returned share is a value between 0 and 1.

getTree() : UpstreamTree

Parameters:

• flow : FlowDescriptor

Calculate the upstream tree for the given flow.

getTree() : UpstreamTree

Parameters:

• impact : ImpactCategoryDescriptor

Calculate the upstream tree for the given LCIA category.

getUpstreamCostResult() : double

Parameters:

• provider : ProcessProduct

Get the upstream contribution of the given process-product pair j to the LCC result: \mathbf{k}_u[j].

getUpstreamCostResult() : double

Parameters:

• process : CategorizedDescriptor

Get the upstream contribution of the given process j to the LCC result. When the process has multiple products it is the sum of the contributions of all of these process-product pairs.

getUpstreamFlowResult() : double

Parameters:

• product : ProcessProduct
• flow : FlowDescriptor

Get the upstream contribution of the given process-product pair j to the inventory result of elementary flow i: \mathbf{U}[i,j].

getUpstreamFlowResult() : double

Parameters:

• process : CategorizedDescriptor
• flow : FlowDescriptor

Get the upstream contribution of the given process j to the inventory result of elementary flow i. When the process has multiple products it is the sum of the contributions of all of these process-product pairs.

getUpstreamFlowResults() : List<FlowResult>

Parameters:

• process : CategorizedDescriptor

Get the upstream contributions of the given process j to the inventory result of all elementary flows in the product system.

getUpstreamImpactResult() : double

Parameters:

• product : ProcessProduct
• impact : ImpactCategoryDescriptor

Get the upstream contribution of the given process-product pair j to the LCIA category result j: \mathbf{V}[i,j].

getUpstreamImpactResult() : double

Parameters:

• process : CategorizedDescriptor
• impact : ImpactCategoryDescriptor

Get the upstream contribution of the given process j to the LCIA category result i. When the process has multiple products it is the sum of the contributions of all of these process-product pairs.

getUpstreamImpactResults() : List<ImpactResult>

Parameters:

• process : CategorizedDescriptor

Get the upstream contributions of the given process j to the LCIA category results.

GroupingContribution

Calculates the contributions of single process results grouped by a given grouping set.

GroupingContribution()

Parameters:

• result : ContributionResult
• groupings : List

undocumented

calculate() : ContributionSet<ProcessGrouping>

Parameters:

• flow : FlowDescriptor

Calculates contributions to an inventory flow.

calculate() : ContributionSet<ProcessGrouping>

Parameters:

• impact : ImpactCategoryDescriptor

Calculates contributions to an impact assessment method.

IResult

The common protocol of all result types.

getFlows() : Set<FlowDescriptor>

Get the (elementary) flows of the inventory model.

getImpacts() : Set<ImpactCategoryDescriptor>

Get the LCIA categories of the LCIA result.

getProcesses() : Set<CategorizedDescriptor>

Get the descriptors of the processes of the inventory model. If a product system contains other product systems, these sub-systems are also handled like processes and returned.

hasCostResults() : boolean

Returns true when this result contains LCC results.

hasFlowResults() : boolean

Returns true when this result contains (elementary) flow results.

hasImpactResults() : boolean

Returns true when this result contains LCIA results.

isInput() : boolean

Parameters:

• flow : FlowDescriptor

Returns true when the given flow is handled as an input flow in the inventory model.

LocationContribution

Calculates the contributions of the single process results in an analysis result grouped by their locations.

LocationContribution()

Parameters:

• result : ContributionResult
• cache : EntityCache

undocumented

Calculates added values aggregated by location.

calculate() : ContributionSet<Location>

Parameters:

• flow : FlowDescriptor

Calculates contributions to an inventory flow.

calculate() : ContributionSet<Location>

Parameters:

• impact : ImpactCategoryDescriptor

Calculates contributions to an impact category.

netCosts() : ContributionSet<Location>

Calculates net-costs aggregated by location.

ProcessGrouping

A group of processes for result analysis. If this group is tagged as rest it contains all processes that are not assigned to other groups.

undocumented

undocumented

undocumented

applyOn() : List<ProcessGrouping>

Parameters:

• processes : Collection
• groupSet : ProcessGroupSet
• restName : String

Applies the given group set on the given processes. If there are processes not assignable to a group of the group set a group with these processes is created using the given parameter restName.

equals() : boolean

Parameters:

• obj : Object

Overridden method of supertype.

hashCode() : int

Overridden method of supertype.

ProjectResult > IResult

A project result is a wrapper for the inventory results of the respective project variants.

Parameters:

• variant : ProjectVariant
• result : ContributionResult

undocumented

getContributions() : ContributionSet<ProjectVariant>

Parameters:

• flow : FlowDescriptor

undocumented

getContributions() : ContributionSet<ProjectVariant>

Parameters:

• impact : ImpactCategoryDescriptor

undocumented

getFlows() : Set<FlowDescriptor>

Overridden method of supertype.

getImpacts() : Set<ImpactCategoryDescriptor>

Overridden method of supertype.

getProcesses() : Set<CategorizedDescriptor>

Overridden method of supertype.

getResult() : ContributionResult

Parameters:

• variant : ProjectVariant

undocumented

getTotalFlowResult() : double

Parameters:

• variant : ProjectVariant
• flow : FlowDescriptor

undocumented

getTotalFlowResults() : List<FlowResult>

Parameters:

• variant : ProjectVariant

undocumented

getTotalImpactResult() : double

Parameters:

• variant : ProjectVariant
• impact : ImpactCategoryDescriptor

undocumented

undocumented

hasCostResults() : boolean

Overridden method of supertype.

hasFlowResults() : boolean

Overridden method of supertype.

hasImpactResults() : boolean

Overridden method of supertype.

isInput() : boolean

Parameters:

• flow : FlowDescriptor

Overridden method of supertype.

SimpleResult > BaseResult

The simplest kind of result of a calculated product system. This result type is particularly suitable for Monte Carlo simulations or other quick calculations.

scalingVector : double[]

The scaling vector \mathbf{s} which is calculated by solving the equation

\mathbf{A} \ \mathbf{s} = \mathbf{f}

where \mathbf{A} is the technology matrix and \mathbf{f} the final demand vector of the product system.

totalCosts : double

The total net-costs k_t of the LCC result:

k_t = \mathbf{k} \cdot \mathbf{s}

Where \mathbf{k}_j are the net-costs of process j and \mathbf{s}_j is the scaling factor of that process.

totalFlowResults : double[]

The inventory result \mathbf{g} of a product system:

\mathbf{g} = \mathbf{B} \ \mathbf{s}

Where \mathbf{B} is the intervention matrix and \mathbf{s} the scaling vector. Note that inputs have negative values in this vector.

totalImpactResults : double[]

The LCIA result \mathbf{h} of a product system:

\mathbf{h} = \mathbf{C} \ \mathbf{g}

Where \mathbf{C} is a flow * LCIA category matrix with the characterization factors and \mathbf{g} the inventory result.

totalRequirements : double[]

The total requirements of the products to fulfill the demand of the product system. As our technology matrix \mathbf{A} is indexed symmetrically (means rows and columns refer to the same process-product pair) our product amounts are on the diagonal of the technology matrix \mathbf{A} and the total requirements can be calculated by the following equation where \mathbf{s} is the scaling vector (\odot denotes element-wise multiplication):

\mathbf{t} = \text{diag}(\mathbf{A}) \odot \mathbf{s}

getScalingFactor() : double

Parameters:

• product : ProcessProduct

Get the scaling factor \mathbf{s}_j of the given process-product pair j.

getScalingFactor() : double

Parameters:

• process : CategorizedDescriptor

Get the scaling factor \mathbf{s}_j of the given process j. When the process has multiple products in the system it returns the sum of the scaling factors of all of these process-product pairs.

getTotalFlowResult() : double

Parameters:

• flow : FlowDescriptor

Get the total inventory result \mathbf{g}_i of the given flow i.

getTotalFlowResults() : List<FlowResult>

Returns the flow results of the inventory result \mathbf{g}.

getTotalImpactResult() : double

Parameters:

• impact : ImpactCategoryDescriptor

Returns the total LCIA result \mathbf{h}_i of the given LCIA category i.

getTotalImpactResults() : List<ImpactResult>

Returns the impact category results for the given result.

hasCostResults() : boolean

Overridden method of supertype.

SimulationResult > BaseResult

The results of a Monte-Carlo-Simulation. The single result values of the simulation runs are stored in an array of lists where the flow- and LCIA category indices are mapped to the respective array rows and the result values to the respective list entries.

SimulationResult()

Parameters:

• data : MatrixData

undocumented

append() : void

Parameters:

• r : SimpleResult

Append the total LCI and LCIA result vectors of the given result to this simulation result.

append() : void

Parameters:

• product : ProcessProduct
• direct : SimpleResult
• upstream : SimpleResult

Append the given direct and upstream result of the pinned product to this result. We only append the respective vectors from the results. The indices of these vectors need to match with the indices of this result.

get() : double

Parameters:

• flow : FlowDescriptor
• i : int

Get the result of the given flow in the iteration i (zero based).

get() : double

Parameters:

• impact : ImpactCategoryDescriptor
• i : int

Get the result of the given LCIA category in the iteration i (zero based).

getAll() : double[]

Parameters:

• flow : FlowDescriptor

Get all simulation results of the given flow.

getAll() : double[]

Parameters:

• impact : ImpactCategoryDescriptor

Get all simulation results of the given LCIA category.

getAllDirect() : double[]

Parameters:

• product : ProcessProduct
• flow : FlowDescriptor

Get the direct contribution of the given product to the given flow for all iterations.

getAllDirect() : double[]

Parameters:

• product : ProcessProduct
• impact : ImpactCategoryDescriptor

Get the direct contribution of the given product to the given LCIA category for all iterations.

getAllUpstream() : double[]

Parameters:

• product : ProcessProduct
• flow : FlowDescriptor

Get the upstream contribution of the given product to the given flow for all iterations.

getAllUpstream() : double[]

Parameters:

• product : ProcessProduct
• impact : ImpactCategoryDescriptor

Get the upstream contribution of the given product to the given LCIA category for all iterations.

getDirect() : double

Parameters:

• product : ProcessProduct
• flow : FlowDescriptor
• i : int

Get the direct contribution of the given product to the given flow in the iteration i (zero based).

getDirect() : double

Parameters:

• product : ProcessProduct
• impact : ImpactCategoryDescriptor
• i : int

Get the direct contribution of the given product to the given LCIA category in the iteration i (zero based).

undocumented

undocumented

getUpstream() : double

Parameters:

• product : ProcessProduct
• flow : FlowDescriptor
• i : int

Get the upstream contribution of the given product to the given flow in the iteration i (zero based).

getUpstream() : double

Parameters:

• product : ProcessProduct
• impact : ImpactCategoryDescriptor
• i : int

Get the upstream contribution of the given product to the given LCIA category in the iteration i (zero based).

hasCostResults() : boolean

Overridden method of supertype.

Statistics

Calculates statistic parameters for a set of numbers. This is mainly used for presenting results of a Monte-Carlo-Simulation.

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

getPercentileValue() : double

Parameters:

• percentile : int

Returns the value at the given percentile.

@param percentile the percentage value (0..100)

hist() : Histogram

Parameters:

• values : double[]
• intervalCount : int

Creates a histogram with associated statistics for the given data and number of intervals.

of() : Statistics

Parameters:

• vals : double[]

undocumented

UpstreamNode

Describes a node in an upstream tree.

provider : ProcessProduct

A process-flow pair which is a product output or waste input that describes a process in the upstream result tree.

result : double

The upstream result of this node.

UpstreamTree

Maps the upstream results of the product system graph to a tree where the root is the reference process of the product system.

UpstreamTree()

Parameters:

• r : FullResult
• u : double[]

undocumented

UpstreamTree()

Parameters:

• ref : BaseDescriptor
• r : FullResult
• u : double[]

undocumented

ref : BaseDescriptor

An optional reference to a model (e.g. flow or LCIA category) to which the upstream tree is related.

undocumented

childs() : List<UpstreamNode>

Parameters:

• parent : UpstreamNode

undocumented

Package: org.openlca.eigen

NativeLibrary

A helper class for loading the native library from a file directory.

undocumented

Parameters:

• dir : File

undocumented

Package: org.openlca.julia

Julia

Provides the Java interface for the native Julia libraries and contains some utility methods for loading these libraries.

invert() : int

Parameters:

• n : int
• a : double[]

Inverts the given matrix.

@param n [in] the dimension of the matrix (n = rows = columns) @param a [io] on entry: the matrix to be inverted, on exit: the inverse (size = n * n) @return the LAPACK return code

Returns true if the Julia libraries with openLCA bindings are loaded.

isWithUmfpack() : boolean

undocumented

Loads the libraries from a folder specified by the “OLCA_JULIA” environment variable.

Parameters:

• dir : File

Loads the Julia libraries and openLCA bindings from the given folder. Returns true if the libraries could be loaded (at least there should be a libjolca library in the folder that could be loaded).

mmult() : void

Parameters:

• rowsA : int
• colsB : int
• k : int
• a : double[]
• b : double[]
• c : double[]

Matrix-matrix multiplication: C := A * B

@param rowsA [in] number of rows of matrix A @param colsB [in] number of columns of matrix B @param k [in] number of columns of matrix A and number of rows of matrix B @param a [in] matrix A (size = rowsAk) @param b [in] matrix B (size = k colsB) @param c [out] matrix C (size = rowsA * colsB)

mvmult() : void

Parameters:

• rowsA : int
• colsA : int
• a : double[]
• x : double[]
• y : double[]

Matrix-vector multiplication: y:= A * x

@param rowsA [in] rows of matrix A @param colsA [in] columns of matrix A @param a [in] the matrix A @param x [in] the vector x @param y [out] the resulting vector y

solve() : int

Parameters:

• n : int
• nrhs : int
• a : double[]
• b : double[]

Solves a system of linear equations A * X = B for general matrices. It calls the LAPACK DGESV routine.

@param n [in] the dimension of the matrix A (n = rows = columns of A) @param nrhs [in] the number of columns of the matrix B @param a [io] on entry the matrix A, on exit the LU factorization of A (size = n * n) @param b [io] on entry the matrix B, on exit the solution of the equation (size = n * bColums) @return the LAPACK return code

umfDispose() : void

Parameters:

• pointer : long

undocumented

umfFactorize() : long

Parameters:

• n : int
• columnPointers : int[]
• rowIndices : int[]
• values : double[]

undocumented

umfSolve() : void

Parameters:

• n : int
• columnPointers : int[]
• rowIndices : int[]
• values : double[]
• demand : double[]
• result : double[]

undocumented

umfSolveFactorized() : long

Parameters:

• pointer : long
• demand : double[]
• result : double[]

undocumented

Package: org.openlca.util

Categories

Utility functions for openLCA categories.

createRefId() : String

Parameters:

• category : Category

undocumented

path() : List<String>

Parameters:

• category : Category

undocumented

Dirs

A simple utility class for directory operations.

clean() : void

Parameters:

• dir : Path

Deletes the content from the given directory but not the directory itself.

copy() : void

Parameters:

• from : Path
• to : Path

Copies a directory recursively.

delete() : void

Parameters:

• path : String

Deletes a directory recursively.

delete() : void

Parameters:

• dir : Path

Deletes a directory recursively.

make() : void

Parameters:

• path : String

Creates a directory if it not yet exists.

make() : void

Parameters:

• dir : Path

Creates a directory if it not yet exists.

move() : void

Parameters:

• from : Path
• to : Path

Moves the given directory to the new location.

size() : long

Parameters:

• dir : Path

Determines the size of the content of a directory recursively.

KeyGen

Generates a UUID version 3 for a given set of names.

Note that the generated key is case insensitive and that leading and trailing white-spaces are ignored.

undocumented

get() : String

Parameters:

• names : String

undocumented

toPath() : String

Parameters:

• names : String

undocumented

OS

Constants for some operating systems which are retrieved from the system property “os.name”.

undocumented

undocumented

undocumented

undocumented

undocumented

undocumented

toString() : String

Overridden method of supertype.

RefIdMap

In the imports and exports we often need a mapping of reference IDs to database internal IDs or the other way around. This class exactly provides such mappings by caching all IDs from the database.

get() : To

Parameters:

• type : Class<?>
• id : From

undocumented

internalToRef() : RefIdMap<Long, String>

Parameters:

• db : IDatabase
• types : Class<? extends T>

undocumented

refToInternal() : RefIdMap<String, Long>

Parameters:

• db : IDatabase
• types : Class<? extends T>

undocumented

Strings

Contains helper methods for string operations.

append() : String[]

Parameters:

• array : String[]
• value : String

undocumented

compare() : int

Parameters:

• str1 : String
• str2 : String

A null-save method for comparing two strings ignoring the case.

cut() : String

Parameters:

• string : String
• length : int

Cut a string to the given length. Appends “…” if the string was truncated.

join() : String

Parameters:

• values : Collection
• delimiter : char

undocumented

join() : String

Parameters:

• values : String[]
• delimiter : char

undocumented

notEmpty() : boolean

Parameters:

• val : String

Returns true if the string is not null or empty, means that it contains other characters that white-spaces.

nullOrEmpty() : boolean

Parameters:

• val : String

Returns true if the given string value is null or empty.

nullOrEqual() : boolean

Parameters:

• string1 : String
• string2 : String

Returns true if both of the given strings are null or if both of the given strings are equal.

prepend() : String[]

Parameters:

• array : String[]
• value : String

undocumented

Parameters:

• is : InputStream

undocumented

TopoSort

An implementation of Kahn’s algorithm for topological sorting.

of() : List<Long>

Parameters:

• pairs : Iterable

Creates a topological order of the given relations. Each relation is encoded in a pair of IDs (first, second) where the (element with the) second ID depends on the (element with the) first ID. The IDs are returned in a list with increasing dependency order. As a topological order can be only created on relations that form an acyclic graph, the first element of the returned list has no dependencies. When there are cycles in the relations, this method returns null which means that a topological order cannot be created.