diff --git a/ai-wozek/classes.py b/ai-wozek/classes.py new file mode 100644 index 0000000..1bdddac --- /dev/null +++ b/ai-wozek/classes.py @@ -0,0 +1,47 @@ + + +class Cargo: + def __init__(self, name, category, size, weight): + self.name = name + self.size = size + self.weight = weight + self.category = category + + +class Clothes(Cargo): + def __init__(self, name, size, weight, fragility): + super().__init__(name,"clothes", size, weight) + self.fragility = fragility + +class NuclearWaste(Cargo): + def __init__(self, name, size, weight, exp_date, toxicity): + super().__init__(name,"nuclear_waste" ,size, weight) + self.exp_date = exp_date + self.toxicity = toxicity + +class Fruit(Cargo): + def __init__(self, name ,size, weight, exp_date): + super().__init__(name,"fruit" ,size, weight) + self.exp_date = exp_date + +class Carparts(Cargo): + def __init__(self, name ,size, weight): + super().__init__(name,"car_parts" ,size, weight) + +class Forklift: + def __init__(self, model): + self.model = model + +class Shelf: + def __init__(self, category): + self.category = category + self.items = [] + + def add_item(self, item): + if isinstance(item, Cargo) and item.category == self.category: + self.items.append(item) + else: + print(f"Can't add: {item.name}. Shelf is for: {self.category}") + + + diff --git a/ai-wozek/wozek.py b/ai-wozek/wozek.py index b8cde9a..9b5621b 100644 --- a/ai-wozek/wozek.py +++ b/ai-wozek/wozek.py @@ -3,6 +3,7 @@ import sys import random import os import time +from classes import * class Node(): def __init__(self,position,rotation,action,parent):