Last active
December 8, 2018 05:50
-
-
Save bgrabow/0306387873ec31e053091eff73c50626 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn refil-available-tasks [{:keys [visited graph open-tasks available-tasks timer workers task-cost] :as the-data}] | |
{:visited visited :timer timer :workers workers :task-cost task-cost :open-tasks open-tasks :graph graph | |
:available-tasks (into available-tasks (get-available-nodes graph open-tasks available-tasks))}) | |
; Change this ^ to this v | |
(defn refil-available-tasks [{:keys [graph open-tasks available-tasks] :as the-data}] | |
(-> the-data | |
(update :available-tasks #(conj % (get-available-nodes graph open-tasks available-tasks))))) | |
(defn reload-workers-with-tasks [{:keys [visited graph open-tasks available-tasks timer workers task-cost] :as the-data}] | |
{:visited visited :timer timer :workers workers :task-cost task-cost :graph graph | |
:open-tasks (refil-open-tasks task-cost workers open-tasks available-tasks) | |
:available-tasks (get-remaining-tasks workers open-tasks available-tasks)}) | |
; Change this ^ to this v | |
(defn reload-workers-with-tasks [{:keys [open-tasks available-tasks workers task-cost] :as the-data}] | |
(-> the-data | |
(assoc :open-tasks (refil-open-tasks task-cost workers open-tasks available-tasks) | |
(assoc :available-tasks (get-remaining-tasks workers open-tasks available-tasks)))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment