我尝试在特征因子不确定的情况下进行蒙特卡洛分析。代码运行良好(没有错误),但每次迭代的结果始终相同。计算仅适用于 LCA 模拟。
这是代码:
样品 LCIA 方法的定义
some_exchange = bw.Database('biosphere3').random()
my_cf = [(some_exchange.key,
{"amount": 10,
"uncertainty_type": 4,
"minimum": 0,
"maximum": 20}
)]
uncertain_method = bw.Method(("fake", "method", "with uncertainty"))
uncertain_method.write(my_cf)
简单活动的定义
simple_LCI_db = bw.Database('simple LCI db')
simple_LCI_db.write(
{('simple LCI db', 'some_code'):
{'name': 'fake activity',
'unit': 'amount',
'exchanges':
[
{'input': ('simple LCI db', 'some_code'),
'amount': 1,
'type': 'production'},
{'input': some_exchange.key,
'amount': 1,
'type': 'biosphere'},
]
},
})
蒙特卡洛代码
mc = bw.MonteCarloLCA({('simple LCI db', 'some_code'):1}, ('fake', 'method', 'with uncertainty'))
next(mc)
不确定性定义有问题吗?
感谢您的帮助!