和顺 / 势衡 返回所属 Agent
SH-04.03

连锁影响

原能力

识别单点依赖、相互制约与可能抵消的影响,标记证据和替代解释。(细化版 p.8–9)

首选项目

NetworkX(BSD-3-Clause)。 NetworkX

匹配范围

可计算依赖路径并模拟已定义反馈。

源码

NetworkX · def descendants(

networkx/algorithms/dag.py · 36–49 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
def descendants(G, source):
    """Returns all nodes reachable from `source` in `G`.

    Parameters
    ----------
    G : NetworkX Graph
    source : node in `G`

    Returns
    -------
    set()
        The descendants of `source` in `G`

    Raises

Mesa · class Model

mesa/model.py · 44–57 行。 在 GitHub 查看源码 · 许可证与声明

源码片段
class Model[A: Agent, S: Scenario](HasEmitters):
    """Base class for models in the Mesa ABM library.

    This class serves as a foundational structure for creating agent-based models.
    It includes the basic attributes and methods necessary for initializing and
    running a simulation model.

    Type Parameters:
        A: The agent type used in this model
        S: The scenario type used in this model

    Attributes:
        running: A boolean indicating if the model should continue running.
        time: the current simulation time.

实现与验收要点

确定因果、传播系数、延迟、抵消和专家复核。