diff --git a/README.md b/README.md index d27c59c5..e487e46a 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,7 @@ The inputs to DATASIM consist of four parts, each represented by JSON. They are One or more valid xAPI Profiles are required for DATASIM to generate xAPI Statements. You can learn more about the xAPI Profile Specification [here](https://github.com/adlnet/xapi-profiles). This input can either be a single Profile JSON-LD document or an array of JSON-LD format profiles. At this time all referenced concepts in a Profile must be included in the input. For instance if in "Profile A" I have a Pattern that references a Statement Template found in "Profile B", both Profiles must be included in an array as the Profile input. -Note that by default, any patterns with a `primary` property set to `true` in the provided profiles will be used for generation. You can control which profiles these primary patterns are sourced from with the `gen-profiles` option by supplying one or more profile IDs. You can further control which specific primary patterns are used with the `gen-patterns` option by supplying one or more pattern IDs. +Note that by default, any patterns with a `primary` property set to `true` in the provided profiles will be used for generation. You can control which profiles these primary patterns are sourced from with the `genProfiles` option by supplying one or more profile IDs. You can further control which specific primary patterns are used with the `genPatterns` option by supplying one or more pattern IDs. #### Personae @@ -90,14 +90,14 @@ and `weight` values (as described under `verbs`). - `hours`: `0` to `23` - `minutes`: `0` to `59` - `seconds`: `0` to `59` - - `boundRetries`: An array of Pattern IDs to retry if the timestamp violates `bounds`. The top-most Pattern in `boundRetries` will be tried, e.g. if Pattern A is a parent of Pattern B and both are listed in `boundRetries`, it will be Pattern A that is retried. If `boundRetries` is empty or not present, or if none of the ancestor Patterns are included, then Statement generation will continue at its current point. + - `boundRestarts`: An array of Pattern IDs to retry if the timestamp violates `bounds`. The top-most Pattern in `boundRestarts` will be tried, e.g. if Pattern A is a parent of Pattern B and both are listed in `boundRestarts`, it will be Pattern A that is retried. If `boundRestarts` is empty or not present, or if none of the ancestor Patterns are included, then Statement generation will continue at its current point. - `periods`: An array of objects that specify the amount of time between generated Statements. Only the first valid period in the array will be applied to generate the next Statement (see `bounds` property). Each period object has the following optional properties: - `min`: a minimum amount of time between Statements; default is `0` - `mean` the average amount of time between Statements (added on top of `min`); default is `1` - `fixed`: a fixed amount of time between Statements; overrides `min` and `mean` - `unit`: the time unit for all temporal values. Valid values are `millis`, `seconds`, `minutes`, `hours`, `days`, and `weeks`; the default is `minutes` - `bounds`: an array of the temporal bounds the period can apply in. During generation, the current Statement timestamp is checked against each period's `bounds`, and the first period whose bound satisfies the timestamp will be used to generate the next Statement timestamp. A nonexisting `bounds` value indicates an infinite bound, i.e. any timestamp is always valid. The syntax is the same as the top-level `bounds` array. At least one period must not have a `bounds` value, so it can act as the default period. -- `templates`: An array of objects with Statement Template `id` and optional `bounds`, `boundRetries`, and `period` properties, as explained above in `patterns`. Note that `weights` and `repeat-max` do not apply here. +- `templates`: An array of objects with Statement Template `id` and optional `bounds`, `boundRestarts`, and `period` properties, as explained above in `patterns`. Note that `weights` and `repeat-max` do not apply here. - `objectOverrides`: An array of objects containing (xAPI) `object` and `weight`. If present, these objects will overwrite any that would have been set by the Profile. An example of a model array with valid `personae`, `verbs`, and `templates` is shown below: @@ -126,7 +126,7 @@ An example of a model array with valid `personae`, `verbs`, and `templates` is s "months": [["January", "May"]] } ], - "boundRetries": [ + "boundRestarts": [ "https://w3id.org/xapi/cmi5#toplevel" ], "period": { @@ -151,10 +151,12 @@ The simulation parameters input covers the details of the simulation not covered "max": 200, "timezone": "America/New_York", "seed": 42, - "max-retries": 10 + "maxRestarts": 10 } ``` -Note the `max-retries` parameter; this is to limit the amount of times a particular Pattern is repeated when a `bounds` is violated. +Note the `maxRestarts` parameter; this is to limit the amount of times a particular Pattern is restarted when a `bounds` is violated. + +Additional parameters include `genPatterns` and `genProfiles`, which are explained in more detail under [xAPI Profiles](#xapi-profiles). #### (Alternatively) Simulation Specification diff --git a/dev-resources/models/simple_with_temporal.json b/dev-resources/models/simple_with_temporal.json index 348929d4..6384fb15 100644 --- a/dev-resources/models/simple_with_temporal.json +++ b/dev-resources/models/simple_with_temporal.json @@ -44,7 +44,7 @@ "minutes": [[0, 10]] } ], - "boundRetries": [ + "boundRestarts": [ "https://w3id.org/xapi/cmi5#typicalsessions" ] }, diff --git a/dev-resources/parameters/simple.json b/dev-resources/parameters/simple.json index 4f2846f4..696610c7 100644 --- a/dev-resources/parameters/simple.json +++ b/dev-resources/parameters/simple.json @@ -1,4 +1,6 @@ -{"start": "2019-11-18T11:38:39.219768Z", - "end": "2019-11-19T11:38:39.219768Z", - "timezone": "America/New_York", - "seed": 42} +{ + "start": "2019-11-18T11:38:39.219768Z", + "end": "2019-11-19T11:38:39.219768Z", + "timezone": "America/New_York", + "seed": 42 +} diff --git a/dev-resources/parameters/tccc_dev.json b/dev-resources/parameters/tccc_dev.json index c324a31e..c5bc2515 100644 --- a/dev-resources/parameters/tccc_dev.json +++ b/dev-resources/parameters/tccc_dev.json @@ -1,6 +1,6 @@ { - "start" : "2020-02-10T11:38:39.219768Z", - "end" : "2020-02-25T17:38:39.219768Z", - "timezone" : "America/New_York", - "seed" : 40 -} \ No newline at end of file + "start": "2020-02-10T11:38:39.219768Z", + "end": "2020-02-25T17:38:39.219768Z", + "timezone": "America/New_York", + "seed": 40 +} diff --git a/src/cli/com/yetanalytics/datasim/main.clj b/src/cli/com/yetanalytics/datasim/main.clj index f5e1426c..3abd8a83 100644 --- a/src/cli/com/yetanalytics/datasim/main.clj +++ b/src/cli/com/yetanalytics/datasim/main.clj @@ -115,10 +115,10 @@ :id :async :default true] [nil "--gen-profile IRI" "Only generate based on primary patterns in the given profile. May be given multiple times to include multiple profiles." - :id :gen-profiles + :id :genProfiles :assoc-fn conj-param-input] [nil "--gen-pattern IRI" "Only generate based on the given primary pattern. May be given multiple times to include multiple patterns." - :id :gen-patterns + :id :genPatterns :assoc-fn conj-param-input] ;; Help ["-h" "--help"]]) diff --git a/src/main/com/yetanalytics/datasim/input.clj b/src/main/com/yetanalytics/datasim/input.clj index d8f97e20..621c99a4 100644 --- a/src/main/com/yetanalytics/datasim/input.clj +++ b/src/main/com/yetanalytics/datasim/input.clj @@ -43,10 +43,10 @@ ;; makes use of two different parts of the input spec (defn validate-pattern-filters - [{{:keys [gen-profiles gen-patterns]} :parameters + [{{:keys [genProfiles genPatterns]} :parameters profiles :profiles}] - (concat (profile/validate-profile-filters profiles gen-profiles) - (profile/validate-pattern-filters profiles gen-patterns))) + (concat (profile/validate-profile-filters profiles genProfiles) + (profile/validate-pattern-filters profiles genPatterns))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Input I/O diff --git a/src/main/com/yetanalytics/datasim/input/model/alignments.clj b/src/main/com/yetanalytics/datasim/input/model/alignments.clj index 1361ea4d..458667c4 100644 --- a/src/main/com/yetanalytics/datasim/input/model/alignments.clj +++ b/src/main/com/yetanalytics/datasim/input/model/alignments.clj @@ -118,7 +118,7 @@ :min-count 1)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; Time Bound Retries +;; Time Bound Restarts ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (s/def ::boundRestarts diff --git a/src/main/com/yetanalytics/datasim/input/parameters.clj b/src/main/com/yetanalytics/datasim/input/parameters.clj index 3b8940e9..20b92469 100644 --- a/src/main/com/yetanalytics/datasim/input/parameters.clj +++ b/src/main/com/yetanalytics/datasim/input/parameters.clj @@ -51,12 +51,16 @@ (s/def ::max pos-int?) +;; Max number of bound restarts before giving up +(s/def ::maxRestarts + pos-int?) + ;; Restrict Generation to these profile IDs -(s/def ::gen-profiles +(s/def ::genProfiles (s/every ::prof/id)) ;; Restrict Generation to these pattern IDs -(s/def ::gen-patterns +(s/def ::genPatterns (s/every ::pat/id)) (defn- ordered-timestamps? @@ -82,9 +86,9 @@ :opt-un [::end ::from ::max - ::max-retries - ::gen-profiles - ::gen-patterns]) + ::maxRestarts + ::genProfiles + ::genPatterns]) ordered-timestamps?)) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -100,17 +104,20 @@ ;; Defaults ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +(def utc-timezone "UTC") +(def default-max-restarts 5) + (defn apply-defaults "Apply defaults to `params` with the current time and a random seed. If `params` is not provided simply return the default parameters." ([] (apply-defaults {})) - ([{:keys [start from timezone seed max-retries] :as params}] + ([{:keys [start from timezone seed maxRestarts] :as params}] (merge params (let [start (or start (.toString (Instant/now)))] {:start start :from (or from start) - :timezone (or timezone "UTC") + :timezone (or timezone utc-timezone) :seed (or seed (random/rand-unbound-int (random/rng))) - :max-retries (or max-retries 5)})))) + :maxRestarts (or maxRestarts default-max-restarts)})))) diff --git a/src/main/com/yetanalytics/datasim/input/profile.clj b/src/main/com/yetanalytics/datasim/input/profile.clj index 957d24da..fc93869a 100644 --- a/src/main/com/yetanalytics/datasim/input/profile.clj +++ b/src/main/com/yetanalytics/datasim/input/profile.clj @@ -61,8 +61,8 @@ (into #{}))] (for [[idx pattern-id] (map-indexed vector gen-patterns) :when (not (contains? pattern-id-set pattern-id))] - {:id (str "parameters-gen-patterns-" idx) - :path [:parameters :gen-patterns idx] + {:id (str "parameters-genPatterns-" idx) + :path [:parameters :genPatterns idx] :text (validate-pattern-filters-emsg pattern-id pattern-id-set)}))) (defn validate-profile-filters @@ -70,6 +70,6 @@ (let [profile-id-set (->> profiles (map :id) (into #{}))] (for [[idx profile-id] (map-indexed vector gen-profiles) :when (not (contains? profile-id-set profile-id))] - {:id (str "parameters-gen-profiles-" idx) - :path [:parameters :gen-profiles idx] + {:id (str "parameters-genProfiles-" idx) + :path [:parameters :genProfiles idx] :text (validate-profile-fitlers-emsg profile-id profile-id-set)}))) diff --git a/src/main/com/yetanalytics/datasim/model.clj b/src/main/com/yetanalytics/datasim/model.clj index 8aa0cbb6..4278d757 100644 --- a/src/main/com/yetanalytics/datasim/model.clj +++ b/src/main/com/yetanalytics/datasim/model.clj @@ -44,7 +44,7 @@ (s/def ::pattern/bounds ::bounds/bounds) -(s/def ::pattern/bound-retries +(s/def ::pattern/bound-restarts (s/every ::xs/iri :kind set?)) (s/def ::pattern/period @@ -56,7 +56,7 @@ (s/def ::pattern (s/keys :opt-un [::pattern/weights ::pattern/bounds - ::pattern/bound-retries + ::pattern/bound-restarts ::pattern/period ::pattern/repeat-max])) diff --git a/src/main/com/yetanalytics/datasim/sim.clj b/src/main/com/yetanalytics/datasim/sim.clj index 4dcde27b..42a4423b 100644 --- a/src/main/com/yetanalytics/datasim/sim.clj +++ b/src/main/com/yetanalytics/datasim/sim.clj @@ -55,7 +55,7 @@ (defn- temp-statement-seq "Generate sequence of maps of `:template`, `:timestamp`, `:time-since-last`, and `:registration` values." - [inputs alignments seed max-retries timestamp registration-seq] + [inputs alignments seed max-restarts timestamp registration-seq] (let [profile-rng (random/seed-rng seed) fill-statement-seq* @@ -65,7 +65,11 @@ (let [profile-seed (random/rand-unbound-int profile-rng) template-maps - (p/walk-profile-patterns inputs alignments profile-seed max-retries timestamp) + (p/walk-profile-patterns inputs + alignments + profile-seed + max-restarts + timestamp) ?next-timestamp (:timestamp (meta template-maps)) template-maps* @@ -125,13 +129,13 @@ "Generate a lazy sequence of xAPI Statements occuring as a Poisson process. The sequence will either end at `?end-time` or, if `nil`, be infinite." - [input seed alignments start-time ?end-time ?from-time zone-region max-retries] + [input seed alignments start-time ?end-time ?from-time zone-region max-restarts] (let [sim-rng (random/seed-rng seed) reg-seed (random/rand-unbound-int sim-rng) temp-seed (random/rand-unbound-int sim-rng) stmt-rng (random/seed-rng (random/rand-unbound-int sim-rng))] (->> (init-statement-seq reg-seed) - (temp-statement-seq input alignments temp-seed max-retries start-time) + (temp-statement-seq input alignments temp-seed max-restarts start-time) (drop-statement-seq ?end-time) (seed-statement-seq stmt-rng) (from-statement-seq ?from-time) @@ -154,7 +158,7 @@ Spooky." [{:keys [profiles personae-array models parameters]}] (let [;; Input parameters - {:keys [start end from timezone seed max-retries]} parameters + {:keys [start end from timezone seed maxRestarts]} parameters ;; RNG for generating the rest of the seeds sim-rng (random/seed-rng seed) ;; Set timezone region and timestamps @@ -200,7 +204,7 @@ ?end-time ?from-time zone-region - max-retries)] + maxRestarts)] (assoc m actor-id actor-stmt-seq))) {})))) diff --git a/src/main/com/yetanalytics/datasim/xapi/profile.clj b/src/main/com/yetanalytics/datasim/xapi/profile.clj index 9a1d0149..2065b047 100644 --- a/src/main/com/yetanalytics/datasim/xapi/profile.clj +++ b/src/main/com/yetanalytics/datasim/xapi/profile.clj @@ -98,13 +98,13 @@ :ret ::type-iri-map) (defn select-primary-patterns - "Given `type-iri-map` and the `gen-profiles` and `gen-patterns` params, + "Given `type-iri-map` and the `genProfiles` and `genPatterns` params, update the Pattern map to further specify primary patterns for generation. - Primary patterns in this context must be specified by `gen-profiles` or - `gen-patterns`, or else they will no longer be counted as primary patterns." - [type-iri-map {:keys [gen-profiles gen-patterns]}] - (let [?profile-set (some-> gen-profiles not-empty set) - ?pattern-set (some-> gen-patterns not-empty set) + Primary patterns in this context must be specified by `genProfiles` or + `genPatterns`, or else they will no longer be counted as primary patterns." + [type-iri-map {:keys [genProfiles genPatterns]}] + (let [?profile-set (some-> genProfiles not-empty set) + ?pattern-set (some-> genPatterns not-empty set) primary-pat? (fn [profile-id pattern-id] (and (or (nil? ?profile-set) (contains? ?profile-set profile-id)) @@ -175,11 +175,11 @@ (partial tmp/update-parsed-rules-map profile-map*)))) (s/fdef walk-profile-patterns - :args (s/cat :profile-map ::profile-map - :alignments ::model/alignments - :seed ::random/seed - :max-retries pos-int? - :start-time t/local-date-time?) + :args (s/cat :profile-map ::profile-map + :alignments ::model/alignments + :seed ::random/seed + :max-restarts pos-int? + :start-time t/local-date-time?) :ret (s/every ::pat/template-map)) (defn walk-profile-patterns @@ -187,12 +187,12 @@ [{pattern-iri-map :pattern-map} {pattern-alignments :patterns} seed - max-retries + max-restarts start-time] (let [pattern-rng (random/seed-rng seed) root-pattern (get pattern-iri-map ::pat/root) context {:pattern-map pattern-iri-map :alignments-map pattern-alignments - :max-retries max-retries + :max-restarts max-restarts :rng pattern-rng}] (pat/walk-pattern context [] start-time start-time root-pattern))) diff --git a/src/main/com/yetanalytics/datasim/xapi/profile/pattern.clj b/src/main/com/yetanalytics/datasim/xapi/profile/pattern.clj index ac94593f..8757a573 100644 --- a/src/main/com/yetanalytics/datasim/xapi/profile/pattern.clj +++ b/src/main/com/yetanalytics/datasim/xapi/profile/pattern.clj @@ -59,9 +59,9 @@ (s/def ::alignments-map (s/map-of ::pattern-map-id ::model/pattern)) -(s/def ::max-retries pos-int?) +(s/def ::max-restarts pos-int?) -(s/def ::retry-id ::pattern-map-id) +(s/def ::restart-id ::pattern-map-id) (s/def ::alignments ::model/pattern) @@ -78,12 +78,12 @@ (s/def ::template-seq-meta (s/keys :req-un [::timestamp] :opt-un [::failure? - ::retry-id])) + ::restart-id])) (def context-spec (s/keys :req-un [::pattern-map ::alignments-map - ::max-retries + ::max-restarts ::random/rng])) (s/fdef walk-pattern @@ -139,7 +139,7 @@ (repeat one-or-more)))) (defn- iterate-patterns - [{:keys [pattern-map alignments-map max-retries] :as ctx} + [{:keys [pattern-map alignments-map max-restarts] :as ctx} alignments-stack init-timestamp init-timestamp-gen @@ -149,7 +149,7 @@ prev-timestamp init-timestamp prev-timestamp-gen init-timestamp-gen child-ids* child-ids - retry-count 0] + restart-count 0] (if-some [child-id (first child-ids*)] (let [pattern (get pattern-map child-id) pat-align (-> (get alignments-map child-id) (assoc :id child-id)) @@ -159,18 +159,18 @@ prev-timestamp prev-timestamp-gen pattern) - {:keys [timestamp timestamp-gen failure? retry-id] :as temp-meta} + {:keys [timestamp timestamp-gen failure? restart-id] :as temp-meta} (meta templates)] (cond (and failure? timestamp - (= retry-id pattern-id) - (< retry-count max-retries)) + (= restart-id pattern-id) + (< restart-count max-restarts)) (recur (list) timestamp init-timestamp-gen child-ids - (inc retry-count)) + (inc restart-count)) failure? (with-meta (concat prev-templates templates) temp-meta) @@ -179,7 +179,7 @@ timestamp timestamp-gen (rest child-ids*) - retry-count))) + restart-count))) (with-meta prev-templates {:timestamp prev-timestamp :timestamp-gen prev-timestamp-gen})))) @@ -191,25 +191,27 @@ (if (bounds/bounded-time? bounds timestamp) ;; Bound is satisfied (recur rest-stack) - ;; Bound is NOT satisfied, find the highest-level pattern to retry + ;; Bound is NOT satisfied, find the highest-level pattern to restart ;; `some` works as alignments-stack vector goes from highest -> lowest - (let [retry-id (when (not-empty bound-restarts) - (->> alignments-stack (map :id) (some bound-restarts)))] - [bounds retry-id])) + (let [restart-id (when (not-empty bound-restarts) + (->> alignments-stack + (map :id) + (some bound-restarts)))] + [bounds restart-id])) ;; All bounds are satisfied [nil nil]))) (defn- visit-template - [{:keys [rng max-retries]} + [{:keys [rng max-restarts]} alignments-stack init-timestamp init-timestamp-gen {template-id :id :as template}] (let [periods (some :periods alignments-stack)] (loop [prev-timestamp init-timestamp - retry-count 0] + restart-count 0] (let [timestamp (periods/add-periods prev-timestamp rng periods) - [?bounds ?retry-id] (repeat-at alignments-stack timestamp)] + [?bounds ?restart-id] (repeat-at alignments-stack timestamp)] (if-not ?bounds (with-meta (list {:template template :timestamp timestamp @@ -218,19 +220,19 @@ {:timestamp timestamp :timestamp-gen timestamp}) (if-some [next-time (bounds/next-bounded-time ?bounds timestamp)] - (if (and (or (not ?retry-id) - (= template-id ?retry-id)) - (< retry-count max-retries)) - (recur next-time (inc retry-count)) + (if (and (or (not ?restart-id) + (= template-id ?restart-id)) + (< restart-count max-restarts)) + (recur next-time (inc restart-count)) (with-meta (list) {:timestamp next-time :timestamp-gen init-timestamp-gen :failure? true - :retry-id ?retry-id})) + :restart-id ?restart-id})) (with-meta (list) {:failure? true :timestamp-gen init-timestamp-gen - :retry-id ?retry-id}))))))) + :restart-id ?restart-id}))))))) (defmethod walk-pattern :sequence [ctx alignments-stack prev-timestamp prev-timestamp-gen {:keys [id sequence]}] diff --git a/src/test/com/yetanalytics/datasim/input_test.clj b/src/test/com/yetanalytics/datasim/input_test.clj index c47fc189..5359bf17 100644 --- a/src/test/com/yetanalytics/datasim/input_test.clj +++ b/src/test/com/yetanalytics/datasim/input_test.clj @@ -83,21 +83,21 @@ true (catch Exception _ false)))) (testing "combined input is invalid" - (testing "with invalid gen-profiles" + (testing "with invalid genProfiles" (is (try (validate-throw :input (assoc-in const/simple-input - [:parameters :gen-profiles] + [:parameters :genProfiles] ["http://example.com/nonexistent.jsonld"])) false (catch Exception _ true)))) - (testing "with invalid gen-patterns" + (testing "with invalid genPatterns" (is (try (validate-throw :input (assoc-in const/simple-input - [:parameters :gen-patterns] + [:parameters :genPatterns] ["http://example.com/nonexistent#pattern"])) false (catch Exception _ true)))))) diff --git a/src/test/com/yetanalytics/datasim/xapi/profile_test.clj b/src/test/com/yetanalytics/datasim/xapi/profile_test.clj index 464e7c30..26b28a33 100644 --- a/src/test/com/yetanalytics/datasim/xapi/profile_test.clj +++ b/src/test/com/yetanalytics/datasim/xapi/profile_test.clj @@ -46,18 +46,18 @@ (is (= combined-iri-map (profile/select-primary-patterns combined-iri-map - {:gen-profiles [cmi5-id tla-id]})))) + {:genProfiles [cmi5-id tla-id]})))) (testing "profile selection, selected patterns" (is (not= combined-iri-map (profile/select-primary-patterns combined-iri-map - {:gen-profiles [cmi5-id tla-id] - :gen-patterns [cmi5-pattern-id]})))) + {:genProfiles [cmi5-id tla-id] + :genPatterns [cmi5-pattern-id]})))) (testing "filters by profile" (is (= [cmi5-pattern-id] (-> (profile/select-primary-patterns combined-iri-map - {:gen-profiles [cmi5-id]}) + {:genProfiles [cmi5-id]}) (get "Pattern") vals primary-pattern-ids)))) @@ -65,7 +65,7 @@ (is (= [cmi5-pattern-id] (-> (profile/select-primary-patterns combined-iri-map - {:gen-patterns [cmi5-pattern-id]}) + {:genPatterns [cmi5-pattern-id]}) (get "Pattern") vals primary-pattern-ids))))) diff --git a/src/test/com/yetanalytics/datasim_test.clj b/src/test/com/yetanalytics/datasim_test.clj index 502f6f41..db95fbc0 100644 --- a/src/test/com/yetanalytics/datasim_test.clj +++ b/src/test/com/yetanalytics/datasim_test.clj @@ -225,22 +225,22 @@ [s1' & _] (generate-seq from-input)] (is (not= s0 s1')) (is (= s1 s1')))) - (testing "Respects `gen-profiles` param (w/ multiple profiles)" + (testing "Respects `genProfiles` param (w/ multiple profiles)" (let [input (update double-profile-input :parameters assoc - :gen-profiles [cmi5-id]) + :genProfiles [cmi5-id]) result (generate-seq input) cat-acts (map get-context-category-activities result)] (is (= [[{"id" cmi5-version-id}] [{"id" cmi5-version-id} ; has both since cmi5-moveon-id is an {"id" cmi5-moveon-id}]] ; 'any' or 'none' value in the profile (distinct cat-acts))))) - (testing "Respects `gen-patterns` param (w/ multiple profiles)" + (testing "Respects `genPatterns` param (w/ multiple profiles)" (let [input (update double-profile-input :parameters assoc - :gen-patterns [tla-completed-session-id]) + :genPatterns [tla-completed-session-id]) result (generate-seq input) cat-acts (map get-context-category-activities result)] (is (= [nil [{"id" tla-version-id}]] ; why are some category activites nil? @@ -250,7 +250,7 @@ (update :profiles conj const/referential-profile) (update :parameters assoc - :gen-patterns [referential-completed-session-id])) + :genPatterns [referential-completed-session-id])) result (generate-seq input) cat-acts (map get-context-category-activities result)] (is (= [nil [{"id" tla-version-id}]] ; why are some category activites nil? diff --git a/src/test/com/yetanalytics/datasim_test_temporal.clj b/src/test/com/yetanalytics/datasim_test_temporal.clj index a14b8f30..b3e8883e 100644 --- a/src/test/com/yetanalytics/datasim_test_temporal.clj +++ b/src/test/com/yetanalytics/datasim_test_temporal.clj @@ -302,7 +302,7 @@ (zero? (mod hr 2)) (zero? (mod min 2))))))) ;; Bounds w/ hour periods - ;; Should cause early termination due to running into max-retries param + ;; Should cause early termination due to running into maxRestarts param (test-temporal "6a_hours_period_every_second_hour" not-empty?