Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions Src/Utilities/Test_buyer_heuristic.py

This file was deleted.

26 changes: 26 additions & 0 deletions Src/Utilities/test_buyer_heuristic.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from Strategic_adjustments import buyer_heuristic
import numpy as np

Price_decision_data = {
'is_buyer': True,
'round_num': 1,
'advantage': 'none',
'price': np.float64(1.5),
'avg_buyer_price': np.float64(2.0),
'avg_seller_price': np.float64(1.0),
'avg_seller_min_price': np.float64(0.7),
'avg_buyer_max_price': np.float64(2.46875),
'std_buyer_price': np.float64(0.0),
'std_seller_price': np.float64(0.0),
'std_buyer_max': np.float64(0.0),
'std_seller_min': np.float64(0.0),
'demand': np.float64(30.0),
'supply': np.float64(10.0),
'pvt_res_price': 1.4375,
'previous_price': 2,
}


def test_buyer_heuristic():
result = buyer_heuristic(Price_decision_data)
assert Price_decision_data['avg_seller_min_price'] <= result <= Price_decision_data['avg_buyer_max_price']