network: Bug fix in get-interaction-sign.
This commit is contained in:
parent
195d71ed4e
commit
c55113f27e
1 changed files with 6 additions and 5 deletions
11
networks.rkt
11
networks.rkt
|
@ -473,11 +473,11 @@
|
|||
[(and (member '> impacts) (not (member '< impacts))) '>]
|
||||
[(equal? impacts '(=)) '=]
|
||||
[else 0]))))
|
||||
(match interactions
|
||||
[(list '<) 1]
|
||||
[(list '>) -1]
|
||||
[(list '=) #f]
|
||||
[_ 0]))
|
||||
(cond
|
||||
[(and (member '< interactions) (not (member '> interactions))) 1]
|
||||
[(and (member '> interactions) (not (member '< interactions))) -1]
|
||||
[(equal? interactions '(=)) #f]
|
||||
[else 0]))
|
||||
|
||||
(module+ test
|
||||
(test-case "get-interaction-sign"
|
||||
|
@ -491,6 +491,7 @@
|
|||
(check-equal? (get-interaction-sign n-bool bool-doms 'x 'y) 1)
|
||||
(check-equal? (get-interaction-sign n-bool bool-doms 'y 'x) -1)
|
||||
(check-false (get-interaction-sign n-bool bool-doms 'x 'z))
|
||||
(check-equal? (get-interaction-sign n-bool bool-doms 'y 'z) 1)
|
||||
(check-equal? (get-interaction-sign n-bool bool-doms 'x 't) 0)
|
||||
(define n-multi (network-form->network
|
||||
(hash 'x '(min (+ y 1) 2)
|
||||
|
|
Loading…
Reference in a new issue