SI_InteligentnyWozekWidlowy/util/ClientParamsFactory.py
Aleksander Szamałek 522b29269d engine improvements
2022-05-22 16:27:36 +02:00

36 lines
983 B
Python

import random
from data.ClientParams import ClientParams
from data.enum.CompanySize import CompanySize
class ClientParamsFactory:
@staticmethod
def getTrueMore(per_of_true: int) -> bool:
custom = random.randint(0, per_of_true)
return custom > 0
@staticmethod
def get_client_params() -> ClientParams:
payment_delay = random.randint(0, 14)
payed = ClientParamsFactory.getTrueMore(5)
net_worth = random.randint(0, 100)
is_skarbowka = not ClientParamsFactory.getTrueMore(5)
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)
)