Skip to content

Commit

Permalink
2.0.5
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaspazza committed Aug 1, 2024
1 parent 88a770b commit ea1ba80
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/commit_validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ jobs:
# this is to fix GIT not liking owner of the checkout dir, See https://github.com/actions/runner/issues/2033
chown -R $(id -u):$(id -g) $PWD
- name: Base image
uses: docker://hephaistox/gha-automaton-optimization:2.0.4
uses: docker://hephaistox/gha-automaton-optimization:2.0.5
2 changes: 1 addition & 1 deletion bb.edn
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
;; The file is updated automatically
{:deps {org.clojars.hephaistox/automaton-build #:mvn{:version "1.4.7"}}
{:deps {org.clojars.hephaistox/automaton-build #:mvn{:version "2.0.0"}}
:paths []
:tasks
{:requires
Expand Down
13 changes: 7 additions & 6 deletions deps.edn
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{:aliases
{:bb-deps {:extra-deps {org.clojars.hephaistox/automaton-build #:mvn{:version
"1.4.7"}}}
:build {:extra-deps {org.clojars.hephaistox/automaton-build #:mvn{:version
"1.4.7"}}}
{:bb-deps {:extra-deps {org.clojars.hephaistox/automaton-build
#:mvn{:version "2.0.0"}}}
:build {:extra-deps {org.clojars.hephaistox/automaton-build
#:mvn{:version "2.0.0"}}}
:cljs-deps {:extra-deps {binaryage/devtools #:mvn{:version "1.0.7"}
criterium/criterium {:mvn/version "0.4.6"}
kixi/stats {:mvn/version "0.5.5"}
Expand All @@ -20,7 +20,8 @@
:extra-paths ["test/clj" "test/cljc" "test/resources"]
:jvm-opts ["-Dheph-conf=env/test/config.edn,env/test/config.edn"]}
:env-development-repl
{:extra-deps {org.clojars.hephaistox/automaton-core #:mvn{:version "1.2.6"}}
{:extra-deps {org.clojars.hephaistox/automaton-core #:mvn{:version
"1.2.7"}}
:extra-paths ["env/development/resources"
"env/development/src/clj"
"env/development/src/cljc"]
Expand All @@ -41,7 +42,7 @@
"test/cljc"]}}
:deps {criterium/criterium {:mvn/version "0.4.6"}
kixi/stats {:mvn/version "0.5.5"}
org.clojars.hephaistox/automaton-core #:mvn{:version "1.2.6"}
org.clojars.hephaistox/automaton-core #:mvn{:version "1.2.7"}
org.clojure/clojure #:mvn{:version "1.11.2"}
thedavidmeister/xoroshiro128 #:mvn{:version "1.1.3"}}
:paths ["src/clj" "src/cljc" "resources" "src/cljs"]}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
[automaton-core.log :as core-log]
[automaton-core.repl :as core-repl]
[mount.core :as mount]
[mount.tools.graph :as graph])
[mount.tools.graph :as mount-graph])
(:gen-class))

(defn- stub [& _args] (constantly nil))
Expand All @@ -13,6 +13,6 @@
"Main entry point for repl"
[& args]
(core-log/info "Start `automaton-simulation-de`")
(core-log/trace "Component dependencies: " (graph/states-with-deps))
(core-log/trace "Component dependencies: " (mount-graph/states-with-deps))
(core-repl/start-repl args (core-repl/default-middleware) stub)
(mount/start))
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<packaging>jar</packaging>
<groupId>org.clojars.hephaistox</groupId>
<artifactId>automaton-optimization</artifactId>
<version>2.0.4</version>
<version>2.0.5</version>
<name>automaton-optimization</name>
<dependencies>
<dependency>
Expand All @@ -20,7 +20,7 @@
<dependency>
<groupId>org.clojars.hephaistox</groupId>
<artifactId>automaton-core</artifactId>
<version>1.2.6</version>
<version>1.2.7</version>
</dependency>
<dependency>
<groupId>kixi</groupId>
Expand Down
18 changes: 9 additions & 9 deletions src/cljc/automaton_optimization/randomness.cljc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"Randomness for optimization projects."
(:require
[automaton-optimization.randomness.distribution
:as opt-distribution]
:as opt-proba-distribution]
[automaton-optimization.randomness.impl.distribution.factory
:as opt-distribution-factory]
[automaton-optimization.randomness.impl.distribution.registry
Expand Down Expand Up @@ -97,10 +97,10 @@

(defn draw
"`(draw)` returns a random value following `distribution`."
([distribution] (opt-distribution/draw distribution))
([distribution] (opt-proba-distribution/draw distribution))
([kw params]
(-> (build kw params)
opt-distribution/draw)))
opt-proba-distribution/draw)))

(defn distribution-registry
"Returns the base registry."
Expand All @@ -110,19 +110,19 @@
#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(defn median
"Returns the median of the distribution"
([distribution] (opt-distribution/median distribution))
([kw params] (opt-distribution/median (build kw params))))
([distribution] (opt-proba-distribution/median distribution))
([kw params] (opt-proba-distribution/median (build kw params))))

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(def cumulative
"Returns the cumulative probability before `p`"
opt-distribution/cumulative)
opt-proba-distribution/cumulative)

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(def minimum "Minimum" opt-distribution/minimum)
(def minimum "Minimum" opt-proba-distribution/minimum)

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(def maximum "Maximum" opt-distribution/maximum)
(def maximum "Maximum" opt-proba-distribution/maximum)

#_{:clj-kondo/ignore [:clojure-lsp/unused-public-var]}
(def quantile opt-distribution/quantile)
(def quantile opt-proba-distribution/quantile)
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,22 @@
![Aggregate entity diagram](archi/time_based/tb_var_additive.png)"
(:require
[automaton-optimization.time-based.impl.storage-strategy
:as opt-tb-storage-strategy]
[automaton-optimization.time-based.impl.storage-strategy :as opt-tb-ss]
[automaton-optimization.time-based.protocol :as
opt-tb-protocol]))

(defrecord TbVarAdditive [storage default-value]
opt-tb-protocol/TimeBased
(default [_] default-value)
(get-measure [_ bucket]
(if-let [val (opt-tb-storage-strategy/get-exact storage bucket)]
(if-let [val (opt-tb-ss/get-exact storage bucket)]
val
default-value))
(get-measures [_ buckets]
(mapv #(if (nil? %) default-value %)
(opt-tb-storage-strategy/get-measures storage buckets)))
(opt-tb-ss/get-measures storage buckets)))
(measure [_ bucket data]
(TbVarAdditive. (opt-tb-storage-strategy/update-date
(TbVarAdditive. (opt-tb-ss/update-date
storage
bucket
(fn [val]
Expand Down
2 changes: 1 addition & 1 deletion version.edn
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
;; Last generated version, note a failed push consume a number
{:version "2.0.4"}
{:version "2.0.5"}

0 comments on commit ea1ba80

Please sign in to comment.