Skip to content

Commit e2d16cf

Browse files
committed
Adapt config class
1 parent 29379ed commit e2d16cf

File tree

8 files changed

+36
-3
lines changed

8 files changed

+36
-3
lines changed

inputData/config/allNoSwitches.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ io {
1919

2020
targetFolder = "convertedData/multiVoltLvlNoSwitches"
2121
compress = true
22+
workers = 20
2223
}
2324

2425
simbenchCodes = [
@@ -150,3 +151,8 @@ io {
150151
"1-MV-urban--2-no_sw"
151152
]
152153
}
154+
155+
conversion {
156+
removeSwitches = false
157+
participantWorkersPerType = 20
158+
}

inputData/config/multiVoltLvlNoSwitches.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ io {
1919

2020
targetFolder = "convertedData/multiVoltLvlNoSwitches"
2121
compress = true
22+
workers = 20
2223
}
2324

2425
simbenchCodes = [
@@ -112,3 +113,8 @@ io {
112113
"1-MVLV-urban-all-2-no_sw"
113114
]
114115
}
116+
117+
conversion {
118+
removeSwitches = false
119+
participantWorkersPerType = 20
120+
}

inputData/config/mvLvNoSwitches.conf

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ io {
1919

2020
targetFolder = "convertedData/mvLvNoSwitches"
2121
compress = true
22+
workers = 20
2223
}
2324

2425
simbenchCodes = [
@@ -106,4 +107,5 @@ io {
106107

107108
conversion {
108109
removeSwitches = true
110+
participantWorkersPerType = 20
109111
}

inputData/config/singleVoltLvlNoSwitches.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ io {
1919

2020
targetFolder = "convertedData/singleVoltLvlNoSwitches"
2121
compress = true
22+
workers = 20
2223
}
2324

2425
simbenchCodes = [
@@ -63,3 +64,8 @@ io {
6364
"1-MV-urban--2-no_sw"
6465
]
6566
}
67+
68+
conversion {
69+
removeSwitches = false
70+
participantWorkersPerType = 20
71+
}

inputData/config/smallGrid.conf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,15 @@ io {
1919

2020
targetFolder = "convertedData/smallGrid"
2121
compress = false
22+
workers = 20
2223
}
2324

2425
simbenchCodes = [
2526
"1-LV-rural1--1-sw"
2627
]
2728
}
29+
30+
conversion {
31+
removeSwitches = false
32+
participantWorkersPerType = 20
33+
}

src/main/resources/config-template.conf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ io {
1818
csv = CsvConfig
1919
targetFolder = "String" | "convertedData"
2020
compress = "Boolean" | true
21+
workers = "Int" | 20
2122
}
2223
}
2324
conversion {

src/main/scala/edu/ie3/simbench/config/ConfigValidator.scala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ case object ConfigValidator {
3535
@throws[SimbenchException]
3636
private def checkValidity(io: SimbenchConfig.Io): Unit = {
3737
checkSimbenchCodes(io.simbenchCodes)
38+
if (io.output.workers <= 0)
39+
throw new SimbenchException(
40+
"The amount of output workers has to be positive!"
41+
)
3842
}
3943

4044
/**

src/main/scala/edu/ie3/simbench/config/SimbenchConfig.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// generated by tscfg 0.9.993 on Fri Aug 27 13:41:17 CEST 2021
1+
// generated by tscfg 0.9.993 on Mon Aug 30 16:37:01 CEST 2021
22
// source: src/main/resources/config-template.conf
33

44
package edu.ie3.simbench.config
@@ -121,7 +121,8 @@ object SimbenchConfig {
121121
final case class Output(
122122
compress: scala.Boolean,
123123
csv: SimbenchConfig.CsvConfig,
124-
targetFolder: java.lang.String
124+
targetFolder: java.lang.String,
125+
workers: scala.Int
125126
)
126127
object Output {
127128
def apply(
@@ -139,7 +140,8 @@ object SimbenchConfig {
139140
),
140141
targetFolder =
141142
if (c.hasPathOrNull("targetFolder")) c.getString("targetFolder")
142-
else "convertedData"
143+
else "convertedData",
144+
workers = if (c.hasPathOrNull("workers")) c.getInt("workers") else 20
143145
)
144146
}
145147
}

0 commit comments

Comments
 (0)