Skip to content

Commit f19582b

Browse files
committed
test up
1 parent cf83b4a commit f19582b

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

test/spatial_reaction_systems/lattice_reaction_systems_jumps.jl

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,19 @@ let
102102
end
103103
end
104104

105-
### ABC Model Test (from JumpProcesses) ###
105+
### Tests taken from JumpProcesses ###
106+
107+
# ABC Model Test
106108
let
107109
# Preparations (stuff used in JumpProcesses examples ported over here, could be written directly into code).
108110
Nsims = 100
109111
reltol = 0.05
110-
non_spatial_mean = [65.7395, 65.7395, 434.2605] #mean of 10,000 simulations
112+
non_spatial_mean = [65.7395, 65.7395, 434.2605] # Mean of 10,000 simulations.
111113
dim = 1
112114
linear_size = 5
113115
num_nodes = linear_size^dim
114116
dims = Tuple(repeat([linear_size], dim))
115-
domain_size = 1.0 #μ-meter
117+
domain_size = 1.0 # μ-meter.
116118
mesh_size = domain_size / linear_size
117119
rates = [0.1 / mesh_size, 1.0]
118120
diffusivity = 1.0
@@ -128,15 +130,16 @@ let
128130
lattice = Graphs.grid(dims)
129131
lrs = LatticeReactionSystem(rn, [tr_1, tr_2, tr_3], lattice)
130132

131-
# Set simulation parameters and create problems
133+
# Set simulation parameters and create problems.
132134
u0 = [:A => [0,0,500,0,0], :B => [0,0,500,0,0], :C => 0]
133135
tspan = (0.0, 10.0)
134136
pV = [:kB => rates[1], :kD => rates[2]]
135137
pE = [:D => diffusivity]
136138
dprob = DiscreteProblem(lrs, u0, tspan, (pV, pE))
137-
jump_problems = [JumpProblem(lrs, dprob, alg(); save_positions = (false, false)) for alg in [NSM, DirectCRDirect]] # NRM doesn't work. Might need Cartesian grid.
139+
# NRM could be added, but doesn't work. Might need Cartesian grid.
140+
jump_problems = [JumpProblem(lrs, dprob, alg(); save_positions = (false, false)) for alg in [NSM, DirectCRDirect]]
138141

139-
# Tests.
142+
# Run tests.
140143
function get_mean_end_state(jump_prob, Nsims)
141144
end_state = zeros(size(jump_prob.prob.u0))
142145
for i in 1:Nsims

0 commit comments

Comments
 (0)