High-Mid-Low ------------------------------------- Description ------------------------------------- High-Mid-Low (HML) creates 10,000 random treatments. The average score of all previous compleations is calculated. If the current score is better than the mean, then the value of this treatment is 1. If the current score is worse than the treatments, the value of the current treatment is -1. Each range is broken up into 3 bins (high, middle, and low). The value of the treatment is added to the appropriate bin. At the end, the maximum bin for each attribute is compaired to the other 2 bins for that range. If the value in the bin is less than half of the value of the maximum bin, then the value is marked as bad. The remaining ranges are reported as the "Acceptable area". ------------------------------------ Pseudo-code ------------------------------------ HighMidLow(type) Create the score bins for each range For each of x random treatments Find the score of a random treatment If the score is greater than the average score Add 1 to the range bin for each attribute in the treatment If the score is less than the average score Subtract 1 from the range bin for each attribute in the treatment ----------------------------------- Actual Code ----------------------------------- (defun highMidLow (type) (let ((parameters (list (list 'DYNAMISIM 0 0) (list 'CRITICALITY 0 0) (list 'CULTURE 0 0) (list 'TEAMSIZE 0 0) (list 'SIZE 0 0) (list 'TEAM-ALPHA 0 0))) (counts (list (list 'DYNAMISIM 0 0 0) (list 'CRITICALITY 0 0 0) (list 'CULTURE 0 0 0) (list 'TEAMSIZE 0 0 0) (list 'SIZE 0 0 0) (list 'TEAM-ALPHA 0 0 0))) (timesToRun 10000) (timesRun 0) (totalScore 0)) (setf parameters (mapcar #'(lambda (x) (list (first x) (float (+ (dist9-min (gethash (first x) *dists*)) (/ (- (dist9-max (gethash (first x) *dists*)) (dist9-min (gethash (first x) *dists*))) 3))) (float (- (dist9-max (gethash (first x) *dists*)) (/ (- (dist9-max (gethash (first x) *dists*)) (dist9-min (gethash (first x) *dists*))) 3))))) parameters)) (dotimes (x timesToRun) (let* ((treatment (completeallbut '())) (score (runPom2 type treatment))) (incf totalScore score) (incf timesRun) (let ((avgScore (/ totalScore timesRun))) (if (> score avgScore) (dolist (parameter treatment) (if (< (second parameter) (second (find (first parameter) parameters :key #'first))) (incf (second (find (first parameter) counts :key #'first))) (if (> (second parameter) (third (find (first parameter) parameters :key #'first))) (incf (fourth (find (first parameter) counts :key #'first))) (incf (third (find (first parameter) counts :key #'first)))))) (if (< score avgScore) (dolist (parameter treatment) (if (< (second parameter) (second (find (first parameter) parameters :key #'first))) (incf (second (find (first parameter) counts :key #'first))) (if (> (second parameter) (third (find (first parameter) parameters :key #'first))) (incf (fourth (find (first parameter) counts :key #'first))) (incf (third (find (first parameter) counts :key #'first))))))))))) (let ((limits (mapcar #'(lambda (x) (let* ((max (reduce #'max (rest x))) (limit (/ max 2))) (list (first x) (if (> (second x) limit) 1 0) (if (> (third x) limit) 1 0) (if (> (fourth x) limit) 1 0)))) counts))) (mapcar #'(lambda (x) (cond ((equal (rest x) (list 1 1 1)) (format t "~A=~A~%" (first x) "All")) ((equal (rest x) (list 0 0 1)) (format t "~A=~A~%" (first x) "High")) ((equal (rest x) (list 0 1 0)) (format t "~A=~A~%" (first x) "Mid")) ((equal (rest x) (list 0 1 1)) (format t "~A=~A~%" (first x) "Mid-High")) ((equal (rest x) (list 1 0 0)) (format t "~A=~A~%" (first x) "Low")) ((equal (rest x) (list 1 0 1)) (format t "~A=~A~%" (first x) "Low or High")) ((equal (rest x) (list 1 1 0)) (format t "~A=~A~%" (first x) "Low-Mid")))) limits))) nil) ------------------------------------- Policy Commitment ------------------------------------- 1. This algorithm jumps around each iteration, but keeps only aggreagate totals for each score. 2. Since each treatment is random, there is no local maxima. 3. The final reported treatment is a conjunction of ranges. 4. This algorithm is stochastic, although the random affects of local compleations are filtered out. To accomplish this filtering, random values are chosen for the non-compleated attributes randomly until the mean score stabilizes. 6. We keep only aggregate statistics of each iteration, this keeps the runtime and memory consumption linear. 7. There is no early termination. 8. There is no back select for this algorithm, but one could be added. 9. This algorithm will not report a trite solution because the most limited a solution can be is to recomend only 1/3 of the total range for each attribute.