def travel_time(self, link, flow): return self.rho * quad_over_lin(1.0, self.mu - flow)
def flow_x_travel_time(self, link, flow): return self.rho * (self.mu * quad_over_lin(1.0, self.mu - flow) - 1.0)
def link_tt_heuristic(link): ff = link.l / link.fd.v q_max = (link.l / link.fd.q_max) * link.v_dens rho_hat = link.fd.rho_max - link.v_dens cong = link.l / link.fd.w * (link.fd.rho_max * quad_over_lin(1.0 , rho_hat) - 1) return cvx_max(hstack([ff, q_max, cong]))