From 7210674d773890b74777c99a8c811de6217e8c96 Mon Sep 17 00:00:00 2001 From: Nikolai Date: Mon, 31 Aug 2020 10:47:05 +0300 Subject: [PATCH] virgo-solver with travis and codecov setup --- .travis.yml | 3 ++- README.md | 2 ++ pom.xml | 5 +++-- src/main/java/ru/itmo/ctlab/virgo/Main.java | 2 +- .../ru/itmo/ctlab/gmwcs/solver/preprocessing/Preprocessor.kt | 5 +++-- src/test/java/ru/itmo/ctlab/virgo/gmwcs/GMWCSTest.java | 1 + src/test/java/ru/itmo/ctlab/virgo/sgmwcs/SGMWCSTest.java | 3 +++ 7 files changed, 15 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index da8ab03..576e321 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/README.md b/README.md index 07d2f4c..63d700f 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/pom.xml b/pom.xml index 1972bc2..aebfeb3 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,6 @@ ifmo.ru virgo-solver - 0.1.0 @@ -57,6 +56,7 @@ default-report + prepare-package report @@ -69,6 +69,7 @@ 2.19.1 + @{argLine} -Djava.library.path=${java.library.path} -Xmx512m -Xms512m @@ -105,7 +106,7 @@ default-testCompile - none + test-compile testCompile diff --git a/src/main/java/ru/itmo/ctlab/virgo/Main.java b/src/main/java/ru/itmo/ctlab/virgo/Main.java index 7fba752..c88088b 100644 --- a/src/main/java/ru/itmo/ctlab/virgo/Main.java +++ b/src/main/java/ru/itmo/ctlab/virgo/Main.java @@ -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 { diff --git a/src/main/kotlin/ru/itmo/ctlab/gmwcs/solver/preprocessing/Preprocessor.kt b/src/main/kotlin/ru/itmo/ctlab/gmwcs/solver/preprocessing/Preprocessor.kt index 2acfb75..57b09dc 100644 --- a/src/main/kotlin/ru/itmo/ctlab/gmwcs/solver/preprocessing/Preprocessor.kt +++ b/src/main/kotlin/ru/itmo/ctlab/gmwcs/solver/preprocessing/Preprocessor.kt @@ -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 @@ -43,7 +43,8 @@ class ReductionSequence(private val step: Step, private val reduction: Reduction, 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) } diff --git a/src/test/java/ru/itmo/ctlab/virgo/gmwcs/GMWCSTest.java b/src/test/java/ru/itmo/ctlab/virgo/gmwcs/GMWCSTest.java index da1194f..702853f 100644 --- a/src/test/java/ru/itmo/ctlab/virgo/gmwcs/GMWCSTest.java +++ b/src/test/java/ru/itmo/ctlab/virgo/gmwcs/GMWCSTest.java @@ -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) { diff --git a/src/test/java/ru/itmo/ctlab/virgo/sgmwcs/SGMWCSTest.java b/src/test/java/ru/itmo/ctlab/virgo/sgmwcs/SGMWCSTest.java index c43ac15..82f15a6 100644 --- a/src/test/java/ru/itmo/ctlab/virgo/sgmwcs/SGMWCSTest.java +++ b/src/test/java/ru/itmo/ctlab/virgo/sgmwcs/SGMWCSTest.java @@ -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(); @@ -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);