This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-10-26
Channels
- # aws (1)
- # aws-lambda (16)
- # beginners (8)
- # boot (2)
- # cider (4)
- # cljsrn (9)
- # clojure (137)
- # clojure-italy (3)
- # clojure-russia (39)
- # clojure-spec (34)
- # clojure-uk (33)
- # clojurescript (44)
- # core-logic (11)
- # cursive (27)
- # data-science (16)
- # datomic (52)
- # duct (1)
- # emacs (1)
- # figwheel (2)
- # fulcro (90)
- # graphql (3)
- # hoplon (7)
- # lambdaisland (2)
- # leiningen (23)
- # lumo (1)
- # off-topic (1)
- # om (40)
- # onyx (44)
- # re-frame (116)
- # reagent (3)
- # shadow-cljs (87)
I'm getting errors when using fd example:
(run* [q]
(fresh [x y]
(fd/in x y (fd/interval 1 10))
(fd/+ x y 10)
(== q [x y]))) ; => ([1 9] [2 8] [3 7] [4 6] [5 5] [6 4] [7 3] [8 2] [9 1])
Gives
Exception Constrained variable <lvar:q__50256> without domain clojure.core.logic/verify-all-bound/verify-all-bound*--48690 (logic.clj:2136)
from:
https://github.com/clojure/core.logic/wiki/Featuresit seems perfect for the problem I want to solve, finding build orders in StarCraft II 🙂
I think in general core.logic would make for a useful tool in an RTS AI. What do people here think?
Maybe generate data to help train a neural net, or help it make decisions, that could then more easily be visualized.
Is there a way to generate the constraints in a macro. I need the following :
(pldb/with-db db (run 1 [q]
(fresh [x y z a b c]
(foo x y)
(foo a b)
(foo b c)
;; more constraints
(== q [x y z a b c])))
I can have many number of vars to fresh and also a lot of foo constraints. I have the following macro but it's not working.
(defmacro my-fresh
[db districts res]
`(pldb/with-db ~db (run 1 [q]
(fresh ~districts
(map (fn [[x y]] ('foo x y)) ~res)
(== q ~districts)))))