Skip to content

Commit

Permalink
Agrego la carpeta target al gitignore, agrego encoding al pom y metod…
Browse files Browse the repository at this point in the history
…o para rescatar las variables del solver con su respectivo test
  • Loading branch information
Juam committed Jun 27, 2018
1 parent 96104e7 commit d41db22
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ ehthumbs.db
Desktop.ini
# Compiled class file
*.class
target/

# Log file
*.log
Expand Down
4 changes: 4 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@
</plugin>
</plugins>
</build>

<properties>
<project.build.sourceEncoding>iso-8859-1</project.build.sourceEncoding>
</properties>
<dependencies>

<dependency>
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/ch/nexpose/simplex/SimplexSolver.java
Original file line number Diff line number Diff line change
Expand Up @@ -389,4 +389,8 @@ private long faculty(int n)
}
return m;
}

public double getResultadoVariable(String xName) {
return schema[getIndexOf(xName)][cIndex];
}
}
5 changes: 4 additions & 1 deletion src/test/java/ch/nexpose/simplex/tests/SolverTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public class SolverTests {

public String readAllText(String filename)
{
String p = "C:/your/repository/route/Simplex-Solucion/LP_problems/"+filename+".csv";
String p = "LP_problems/"+filename+".csv";
Path path = Paths.get(p);

String contents = "Not Data";
Expand Down Expand Up @@ -55,6 +55,9 @@ public void basicExampleTest() {
double expected = 26.0;

assertEquals(expected, result, EPSILON);

double expectedX1 = 4.857142857142857;
assertEquals(expectedX1, solver.getResultadoVariable("X1"), EPSILON);
}

@Test
Expand Down

0 comments on commit d41db22

Please sign in to comment.