Exemplo n.º 1
0
    def think(self, data):
        self.gene_index = 0
        rbf = self.rbf

        if data[0] == 0 and data[4] == 0:
            return (0.005, 0)

        else:
            if data[0] == 1:
                left = (rbf(data[1]) + rbf(data[2]) + rbf(data[3]),
                        rbf(data[1]) + rbf(data[2]) + rbf(data[3]))
            else:
                self.gene_index += self.G_TOTAL_CONNECTIONS / 2
                left = (0, 0)

            if data[4] == 1:
                right = (rbf(data[5]) + rbf(data[6]) + rbf(data[7]),
                         rbf(data[5]) + rbf(data[6]) + rbf(data[7]))
            else:
                right = (0, 0)

            return (transfer(left[0] + right[0]), transfer(left[1] + right[1]))
Exemplo n.º 2
0
	def think(self, data):
		self.gene_index = 0
		rbf = self.rbf

		if data[0] == 0 and data[4] == 0:
			return (0.005, 0)
		
		else:
			if data[0] == 1:
				left = (rbf(data[1]) + rbf(data[2]) + rbf(data[3]),
					rbf(data[1]) + rbf(data[2]) + rbf(data[3]))
			else:
				self.gene_index += self.G_TOTAL_CONNECTIONS / 2
				left = (0,0)

			if data[4] == 1:
				right = (rbf(data[5]) + rbf(data[6]) + rbf(data[7]),
					rbf(data[5]) + rbf(data[6]) + rbf(data[7]))
			else:
				right = (0,0)

			return (transfer(left[0] + right[0]), transfer(left[1] + right[1]))
Exemplo n.º 3
0
    def think(self, data):
        self.gene_index = 0
        f = self.apply_genes

        if data[0] == 0 and data[4] == 0:
            return (0.005, 0)

        else:
            if data[0] != 0:
                left = (f(data[1]) + f(data[2]) + f(data[3]), f(data[1]) + f(data[2]) + f(data[3]))
            else:
                self.gene_index += self.G_TOTAL_CONNECTIONS / 2
                left = (0, 0)

            if data[4] != 0:
                right = (f(data[5]) + f(data[6]) + f(data[7]), f(data[5]) + f(data[6]) + f(data[7]))
            else:
                right = (0, 0)

                # print "# Input: %s" % data
                # print "# Output: (%s,%s)" % ((left[0] + right[0]) / 6, (left[1] + right[1]) / 6)
        return (transfer(left[0] + right[0]), transfer(left[1] + right[1]))
Exemplo n.º 4
0
	def think(self, data):
		self.gene_index = 0
		f = self.apply_genes

		if data[0] == 0 and data[4] == 0:
			return (0.005,0)
		
		else:
			if data[0] != 0:
				left = (f(data[1]) + f(data[2]) + f(data[3]),
					f(data[1]) + f(data[2]) + f(data[3]))
			else:
				self.gene_index += self.G_TOTAL_CONNECTIONS / 2
				left = (0,0)

			if data[4] != 0:
				right = (f(data[5]) + f(data[6]) + f(data[7]),
					f(data[5]) + f(data[6]) + f(data[7]))
			else:
				right = (0,0)
			
		#print "# Input: %s" % data
		#print "# Output: (%s,%s)" % ((left[0] + right[0]) / 6, (left[1] + right[1]) / 6)
		return (transfer(left[0] + right[0]), transfer(left[1] + right[1]))
#        letter = 'F'
#    ID = str(num) + letter
#    return ID

id_path = r'T:\AnalysisDroneData\groundTruth\CLMB STND 2019 Flight Data\100085_2019_07_18_15_54_58\id_processed'
filelist = [f for f in os.listdir(os.path.join(id_path)) if f.endswith('.mat')]

# get the correct order of files
list_frame_idx_hyper = []
for f in filelist:
    hyper_cube_name = re.findall('\d+', f)[0]
    list_frame_idx_hyper.append(int(hyper_cube_name))
index_temp = np.argsort(list_frame_idx_hyper)
file_list = [filelist[i] for i in index_temp]

plot_list = [funcs.transfer(i) for i in range(1, 37)]
col = [re.findall('\d+', f)[0] for f in file_list]
row = plot_list

#col = ['class {}'.format(i) for i in range(0,7)]
#row = [re.findall('\d+', f)[0] for f in file_list]
df_summary = pd.DataFrame(columns=col, index=row)

class_names = np.arange(1, 37)
for f in file_list:
    count_final = np.zeros(36)
    hyper_cube_name = re.findall('\d+', f)[0]
    loaded = sio.loadmat(os.path.join(id_path, f), squeeze_me=True)
    plotID = loaded['id']

    [plot_name, counts] = np.unique(plotID, return_counts=True)