|
12 | 12 | import java.util.concurrent.Future; |
13 | 13 | import java.util.concurrent.TimeUnit; |
14 | 14 | import java.util.concurrent.TimeoutException; |
15 | | -import java.util.concurrent.atomic.AtomicLong; |
16 | 15 |
|
17 | 16 | import org.json.JSONException; |
18 | | -import org.springframework.http.ResponseEntity; |
19 | | -import org.springframework.web.bind.annotation.CrossOrigin; |
20 | | -import org.springframework.web.bind.annotation.GetMapping; |
21 | 17 | import org.springframework.web.bind.annotation.PostMapping; |
22 | 18 | import org.springframework.web.bind.annotation.RestController; |
23 | 19 | import org.tweetyproject.arg.dung.syntax.DungTheory; |
|
26 | 22 | import org.tweetyproject.commons.Parser; |
27 | 23 | import org.tweetyproject.commons.ParserException; |
28 | 24 | import org.tweetyproject.logics.commons.analysis.InconsistencyMeasure; |
| 25 | +import org.tweetyproject.logics.commons.analysis.NaiveMusEnumerator; |
29 | 26 | import org.tweetyproject.logics.fol.parser.FolParser; |
30 | 27 | import org.tweetyproject.logics.fol.syntax.FolFormula; |
31 | 28 | import org.tweetyproject.logics.fol.syntax.Negation; |
32 | 29 | import org.tweetyproject.logics.pl.analysis.InconsistencyMeasureFactory; |
33 | 30 | import org.tweetyproject.logics.pl.analysis.InconsistencyMeasureFactory.Measure; |
34 | 31 | import org.tweetyproject.logics.pl.parser.PlParserFactory; |
35 | 32 | import org.tweetyproject.logics.pl.parser.PlParserFactory.Format; |
| 33 | +import org.tweetyproject.logics.pl.sat.PlMusEnumerator; |
| 34 | +import org.tweetyproject.logics.pl.sat.Sat4jSolver; |
| 35 | +import org.tweetyproject.logics.pl.sat.SatSolver; |
36 | 36 | import org.tweetyproject.logics.pl.syntax.PlBeliefSet; |
37 | 37 | import org.tweetyproject.logics.pl.syntax.PlFormula; |
38 | 38 | import org.tweetyproject.logics.pl.syntax.PlSignature; |
| 39 | +import org.tweetyproject.math.opt.solver.ApacheCommonsSimplex; |
| 40 | +import org.tweetyproject.math.opt.solver.GlpkSolver; |
| 41 | +import org.tweetyproject.math.opt.solver.Solver; |
39 | 42 | import org.tweetyproject.web.TweetyServer; |
40 | 43 | import org.tweetyproject.web.pyargservices.dung.AbstractExtensionReasonerFactory; |
41 | 44 | import org.tweetyproject.web.pyargservices.dung.DungReasonerCalleeFactory; |
|
50 | 53 | import org.tweetyproject.web.services.InconsistencyMeasurementService; |
51 | 54 | import org.springframework.web.bind.annotation.ResponseBody; |
52 | 55 | import org.springframework.web.bind.annotation.RequestBody; |
53 | | -import org.springframework.web.bind.annotation.RequestParam; |
54 | 56 | import org.tweetyproject.arg.delp.parser.DelpParser; |
55 | 57 | import org.tweetyproject.arg.delp.reasoner.DelpReasoner; |
56 | 58 | import org.tweetyproject.arg.delp.semantics.ComparisonCriterion; |
@@ -261,6 +263,12 @@ private InconsistencyValueResponse handleGetICMESValue(InconsistencyPost query) |
261 | 263 | int user_timeout = Utils.checkUserTimeout(query.getTimeout(), SERVICES_TIMEOUT_INCMES, unit); |
262 | 264 | // if(!query.has(InconsistencyMeasurementService.JSON_ATTR_MEASURE)) |
263 | 265 | // throw new JSONException("Malformed JSON: no \"measure\" attribute given"); |
| 266 | + // set sub-solvers |
| 267 | + SatSolver.setDefaultSolver(new Sat4jSolver()); |
| 268 | + PlMusEnumerator.setDefaultEnumerator(new NaiveMusEnumerator<PlFormula>(new Sat4jSolver())); |
| 269 | + Solver.setDefaultLinearSolver(new ApacheCommonsSimplex()); |
| 270 | + Solver.setDefaultIntegerLinearSolver(new GlpkSolver()); |
| 271 | + // get measure |
264 | 272 | InconsistencyMeasure<BeliefSet<PlFormula,?>> measure = |
265 | 273 | InconsistencyMeasureFactory.getInconsistencyMeasure( |
266 | 274 | Measure.getMeasure(query.getMeasure())); |
|
0 commit comments