frequenz_microgrid_component_graph/config.rs
1// License: MIT
2// Copyright © 2024 Frequenz Energy-as-a-Service GmbH
3
4//! This module contains the configuration options for the `ComponentGraph`.
5
6/// Configuration options for the `ComponentGraph`.
7#[derive(Clone, Default, Debug)]
8pub struct ComponentGraphConfig {
9 /// Whether to allow validation errors on components. When this is `true`,
10 /// the graph will be built even if there are validation errors on
11 /// components.
12 pub allow_component_validation_failures: bool,
13
14 /// Whether to allow unconnected components in the graph, that are not
15 /// reachable from the root.
16 pub allow_unconnected_components: bool,
17
18 /// Whether to allow untyped inverters in the graph. When this is `true`,
19 /// inverters that have `InverterType::Unspecified` will be assumed to be
20 /// Battery inverters.
21 pub allow_unspecified_inverters: bool,
22
23 /// Whether to disable fallback components in generated formulas. When this
24 /// is `true`, the formulas will not include fallback components.
25 pub disable_fallback_components: bool,
26
27 /// Meters with successors can still have loads not represented in the
28 /// component graph. These are called phantom loads.
29 ///
30 /// When this is `true`, phantom loads are included in formulas by excluding
31 /// the measurements of successor meters from the measurements of their
32 /// predecessor meters.
33 ///
34 /// When `false`, consumer formula is generated by excluding production
35 /// and battery components from the grid measurements.
36 pub include_phantom_loads_in_consumer_formula: bool,
37
38 /// Whether to prefer PV inverters when generating PV formulas. When this
39 /// is `true`, PV inverters will be the primary source and PV meters will be
40 /// the fallback. When `false`, PV meters will be the primary source.
41 pub prefer_inverters_in_pv_formula: bool,
42
43 /// Whether to prefer battery inverters when generating Battery formulas.
44 /// When this is `true`, battery inverters will be the primary source and
45 /// battery meters will be secondary. When `false`, battery meters will be
46 /// the primary source.
47 pub prefer_inverters_in_battery_formula: bool,
48
49 /// Whether to prefer CHP when generating CHP formulas. When this is
50 /// `true`, CHP units will be the primary source and CHP meters will be
51 /// secondary. When `false`, CHP meters will be the primary source.
52 pub prefer_chp_in_chp_formula: bool,
53
54 /// Whether to prefer EV chargers when generating EV formulas. When this
55 /// is `true`, EV chargers will be the primary source and EV meters will be
56 /// secondary. When `false`, EV meters will be the primary source.
57 pub prefer_ev_chargers_in_ev_formula: bool,
58
59 /// Whether to prefer wind turbines when generating Wind formulas. When
60 /// this is `true`, wind turbines will be the primary source and wind meters
61 /// will be secondary. When `false`, wind meters will be the primary
62 /// source.
63 pub prefer_wind_turbines_in_wind_formula: bool,
64}