Parameters - LCA-ActivityBrowser/activity-browser GitHub Wiki
[!IMPORTANT] This wiki section is incomplete or outdated.
Please help us improve the wiki by reading our contributing guidelines.
General concepts
Creating parameters
Parameters are special objects in Brightway that allow users to create incredibly complex systems of interlocking parts.
What parameters actually do is store a value and allow recalculation of that
value through a formula. While there are technically three layers of
parameters (Project
, Database
and Activity
), the AB encourages users to
only use two (Project
and Activity
).
Note that each parameter has a name which is unique within their 'group'. So project parameters have unique names within the project and activity parameters have names unique within their 'group'. The Activity Browser will strongly enforce this uniqueness and won't allow name changes if a conflict exists.
The reason for this uniqueness is that a parameter name can be used in formulas to insert the value of that parameter at that specific place in the formula.
Project parameters
A new project parameter can be created by clicking the New
button next
to the 'Project' label. A default name is assigned to this parameter which
can later be altered (renaming) by right-clicking on the parameter and
selecting the Rename parameter
option from the drop-down menu that opens.
Both the amount and formula fields can be edited by double-clicking in them, though keep in mind that the formula field has precedence when determining the amount of the parameter.
Finally, a (project) parameter can be deleted by right-clicking on the
parameter and selecting the Delete parameter
option from the drop-down
menu. Do note however that a parameter can only be deleted if it is
not being used in any other formula field, if the Activity Browser finds
that this is the case, the Delete
option will be grayed out.
Activity Parameters
Where project parameters can be used by any formula anywhere in the project, activity parameters are a lot more narrow in scope. These parameters are made to target the specific exchanges that exist within the activity that is parameterized.
There are some rules for activity parameters:
-
Multiple parameters can be created for one activity.
-
Exchanges for activity B cannot use parameters created for activity A.
-
Activity parameters must have a unique name within the 'group' of the related activity. Two parameters on different activities can have the same name.
-
If a project parameter and an activity parameter share a name, the activity parameter will be preferred if that name is used in a formula for one of the exchanges.
In the Activity Browser activity parameters can be created in two ways:
-
The first way is through dragging-and-dropping activities from the activities table on the left side into the activity parameters table on the right side. This allows for an easy way of parameterizing multiple activities at once. However, the user still has to go into each activity (by way of the Activity Detail tab) and parameterize the relevant exchanges.
-
The second way is through directly parameterizing exchanges within the Activity Detail tab (by editing the formula field). As soon as an exchange formula is stored, the Activity Browser will generate a new activity parameter for the related activity.
Activity parameters can be Renamed
and Deleted
through right-clicking the
parameter, much the same as project parameters. Additionally, the Activity
Detail tab can be opened for the parameterized activity by way of the
Open activities
option.