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

Refactor RuntimeConfig #1173

Merged
merged 9 commits into from
Feb 17, 2025
4 changes: 2 additions & 2 deletions src/main/scala/edu/ie3/simona/config/ArgsParser.scala
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,8 @@ object ArgsParser extends LazyLogging {
ConfigFactory.parseString(
s"""config = "${parsedArgs.configLocation.get.replace("\\", "\\\\")}"
|simona.runtime_configuration {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also this is supposed to be simona.runtime?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know. I checked this part and it was simona.runtime_configuration in the initial commit.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know, if we actually need this part? It is given to the ActorSystem, but I don't see any place it is ever used.

Copy link
Member

@sebastian-peter sebastian-peter Feb 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can just throw out selectedSubgrids and selectedVoltLvls from ArgsParser, now that I think about it. I think we never really used it, and if one wants to use it, it can still be configured through the conf file

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But then also, there's lots of stuff in ArgsParser that can be thrown out. So maybe we should create a separate issue for that.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#1192 -> This PR can just stay as it is in that regard

| selected_subnets = [${parsedArgs.selectedSubnets.getOrElse("")}]
| selected_volt_lvls = [${parsedArgs.selectedVoltLvls
| selectedSubnets = [${parsedArgs.selectedSubnets.getOrElse("")}]
| selectedVoltLvls = [${parsedArgs.selectedVoltLvls
.getOrElse("")}]
|}
|""".stripMargin
Expand Down
11 changes: 5 additions & 6 deletions src/main/scala/edu/ie3/simona/config/RuntimeConfig.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,16 @@ import scala.language.implicitConversions
* runtime listener configuration
* @param participant
* runtime configuration
* @param selected_subgrids
* @param selectedSubgrids
* option for selected sub grids (default: None)
* @param selected_volt_lvls
* @param selectedVoltLvls
* option for selected voltage levels (default: None)
*/
case class RuntimeConfig(
final case class RuntimeConfig(
listener: Listener = Listener(),
participant: Participant = Participant.empty(),
selected_subgrids: Option[List[Int]] = None,
selected_volt_lvls: Option[List[VoltLvlConfig]] = None,
selectedSubgrids: Option[List[Int]] = None,
selectedVoltLvls: Option[List[VoltLvlConfig]] = None,
)

object RuntimeConfig {
Expand Down Expand Up @@ -74,7 +74,6 @@ object RuntimeConfig {
* runtime configs for wind energy converters
*/
final case class Participant(
// TODO: move em, since ems aren't participants
em: ParticipantRuntimeConfigs[EmRuntimeConfig],
evcs: ParticipantRuntimeConfigs[EvcsRuntimeConfig],
fixedFeedIn: ParticipantRuntimeConfigs[FixedFeedInRuntimeConfig],
Expand Down