Skip to content

Commit

Permalink
make named tuple outputs consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdfish committed Aug 27, 2024
1 parent c5196e5 commit 003199a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SequentialSamplingModels"
uuid = "0e71a2a6-2b30-4447-8742-d083a85e82d1"
authors = ["itsdfish"]
version = "0.11.7"
version = "0.11.8"

[deps]
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
Expand Down
8 changes: 4 additions & 4 deletions src/ClassicMDFT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,14 +121,14 @@ function rand(
n_alternatives = size(M, 1)
x = fill(0.0, n_alternatives)
Δμ = fill(0.0, n_alternatives)
choices = fill(0, n_sim)
rts = fill(0.0, n_sim)
choice = fill(0, n_sim)
rt = fill(0.0, n_sim)
CM = dist.C * M
for i 1:n_sim
choices[i], rts[i] = _rand(rng, dist, x, Δμ, CM)
choice[i], rt[i] = _rand(rng, dist, x, Δμ, CM)
x .= 0.0
end
return (; choices, rts)
return (; choice, rt)
end

rand(dist::ClassicMDFT, M::AbstractArray;) = rand(Random.default_rng(), dist, M)
Expand Down
8 changes: 4 additions & 4 deletions src/LCA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,13 @@ function rand(rng::AbstractRNG, dist::AbstractLCA, n_sim::Int; Δt = 0.001)
n = length(dist.ν)
x = fill(0.0, n)
Δμ = fill(0.0, n)
choices = fill(0, n_sim)
rts = fill(0.0, n_sim)
choice = fill(0, n_sim)
rt = fill(0.0, n_sim)
for i 1:n_sim
choices[i], rts[i] = _rand(rng, dist, x, Δμ; Δt)
choice[i], rt[i] = _rand(rng, dist, x, Δμ; Δt)
x .= 0.0
end
return (; choices, rts)
return (; choice, rt)
end

function _rand(rng::AbstractRNG, dist::AbstractLCA, x, Δμ; Δt = 0.001)
Expand Down
8 changes: 4 additions & 4 deletions src/MDFT.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,16 +153,16 @@ function rand(
x = fill(0.0, n_options)
Δμ = fill(0.0, n_options)
ϵ = fill(0.0, n_options)
choices = fill(0, n_sim)
rts = fill(0.0, n_sim)
choice = fill(0, n_sim)
rt = fill(0.0, n_sim)
dist._CM = dist.C * M * dist.γ
distances = compute_distances(dist, M)
dist.S = compute_feedback_matrix(dist, distances)
for i 1:n_sim
choices[i], rts[i] = _rand(rng, dist, x, Δμ; Δt)
choice[i], rt[i] = _rand(rng, dist, x, Δμ; Δt)
x .= 0.0
end
return (; choices, rts)
return (; choice, rt)
end

rand(dist::MDFT, M::AbstractArray; Δt = 0.001) = rand(Random.default_rng(), dist, M; Δt)
Expand Down

0 comments on commit 003199a

Please sign in to comment.