Skip to content

Commit

Permalink
arreglo con autociclos
Browse files Browse the repository at this point in the history
  • Loading branch information
dariocorreal committed May 1, 2021
1 parent f32d708 commit 499ecfe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion App/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ def loadServices(analyzer, servicesfile):
if lastservice is not None:
sameservice = lastservice['ServiceNo'] == service['ServiceNo']
samedirection = lastservice['Direction'] == service['Direction']
if sameservice and samedirection:
samebusStop = lastservice['BusStopCode'] == service['BusStopCode']
if sameservice and samedirection and not samebusStop:
model.addStopConnection(analyzer, lastservice, service)
lastservice = service
model.addRouteConnections(analyzer)
Expand Down
1 change: 1 addition & 0 deletions App/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ def addStopConnection(analyzer, lastservice, service):
destination = formatVertex(service)
cleanServiceDistance(lastservice, service)
distance = float(service['Distance']) - float(lastservice['Distance'])
distance = abs(distance)
addStop(analyzer, origin)
addStop(analyzer, destination)
addConnection(analyzer, origin, destination, distance)
Expand Down

0 comments on commit 499ecfe

Please sign in to comment.