-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The fix simplifies the diagram. Details below fuel and electricity consumers will no longer available. It also assumes no changes over time. The main reason for doing this now is to not depend on dtos for flow diagram generation.
- Loading branch information
Showing
16 changed files
with
725 additions
and
2,015 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,50 @@ | ||
import abc | ||
|
||
from libecalc.application.energy.component_energy_context import ComponentEnergyContext | ||
from libecalc.common.component_type import ComponentType | ||
from libecalc.core.result import EcalcModelResult | ||
|
||
|
||
class EnergyComponent(abc.ABC): | ||
""" | ||
A component in the energy model, aka a node in the energy graph. This might be a provider or consumer or both. | ||
TODO: might also be an emitter, which consumes or provides no energy. | ||
""" | ||
|
||
@property | ||
@abc.abstractmethod | ||
def id(self) -> str: ... | ||
|
||
@abc.abstractmethod | ||
def get_component_process_type(self) -> ComponentType: ... | ||
|
||
@abc.abstractmethod | ||
def get_name(self) -> str: ... | ||
|
||
@abc.abstractmethod | ||
def is_provider(self) -> bool: | ||
""" | ||
Whether the energy component provides energy to other energy components. | ||
""" | ||
... | ||
|
||
@abc.abstractmethod | ||
def is_container(self) -> bool: | ||
""" | ||
Whether the energy component is a container for other energy components. | ||
""" | ||
... | ||
|
||
@abc.abstractmethod | ||
def is_fuel_consumer(self) -> bool: | ||
"""Returns True if the component consumes fuel""" | ||
... | ||
|
||
@abc.abstractmethod | ||
def is_electricity_consumer(self) -> bool: | ||
"""Returns True if the component consumes electricity""" | ||
... | ||
|
||
|
||
class EvaluatableEnergyComponent(EnergyComponent, abc.ABC): | ||
@abc.abstractmethod | ||
def evaluate_energy_usage(self, energy_context: ComponentEnergyContext) -> EcalcModelResult: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.