Untitled
unknown
python
2 years ago
1.0 kB
2
Indexable
Never
class edge: def __init__(self, origin, destination, CAPACITY, RES): self.origin = origin self.destination = destination self.CAPACITY = CAPACITY self.RES = CAPACITY self.ACTIVATED = True def getRES(): return resCap if ACTIVATED else 0 def form(): input = open("C:\\Users\\Carl\\Programmering\\EDAF05-labs-public\\6railwayplanning\\data\\sample\\1.in") numbers = input.readline().split() N = int(numbers[0]) #Number of nodes (cities) M = int(numbers[1]) #Number of edges (connections) C = int(numbers[2]) #Number of flow (students/soldiers) P = int(numbers[3]) #Number of routes edges = np.array([]) for i in range(0, M): line = input.readline().split() np.append(edges, edge(origin = int(line[0], destination = int(line[1]), CAPACITY = int(line[2]), RES = int(line[2])))) removelist = np.array([]) for k in range (0,P): np.append(removelist,int(input.readline()))