Skip to content

Commit

Permalink
test get max value distance
Browse files Browse the repository at this point in the history
  • Loading branch information
syarifuddinahmads committed May 30, 2021
1 parent 05f9593 commit 5c2f874
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,35 @@ def __init__(self,Customer,Distance):
self.distance = Distance

def create_rute(self):
# kurang build rute berdasar data saving
# print('Customer In Class Rute = ',str(self.customer[0]))
print('Customer In Class Rute = ',str(self.customer[0]))
print('Distance In Class Rute = ',str(self.distance))

# temp_distance = []
# for i in range(len(self.distance)):
# print('Item Max = ',max(self.distance[i]))
# print('Index Row of Max ',(i+1))
# print('Index Column of Max = ',(self.distance[i].index(max(self.distance[i]))+1))
# print('Max = ',max(self.distance[i]),' Row = ',(i+1),' Column = ',(self.distance[i].index(max(self.distance[i]))+1))
# temp_distance.append([max(self.distance[i]),(i+1),(self.distance[i].index(max(self.distance[i]))+1)])

# print('Before sorting = ',temp_distance)
# temp_distance.sort(reverse=True)
# print('After sorting = ',temp_distance)

temp_last_max_distance = []
temp_max_distance = []
for i in range(len(self.distance)):
print('Item Max = ',max(self.distance[i]))
print('Index Row of Max ',(i+1))
print('Index Column of Max = ',(self.distance[i].index(max(self.distance[i]))+1))
print('Max = ',max(self.distance[i]),' Row = ',(i+1),' Column = ',(self.distance[i].index(max(self.distance[i]))+1))
temp_max_distance.append([max(self.distance[i]),(i+1),(self.distance[i].index(max(self.distance[i]))+1)])

print('Before sorting = ',temp_max_distance)
temp_max_distance.sort(reverse=True)
print('After sorting = ',temp_max_distance)
print('Get max distance = ',temp_max_distance[0][0])

rute = []
return rute

Expand Down

0 comments on commit 5c2f874

Please sign in to comment.