Expand description
§Frequenz Microgrid Component Graph
This is a library for representing the components of a microgrid and the connections between them as a Directed Acyclic Graph (DAG).
A graph representation makes it easy to reason about the relationships between the components and to come up with formulas for calculating aggregated metrics for the microgrid.
§The Node and Edge traits
The main struct is ComponentGraph, instances of which can be created by
passing an iterator of components and the connections between them to the
try_new method.
But because component_graph is an independent library, it doesn’t know about
the component and connection types and instead uses traits to interact with
them.
Therefore, to be usable with this library, the component and connection types
must implement the Node and Edge traits, respectively. Check out the
documentation for these traits for sample implementations.
§Validation
The try_new method several checks on the graph
including checking that:
- There is exactly one root node.
- All edges point to existing nodes.
- All nodes are reachable from the root node.
- There are no cycles in the graph.
- The components have sensible neighbor types. For example, a battery shouldn’t have successors and should have a battery inverter as a predecessor.
If any of the validation steps fail, the method will return an Error, and a
ComponentGraph instance otherwise.
§Formula generation
The component graph library has methods for generating formulas for various metrics of the microgrid. The following formulas are supported:
Modules§
- iterators
- Iterators over components and connections in a
ComponentGraph.
Structs§
- Aggregation
Formula - Coalesce
Formula - Represents a formula that coalesces metrics from multiple components.
- Component
Graph - A graph representation of the electrical components of a microgrid and the connections between them.
- Component
Graph Config - Configuration options for the
ComponentGraph. - Error
- An error that can occur during the creation or traversal of a ComponentGraph.
Enums§
- Battery
Type - Represents the type of a battery.
- Component
Category - Represents the category of a component.
- EvCharger
Type - Represents the type of an EV charger.
- Inverter
Type - Represents the type of an inverter.