From 7d0a1319ac38ad3456d73c63af1ccfa6a9441314 Mon Sep 17 00:00:00 2001 From: oxaliq Date: Thu, 4 Apr 2024 22:11:56 -0400 Subject: [PATCH] fix inconsistent record parameter naming in naive_scalar_net --- src/prop_net/naive_scalar_net.clj | 38 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/prop_net/naive_scalar_net.clj b/src/prop_net/naive_scalar_net.clj index 8a1c845..d7ebdb0 100644 --- a/src/prop_net/naive_scalar_net.clj +++ b/src/prop_net/naive_scalar_net.clj @@ -42,11 +42,11 @@ ;; run methods (initialize-scheduler! [this] - "") + "removes any propagators from schedule") (last-value-of-run [this] "") (simulate! [this] - "") + "makes one step through schedule") (halt! [this] "")) @@ -61,20 +61,20 @@ IPropNet ;; introspect methods INFO - complete - (get-alerted-propagators [net] (deref-get net :alerted-propagators)) - (propagators-ever-alerted [net] (deref-get net :propagators-ever-alerted)) - (get-cells [net] (deref-get net :cells)) - (propagators [net] (deref-get net :all-propagators)) - (get-cell [net cell-key] - (cell-key (get-cells net))) - (cell-content [net cell-key] (deref-get (get-cell net cell-key) + (get-alerted-propagators [this] (deref-get this :alerted-propagators)) + (propagators-ever-alerted [this] (deref-get this :propagators-ever-alerted)) + (get-cells [this] (deref-get this :cells)) + (propagators [this] (deref-get this :all-propagators)) + (get-cell [this cell-key] + (cell-key (get-cells this))) + (cell-content [this cell-key] (deref-get (get-cell this cell-key) :content)) - (propagator [net prop-key] (prop-key (propagators net))) + (propagator [this prop-key] (prop-key (propagators this))) ;; mutation methods - (add-cell! [net cell-key] - (swap! (:cells net) assoc cell-key (c/make-cell)) - (get-cells net)) + (add-cell! [this cell-key] + (swap! (:cells this) assoc cell-key (c/make-cell)) + (get-cells this)) (add-content-to-cell! [this cell-key content] (let [cur-cell (get-cell this cell-key)] ;; add the content @@ -108,18 +108,18 @@ output-setter))) ;; run methods - (last-value-of-run [net] (deref-get net :last-value-of-run)) + (last-value-of-run [this] (deref-get this :last-value-of-run)) (initialize-scheduler! [this] (reset! (:alerted-propagators this) alerted-propagators*) (reset! (:last-value-of-run this) done) (reset! (:propagators-ever-alerted this) propagators-ever-alerted*) :ok) - (simulate! [net] + (simulate! [this] (run! (fn [prop-key] - (do (swap! (:alerted-propagators net) disj prop-key) - (p/apply! (propagator net prop-key)))) - (vec (get-alerted-propagators net)))) - ;; (halt! [net]) + (do (swap! (:alerted-propagators this) disj prop-key) + (p/apply! (propagator this prop-key)))) + (vec (get-alerted-propagators this)))) + ;; (halt! [this]) ) ;; returns a propnet