Skip to content

Commit 0578204

Browse files
author
matthias.thimm
committed
added customizable options for constructor.
1 parent 2a5fa9d commit 0578204

2 files changed

Lines changed: 8 additions & 2 deletions

File tree

org-tweetyproject-arg-rankings/src/main/java/org/tweetyproject/arg/rankings/reasoner/StrategyBasedRankingReasoner.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,7 @@ public double computeStrengthOfArgument(Argument a, DungTheory kb, Set<Set<Argum
122122
/*
123123
* Solve problem with simplex algorithm
124124
*/
125-
ApacheCommonsSimplex solver = new ApacheCommonsSimplex();
126-
solver.onlyPositive = true;
125+
ApacheCommonsSimplex solver = new ApacheCommonsSimplex(true);
127126
try {
128127
Map<Variable, Term> solution = solver.solve(problem);
129128
return solution.get(targetVar).doubleValue();

org-tweetyproject-math/src/main/java/org/tweetyproject/math/opt/solver/ApacheCommonsSimplex.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ public ApacheCommonsSimplex() {
7575
this(0.01);
7676
}
7777

78+
/** Constructor
79+
* @param precision Whether only positive solutions are allowed.
80+
*/
81+
public ApacheCommonsSimplex(boolean restrictToNonNegative) {
82+
this(50000,0.01,restrictToNonNegative);
83+
}
84+
7885
/** Constructor
7986
* @param precision The precision
8087
*/

0 commit comments

Comments
 (0)