Rename counter to accumulator
This commit is contained in:
parent
ceea2d8824
commit
5cff3199c6
|
@ -25,16 +25,16 @@ def get_row_distance(source, destination, data):
|
||||||
|
|
||||||
|
|
||||||
def get_fitness(solutions, data):
|
def get_fitness(solutions, data):
|
||||||
counter = 0
|
accumulator = 0
|
||||||
comb = combinations(solutions.index, r=2)
|
comb = combinations(solutions.index, r=2)
|
||||||
for index in list(comb):
|
for index in list(comb):
|
||||||
elements = solutions.loc[index, :]
|
elements = solutions.loc[index, :]
|
||||||
counter += get_row_distance(
|
accumulator += get_row_distance(
|
||||||
source=elements["point"].head(n=1).values[0],
|
source=elements["point"].head(n=1).values[0],
|
||||||
destination=elements["point"].tail(n=1).values[0],
|
destination=elements["point"].tail(n=1).values[0],
|
||||||
data=data,
|
data=data,
|
||||||
)
|
)
|
||||||
return counter
|
return accumulator
|
||||||
|
|
||||||
|
|
||||||
def show_results(solutions, fitness, time_delta):
|
def show_results(solutions, fitness, time_delta):
|
||||||
|
|
Loading…
Reference in New Issue