-
Notifications
You must be signed in to change notification settings - Fork 92
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fffb0fe
commit 5f046d3
Showing
28 changed files
with
1,423 additions
and
815 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
(ns clojush.cli.log | ||
(:require [puget.printer :as puget] | ||
[plumbing.fnk.pfnk :as pfnk] | ||
[plumbing.core :refer [map-vals]] | ||
|
||
[clojush.log.events :refer [label->compute-graph]] | ||
[clojush.log.events.generation.individual :as individual]) | ||
(:import (schema.core.Predicate) | ||
(schema.core.AnythingSchema))) | ||
|
||
(def schema-handlers | ||
{schema.core.Predicate (fn [_1 _2] nil) | ||
schema.core.AnythingSchema (fn [_1 _2] nil)}) | ||
|
||
(defn my-print [form] | ||
(puget/cprint | ||
form | ||
{:print-handlers schema-handlers})) | ||
|
||
|
||
(defn event-inputs | ||
"Prints the mapping of each event to it's outputs" | ||
[& args] | ||
(my-print | ||
(map-vals pfnk/input-schema label->compute-graph))) | ||
|
||
(defn event-outputs | ||
"Prints the mapping of each event to it's inputs" | ||
[& args] | ||
(my-print | ||
(map-vals pfnk/output-schema label->compute-graph))) | ||
|
||
|
||
(defn individual-input [& args] | ||
(my-print | ||
(pfnk/input-schema | ||
individual/compute-graph))) | ||
|
||
(defn individual-output [& args] | ||
(my-print | ||
(pfnk/output-schema | ||
individual/compute-graph))) |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
(ns clojush.log | ||
(:require [clojush.structured-logger :refer [->structured-logger]] | ||
[clojush.log.events :refer [label->compute-graph]] | ||
[clojush.log.handlers :refer [handlers]])) | ||
;; this stuff is spread out over many files in subdirectories | ||
;; Not only does this help with keeping files shorter, but it also allows | ||
;; us to use the defnk names directly in the graph, because we don't | ||
;; have to namespace them. For example, if we define `best` in the | ||
;; lexicase file, then we can just throw that in the graph we defined | ||
;; there, and it will registered under :best. | ||
|
||
(def structured-logger | ||
(->structured-logger | ||
{:handlers handlers | ||
:label->compute-graph label->compute-graph})) | ||
|
||
(def log! (:log! structured-logger)) | ||
|
||
(def get-computed (:get-computed structured-logger)) |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(ns clojush.log.events | ||
(:require [clojush.log.events.init] | ||
[clojush.log.events.config] | ||
[clojush.log.events.generation])) | ||
|
||
(def label->compute-graph | ||
{:init clojush.log.events.init/compute-graph | ||
:config clojush.log.events.config/compute-graph | ||
:generation clojush.log.events.generation/compute-graph}) |
Oops, something went wrong.