Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
stgroup
ttc18
Commits
3f956822
Commit
3f956822
authored
Jul 18, 2018
by
Johannes Mey
Browse files
make random solver more reliable
parent
ce87f1ed
Changes
3
Hide whitespace changes
Inline
Side-by-side
jastadd-mquat-solver-random/src/main/java/de/tudresden/inf/st/mquat/solving/random/RandomSolver.java
View file @
3f956822
...
...
@@ -27,12 +27,11 @@ public class RandomSolver implements BenchmarkableSolver {
private
long
maxSolvingTime
;
private
boolean
timedOut
;
public
RandomSolver
()
{
this
(
Long
.
MAX_VALUE
);
}
private
final
Random
random
;
public
RandomSolver
(
long
maxSolvingTime
)
{
public
RandomSolver
(
long
maxSolvingTime
,
long
seed
)
{
this
.
maxSolvingTime
=
maxSolvingTime
;
this
.
random
=
new
Random
(
seed
);
reset
();
}
...
...
@@ -50,8 +49,6 @@ public class RandomSolver implements BenchmarkableSolver {
List
<
Solution
>
solutions
=
new
ArrayList
<>();
Random
random
=
new
Random
();
do
{
numTotalSoftwareSolutions
++;
...
...
jastadd-mquat-solver-random/src/test/java/de/tudresden/inf/st/mquat/solving/RandomHandwrittenTest.java
View file @
3f956822
...
...
@@ -6,6 +6,6 @@ public class RandomHandwrittenTest extends HandwrittenTestSuite {
@Override
protected
Solver
getSolver
()
{
return
new
RandomSolver
(
6
0000
);
return
new
RandomSolver
(
5
000
,
0
);
}
}
jastadd-mquat-solver-random/src/test/java/de/tudresden/inf/st/mquat/solving/RandomSolverTest.java
View file @
3f956822
...
...
@@ -42,7 +42,7 @@ public class RandomSolverTest {
ScenarioGenerator
generator
=
new
ScenarioGenerator
(
new
ScenarioDescription
(
tlc
,
iac
,
isd
,
cac
,
csd
,
dep
,
imp
,
res
,
req
,
cpu
,
seed
));
Root
model
=
generator
.
generate
();
RandomSolver
solver
=
new
RandomSolver
(
5000
);
RandomSolver
solver
=
new
RandomSolver
(
5000
,
1337
);
Solution
solution
=
solver
.
solve
(
model
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment