36 lines
1016 B
Python
36 lines
1016 B
Python
import pygame
|
|
from treelearn import treelearn
|
|
import loadmodel
|
|
from astar import astar
|
|
from state import State
|
|
import time
|
|
from garbage_truck import GarbageTruck
|
|
from heuristicfn import heuristicfn
|
|
from map import randomize_map
|
|
from heuristicfn import heuristicfn
|
|
import pygame as pg
|
|
import random
|
|
from request import Request
|
|
|
|
def apply_tree(request_list):
|
|
|
|
print("Przed zastosowaniem drzewa na liście jest śmieci: ", len(request_list))
|
|
|
|
for address in request_list:
|
|
r = [
|
|
0,
|
|
0,
|
|
address.volume,
|
|
address.last_collection,
|
|
address.is_paid,
|
|
address.odour_intensity,
|
|
address.weight,
|
|
address.type
|
|
]
|
|
clf = treelearn()
|
|
if clf.predict([r]) == False:
|
|
request_list.pop(request_list.index(address))
|
|
|
|
print("Po zastosowaniu drzewa na liście jest śmieci: ", len(request_list))
|
|
return request_list
|