mirror of
https://github.com/logos-co/scratch.git
synced 2025-02-22 19:28:10 +00:00
Summarize output files suitable for plotting
This commit is contained in:
parent
73546f9896
commit
d9c0eeebc6
@ -8,5 +8,6 @@
|
|||||||
:pathname "./"
|
:pathname "./"
|
||||||
:components ((:file "package")
|
:components ((:file "package")
|
||||||
(:file "json-path")
|
(:file "json-path")
|
||||||
|
(:file "plot")
|
||||||
(:file "glacier")))))
|
(:file "glacier")))))
|
||||||
|
|
||||||
|
25
mevenson/simulation/plot.lisp
Normal file
25
mevenson/simulation/plot.lisp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
(in-package :glacier)
|
||||||
|
|
||||||
|
(defun summarize (file)
|
||||||
|
(let* ((s
|
||||||
|
(alexandria:read-file-into-string file))
|
||||||
|
(j
|
||||||
|
(jsown:parse s))
|
||||||
|
(rounds
|
||||||
|
(loop :for column :in (get-path j '$.columns)
|
||||||
|
:collecting (get-path column '$.values))))
|
||||||
|
(loop :for round :in rounds
|
||||||
|
:collecting ;; TODO optimize
|
||||||
|
(list
|
||||||
|
(length
|
||||||
|
(remove-if-not #'zerop round))
|
||||||
|
(length
|
||||||
|
(remove-if-not
|
||||||
|
(lambda (x) (= 1 x))
|
||||||
|
round))
|
||||||
|
(length
|
||||||
|
(remove-if-not
|
||||||
|
(lambda (x) (= 2 x))
|
||||||
|
round))))))
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user