Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

供电系统抽象有向无环图(directed acyclic graph或dag),是供电系统分析的核心数据结构

Notifications You must be signed in to change notification settings

xiechao06/abstract-power-supply-system-models

Repository files navigation

abstract-power-supply-system-dag

Commitizen friendly

Documentation

供电系统抽象图,是供电系统分析的核心数据结构, 在给定真值表下, 该图将生成以各个电源为根节点的一组树。

注意,在生成森林的过程中,只有一条规则:

任意两个电源,以及电源和电源自己,不能存在闭合通路

Dc/Dc, 闭合开关正向二极管都认为是闭合通路的一部分。

test_graph.py下有若干对闭合通路的测试,可以查看单元测试进一步的了解如何 是一个合法的供电系统工作状态.

Sample

sample

Limitations

  • TREE的根一定是电源
  • 电源一定接开关
  • 开关接汇流条, DC/DC 或者负载
  • 汇流条下有 DC/DC 或者其他开关

Development & Test

Install rye, then:

rye sync
pytest

Benchmarks

  • Generate forest

gen forest benchmark

  • Find passages

find passages benchmark

FAQ

  • 为什么要用forest(森林)而不是dag(有向无环图)来描述供电系统的运行状态?

首先dag可以表达为逻辑上等价的forest, 只是forest的空间效率低于dag.

Alt text

严格来说,由于不能存在多路供电,供电系统的运行状态是forest, 但是由于我们没有实现表决算法,实际上供电系统 的运行状态也可以用dag描述。

所以,仅仅就目前而言, 用forest只是出于算法实现的简化, 但通过性能测试,forest也足以满足需求, 所以先用forest描述供电系统的运行状态。

About

供电系统抽象有向无环图(directed acyclic graph或dag),是供电系统分析的核心数据结构

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages