Weight in random constraints now is not limited by 1
This commit is contained in:
parent
f5977e41e1
commit
f4d29094c9
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
;;;
|
;;;
|
||||||
;;; Remove redundant (zero range) constraints.
|
;;; Remove redundant (zero range) constraints.
|
||||||
;;; Limit weight in range (0..1]
|
;;; Limit the weight value in positive range
|
||||||
;;;
|
;;;
|
||||||
(define (clean-constraints constrs)
|
(define (clean-constraints constrs)
|
||||||
(remove (lambda (c)
|
(remove (lambda (c)
|
||||||
@ -20,14 +20,11 @@
|
|||||||
(map (lambda (c)
|
(map (lambda (c)
|
||||||
(let ((from (inexact->exact (round (car c))))
|
(let ((from (inexact->exact (round (car c))))
|
||||||
(to (inexact->exact (round (cadr c))))
|
(to (inexact->exact (round (cadr c))))
|
||||||
(w (caddr c)))
|
(w (let ((w (caddr c)))
|
||||||
(let ((w (cond
|
(if (< w 0) 0 w))))
|
||||||
((< w 0) 0)
|
(if (> from to)
|
||||||
((> w 1) 1)
|
(list to from w)
|
||||||
(else w))))
|
(list from to w))))
|
||||||
(if (> from to)
|
|
||||||
(list to from w)
|
|
||||||
(list from to w)))))
|
|
||||||
constrs)))
|
constrs)))
|
||||||
;;;
|
;;;
|
||||||
;;; Make constrained random number generator.
|
;;; Make constrained random number generator.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user