-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
080bddd
commit a1d32f4
Showing
1,678 changed files
with
225 additions
and
185,903 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"jupyter.jupyterServerType": "local" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
class DataModel(): | ||
|
||
def customer_data_model(): | ||
customer = [ | ||
('Richa',55), | ||
('Calvin',50), | ||
('Yono',50), | ||
('Tutik',55), | ||
('Febri',70), | ||
('Zahwa',45), | ||
('Cipto',60), | ||
('Eko',60), | ||
('Khamimah',40), | ||
('Mamik',35), | ||
] | ||
return customer | ||
|
||
def create_distance_data_model(): | ||
distance_matrix = [ | ||
[0,8.3,10.2,6.5,6.6,7.1,7.7,5.8,6.0,5.7,8.1], | ||
[8.3,0,6.8,7.2,5.9,8.8,9.0,4.4,7.9,9.1,5.5], | ||
[10.2,6.8,0,7.8,6.1,3.2,8.0,5.1,10.0,7.3,4.5], | ||
[6.5,7.2,7.8,0,5.6,4.7,6.7,7.0,6.9,6.8,9.9], | ||
[6.6,5.9,6.1,5.6,0,8.9,6.2,0.3,8.2,3.8,5.3], | ||
[7.1,8.8,3.2,4.7,8.9,0,7.5,4.8,3.9,4.1,6.4], | ||
[7.7,9.0,8.0,6.7,6.2,7.5,0,5.4,6.5,9.5,7.4], | ||
[5.8,4.4,5.1,7.0,10.3,4.8,5.4,0,6.3,4.6,8.5], | ||
[6.0,7.9,10.0,6.9,8.2,3.9,6.5,6.3,0,8.4,11.0], | ||
[5.7,9.1,7.3,6.8,3.8,4.1,9.5,4.6,8.4,0,7.6], | ||
[8.1,5.5,4.5,9.9,5.3,6.4,7.4,8.5,11.0,7.6,0], | ||
] | ||
return distance_matrix | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
class Distance(): | ||
|
||
customer = [] | ||
distance = [] | ||
|
||
def __init__(self,Customer,Distance): | ||
self.customer = Customer | ||
self.distance = Distance | ||
|
||
def count_distance_customer_dinamic(self,counter): | ||
data_distance = self.distance | ||
leng_matrix = len(data_distance) | ||
counter_loop = counter+1 | ||
_data = [] | ||
while counter_loop < leng_matrix: | ||
x = data_distance[counter_loop][0] | ||
y = data_distance[0][counter] | ||
xy = data_distance[counter_loop][counter] | ||
total_xy = x+y-xy | ||
print('Total = ',round(total_xy,2)) | ||
_data.append(round(total_xy,2)) | ||
|
||
counter_loop+=1 | ||
return _data | ||
|
||
def execute_distance(self): | ||
starting_point = 1 | ||
data_distance_matrix = [] | ||
while starting_point < len(self.distance)-1: | ||
data_distance_matrix.append(self.count_distance_customer_dinamic(starting_point)) | ||
starting_point+=1 | ||
return data_distance_matrix | ||
|
||
|
Oops, something went wrong.