Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp the attribute system #62

Merged
merged 219 commits into from
Apr 25, 2022
Merged

Revamp the attribute system #62

merged 219 commits into from
Apr 25, 2022

Conversation

JTS22
Copy link
Contributor

@JTS22 JTS22 commented Dec 29, 2021

This PR introduces a new attribute system to DPsim. Attributes are variable properties that can hold some numerical value, which can then be accessed from the outside by the simulation scheduler or by other components. Attributes can be computed from other attributes, therefore forming a dependency graph which is used in the scheduler to determine the execution order of tasks.

With this PR, every attribute can either be static or dynamic. Static attributes do not have any immediate dependencies, while dynamic attributes can be entirely derived from other attributes. For more details on the distinction between dynamic and static attributes, see this comment in issue #61

The usage of attributes in the component code remains roughly the same, however there are some differences:

  • Attributes are public member variables of the components they belong to and they usually have type const Attribute<T>::Ptr.
  • Attributes are created in the constructors initialization list. A new attribute can be created with the Attribute<T>::create and Attribute<T>::createDynamic methods.
  • To acquire a (mutable) reference to an attribute's underlying data, the dereference operator has to be used twice on the attribute member variable, resulting in **mAttribute.
  • Derived attributes can be created using the various derive-functions on the attribute object.

JTS22 added 21 commits April 8, 2022 07:12
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
JTS22 added 15 commits April 8, 2022 07:12
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
Signed-off-by: Jonas Schroeder <[email protected]>
@JTS22 JTS22 changed the title Draft: Revamp the attribute system Revamp the attribute system Apr 8, 2022
Signed-off-by: Jonas Schroeder <[email protected]>
CMakeLists.txt Outdated Show resolved Hide resolved
Include/dpsim/DataLogger.h Outdated Show resolved Hide resolved
Source/pybind/main.cpp Show resolved Hide resolved
Source/MNASolver.cpp Show resolved Hide resolved
cmake/GetVillasDPsim.cmake Outdated Show resolved Hide resolved
m-mirz added a commit to dpsim-simulator/dpsim-villas that referenced this pull request Apr 22, 2022
This PR adapts dpsim-villas and the examples contained within it to the new attribute system for DPsim, which will be added in PR sogno-platform/dpsim#62.
@m-mirz m-mirz merged commit 40f126f into sogno-platform:master Apr 25, 2022
JTS22 pushed a commit that referenced this pull request Jun 22, 2022
This PR adapts dpsim-villas and the examples contained within it to the new attribute system for DPsim, which will be added in PR #62.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants