Ejemplo n.º 1
0
for x in range(len(myWorld.Edges)):
    Graph.add_edge(edgeGraph, myWorld.Edges[x][0], myWorld.Edges[x][1], myWorld.Edges[x][2])
    
    
#Random test for shortest path
testValue1 = 1
testValue2 = 1

while testValue1 == testValue2:
    testValue1 = random.choice(myWorld.Verticies)
    testValue2 = random.choice(myWorld.Verticies)

firstNode = testValue1[0]
secondNode = testValue2[0]
#This is just for consistency
firstNode = myWorld.Verticies[0][0]
secondNode = myWorld.Verticies[1][0]

Graph.shortest_path(edgeGraph,firstNode,secondNode)

=======
>>>>>>> branch 'master' of https://github.com/lylenchamberlain/teamx.git


print(myWorld.Verticies)

print(myWorld.Edges)

myWorld.runSimulation(10)

Ejemplo n.º 2
0
        myWorld.Edges[j][0], myWorld.Edges[j][1], myWorld.Edges[j][2],
        myWorld.Edges[j][3], myWorld.Edges[j][4]
    )  #graphObj.add_edge(myWorld.Edges[i][0], myWorld.Edges[i][1],myWorld.Edges[i][2]) for when we want to add actual time

#set the floyd welch matrix up
graphObj.setFloyd()
'''

trying to see if there is a realtionship between time and length of an
'''

print(graphObj.getNeighbor(101))

vtx = myWorld.Verticies

myWorld.changeToViz(vtx)  #draws the vertex's
'''
print('locatin of trucks')
trucks = myWorld.getInitialTruckLocations() 

print(trucks[3])
'''

for k in range(len(myWorld.Edges)):

    myWorld.drawGraph(k, graphObj.getNeighbor(k))

#myWorld.appearances()

myWorld.runSimulation(5)