Skip to content

Commit

Permalink
Merge branch 'master' into ansible2
Browse files Browse the repository at this point in the history
Conflicts:
	iidm-ddb/iidm-ddb-ejb-remote-client-wildfly/pom.xml
  • Loading branch information
Christian Biasuzzi committed Feb 1, 2017
2 parents a5da5b7 + cf13009 commit b12e380
Show file tree
Hide file tree
Showing 244 changed files with 3,680 additions and 74,969 deletions.
7 changes: 5 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ jdk:
install:
# Build iPST core
- git clone https://github.com/itesla/ipst-core itesla/ipst-core
- cd itesla/ipst-core && mvn install
- pushd itesla/ipst-core && mvn install && popd

# Build iPST entsoe
- git clone https://github.com/itesla/ipst-entsoe itesla/ipst-entsoe
- pushd itesla/ipst-entsoe && mvn install && popd

script:
- cd ${TRAVIS_BUILD_DIR}
- mvn clean test jacoco:report coveralls:report

9 changes: 7 additions & 2 deletions EU2Mod_MB/src/main/java/itesla/converter/ModelicaModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ public void BlocksDeclaration(){
} else if(Blocks[i].idEu == 23)
{
modelDeclaration = " " + model.pathModelica + " " + "Max" + "_" + Blocks[i].GraphicalNumber.toString();
} else
} else
{
modelDeclaration = " " + model.pathModelica + " " + model.nameModelica + "_" + Blocks[i].GraphicalNumber.toString();
}
Expand Down Expand Up @@ -427,7 +427,12 @@ public void BlocksDeclaration(){
if(Blocks[i].idEu.equals(6))
{
modelParameters = modelParameters + model.param.get(j) + "=" + "init_" + Blocks[i].GraphicalNumber.toString() + ", "+ "initType = Modelica.Blocks.Types.Init.SteadyState";
} else
}
else if(Blocks[i].idEu.equals(9))
{
modelParameters = modelParameters + model.param.get(j) + "=" + "init_" + Blocks[i].GraphicalNumber.toString() + ", "+ "initType = Modelica.Blocks.Types.Init.InitialOutput";
}
else
{
modelParameters = modelParameters + model.param.get(j) + "=" + "init_" + Blocks[i].GraphicalNumber.toString();
}
Expand Down
2 changes: 1 addition & 1 deletion EU2Mod_MB/src/main/resources/CorrespondenceTable.csv
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ EU num;Eurostag Name;nInputPins;Modelica model;param 1;param 2;param 3;param 4;p
6; SIMPLE-LAG;1;iPSL.NonElectrical.Continuous.SimpleLag;K;T;;;;;;y_start;
7; LIMITED-INTEGRATOR;1;Modelica.Blocks.Continuous.LimIntegrator;outMax;k;outMin;;;;;y_start;
8; LIMITED-SIMPLE-LAG;1;iPSL.NonElectrical.Continuous.SimpleLagLim;outMax;K;T;outMin;;;;y_start;
9; DERIVATIVE-LAG;1;iPSL.NonElectrical.Continuous.DerivativeLag;K;T;y_start;;;;;x_start;
9; DERIVATIVE-LAG;1;Modelica.Blocks.Continuous.Derivative;k;T;y_start;;;;;x_start;
10; LEAD-LAG;1;iPSL.NonElectrical.Continuous.LeadLag;K;T1;T2;;;;;y_start;
11; CONSTANT;0;Modelica.Blocks.Sources.Constant;k;;;;;;;;
12; EXPONENTIAL;1;iPSL.NonElectrical.Eurostag.Math.ImExponential;A;B;;;;;;;
Expand Down
4 changes: 3 additions & 1 deletion EU2Mod_MB/src/test/java/itesla/test/iTesla.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import java.io.IOException;
import java.util.HashMap;
import java.nio.file.Paths;
import java.util.List;
import java.util.Map;
import org.junit.Test;
Expand All @@ -21,7 +22,8 @@ public class iTesla {
@Test
public void test() throws IOException {
String pathFRM = getClass().getResource("/edftur1c.frm").toString();
String pathOUT = getClass().getResource("/output").toString();
String pathOUT = getClass().getResource("/output").toString();

converter = new Converter(pathFRM, pathOUT, false);
converter_init = new Converter(pathFRM, pathOUT, true);
try {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ In order to build iPST you need:
* CMake *(2.6 or greater)*
* Recent C++ compiler (GNU g++ or Clang)
* [ipst-core](https://github.com/itesla/ipst-core)
* [ipst-entsoe](https://github.com/itesla/ipst-entsoe)

Optional C++ modules requires:
* Intel Fortran Compiler
Expand Down
8 changes: 5 additions & 3 deletions ampl-export/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,21 @@
<name>AMPL export</name>

<dependencies>
<!-- Compilation dependencies -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>eu.itesla_project</groupId>
<artifactId>iidm-converter-api</artifactId>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<groupId>eu.itesla_project</groupId>
<artifactId>network-merge</artifactId>
<version>${project.version}</version>
</dependency>

<!-- Test dependencies -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1201,14 +1201,20 @@ private void writeShunts(AmplExportContext context) throws IOException {

private void writeStaticVarCompensators(AmplExportContext context) throws IOException {
try (TableFormatter formatter = new AmplDatTableFormatter(
new OutputStreamWriter(dataSource.newOutputStream("_network_static_var_compensatiors", "txt", append), StandardCharsets.UTF_8),
new OutputStreamWriter(dataSource.newOutputStream("_network_static_var_compensators", "txt", append), StandardCharsets.UTF_8),
getTableTitle("Static VAR compensators"),
INVALID_FLOAT_VALUE,
!append,
LOCALE)) {
LOCALE,
new Column("num"),
new Column("id"))) {
List<String> skipped = new ArrayList<>();
for (StaticVarCompensator svc : network.getStaticVarCompensators()) {
throw new UnsupportedOperationException(); // FIXME
// FIXME
String id = svc.getId();
int num = mapper.getInt(AmplSubset.STATIC_VAR_COMPENSATOR, id);
formatter.writeCell(num)
.writeCell(id);
}
if (skipped.size() > 0) {
LOGGER.trace("Skip static VAR compensators {} because not connected and not connectable", skipped);
Expand Down Expand Up @@ -1390,10 +1396,16 @@ private void writeHVDCLines(AmplExportContext context) throws IOException {
getTableTitle("HVDC lines"),
INVALID_FLOAT_VALUE,
!append,
LOCALE)) {
LOCALE,
new Column("num"),
new Column("id"))) {
List<String> skipped = new ArrayList<>();
for (HvdcLine hvdcLine : network.getHvdcLines()) {
throw new UnsupportedOperationException(); // FIXME
// FIXME
String id = hvdcLine.getId();
int num = mapper.getInt(AmplSubset.HVDC_LINE, id);
formatter.writeCell(num)
.writeCell(id);
}
if (skipped.size() > 0) {
LOGGER.trace("Skip HVDC lines {} because not connected and not connectable", skipped);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import eu.itesla_project.commons.util.IntCounter;

/**
*
* @author Geoffroy Jamgotchian <geoffroy.jamgotchian at rte-france.com>
*/
public enum AmplSubset implements IntCounter {
Expand All @@ -28,11 +27,13 @@ public enum AmplSubset implements IntCounter {
THREE_WINDINGS_TRANSFO(1),
FAULT(1),
CURATIVE_ACTION(1),
PREVENTIVE_ACTION(1);
PREVENTIVE_ACTION(1),
STATIC_VAR_COMPENSATOR(1),
HVDC_LINE(1);

private final int initialValue;

private AmplSubset(int initialValue) {
AmplSubset(int initialValue) {
this.initialValue = initialValue;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,12 @@ public static void fillMapper(StringToIntMapper<AmplSubset> mapper, Network netw
mapper.newInt(AmplSubset.GENERATOR, g.getId());
}

// static var compensators
network.getStaticVarCompensatorStream().forEach(svc -> mapper.newInt(AmplSubset.STATIC_VAR_COMPENSATOR, svc.getId()));

// HVDC lines
network.getHvdcLineStream().forEach(hvdc -> mapper.newInt(AmplSubset.HVDC_LINE, hvdc.getId()));

// limits
for (Line l : network.getLines()) {
if (l.getCurrentLimits1() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
import eu.itesla_project.iidm.datasource.MemDataSource;
import eu.itesla_project.iidm.network.Network;
import eu.itesla_project.iidm.network.test.EurostagTutorialExample1Factory;
import eu.itesla_project.iidm.network.test.HvdcTestNetwork;
import eu.itesla_project.iidm.network.test.SvcTestCaseFactory;
import org.junit.Test;

import java.io.IOException;
Expand All @@ -29,7 +31,7 @@ private void assertEqualsToRef(MemDataSource dataSource, String suffix, String r
}

@Test
public void write() throws Exception {
public void writeEurostag() throws Exception {
Network network = EurostagTutorialExample1Factory.create();

MemDataSource dataSource = new MemDataSource();
Expand All @@ -47,4 +49,36 @@ public void write() throws Exception {
assertEqualsToRef(dataSource, "_network_limits", "eurostag-tutorial-example1-limits.txt");
}

@Test
public void writeSVC() throws Exception {
Network network = SvcTestCaseFactory.create();

MemDataSource dataSource = new MemDataSource();
new AmplNetworkWriter(network, dataSource, new AmplExportConfig(AmplExportConfig.ExportScope.ALL, true, AmplExportConfig.ExportActionType.CURATIVE))
.write();

assertEqualsToRef(dataSource, "_network_static_var_compensators", "svc-test-case.txt");
}

@Test
public void writeLcc() throws Exception {
Network network = HvdcTestNetwork.createLcc();

MemDataSource dataSource = new MemDataSource();
new AmplNetworkWriter(network, dataSource, new AmplExportConfig(AmplExportConfig.ExportScope.ALL, true, AmplExportConfig.ExportActionType.CURATIVE))
.write();

assertEqualsToRef(dataSource, "_network_hvdc", "lcc-test-case.txt");
}

@Test
public void writeVsc() throws Exception {
Network network = HvdcTestNetwork.createVsc();

MemDataSource dataSource = new MemDataSource();
new AmplNetworkWriter(network, dataSource, new AmplExportConfig(AmplExportConfig.ExportScope.ALL, true, AmplExportConfig.ExportActionType.CURATIVE))
.write();

assertEqualsToRef(dataSource, "_network_hvdc", "vsc-test-case.txt");
}
}
3 changes: 3 additions & 0 deletions ampl-export/src/test/resources/lcc-test-case.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#HVDC lines (hvdctest/InitialState)
#"num" "id"
1 "L"
3 changes: 3 additions & 0 deletions ampl-export/src/test/resources/svc-test-case.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#Static VAR compensators (svcTestCase/InitialState)
#"num" "id"
1 "SVC2"
3 changes: 3 additions & 0 deletions ampl-export/src/test/resources/vsc-test-case.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#HVDC lines (hvdctest/InitialState)
#"num" "id"
1 "L"
62 changes: 0 additions & 62 deletions cim1-import/pom.xml

This file was deleted.

This file was deleted.

0 comments on commit b12e380

Please sign in to comment.