Skip to content

Commit

Permalink
chore: Use fromInput method to pass input directly to LpFileParser
Browse files Browse the repository at this point in the history
  • Loading branch information
Elscrux committed Dec 29, 2024
1 parent c983324 commit 42f2b02
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation 'org.springdoc:springdoc-openapi-starter-webflux-ui:2.0.4'
implementation 'com.bpodgursky:jbool_expressions:1.24'
implementation 'com.github.ProvideQ.jplex:input:ad6a034668'
implementation 'com.github.ProvideQ.jplex:input:703b4d0086'
implementation files('lib/de.ovgu.featureide.lib.fm-v3.9.1.jar', 'lib/uvl-parser.jar')
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.mockito:mockito-core:5.+'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
import edu.kit.provideq.toolbox.meta.setting.SolverSetting;
import edu.kit.provideq.toolbox.meta.setting.basic.TextSetting;
import edu.kit.provideq.toolbox.qubo.QuboConfiguration;
import java.io.BufferedReader;
import java.io.StringReader;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -62,12 +60,8 @@ public Mono<Solution<String>> solve(
return Mono.just(Solution.failed(this, "No PlanQK token provided."));
}

// Convert problem data string to buffered reader
var problemDataReader = new BufferedReader(new StringReader(input));
// Parse lp data
LpFileReader lpReader = new LpFileReader(problemDataReader);

KipuQuboProblem kipuQubo;
LpFileReader lpReader = LpFileReader.fromInput(input);
try {
kipuQubo = parseKipuQubo(lpReader);
} catch (ConversionException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
import edu.kit.provideq.toolbox.meta.setting.SolverSetting;
import edu.kit.provideq.toolbox.meta.setting.basic.TextSetting;
import edu.kit.provideq.toolbox.qubo.QuboConfiguration;
import java.io.BufferedReader;
import java.io.StringReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Optional;
Expand Down Expand Up @@ -61,12 +59,8 @@ public Mono<Solution<String>> solve(
return Mono.just(Solution.failed(this, "No PlanQK token provided."));
}

// Convert problem data string to buffered reader
var problemDataReader = new BufferedReader(new StringReader(input));
// Parse lp data
LpFileReader lpReader = new LpFileReader(problemDataReader);

QuantagoniaQuboProblem quantagoniaQubo;
LpFileReader lpReader = LpFileReader.fromInput(input);
try {
quantagoniaQubo = parseQuantagoniaQubo(lpReader);
} catch (ConversionException e) {
Expand Down

0 comments on commit 42f2b02

Please sign in to comment.