@@ -148,8 +148,7 @@ function evolve!(state)
148148
149149 reqs = get_reqs_init! (reqs, qs, state)
150150
151- allocs =
152- get_allocs! (reqs, state. u, state, state[:, :transPriority ], state. p[:strategy ])
151+ allocs = get_allocs! (reqs, state. u, state, state[:, :transPriority ], state. p[:strategy ])
153152
154153 qs .= get_init_satisfied (allocs, qs, state)
155154
@@ -168,7 +167,13 @@ function evolve!(state)
168167 for i = 1 : nparts (state, :T )
169168 qs[i] != 0 && push! (
170169 state. ongoing_transitions,
171- Transition (string (state[i, :transName ]) * " _@$(state. t) " , get_sampled_transition (state, i), state. t, qs[i], 0.0 ),
170+ Transition (
171+ string (state[i, :transName ]) * " _@$(state. t) " ,
172+ get_sampled_transition (state, i),
173+ state. t,
174+ qs[i],
175+ 0.0 ,
176+ ),
172177 )
173178 end
174179
@@ -332,7 +337,7 @@ function ReactionNetworkProblem(
332337 transition_recipes = transitions
333338 u0_init = zeros (nparts (acs, :S ))
334339
335- for i in 1 : nparts (acs, :S )
340+ for i = 1 : nparts (acs, :S )
336341 if ! isnothing (acs[i, :specName ]) && haskey (u0, acs[i, :specName ])
337342 u0_init[i] = u0[acs[i, :specName ]]
338343 else
@@ -350,19 +355,17 @@ function ReactionNetworkProblem(
350355 ) ∪ [:transLHS , :transRHS , :transToSpawn , :transHash ]
351356 transitions = Dict {Symbol,Vector} (a => [] for a in transitions_attrs)
352357
353- sol = DataFrame (" t" => Float64[], (string (name) => Float64[] for name in acs[:, :specName ]). .. )
358+ sol = DataFrame (
359+ " t" => Float64[],
360+ (string (name) => Float64[] for name in acs[:, :specName ]). .. ,
361+ )
354362 network = ReactionNetworkProblem (
355363 name,
356364 acs,
357365 attrs,
358366 transition_recipes,
359- u0_init,
360- merge (
361- p,
362- Dict (
363- :strategy => get (keywords, :alloc_strategy , :weighted ),
364- ),
365- ),
367+ u0_init,
368+ merge (p, Dict (:strategy => get (keywords, :alloc_strategy , :weighted ))),
366369 keywords[:tspan ][1 ],
367370 keywords[:tspan ],
368371 get (keywords, :tstep , 1 ),
@@ -371,7 +374,7 @@ function ReactionNetworkProblem(
371374 log,
372375 observables,
373376 wrap_fun,
374- sol
377+ sol,
375378 )
376379
377380 save! (network)
@@ -387,7 +390,7 @@ function AlgebraicAgents._reinit!(state::ReactionNetworkProblem)
387390 state. observables = compile_observables (state. acs)
388391 empty! (state. sol)
389392
390- state
393+ return state
391394end
392395
393396function AlgebraicAgents. _step! (state:: ReactionNetworkProblem )
@@ -400,20 +403,24 @@ function AlgebraicAgents._step!(state::ReactionNetworkProblem)
400403
401404 push! (
402405 state. log,
403- (:valuation , state. t, state. u' * [state[i, :specValuation ] for i = 1 : nparts (state, :S )]),
406+ (
407+ :valuation ,
408+ state. t,
409+ state. u' * [state[i, :specValuation ] for i = 1 : nparts (state, :S )],
410+ ),
404411 )
405412
406413 save! (state)
407414 return state. t += state. dt
408415end
409416
410417function AlgebraicAgents. _projected_to (state:: ReactionNetworkProblem )
411- state. t > state. tspan[2 ] ? true : state. t
418+ return state. t > state. tspan[2 ] ? true : state. t
412419end
413420
414421function fetch_params (acs:: ReactionNetworkSchema )
415422 return Dict {Symbol,Any} ((
416423 acs[i, :prmName ] => acs[i, :prmVal ] for
417424 i in Iterators. filter (i -> ! isnothing (acs[i, :prmVal ]), 1 : nparts (acs, :P ))
418425 ))
419- end
426+ end
0 commit comments