swolfpy_processmodels¶
Process Model¶
Distance¶
- class swolfpy_processmodels.Distance(data=None)[source]¶
Python class for importing the distances between the process models.
Transport modes include:
Heavy Duty Truck
Medium Duty Truck
Rail
Barge
Cargo Ship
- Parameters:
data – Dictionary that includes Pandas DataFrame for the distances between the process models as value and transport modes as key. DataFrame should use the name of processes as both column and row index.
- Example:
>>> from swolfpy_processmodels import Distance >>> data = Distance.create_distance_table(['LF','WTE','AD'], ['Heavy Duty Truck'], default_dist=20) >>> data {'Heavy Duty Truck': LF WTE AD LF NaN 20.0 20.0 WTE NaN NaN 20.0 AD NaN NaN NaN} >>> distance = Distance(data) >>> distance.Distance[('LF','WTE')] {'Heavy Duty Truck': 20.0} >>> distance.Distance[('LF','WTE')]['Heavy Duty Truck'] 20.0
- static create_distance_table(process_names, transport_modes, default_dist=nan)[source]¶
Static method for creating the data structure for distances and transport modes.
- Parameters:
process_names – List of process names (e.g.,
['LF', 'WTE']
)transport_modes – List of transport modes (i.e., Heavy Duty Truck, Medium Duty Truck, Rail, Barge, Cargo Ship). Example:
['Heavy Duty Truck', 'Medium Duty Truck']
default_dist – Default distance that is used to fill the DataFrame.