Skip to content

Commit

Permalink
minor update to rule constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdfish committed May 26, 2021
1 parent 96870f1 commit f8efd52
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ACTRModels"
uuid = "c095b0ea-a6ca-5cbd-afed-dbab2e976880"
authors = ["itsdfish"]
version = "0.6.13"
version = "0.6.14"

[deps]
ConcreteStructs = "2569d6c7-a4a2-43d3-a901-331e8e4be471"
Expand Down
8 changes: 4 additions & 4 deletions src/Structs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -372,8 +372,8 @@ Rule(;utlity=0.0, conditions, action)
end

function Rule(;utility=0.0, conditions, name="", actr, task, action, args=(), kwargs...)
Rule(utility, map(x->()->x(actr, args...; kwargs...), conditions),
()->action(actr, task; kwargs...), name)
Rule(utility, ()->conditions(actr, args...; kwargs...),
()->action(actr, task; kwargs...), name)
end

"""
Expand Down Expand Up @@ -418,8 +418,8 @@ function exact_match(actr)
return rules
end

function match(rule::Rule)
all(c->c(), rule.conditions)
function match(rule)
return rule.conditions()
end

"""
Expand Down

0 comments on commit f8efd52

Please sign in to comment.