public int findTimeForDepartureFromU(Node u, Node v, Edge edge, int departureTimeFromU, int arrivalAtV)
	{
		//find time at which people can go from u to v
		int delay = 0;
		boolean change = true;
		while(change)
		{
			change = false;
			
			while(u.getNodeCapacityAtTime().size() < (departureTimeFromU + 1))
				u.getNodeCapacityAtTime().add(u.getMaxCapacity()-u.getCurrentOccupancy());
			
			if(u.getNodeCapacityAtTime().get(departureTimeFromU) <= 0)
			{
				change=true;
				delay++;
				departureTimeFromU++;
				arrivalAtV++;
			}
			if(edge.getEdgeCapacityAtSrc().get(departureTimeFromU) <=0)
			{
				change=true;
				delay++;
				departureTimeFromU++;
				arrivalAtV++;
				
				int timeInstancesToAddAtSrc = departureTimeFromU - edge.getEdgeCapacityAtSrc().size() + 2;
				int timeInstancesToAddAtTarget = arrivalAtV - edge.getEdgeCapacityAtTarget().size() + 2;
				
				for(int i = 0; i < timeInstancesToAddAtSrc; i++)
					edge.addEdgeCapacityAtSrc();
				
				for(int i = 0; i < timeInstancesToAddAtTarget; i++)
					edge.addEdgeCapacityAtTarget();
				
				continue;
			}
			while(v.getNodeCapacityAtTime().size() < (arrivalAtV + 1))
				v.getNodeCapacityAtTime().add(v.getMaxCapacity()-v.getCurrentOccupancy());
			
			if(v.getNodeCapacityAtTime().get(arrivalAtV) <=0)
			{
				change=true;
				delay++;
				departureTimeFromU++;
				arrivalAtV++;
				continue;
			}
		}
		return departureTimeFromU;
	}