(defun random-lon (len modd)
(if
(zerop len)
nil
(cons (random modd) (random-lon (1- len) modd))))
(defun random-lol (params points modd)
(if
(zerop points)
nil
(cons (random-lon params modd) (random-lol params (1- points) modd))))
; Does list1 dominate by list2?
; list1 and list2 are lists of numbers of equal length
; each position within the list represents a parameter
; each list represents a data point
(defun domp (list1 list2)
(and
(eval (cons 'or (mapcar #'> list1 list2)))
(eval (cons 'and (mapcar #'>= list1 list2)))))
; nondominated subset of lol
; lol is a list of lists of numbers of equal length
; This works.
(defun nondom (lol)
(do*
((indx lol (cdr indx))
(rv lol (remove-if #'(lambda (x) (domp (car indx) x)) rv)))
((null indx) rv)))
(defun transpose (lol)
(if (and lol (car lol))
(cons
(mapcar #'car lol)
(transpose (mapcar #'cdr lol)))))
; Look up:
; Dr. Gordon Neufeld, neo-authoritarian theorist of child behavior
(defun tcount (s)
(if s
(+ (if (car s) 1 0) (tcount (cdr s)))
0))
; quantile ranking of number n in list of numbers n
; using midpoint rule
; in case of multiples, the midpoint of the multiples' rankings is used
(defun quantile-in (n lon)
(/
(+
(tcount (mapcar #'(lambda (x) (> n x)) lon))
(tcount (mapcar #'(lambda (x) (>= n x)) lon)))
(* (length lon) 2)))
; assign quantile rank to each element
; utilizes #'tcount and #'quantile-in, above
; This works.
(defun quantile-rank (lon)
(mapcar #'cons
lon
(mapcar
#'(lambda (x) (quantile-in x lon))
lon)))
; Check out the following:
; disembodied thought
; reductive materialism
; triaxial cartesian space
; list nondominated subset of lol
; cons each value to the quantile ranking for its parameter
; within the nondominated subset
(defun normalize (lol)
(transpose (mapcar #'quantile-rank (transpose (nondom lol)))))