Skip to content

Commit

Permalink
virgo-solver with travis and codecov setup
Browse files Browse the repository at this point in the history
  • Loading branch information
np96 committed Aug 31, 2020
1 parent cfa34dd commit 7210674
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,10 @@ install:
script:
- mvn install -DskipTests=true
- java -Djava.library.path=lib/lib -cp lib/lib/cplex.jar:target/virgo-solver.jar ru.itmo.ctlab.virgo.Main -type sgmwcs -n examples/sgmwcs-1450/nodes -e examples/sgmwcs-1450/edges -s examples/sgmwcs-1450/signals
- mvn -Djava.library.path=lib/lib test
- mvn -Djava.library.path=lib/lib test -B

after_success:
- mvn jacoco:report
- bash <(curl -s https://codecov.io/bash)

deploy:
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ This is a common solver for SGMWCS and GMWCS problems.

[![Build Status](https://travis-ci.org/ctlab/virgo-solver.svg?branch=master)](https://travis-ci.org/ctlab/virgo-solver)

[![codecov](https://codecov.io/gh/ctlab/virgo-solver/branch/master/graph/badge.svg)](https://codecov.io/gh/ctlab/virgo-solver)

See [releases](https://github.com/ctlab/virgo-solver/releases) to get built jar files.

# Problem
Expand Down
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<groupId>ifmo.ru</groupId>
<artifactId>virgo-solver</artifactId>


<version>0.1.0</version>

<properties>
Expand Down Expand Up @@ -57,6 +56,7 @@
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
Expand All @@ -69,6 +69,7 @@
<version>2.19.1</version>
<configuration>
<argLine>
@{argLine}
-Djava.library.path=${java.library.path}
-Xmx512m
-Xms512m
Expand Down Expand Up @@ -105,7 +106,7 @@
</execution>
<execution>
<id>default-testCompile</id>
<phase>none</phase>
<phase>test-compile</phase>
<goals>
<goal>testCompile</goal>
</goals>
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ru/itmo/ctlab/virgo/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import static java.util.Arrays.asList;

public class Main {
public static final String VERSION = "0.9.9";
public static final String VERSION = "0.1.1";

static {
/*try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import java.util.stream.Stream
* Created by Nikolay Poperechnyi on 03/10/2017.
*/

private var logLevel = 1
private var logLevel = 0

private var threads: Int = 1

Expand Down Expand Up @@ -43,7 +43,8 @@ class ReductionSequence<T : Elem>(private val step: Step<T>,
private val reduction: Reduction<T>,
private val redName: String) {
fun apply(graph: Graph):Int {
println("Running rule $redName")
if (logLevel > 1)
println("Running rule $redName")
val res = step(graph, mutableSetOf())
return reduction(graph, res)
}
Expand Down
1 change: 1 addition & 0 deletions src/test/java/ru/itmo/ctlab/virgo/gmwcs/GMWCSTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class GMWCSTest {
public GMWCSTest() {
random = new Random(SEED);
this.solver = new BicomponentSolver();
solver.suppressOutput();
tests = new ArrayList<>();
referenceSolver = new ReferenceSolver();
if (System.getProperty("skipTests") != null) {
Expand Down
3 changes: 3 additions & 0 deletions src/test/java/ru/itmo/ctlab/virgo/sgmwcs/SGMWCSTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public SGMWCSTest() {
random = new Random(SEED);
solver = new ComponentSolver(3, false);
solver.setPreprocessingLevel(2);
solver.setLogLevel(0);
tests = new ArrayList<>();
referenceSolver = new ReferenceSolver();
rltSolver = new RLTSolver();
Expand Down Expand Up @@ -158,8 +159,10 @@ public void test05_minimization() {
try {
var minimizing = new ComponentSolver(3, true);
minimizing.setPreprocessingLevel(2);
minimizing.setLogLevel(0);
var ordinary = new ComponentSolver(3, false);
ordinary.setPreprocessingLevel(2);
ordinary.setLogLevel(0);
var ord = ordinary.solve(test.graph(), s);
var min = minimizing.solve(test.graph(), s);
var delta = s.sum(ord) - s.sum(min);
Expand Down

0 comments on commit 7210674

Please sign in to comment.