-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFlower.py
32 lines (26 loc) · 898 Bytes
/
Flower.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import pandas as pd
import arcade
import random
from Field import Field
from random import randint
class Flower(Field):
def __init__(self, x, y,center_x,center_y, gaMap, reachable=True):
self.isProtected = None
self.flowerName = None
self.picNum = None
self.loadConfig()
self.gaMap = gaMap
super().__init__(x, y, center_x, center_y, self.flowerName, self.gaMap,reachable)
self.h = 1000
def loadConfig(self):
labelsFile = open('./flowers_recoginition/flowerTest/labels.tsv')
labels = labelsFile.read().split("\t")
self.picNum = randint(1, 21)
self.flowerName = labels[self.picNum - 1]
if (self.flowerName == 'snowdrop'):
self.isProtected = 1
else:
self.isProtected = 0
labelsFile.close()
def __lt__(self, other):
return self.h <= other.h