Skip to content

Commit

Permalink
moving some processing to the processing file
Browse files Browse the repository at this point in the history
  • Loading branch information
egri-nagy committed Nov 6, 2023
1 parent f7c8752 commit 364fe3e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions project.clj
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
:plugins [[lein-cloverage "1.2.4"]
[lein-kibit "0.1.8"]
[lein-ancient "0.7.0"]
[jonase/eastwood "1.4.0"]
[jonase/eastwood "1.4.2"]
[fourtytoo/record-deps "0.3.3-SNAPSHOT"]
[cider/cider-nrepl "0.41.0"]]
[cider/cider-nrepl "0.43.0"]]
:main lgo.core
:target-path "target/%s"
:profiles {:uberjar {:aot [lgo.core]}})
10 changes: 2 additions & 8 deletions src/lgo/analysis/clay.clj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
effects
choices
deviations
cost-of-passing
cost-of-passing-data
effect-vs-cop
normalize-effects
data-transform2]]
Expand All @@ -25,13 +25,7 @@
of the vage-lite visualizations."
[RAW title]
(let [raw (:game RAW) ;; the game entries
copd (reduce
(fn [d m]
(if (= "black" (:color m))
(conj d m)
(conj d (update m :cop sign-swap))))
[]
(cost-of-passing RAW))
copd (cost-of-passing-data RAW)
all-sm (unroll-scoremeans raw)
;;effect
raw-effs (effects raw)
Expand Down
12 changes: 12 additions & 0 deletions src/lgo/analysis/processing.clj
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
[meander.epsilon :refer [match]]))


(def sign-swap (partial * -1))

(defn data-transform
"Declarative version of data-transform2."
[db]
Expand Down Expand Up @@ -113,6 +115,16 @@
:move move}))
tuples)))

(defn cost-of-passing-data
[RAW]
(reduce
(fn [d m]
(if (= "black" (:color m))
(conj d m)
(conj d (update m :cop sign-swap))))
[]
(cost-of-passing RAW)))

(defn effect-vs-cop
[effd copd]
(map
Expand Down

0 comments on commit 364fe3e

Please sign in to comment.