Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/qualitative_networks.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ end
"""
function limit_change(prev_value, next_value, N::Int)
if next_value > prev_value
limited_value = min(prev_value + 1, N + 1)
limited_value = min(prev_value + 1, N)
elseif next_value < prev_value
limited_value = max(prev_value - 1, 0)
else
Expand Down
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,6 @@ Graphs = "86223c79-3864-5bf0-83f7-82e725a168b6"
HerbCore = "2b23ba43-8213-43cb-b5ea-38c12b45bd45"
JET = "c3a54625-cd67-489e-a8e7-0a5a0ff4e31b"
MetaGraphsNext = "fa8bd995-216d-47f1-8a91-f3b68fbeb377"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SoleLogics = "b002da8f-3cb3-4d91-bbe3-2953433912b5"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
11 changes: 8 additions & 3 deletions test/test-qn.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using DynamicalSystemsBase: step!, get_state, set_state!
using Graphs: ne, nv
using Random: seed!

@testset "QN Grammar Creation" begin
entities = [:a, :b, :c]
Expand Down Expand Up @@ -64,7 +65,11 @@ end
end

@testset "Async QN" begin
async_qn = aqn(network, N)
step!(async_qn, 10)
@test all(get_state(async_qn.model) .<= N)
seed!(42)

for i = 1:100
async_qn = aqn(network, N + i)
step!(async_qn, 10)
@test all(get_state(async_qn.model) .<= N + i)
end
end
Loading