@@ -48,34 +48,34 @@ def __init__(self, gensets: tuple):
4848 # self.combo_mol_caps = dict(sorted(self.combo_mol_caps.keys()))
4949 # self.gencombos = tuple(self.combo_mol_caps.keys())
5050
51- def calc_gencombo (self , eload : float , select_combo : tuple ):
51+ def calc_gen_fuel (self , gen_loads : dict ):
5252 """
5353 calculate the fuel usage of the generator combo
5454 :param eload: the overall electrical load
5555 :param select_combo: the combination of generators to be used
5656 :return: the dict of the fuel usage, keys are generators and values are pandas dataframes
5757 """
58- if select_combo is None :
59- return {'None' : 0 }
60-
61- sum = 0
62- if len (select_combo ) == 1 :
63- sum = self .gendict_cap [select_combo [0 ]]
64- else :
65- for generator in select_combo :
66- sum += self .gendict_cap [generator ]
67-
68- if sum != 0 :
69- ratios = {item :self .gendict_cap [item ]/ sum for item in select_combo }
70- else :
71- # if the generators are off there is nothing to return
72- return 0
73-
74- pwrhouse_usage = {gen : round (self .gensets [gen ].calc_diesel_usage (eload * ratios [gen ]), 3 )
75- for gen in select_combo }
58+ # if select_combo is None:
59+ # return {'None': 0}
60+ #
61+ # sum = 0
62+ # if len(select_combo) == 1:
63+ # sum = self.gendict_cap[select_combo[0]]
64+ # else:
65+ # for generator in select_combo:
66+ # sum += self.gendict_cap[generator]
67+ #
68+ # if sum != 0:
69+ # ratios = {item:self.gendict_cap[item]/sum for item in select_combo}
70+ # else:
71+ # # if the generators are off there is nothing to return
72+ # return 0
73+
74+ pwrhouse_usage = {gen : round (self .gensets [gen ].calc_diesel_usage (gen_loads [gen ]), 3 )
75+ for gen in gen_loads }
7676 return pwrhouse_usage
7777
78- def calc_genload (self , eload : float , select_combo : tuple ):
78+ def calc_gen_load (self , eload : float , select_combo : tuple ):
7979 """
8080 calculate the per generator load
8181 :param eload: the overall load
0 commit comments