Skip to content

Commit 93fb140

Browse files
Merge pull request #102 from SciML/fixstochtests
Add seed for SAMIN test
2 parents 82f19ee + e08805c commit 93fb140

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

Project.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
5151
NLopt = "76087f3c-5699-56af-9a33-bf431cd00edd"
5252
OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed"
5353
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
54+
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
5455
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
5556
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
5657

5758
[targets]
58-
test = ["BlackBoxOptim", "Evolutionary", "DiffEqFlux", "IterTools", "OrdinaryDiffEq", "NLopt", "CMAEvolutionStrategy", "Pkg", "SafeTestsets", "Test"]
59+
test = ["BlackBoxOptim", "Evolutionary", "DiffEqFlux", "IterTools", "OrdinaryDiffEq", "NLopt", "CMAEvolutionStrategy", "Pkg", "Random","SafeTestsets", "Test"]

test/rosenbrock.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
using GalacticOptim, Optim, Test
1+
using GalacticOptim, Optim, Test, Random
22

33
rosenbrock(x, p) = (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2
44
x0 = zeros(2)
@@ -10,6 +10,7 @@ prob = OptimizationProblem(f, x0, _p)
1010
sol = solve(prob, SimulatedAnnealing())
1111
@test 10*sol.minimum < l1
1212

13+
Random.seed!(1234)
1314
prob = OptimizationProblem(f, x0, _p, lb=[-1.0, -1.0], ub=[0.8, 0.8])
1415
sol = solve(prob, SAMIN())
1516
@test 10*sol.minimum < l1

0 commit comments

Comments
 (0)