和顺 / 知几 返回所属 Agent
ZJ-08.03

联动影响

原能力

记录影响如何扩大、延迟或抵消,并标明哪些传导仍是推断。(细化版 p.4–5)

首选项目

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.

实现与验收要点

定义传播、衰减、抵消以及事实与假设标记。