SI_InteligentnyWozekWidlowy/ClientParamsFactory.py

35 lines
980 B
Python
Raw Normal View History

2022-05-09 15:49:11 +02:00
import random
from data.ClientParams import ClientParams
from data.enum.CompanySize import CompanySize
class ClientParamsFactory:
def __init__(self) -> None:
super().__init__()
def getTrueMore(self, perOfTrue: int) -> bool:
custom = random.randint(0, perOfTrue)
return custom > 0
2022-05-09 15:49:11 +02:00
def get_client_params(self) -> ClientParams:
payment_delay = random.randint(0, 14)
payed = self.getTrueMore(5)
2022-05-09 15:49:11 +02:00
net_worth = random.randint(0, 100)
is_skarbowka = not self.getTrueMore(5)
2022-05-09 15:49:11 +02:00
membership = random.getrandbits(1)
infuelnce_rate = random.randint(0, 100)
is_hat = random.getrandbits(1)
company_size = random.randint(1,6)
return ClientParams(
payment_delay,
net_worth,
infuelnce_rate,
bool(payed),
bool(is_skarbowka),
bool(membership),
bool(is_hat),
CompanySize(company_size)
)