Skip to content

Commit 75d7f9f

Browse files
authored
Delete startup cost field (#270)
delete startUpCost field Signed-off-by: Ghazwa REHILI <[email protected]>
1 parent 59b38a0 commit 75d7f9f

16 files changed

+19
-60
lines changed

src/main/java/org/gridsuite/modification/server/dto/GeneratorCreationInfos.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ public class GeneratorCreationInfos extends InjectionCreationInfos {
6464
@Schema(description = "Planning active power set point")
6565
private Double plannedActivePowerSetPoint;
6666

67-
@Schema(description = "Startup cost")
68-
private Double startupCost;
69-
7067
@Schema(description = "Marginal cost")
7168
private Double marginalCost;
7269

src/main/java/org/gridsuite/modification/server/dto/GeneratorModificationInfos.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ public class GeneratorModificationInfos extends InjectionModificationInfos {
6161
@Schema(description = "Planning active power set point")
6262
private AttributeModification<Double> plannedActivePowerSetPoint;
6363

64-
@Schema(description = "Startup cost")
65-
private AttributeModification<Double> startupCost;
66-
6764
@Schema(description = "Marginal cost")
6865
private AttributeModification<Double> marginalCost;
6966

src/main/java/org/gridsuite/modification/server/entities/equipment/creation/GeneratorCreationEntity.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,6 @@ public class GeneratorCreationEntity extends InjectionCreationEntity {
5555
@Column(name = "plannedActivePowerSetPoint")
5656
private Double plannedActivePowerSetPoint;
5757

58-
@Column(name = "startupCost")
59-
private Double startupCost;
60-
6158
@Column(name = "marginalCost")
6259
private Double marginalCost;
6360

@@ -134,7 +131,6 @@ private void assignAttributes(GeneratorCreationInfos generatorCreationInfos) {
134131
this.voltageRegulationOn = generatorCreationInfos.isVoltageRegulationOn();
135132
this.voltageSetpoint = generatorCreationInfos.getVoltageSetpoint();
136133
this.plannedActivePowerSetPoint = generatorCreationInfos.getPlannedActivePowerSetPoint();
137-
this.startupCost = generatorCreationInfos.getStartupCost();
138134
this.marginalCost = generatorCreationInfos.getMarginalCost();
139135
this.plannedOutageRate = generatorCreationInfos.getPlannedOutageRate();
140136
this.forcedOutageRate = generatorCreationInfos.getForcedOutageRate();
@@ -195,7 +191,6 @@ public GeneratorCreationInfos toModificationInfos() {
195191
.voltageRegulationOn(isVoltageRegulationOn())
196192
.voltageSetpoint(getVoltageSetpoint())
197193
.plannedActivePowerSetPoint(getPlannedActivePowerSetPoint())
198-
.startupCost(getStartupCost())
199194
.marginalCost(getMarginalCost())
200195
.plannedOutageRate(getPlannedOutageRate())
201196
.forcedOutageRate(getForcedOutageRate())

src/main/java/org/gridsuite/modification/server/entities/equipment/modification/GeneratorModificationEntity.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,6 @@ public class GeneratorModificationEntity extends InjectionModificationEntity {
9494
})
9595
DoubleModificationEmbedded plannedActivePowerSetPoint;
9696

97-
@Embedded
98-
@AttributeOverrides(value = {
99-
@AttributeOverride(name = "value", column = @Column(name = "startupCost")),
100-
@AttributeOverride(name = "opType", column = @Column(name = "startupCostOp"))
101-
})
102-
DoubleModificationEmbedded startupCost;
103-
10497
@Embedded
10598
@AttributeOverrides(value = {
10699
@AttributeOverride(name = "value", column = @Column(name = "marginalCost")),
@@ -231,7 +224,6 @@ private void assignAttributes(GeneratorModificationInfos generatorModificationIn
231224
this.voltageRegulationOn = new BooleanModificationEmbedded(generatorModificationInfos.getVoltageRegulationOn());
232225
this.voltageSetpoint = new DoubleModificationEmbedded(generatorModificationInfos.getVoltageSetpoint());
233226
this.plannedActivePowerSetPoint = new DoubleModificationEmbedded(generatorModificationInfos.getPlannedActivePowerSetPoint());
234-
this.startupCost = new DoubleModificationEmbedded(generatorModificationInfos.getStartupCost());
235227
this.marginalCost = new DoubleModificationEmbedded(generatorModificationInfos.getMarginalCost());
236228
this.plannedOutageRate = new DoubleModificationEmbedded(generatorModificationInfos.getPlannedOutageRate());
237229
this.forcedOutageRate = new DoubleModificationEmbedded(generatorModificationInfos.getForcedOutageRate());
@@ -290,7 +282,6 @@ public GeneratorModificationInfos toModificationInfos() {
290282
.voltageRegulationOn(toAttributeModification(getVoltageRegulationOn()))
291283
.voltageSetpoint(toAttributeModification(getVoltageSetpoint()))
292284
.plannedActivePowerSetPoint(toAttributeModification(getPlannedActivePowerSetPoint()))
293-
.startupCost(toAttributeModification(getStartupCost()))
294285
.marginalCost(toAttributeModification(getMarginalCost()))
295286
.plannedOutageRate(toAttributeModification(getPlannedOutageRate()))
296287
.forcedOutageRate(toAttributeModification(getForcedOutageRate()))

src/main/java/org/gridsuite/modification/server/modifications/GeneratorCreation.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -443,15 +443,13 @@ private void createGeneratorShortCircuit(GeneratorCreationInfos generatorCreatio
443443

444444
private void createGeneratorStartUp(GeneratorCreationInfos generatorCreationInfos, Generator generator, Reporter subReporter) {
445445
if (generatorCreationInfos.getPlannedActivePowerSetPoint() != null
446-
|| generatorCreationInfos.getStartupCost() != null
447446
|| generatorCreationInfos.getMarginalCost() != null
448447
|| generatorCreationInfos.getPlannedOutageRate() != null
449448
|| generatorCreationInfos.getForcedOutageRate() != null) {
450449
List<Report> startupReports = new ArrayList<>();
451450
try {
452451
generator.newExtension(GeneratorStartupAdderImpl.class)
453452
.withPlannedActivePowerSetpoint(nanIfNull(generatorCreationInfos.getPlannedActivePowerSetPoint()))
454-
.withStartupCost(nanIfNull(generatorCreationInfos.getStartupCost()))
455453
.withMarginalCost(nanIfNull(generatorCreationInfos.getMarginalCost()))
456454
.withPlannedOutageRate(nanIfNull(generatorCreationInfos.getPlannedOutageRate()))
457455
.withForcedOutageRate(nanIfNull(generatorCreationInfos.getForcedOutageRate()))
@@ -460,10 +458,6 @@ private void createGeneratorStartUp(GeneratorCreationInfos generatorCreationInfo
460458
startupReports.add(ModificationUtils.getInstance().buildCreationReport(
461459
generatorCreationInfos.getPlannedActivePowerSetPoint(), "Planning active power set point"));
462460
}
463-
if (generatorCreationInfos.getStartupCost() != null) {
464-
startupReports.add(ModificationUtils.getInstance().buildCreationReport(
465-
generatorCreationInfos.getStartupCost(), "Startup cost"));
466-
}
467461
if (generatorCreationInfos.getMarginalCost() != null) {
468462
startupReports.add(ModificationUtils.getInstance().buildCreationReport(
469463
generatorCreationInfos.getMarginalCost(), "Marginal cost"));

src/main/java/org/gridsuite/modification/server/modifications/GeneratorModification.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -453,13 +453,11 @@ private void modifyGeneratorStartUpAttributes(GeneratorModificationInfos modific
453453
GeneratorStartup generatorStartup = generator.getExtension(GeneratorStartup.class);
454454
GeneratorStartupAdder generatorStartupAdder = generator.newExtension(GeneratorStartupAdder.class);
455455
boolean plannedActivePowerSetPointUpdated = addPlannedActivePowerSetPoint(modificationInfos, generatorStartupAdder, generatorStartup, reports);
456-
boolean startupCostUpdated = addStartupCost(modificationInfos, generatorStartupAdder, generatorStartup, reports);
457456
boolean marginalCostUpdated = addMarginalCost(modificationInfos, generatorStartupAdder, generatorStartup, reports);
458457
boolean plannedOutageRateUpdated = addPlannedOutageRate(modificationInfos, generatorStartupAdder, generatorStartup, reports);
459458
boolean forcedOutageRateUpdated = addForcedOutageRate(modificationInfos, generatorStartupAdder, generatorStartup, reports);
460459

461460
if (plannedActivePowerSetPointUpdated ||
462-
startupCostUpdated ||
463461
marginalCostUpdated ||
464462
plannedOutageRateUpdated ||
465463
forcedOutageRateUpdated) {
@@ -516,22 +514,6 @@ private boolean addMarginalCost(GeneratorModificationInfos modificationInfos, Ge
516514
return false;
517515
}
518516

519-
private boolean addStartupCost(GeneratorModificationInfos modificationInfos, GeneratorStartupAdder generatorStartupAdder, GeneratorStartup generatorStartup, List<Report> reports) {
520-
Double oldStartupCost = generatorStartup != null ? generatorStartup.getStartupCost() : Double.NaN;
521-
if (modificationInfos.getStartupCost() != null) {
522-
generatorStartupAdder
523-
.withStartupCost(modificationInfos.getStartupCost().getValue());
524-
reports.add(ModificationUtils.getInstance().buildModificationReport(oldStartupCost,
525-
modificationInfos.getStartupCost().getValue(),
526-
"Startup cost"));
527-
return true;
528-
} else {
529-
generatorStartupAdder
530-
.withStartupCost(oldStartupCost);
531-
}
532-
return false;
533-
}
534-
535517
private boolean addPlannedActivePowerSetPoint(GeneratorModificationInfos modificationInfos, GeneratorStartupAdder generatorStartupAdder, GeneratorStartup generatorStartup, List<Report> reports) {
536518
Double oldPlannedActivePowerSetPoint = generatorStartup != null ? generatorStartup.getPlannedActivePowerSetpoint() : Double.NaN;
537519
if (modificationInfos.getPlannedActivePowerSetPoint() != null) {
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
2+
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:pro="http://www.liquibase.org/xml/ns/pro" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/pro http://www.liquibase.org/xml/ns/pro/liquibase-pro-4.1.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.1.xsd">
3+
<changeSet author="rehiligha (generated)" id="1687267810063-5">
4+
<dropColumn columnName="STARTUP_COST" tableName="GENERATOR_CREATION"/>
5+
</changeSet>
6+
<changeSet author="rehiligha (generated)" id="1687267810063-6">
7+
<dropColumn columnName="STARTUP_COST" tableName="GENERATOR_MODIFICATION"/>
8+
</changeSet>
9+
<changeSet author="rehiligha (generated)" id="1687267810063-7">
10+
<dropColumn columnName="STARTUP_COST_OP" tableName="GENERATOR_MODIFICATION"/>
11+
</changeSet>
12+
</databaseChangeLog>

src/main/resources/db/changelog/db.changelog-master.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,4 +146,7 @@ databaseChangeLog:
146146
relativeToChangelogFile: true
147147
- include:
148148
file: changesets/changelog_20230529T102224Z.xml
149-
relativeToChangelogFile: true
149+
relativeToChangelogFile: true
150+
- include:
151+
file: changesets/changelog_20230620T132951Z.xml
152+
relativeToChangelogFile: true

src/test/java/org/gridsuite/modification/server/ModificationControllerTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,6 @@ public void createGeneratorWithStartup() {
530530
generatorStartup = network.getGenerator("idGenerator21").getExtension(GeneratorStartup.class);
531531
assertNotNull(generatorStartup);
532532
assertEquals(Double.NaN, generatorStartup.getPlannedActivePowerSetpoint(), 0);
533-
assertEquals(Double.NaN, generatorStartup.getStartupCost(), 0);
534533
assertEquals(8., generatorStartup.getMarginalCost(), 0);
535534
assertEquals(Double.NaN, generatorStartup.getPlannedOutageRate(), 0);
536535
assertEquals(Double.NaN, generatorStartup.getForcedOutageRate(), 0);
@@ -546,7 +545,6 @@ public void createGeneratorWithStartup() {
546545
generatorStartup = networkStoreService.getNetwork(TEST_NETWORK_BUS_BREAKER_ID).getGenerator("idGenerator3").getExtension(GeneratorStartup.class);
547546
assertNotNull(generatorStartup);
548547
assertEquals(Double.NaN, generatorStartup.getPlannedActivePowerSetpoint(), 0);
549-
assertEquals(Double.NaN, generatorStartup.getStartupCost(), 0);
550548
assertEquals(Double.NaN, generatorStartup.getMarginalCost(), 0);
551549
assertEquals(80., generatorStartup.getPlannedOutageRate(), 0);
552550
assertEquals(Double.NaN, generatorStartup.getForcedOutageRate(), 0);

src/test/java/org/gridsuite/modification/server/modifications/GeneratorCreationInBusBreakerTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ protected ModificationInfos buildModification() {
5656
.minimumReactivePower(20.0)
5757
.maximumReactivePower(25.0)
5858
.plannedActivePowerSetPoint(222.)
59-
.startupCost(301.)
6059
.marginalCost(0.50)
6160
.plannedOutageRate(.85)
6261
.forcedOutageRate(.96)
@@ -94,7 +93,6 @@ protected ModificationInfos buildModificationUpdate() {
9493
.minimumReactivePower(23.0)
9594
.maximumReactivePower(26.0)
9695
.plannedActivePowerSetPoint(111.)
97-
.startupCost(201.)
9896
.marginalCost(0.40)
9997
.plannedOutageRate(.45)
10098
.forcedOutageRate(.66)

0 commit comments

Comments
 (0)