优先恢复顺序
原能力
先找即将失效或会影响后续多段行程的安排,列出处理顺序及理由。(细化版 p.10–11)
首选项目
NetworkX(BSD-3-Clause)。 NetworkX
匹配范围
依赖路径和工作包优先级支持恢复清单。
源码
NetworkX · def topological_sort(
networkx/algorithms/dag.py · 312–325 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
def topological_sort(G):
"""Returns a generator of nodes in topologically sorted order.
A topological sort is a nonunique permutation of the nodes of a
directed graph such that an edge from u to v implies that u
appears before v in the topological sort order. This ordering is
valid only if the graph has no directed cycles.
Parameters
----------
G : NetworkX digraph
A directed acyclic graph (DAG)
Yields
OpenProject · class WorkPackage
app/models/work_package.rb · 30–43 行。 在 GitHub 查看源码 · 许可证与声明
源码片段
class WorkPackage < ApplicationRecord
include WorkPackage::SemanticIdentifier
include WorkPackage::Validations
include WorkPackage::SchedulingRules
include WorkPackage::StatusTransitions
include WorkPackage::AskBeforeDestruction
include WorkPackage::TimeEntriesCleaner
include WorkPackage::Ancestors
include WorkPackage::Automatable
include WorkPackage::Hooks
include WorkPackage::Origin
# Must stay above WorkPackage::Journalized: its after_save persists the
# version rows that the journal snapshot then reads.
include WorkPackage::Versions
- #-- copyright
- # Copyright (C) the OpenProject GmbH
- # OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
- # Copyright (C) 2006-2013 Jean-Philippe Lang
- # Copyright (C) 2010-2013 the ChiliProject Team
- # See COPYRIGHT and LICENSE files for more details.
实现与验收要点
临期、票款、可逆性与旅客偏好构成排序。