有效优先级 = 基础优先级 + 老化加权(随等待时间单调上升,封顶 AGING_MAX)。 使长期得不到链路的低优先级请求随等待自动升权,避免饥饿。
(self, req)
| 837 | return size |
| 838 | |
| 839 | def _effective_priority(self, req): |
| 840 | """有效优先级 = 基础优先级 + 老化加权(随等待时间单调上升,封顶 AGING_MAX)。 |
| 841 | |
| 842 | 使长期得不到链路的低优先级请求随等待自动升权,避免饥饿。 |
| 843 | """ |
| 844 | base = req.priority or 0 |
| 845 | wait = max(0.0, self.current_time - (req.submit_time if req.submit_time is not None else self.current_time)) |
| 846 | return base + min(AGING_MAX, AGING_FACTOR * wait) |
| 847 | |
| 848 | def _update_transmissions(self, delta_time): |
| 849 | """更新所有传输任务的进度 (包含动态链路切换逻辑)""" |
nothing calls this directly
no outgoing calls
no test coverage detected