2017-06-16 2 views
2

私は、特徴付け係数の不確かさでモンテカルロ解析を実行しようとします。コードは正常に実行されています(エラーはありません)が、各反復の結果は常に同じです。計算は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) 

はありサンプルLCIA手法の

定義somet不確実性の定義が間違っていますか?

ありがとうございました!

答えて

0

あなたは単に若干異なるあなたのuncertainty dictionaryを定義する必要があります。Brightwayで、uncertainty type_せずに書かれている、すなわち

my_cf = [(some_exchange.key, 
     {"amount": 10, 
     "uncertainty type": 4, #and not "uncertainty_type" 
     "minimum": 0, 
     "maximum": 20} 
    )] 

あなたはBrightway documentation

にBrightwayの枠組みの中で uncertainty dictionaryのスキーマを見ることができます

stats_arraysdocumentationで定義されているように書きました。なぜ異なるのかわかりません。なぜなら、あるケースではuncertainty typeがあり、もう1つはuncertainty_typeですが、_を削除すればコードが機能します。