Skip to content

Commit

Permalink
removed parameters from input class
Browse files Browse the repository at this point in the history
Signed-off-by: CHEN Roxane <[email protected]>
  • Loading branch information
CHEN Roxane committed Dec 11, 2024
1 parent c784265 commit 4a3ee38
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
package com.powsybl.openrao.raoapi;

import com.powsybl.openrao.commons.TemporalData;
import com.powsybl.openrao.raoapi.parameters.RaoParameters;

import java.time.OffsetDateTime;
import java.util.Set;
Expand All @@ -20,27 +19,21 @@
*/
public class InterTemporalRaoInput {
private final TemporalData<RaoInput> raoInputs;
private final RaoParameters parameters;
private final Set<OffsetDateTime> timestampsToRun;

public InterTemporalRaoInput(TemporalData<RaoInput> raoInputs, RaoParameters parameters, Set<OffsetDateTime> timestampsToRun) {
public InterTemporalRaoInput(TemporalData<RaoInput> raoInputs, Set<OffsetDateTime> timestampsToRun) {
this.raoInputs = raoInputs;
this.parameters = parameters;
this.timestampsToRun = timestampsToRun;
}

public InterTemporalRaoInput(TemporalData<RaoInput> raoInputs, RaoParameters parameters) {
this(raoInputs, parameters, raoInputs.getTimestamps().stream().collect(Collectors.toSet()));
public InterTemporalRaoInput(TemporalData<RaoInput> raoInputs) {
this(raoInputs, raoInputs.getTimestamps().stream().collect(Collectors.toSet()));
}

public TemporalData<RaoInput> getRaoInputs() {
return raoInputs;
}

public RaoParameters getParameters() {
return parameters;
}

public Set<OffsetDateTime> getTimestampsToRun() {
return timestampsToRun;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@

import com.powsybl.openrao.commons.TemporalData;
import com.powsybl.openrao.commons.TemporalDataImpl;
import com.powsybl.openrao.raoapi.parameters.RaoParameters;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.Mockito;
Expand All @@ -27,15 +26,13 @@
*/
class InterTemporalRaoInputTest {

private RaoParameters params;
private OffsetDateTime timestamp1;
private OffsetDateTime timestamp2;
private OffsetDateTime timestamp3;
private TemporalData<RaoInput> temporalData;

@BeforeEach
void setUp() {
params = new RaoParameters();
RaoInput raoInput1 = Mockito.mock(RaoInput.class);
RaoInput raoInput2 = Mockito.mock(RaoInput.class);
RaoInput raoInput3 = Mockito.mock(RaoInput.class);
Expand All @@ -47,16 +44,14 @@ void setUp() {

@Test
void testInstantiateInterTemporalRaoInput() {
InterTemporalRaoInput input = new InterTemporalRaoInput(temporalData, params, Set.of(timestamp1, timestamp3));
assertEquals(params, input.getParameters());
InterTemporalRaoInput input = new InterTemporalRaoInput(temporalData, Set.of(timestamp1, timestamp3));
assertEquals(temporalData, input.getRaoInputs());
assertEquals(Set.of(timestamp1, timestamp3), input.getTimestampsToRun());
}

@Test
void testInstantiateInterTemporalRaoInputAllTimestamps() {
InterTemporalRaoInput input = new InterTemporalRaoInput(temporalData, params);
assertEquals(params, input.getParameters());
InterTemporalRaoInput input = new InterTemporalRaoInput(temporalData);
assertEquals(temporalData, input.getRaoInputs());
assertEquals(Set.of(timestamp1, timestamp2, timestamp3), input.getTimestampsToRun());
}
Expand Down

0 comments on commit 4a3ee38

Please sign in to comment.