Skip to content

Commit

Permalink
Compatibility fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mj-xmr committed Apr 16, 2022
1 parent 2f2a45c commit 843bdb3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/config.json
11 changes: 7 additions & 4 deletions src/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ def get_usage_simple(available):
hashrates = [usage_exp[0] * 0.5] * len(available)
loads = []
usage = []
incomes = [0]* len(available)
costs = [0]* len(available)
effs = [0]* len(available)
bat_sim = BatterySimulator()
for i, use_exp in enumerate(usage_exp):
if bat_sim.get_load() > bat_sim.MIN_LOAD:
Expand All @@ -230,7 +233,7 @@ def get_usage_simple(available):
load_i = bat_sim.iter_get_load(available[i], use)
loads.append(load_i)

return "Simple", hashrates, usage, loads, bat_sim
return "Simple", hashrates, usage, loads, bat_sim, incomes, costs, effs

def print_hashes(hashrates):
HASH_UNIT = 1e6
Expand All @@ -254,12 +257,12 @@ def print_profits(incomes, costs):
print(f"Profitability = {profitability:.2f} %")

def get_usage(available):
name, hashrates, usage, bat, bat_sim = get_usage_simple(available)
# name, hashrates, usage, bat, bat_sim, incomes, costs = get_usage_endor_example(available)
name, hashrates, usage, bat, bat_sim, incomes, costs, effs = get_usage_simple(available)
#name, hashrates, usage, bat, bat_sim, incomes, costs, effs = get_usage_endor_example(available)
print("Algo name: ", name)
bat_sim.print_stats(len(available))
print_hashes(hashrates)
# print_profits(incomes, costs)
print_profits(incomes, costs)
# print(effs) # Check if efficiency is reasonable
# return name, list_to_pd(usage, available), list_to_pd(incomes, available), list_to_pd(costs, available), list_to_pd(bat, available)
return name, list_to_pd(usage, available), list_to_pd(bat, available)
Expand Down

0 comments on commit 843bdb3

Please sign in to comment.