-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuyer.py
39 lines (24 loc) · 839 Bytes
/
Buyer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
import numpy as np
class Buyer():
def __init__(self, money, goods, value, low):
self.money = money
self.goods = goods
self.value = value
self.low = low
return
def make_bid(self):
bid = np.random.uniform(low=self.orderbook.bid, high=min(self.value, self.money))
# print('BUYER: low: {:10.4f} high: {:10.4f} bid: {:10.4f}'.format(self.orderbook.bid, min(self.value, self.money),bid))
return bid
def set_cost(self, cost):
return
def set_buyer_orderbook(self, orderbook):
self.orderbook = orderbook
return
# def make_trade(self, price):
#
# self.money -= price
# self.goods += 1
#
# return