client factory added better data creation

This commit is contained in:
Jeremi Lisek 2022-05-12 17:05:12 +02:00
parent 77625d79e4
commit df2bc2a04f
2 changed files with 8 additions and 3 deletions

View File

@ -8,11 +8,16 @@ class ClientParamsFactory:
def __init__(self) -> None:
super().__init__()
def getTrueMore(self, perOfTrue: int) -> bool:
custom = random.randint(0, perOfTrue)
return custom > 0
def get_client_params(self) -> ClientParams:
payment_delay = random.randint(0, 14)
payed = random.getrandbits(1)
payed = self.getTrueMore(5)
net_worth = random.randint(0, 100)
is_skarbowka = random.getrandbits(1)
is_skarbowka = not self.getTrueMore(5)
membership = random.getrandbits(1)
infuelnce_rate = random.randint(0, 100)
is_hat = random.getrandbits(1)

View File

@ -75,7 +75,7 @@ if __name__ == '__main__':
writer.writerow(header)
for i in range(50):
for i in range(200):
data = test.get_client_params()
writer.writerow([data.payment_delay,