(defun POM2 (numOfTrials type &optional(makeChart nil)) (let ((stoppingAt 6) (results '())) (dotimes (x numOfTrials) (reset-all-unclamped-sample) (if (not makeChart) (getNewTasksPre));because ric cant get over it, its shal be called generateTasks (if (not makeChart) (generateTeams)); (getTotalCost))) (if (not makeChart) (getNewTasksPost));because ric cant get over it, its shal be called assignTasksToTeams because its not people first (if (not makeChart) (generateTeamsPost (getTotalCost))) ;At least 2 iterations and max 6 (setf stoppingAt (min (max 2 (binomial 0.91)) 6)) ;(print stoppingAt) (setf stoppingAt 6) ;get orig values and make result for intial ;(if (not makeChart) (push (make-result :run 'INITIAL ;:origCosts (mapcar #'getTaskCost (getAllKnownTasks)) ;:origValues (mapcar #'getTaskOrigionalValue (getAllKnownTasks)) ;:endCosts (mapcar #'getTaskCost (getAllKnownTasks)) ;:endValues (mapcar #'getTaskValue (getAllKnownTasks))) results)) ;It calles getTaskValue because nothing has changed yet... Its still orrigional (resetTasks) (resetTeams) (if (equal type 'PB) (dotimes (z 6) (discoverNewTasks))) ;(if (equal type 'PB) (print "I am pb") (print "I am not PB")) ;(print (get-static 'Dynamisim)) (dotimes (iteration stoppingAt) (assignBudget) (getPossibleFromTree type) (completeTasks) (if (not (equal type 'PB)) (discoverNewTasks)) ;(discoverNewTasks) (changeTaskValues)) (push (make-result :run type ;:origCosts (mapcar #'getTaskCost (getAllCompleted)) ;:origValues (mapcar #'getTaskOrigionalValue (getAllCompleted)) :endCosts (mapcar #'getTaskCost (getAllCompleted)) :endValues (mapcar #'getTaskValue (getAllCompleted))) results) (push (make-result :run 'FRONT ;:origCosts (mapcar #'getTaskCost (getAllKnownTasks)) ;:origValues (mapcar #'getTaskOrigionalValue (getAllKnownTasks)) :endCosts (mapcar #'getTaskCost (sortBest (getAllCompleted))) :endValues (mapcar #'getTaskValue (sortBest (getAllCompleted)))) results) (push (make-result :run 'INITIAL ;:origCosts (mapcar #'getTaskCost (getAllKnownTasks)) ;:origValues (mapcar #'getTaskOrigionalValue (getAllKnownTasks)) :endCosts (mapcar #'getTaskCost (sortWorst (getAllCompleted))) :endValues (mapcar #'getTaskValue (sortWorst (getAllCompleted)))) results)) results)) ; (push (make-result :run 'INITIAL ;:origCosts (mapcar #'getTaskCost (getAllKnownTasks)) ;:origValues (mapcar #'getTaskOrigionalValue (getAllKnownTasks)) ; :endCosts (mapcar #'getTaskCost (getAllKnownTasks #'(lambda (z) (/ (task-value-orig z) (task-cost z))))) ; :endValues (mapcar #'getTaskOrigionalValue (getAllKnownTasks #'(lambda (z) (/ (task-value-orig z) (task-cost z)))))) results)) ;(plot-data results) ; results))