Compare commits
18 Commits
Author | SHA1 | Date | |
---|---|---|---|
3e01a528d3 | |||
0186e21290 | |||
aae5ad9491 | |||
|
fa27b138e4 | ||
|
1bcce19de2 | ||
4e78dfdbab | |||
404586daf8 | |||
|
ee2e1180af | ||
|
80aa2995ff | ||
302001e531 | |||
1de4b34d8e | |||
bf53abc658 | |||
5760a51d5f | |||
3680e50105 | |||
|
d7edccf091 | ||
|
4e7550edf2 | ||
|
67a695630e | ||
308d07d8c8 |
78
board
@ -1,78 +0,0 @@
|
||||
import sys
|
||||
import pygame
|
||||
|
||||
screen = []
|
||||
objectArray = []
|
||||
|
||||
class Agent:
|
||||
def __init__(self, name, xPos, yPos):
|
||||
self.name = name
|
||||
self.xPos = xPos
|
||||
self.yPos = yPos
|
||||
|
||||
def draw(square_num, objectArr):
|
||||
#następne dwie linijki do odkomentowania, jak będzie wgrane zdjęcie do tła
|
||||
#background = pygame.image.load("ścieżka do pliku").convert() #tu ścieżka do zdjęcia w tle
|
||||
#screen.blit(background, (0, 0))
|
||||
grid_color = (0, 0, 0) #kolor czarny
|
||||
|
||||
grid_size = 500 #rozmiar kraty
|
||||
square = grid_size/square_num #rozmiar pojedyńczego kwadracika
|
||||
|
||||
a = 50
|
||||
b = 10 #odległości kraty od krawędzi okna
|
||||
|
||||
for i in range(square_num):
|
||||
pygame.draw.line(screen, grid_color, (a + i*square, b), (a + i*square, b + grid_size), 2)
|
||||
|
||||
pygame.draw.line(screen, grid_color, (a, b + i*square), (a + grid_size, b + i*square), 2)
|
||||
|
||||
pygame.draw.line(screen, grid_color, (a, b + grid_size), (a + grid_size,
|
||||
b + grid_size), 2)
|
||||
pygame.draw.line(screen, grid_color, (a + grid_size, b),
|
||||
(a + grid_size, b + grid_size), 2)
|
||||
|
||||
## tutaj rysujemy agenta i inne obiekty juz na gotowej mapie
|
||||
|
||||
## RYSUJEMY AGENTA
|
||||
#agent_color = (255, 0, 0)
|
||||
circleX = objectArr[0].xPos * square + square + square/ 2 #dodane jedno +square, by śmieciara nie wychodziła poza kratę
|
||||
circleY = objectArr[0].yPos * square - square / 2
|
||||
#radius = 10
|
||||
#pygame.draw.circle(screen, agent_color, (a + circleX, b + circleY), radius)
|
||||
truck = pygame.image.load("https://git.wmi.amu.edu.pl/s450737/SI-projekt-smieciarka/src/branch/master/car.png.png").convert_alpha() #tu ścieżka do zdjęcia w tle
|
||||
truck = pygame.transform.scale(truck, (square, square))
|
||||
screen.blit(truck, (circleX, circleY))
|
||||
|
||||
def kb_listen(objectArray, gridLength):
|
||||
for event in pygame.event.get():
|
||||
if event.type == pygame.KEYDOWN:
|
||||
if event.key == pygame.K_LEFT and objectArray[0].xPos > 0:
|
||||
objectArray[0].xPos = objectArray[0].xPos - 1
|
||||
if event.key == pygame.K_RIGHT and objectArray[0].xPos < gridLength - 1:
|
||||
objectArray[0].xPos = objectArray[0].xPos + 1
|
||||
if event.key == pygame.K_UP and objectArray[0].yPos > 1:
|
||||
objectArray[0].yPos = objectArray[0].yPos - 1
|
||||
if event.key == pygame.K_DOWN and objectArray[0].yPos < gridLength:
|
||||
objectArray[0].yPos = objectArray[0].yPos + 1
|
||||
if event.type == pygame.QUIT:
|
||||
sys.exit()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
pygame.init() #inicjalizacja modułów, na razie niepotrzebna
|
||||
|
||||
#Tworzymy nowego playera, czy tam agenta
|
||||
agent = Agent("smieciarka", 5, 7)
|
||||
objectArray.append(agent)
|
||||
|
||||
width = 600
|
||||
height = 530
|
||||
screen = pygame.display.set_mode((width, height)) #ustalanie rozmiarów okna
|
||||
|
||||
while 1:
|
||||
c = (255, 255, 255) #tymczasowy kolor tła - do usunięcia, jak już będzie zdjęcie
|
||||
screen.fill(c)
|
||||
draw(15, objectArray)
|
||||
kb_listen(objectArray, 15)
|
||||
pygame.display.update() #by krata pojawiła się w okienku - update powierzchni
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
30
cwiczenia.txt
Normal file
@ -0,0 +1,30 @@
|
||||
1) Dom nie jest sterta smieci
|
||||
∀x (dom(x) ⇒ ¬sterta smieci(x))
|
||||
dom(x) ∧ sterta smieci(x) ⇒
|
||||
|
||||
2) Kazdy smiec ma inny typ
|
||||
∀x (smiec(x) ⇒ ∃y typ(x, y))
|
||||
smiec(x) ⇒ typ(x, d(x))
|
||||
|
||||
3) Kazdy smiec jest albo papierem, plastikiem lub szklem
|
||||
∀x (smiec(x) ⇒ papier(x) ∨ szklo(x) ∨ plastik(x))
|
||||
smiec(x) ⇒ papier(x) ∨ szklo(x) ∨ plastik(x)
|
||||
|
||||
– Cos nie moze byc jednoczesnie papierem, plasitkiem/szklem ...
|
||||
|
||||
4) Kazda sterta smieci jest albo papierem, plastikiem lub szklem
|
||||
∀x (sterta smieci(x) ⇒ papier(x) ∨ szklo(x) ∨ plastik(x))
|
||||
sterta smieci(x) ⇒ papier(x) ∨ szklo(x) ∨ plastik(x)
|
||||
|
||||
5) Dom wytwarza smieci
|
||||
wytwarza(smieci, dom)
|
||||
wytwarza(smieci, dom)
|
||||
|
||||
6) Niektore domy nie maja smieci
|
||||
∃x(dom(x) ⇒ ¬smieci(x))
|
||||
|
||||
Wprowadzamy stala Skolema (b)
|
||||
dom(b) ∧ smieci(b) ⇒
|
||||
|
||||
7) Kazde dwa obiekty znajduja sie w pewnej odleglosci od siebie
|
||||
∀x∀y
|
BIN
dataset/export.pkl
Normal file
BIN
dataset/glass/glass1.jpg
Normal file
After Width: | Height: | Size: 8.1 KiB |
BIN
dataset/glass/glass10.jpg
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
dataset/glass/glass100.jpg
Normal file
After Width: | Height: | Size: 21 KiB |
BIN
dataset/glass/glass101.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
dataset/glass/glass102.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass103.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dataset/glass/glass104.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
dataset/glass/glass105.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dataset/glass/glass106.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dataset/glass/glass107.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
dataset/glass/glass108.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
dataset/glass/glass109.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
dataset/glass/glass11.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dataset/glass/glass110.jpg
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
dataset/glass/glass111.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
dataset/glass/glass112.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass113.jpg
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
dataset/glass/glass114.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass115.jpg
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
dataset/glass/glass116.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
dataset/glass/glass117.jpg
Normal file
After Width: | Height: | Size: 23 KiB |
BIN
dataset/glass/glass118.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
dataset/glass/glass119.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass12.jpg
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
dataset/glass/glass120.jpg
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
dataset/glass/glass121.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
dataset/glass/glass122.jpg
Normal file
After Width: | Height: | Size: 24 KiB |
BIN
dataset/glass/glass123.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
dataset/glass/glass124.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
dataset/glass/glass125.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
dataset/glass/glass126.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass127.jpg
Normal file
After Width: | Height: | Size: 8.3 KiB |
BIN
dataset/glass/glass128.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
dataset/glass/glass129.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
dataset/glass/glass13.jpg
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
dataset/glass/glass130.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dataset/glass/glass131.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass132.jpg
Normal file
After Width: | Height: | Size: 9.0 KiB |
BIN
dataset/glass/glass133.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dataset/glass/glass134.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
dataset/glass/glass135.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
dataset/glass/glass136.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
dataset/glass/glass137.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
dataset/glass/glass138.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
dataset/glass/glass139.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
dataset/glass/glass14.jpg
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
dataset/glass/glass140.jpg
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
dataset/glass/glass141.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass142.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
dataset/glass/glass143.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass144.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
dataset/glass/glass145.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
dataset/glass/glass146.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dataset/glass/glass147.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
dataset/glass/glass148.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
dataset/glass/glass149.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass15.jpg
Normal file
After Width: | Height: | Size: 8.9 KiB |
BIN
dataset/glass/glass150.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
dataset/glass/glass151.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
dataset/glass/glass152.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
dataset/glass/glass153.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
dataset/glass/glass154.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
dataset/glass/glass155.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass156.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
dataset/glass/glass157.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
dataset/glass/glass158.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass159.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
dataset/glass/glass16.jpg
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
dataset/glass/glass160.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
dataset/glass/glass161.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
dataset/glass/glass162.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
dataset/glass/glass163.jpg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
dataset/glass/glass164.jpg
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
dataset/glass/glass165.jpg
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
dataset/glass/glass166.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
dataset/glass/glass167.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
dataset/glass/glass168.jpg
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
dataset/glass/glass169.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dataset/glass/glass17.jpg
Normal file
After Width: | Height: | Size: 19 KiB |
BIN
dataset/glass/glass170.jpg
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
dataset/glass/glass171.jpg
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
dataset/glass/glass172.jpg
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
dataset/glass/glass173.jpg
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
dataset/glass/glass174.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
dataset/glass/glass175.jpg
Normal file
After Width: | Height: | Size: 9.1 KiB |
BIN
dataset/glass/glass176.jpg
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
dataset/glass/glass177.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
dataset/glass/glass178.jpg
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
dataset/glass/glass179.jpg
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
dataset/glass/glass18.jpg
Normal file
After Width: | Height: | Size: 12 KiB |
BIN
dataset/glass/glass180.jpg
Normal file
After Width: | Height: | Size: 8.8 KiB |
BIN
dataset/glass/glass181.jpg
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
dataset/glass/glass182.jpg
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
dataset/glass/glass183.jpg
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
dataset/glass/glass184.jpg
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
dataset/glass/glass185.jpg
Normal file
After Width: | Height: | Size: 20 KiB |