zajecia drzewa decyzyjne
This commit is contained in:
parent
d72364e069
commit
f7b6da279d
31
ClientParamsFactory.py
Normal file
31
ClientParamsFactory.py
Normal file
@ -0,0 +1,31 @@
|
||||
import random
|
||||
|
||||
from data.ClientParams import ClientParams
|
||||
from data.enum.CompanySize import CompanySize
|
||||
|
||||
|
||||
class ClientParamsFactory:
|
||||
|
||||
def __init__(self) -> None:
|
||||
super().__init__()
|
||||
|
||||
def get_client_params(self) -> ClientParams:
|
||||
payment_delay = random.randint(0, 14)
|
||||
payed = random.getrandbits(1)
|
||||
net_worth = random.randint(0, 100)
|
||||
is_skarbowka = random.getrandbits(1)
|
||||
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)
|
||||
)
|
@ -1,7 +1,7 @@
|
||||
import random
|
||||
|
||||
from data.Item import Item
|
||||
from data.ItemType import ItemType
|
||||
from data.enum.ItemType import ItemType
|
||||
from data.Order import Order
|
||||
|
||||
|
||||
|
21
data/ClientParams.py
Normal file
21
data/ClientParams.py
Normal file
@ -0,0 +1,21 @@
|
||||
from data.enum.CompanySize import CompanySize
|
||||
|
||||
|
||||
class ClientParams:
|
||||
def __init__(self,
|
||||
payment_delay: int,
|
||||
net_worth: int,
|
||||
infuelnce_rate: int,
|
||||
payed: bool,
|
||||
is_skarbowka: bool,
|
||||
membership: bool,
|
||||
is_hat: bool,
|
||||
company_size: CompanySize) -> None:
|
||||
self.payment_delay = payment_delay
|
||||
self.payed = payed
|
||||
self.net_worth = net_worth
|
||||
self.is_skarbowka = is_skarbowka
|
||||
self.infuence_rate = infuelnce_rate
|
||||
self.membership = membership
|
||||
self.company_size = company_size
|
||||
self.is_hat = is_hat
|
@ -1,6 +1,6 @@
|
||||
from typing import Dict
|
||||
|
||||
from data.ItemType import ItemType
|
||||
from data.enum.ItemType import ItemType
|
||||
from util.PathDefinitions import GridLocation
|
||||
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
from itertools import count
|
||||
|
||||
from data.ItemType import ItemType
|
||||
from data.enum.ItemType import ItemType
|
||||
|
||||
|
||||
class Item:
|
||||
|
@ -1,13 +1,16 @@
|
||||
from itertools import count
|
||||
|
||||
from data.ClientParams import ClientParams
|
||||
from data.Item import Item
|
||||
from data.enum.Priority import Priority
|
||||
|
||||
|
||||
class Order:
|
||||
id_counter = count(start=0)
|
||||
|
||||
def __init__(self, time: int, items: [Item], value: int):
|
||||
def __init__(self, time: int, items: [Item], value: int, priority: Priority, client_params: ClientParams):
|
||||
self.id = next(self.id_counter)
|
||||
self.time = time
|
||||
self.items = items
|
||||
self.value = value
|
||||
self.priority = priority
|
||||
|
@ -1,4 +1,4 @@
|
||||
from data.ItemType import ItemType
|
||||
from data.enum.ItemType import ItemType
|
||||
from data.Item import Item
|
||||
|
||||
|
||||
|
10
data/enum/CompanySize.py
Normal file
10
data/enum/CompanySize.py
Normal file
@ -0,0 +1,10 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class CompanySize(Enum):
|
||||
BIG = 1
|
||||
NORMAL = 2
|
||||
SMALL = 3
|
||||
NO = 4
|
||||
HUGE = 5
|
||||
GIGANTISHE = 6
|
7
data/enum/Priority.py
Normal file
7
data/enum/Priority.py
Normal file
@ -0,0 +1,7 @@
|
||||
from enum import Enum
|
||||
|
||||
|
||||
class Priority(Enum):
|
||||
HIGH = 1
|
||||
MEDIUM = 2
|
||||
LOW = 3
|
@ -1,4 +1,4 @@
|
||||
from data.Direction import Direction
|
||||
from data.enum.Direction import Direction
|
||||
from data.Item import Item
|
||||
from data.Order import Order
|
||||
from decision.ActionType import ActionType
|
||||
|
2
main.py
2
main.py
@ -7,7 +7,7 @@ from ForkliftAgent import ForkliftAgent
|
||||
from GameModel import GameModel
|
||||
from PatchAgent import PatchAgent
|
||||
from PatchType import PatchType
|
||||
from data.Direction import Direction
|
||||
from data.enum.Direction import Direction
|
||||
from util.PathDefinitions import GridWithWeights
|
||||
|
||||
colors = [
|
||||
|
Loading…
Reference in New Issue
Block a user