Fix bug in setting of autoconstructive genome instructions; add dubstep instruction list

--- src/clojush/args.clj
+++ src/clojush/args.clj
@@ -589,185 +589,185 @@
     ;; add autoconstructive-specific instructions (:genome or :gtm)
     (doseq [instr (case (:autoconstructive-genome-instructions @push-argmap)
                     :all (registered-for-stacks
-                           (if (:autoconstructive-environments @push-argmap)
-                             [:integer :boolean :exec :genome :float :tag :environment]
-                             [:integer :boolean :exec :genome :float :tag]))
+                          (if (:autoconstructive-environments @push-argmap)
+                            [:integer :boolean :exec :genome :float :tag :environment]
+                            [:integer :boolean :exec :genome :float :tag]))
                     :gene-oriented (into (registered-for-stacks
-                                           (if (:autoconstructive-environments @push-argmap)
-                                             [:integer :boolean :exec :float :tag :environment]
-                                             [:integer :boolean :exec :float :tag]))
+                                          (if (:autoconstructive-environments @push-argmap)
+                                            [:integer :boolean :exec :float :tag :environment]
+                                            [:integer :boolean :exec :float :tag]))
                                          '(genome_pop
-                                            genome_dup
-                                            genome_swap
-                                            genome_rot
-                                            genome_flush
-                                            genome_eq
-                                            genome_stackdepth
-                                            genome_yank
-                                            genome_yankdup
-                                            genome_shove
-                                            genome_empty
-                                            genome_gene_dup
-                                            genome_gene_randomize
-                                            genome_gene_replace
-                                            genome_gene_delete
-                                            genome_rotate
-                                            genome_gene_copy
-                                            genome_gene_copy_range
-                                            genome_toggle_silent
-                                            genome_silence
-                                            genome_unsilence
-                                            genome_instruction_eq
-                                            genome_gene_close
-                                            genome_gene_silent
-                                            genome_close_inc
-                                            genome_close_dec
-                                            genome_new
-                                            genome_parent1
-                                            genome_parent2
-                                            autoconstructive_integer_rand
-                                            autoconstructive_boolean_rand
-                                            genome_autoconstructing
-                                            genome_if_autoconstructing
-                                            genome_gene_genome_instruction
-                                            genome_if_gene_genome_instruction
-                                            genome_genesis))
+                                           genome_dup
+                                           genome_swap
+                                           genome_rot
+                                           genome_flush
+                                           genome_eq
+                                           genome_stackdepth
+                                           genome_yank
+                                           genome_yankdup
+                                           genome_shove
+                                           genome_empty
+                                           genome_gene_dup
+                                           genome_gene_randomize
+                                           genome_gene_replace
+                                           genome_gene_delete
+                                           genome_rotate
+                                           genome_gene_copy
+                                           genome_gene_copy_range
+                                           genome_toggle_silent
+                                           genome_silence
+                                           genome_unsilence
+                                           genome_instruction_eq
+                                           genome_gene_close
+                                           genome_gene_silent
+                                           genome_close_inc
+                                           genome_close_dec
+                                           genome_new
+                                           genome_parent1
+                                           genome_parent2
+                                           autoconstructive_integer_rand
+                                           autoconstructive_boolean_rand
+                                           genome_autoconstructing
+                                           genome_if_autoconstructing
+                                           genome_gene_genome_instruction
+                                           genome_if_gene_genome_instruction
+                                           genome_genesis))
                     :uniform (into (registered-for-stacks
-                                     (if (:autoconstructive-environments @push-argmap)
-                                       [:integer :boolean :exec :float :tag :environment]
-                                       [:integer :boolean :exec :float :tag]))
+                                    (if (:autoconstructive-environments @push-argmap)
+                                      [:integer :boolean :exec :float :tag :environment]
+                                      [:integer :boolean :exec :float :tag]))
                                    '(genome_pop
-                                      genome_dup
-                                      genome_swap
-                                      genome_rot
-                                      genome_flush
-                                      genome_eq
-                                      genome_stackdepth
-                                      genome_yank
-                                      genome_yankdup
-                                      genome_shove
-                                      genome_empty
-                                      genome_rotate
-                                      genome_new
-                                      genome_parent1
-                                      genome_parent2
-                                      autoconstructive_integer_rand
-                                      autoconstructive_boolean_rand
-                                      genome_autoconstructing
-                                      genome_if_autoconstructing
-                                      genome_uniform_instruction_mutation
-                                      genome_uniform_integer_mutation
-                                      genome_uniform_float_mutation
-                                      genome_uniform_tag_mutation
-                                      genome_uniform_string_mutation
-                                      genome_uniform_boolean_mutation
-                                      genome_uniform_close_mutation
-                                      genome_uniform_silence_mutation
-                                      genome_uniform_deletion
-                                      genome_uniform_addition
-                                      genome_uniform_addition_and_deletion
-                                      genome_uniform_combination_and_deletion
-                                      genome_genesis
-                                      genome_alternation
-                                      genome_uniform_crossover
-                                      genome_gene_genome_instruction
-                                      genome_if_gene_genome_instruction))
+                                     genome_dup
+                                     genome_swap
+                                     genome_rot
+                                     genome_flush
+                                     genome_eq
+                                     genome_stackdepth
+                                     genome_yank
+                                     genome_yankdup
+                                     genome_shove
+                                     genome_empty
+                                     genome_rotate
+                                     genome_new
+                                     genome_parent1
+                                     genome_parent2
+                                     autoconstructive_integer_rand
+                                     autoconstructive_boolean_rand
+                                     genome_autoconstructing
+                                     genome_if_autoconstructing
+                                     genome_uniform_instruction_mutation
+                                     genome_uniform_integer_mutation
+                                     genome_uniform_float_mutation
+                                     genome_uniform_tag_mutation
+                                     genome_uniform_string_mutation
+                                     genome_uniform_boolean_mutation
+                                     genome_uniform_close_mutation
+                                     genome_uniform_silence_mutation
+                                     genome_uniform_deletion
+                                     genome_uniform_addition
+                                     genome_uniform_addition_and_deletion
+                                     genome_uniform_combination_and_deletion
+                                     genome_genesis
+                                     genome_alternation
+                                     genome_uniform_crossover
+                                     genome_gene_genome_instruction
+                                     genome_if_gene_genome_instruction))
                     :non-recombinative (into (registered-for-stacks
-                                               (if (:autoconstructive-environments @push-argmap)
-                                                 [:integer :boolean :exec :float :tag :environment]
-                                                 [:integer :boolean :exec :float :tag]))
+                                              (if (:autoconstructive-environments @push-argmap)
+                                                [:integer :boolean :exec :float :tag :environment]
+                                                [:integer :boolean :exec :float :tag]))
                                              '(genome_pop
-                                                genome_dup
-                                                genome_swap
-                                                genome_rot
-                                                genome_flush
-                                                genome_eq
-                                                genome_stackdepth
-                                                genome_yank
-                                                genome_yankdup
-                                                genome_shove
-                                                genome_empty
-                                                genome_gene_dup
-                                                genome_gene_randomize
-                                                genome_gene_replace
-                                                genome_gene_delete
-                                                genome_rotate
+                                               genome_dup
+                                               genome_swap
+                                               genome_rot
+                                               genome_flush
+                                               genome_eq
+                                               genome_stackdepth
+                                               genome_yank
+                                               genome_yankdup
+                                               genome_shove
+                                               genome_empty
+                                               genome_gene_dup
+                                               genome_gene_randomize
+                                               genome_gene_replace
+                                               genome_gene_delete
+                                               genome_rotate
                                                 ;genome_gene_copy
                                                 ;genome_gene_copy_range
-                                                genome_toggle_silent
-                                                genome_silence
-                                                genome_unsilence
-                                                genome_instruction_eq
-                                                genome_gene_close
-                                                genome_gene_silent
-                                                genome_close_inc
-                                                genome_close_dec
-                                                genome_new
-                                                genome_parent1
-                                                genome_parent2
-                                                autoconstructive_integer_rand
-                                                autoconstructive_boolean_rand
-                                                genome_autoconstructing
-                                                genome_if_autoconstructing
-                                                genome_gene_genome_instruction
-                                                genome_if_gene_genome_instruction
-                                                genome_genesis
-                                                genome_uniform_instruction_mutation
-                                                genome_uniform_integer_mutation
-                                                genome_uniform_float_mutation
-                                                genome_uniform_tag_mutation
-                                                genome_uniform_string_mutation
-                                                genome_uniform_boolean_mutation
-                                                genome_uniform_close_mutation
-                                                genome_uniform_silence_mutation
-                                                genome_uniform_deletion
-                                                genome_uniform_addition
-                                                genome_uniform_addition_and_deletion
+                                               genome_toggle_silent
+                                               genome_silence
+                                               genome_unsilence
+                                               genome_instruction_eq
+                                               genome_gene_close
+                                               genome_gene_silent
+                                               genome_close_inc
+                                               genome_close_dec
+                                               genome_new
+                                               genome_parent1
+                                               genome_parent2
+                                               autoconstructive_integer_rand
+                                               autoconstructive_boolean_rand
+                                               genome_autoconstructing
+                                               genome_if_autoconstructing
+                                               genome_gene_genome_instruction
+                                               genome_if_gene_genome_instruction
+                                               genome_genesis
+                                               genome_uniform_instruction_mutation
+                                               genome_uniform_integer_mutation
+                                               genome_uniform_float_mutation
+                                               genome_uniform_tag_mutation
+                                               genome_uniform_string_mutation
+                                               genome_uniform_boolean_mutation
+                                               genome_uniform_close_mutation
+                                               genome_uniform_silence_mutation
+                                               genome_uniform_deletion
+                                               genome_uniform_addition
+                                               genome_uniform_addition_and_deletion
                                                 ;genome_uniform_combination_and_deletion
                                                 ;genome_alternation
                                                 ;genome_uniform_crossover
-                                                ))
+                                               ))
                     :gene-oriented-non-recombinative
                     (into (registered-for-stacks
-                            (if (:autoconstructive-environments @push-argmap)
-                              [:integer :boolean :exec :float :tag :environment]
-                              [:integer :boolean :exec :float :tag]))
+                           (if (:autoconstructive-environments @push-argmap)
+                             [:integer :boolean :exec :float :tag :environment]
+                             [:integer :boolean :exec :float :tag]))
                           '(genome_pop
-                             genome_dup
-                             genome_swap
-                             genome_rot
-                             genome_flush
-                             genome_eq
-                             genome_stackdepth
-                             genome_yank
-                             genome_yankdup
-                             genome_shove
-                             genome_empty
-                             genome_gene_dup
-                             genome_gene_randomize
-                             genome_gene_replace
-                             genome_gene_delete
-                             genome_rotate
+                            genome_dup
+                            genome_swap
+                            genome_rot
+                            genome_flush
+                            genome_eq
+                            genome_stackdepth
+                            genome_yank
+                            genome_yankdup
+                            genome_shove
+                            genome_empty
+                            genome_gene_dup
+                            genome_gene_randomize
+                            genome_gene_replace
+                            genome_gene_delete
+                            genome_rotate
                              ;genome_gene_copy
                              ;genome_gene_copy_range
-                             genome_toggle_silent
-                             genome_silence
-                             genome_unsilence
-                             genome_instruction_eq
-                             genome_gene_close
-                             genome_gene_silent
-                             genome_close_inc
-                             genome_close_dec
-                             genome_new
-                             genome_parent1
-                             genome_parent2
-                             autoconstructive_integer_rand
-                             autoconstructive_boolean_rand
-                             genome_autoconstructing
-                             genome_if_autoconstructing
-                             genome_gene_genome_instruction
-                             genome_if_gene_genome_instruction
-                             genome_genesis
+                            genome_toggle_silent
+                            genome_silence
+                            genome_unsilence
+                            genome_instruction_eq
+                            genome_gene_close
+                            genome_gene_silent
+                            genome_close_inc
+                            genome_close_dec
+                            genome_new
+                            genome_parent1
+                            genome_parent2
+                            autoconstructive_integer_rand
+                            autoconstructive_boolean_rand
+                            genome_autoconstructing
+                            genome_if_autoconstructing
+                            genome_gene_genome_instruction
+                            genome_if_gene_genome_instruction
+                            genome_genesis
                              ;;genome_uniform_instruction_mutation
                              ;;genome_uniform_integer_mutation
                              ;;genome_uniform_float_mutation
@@ -782,23 +782,23 @@
                              ;genome_uniform_combination_and_deletion
                              ;genome_alternation
                              ;genome_uniform_crossover
-                             ))
+                            ))
                     :uniform-non-recombinative
                     (into (registered-for-stacks
-                            (if (:autoconstructive-environments @push-argmap)
-                              [:integer :boolean :exec :float :tag :environment]
-                              [:integer :boolean :exec :float :tag]))
+                           (if (:autoconstructive-environments @push-argmap)
+                             [:integer :boolean :exec :float :tag :environment]
+                             [:integer :boolean :exec :float :tag]))
                           '(genome_pop
-                             genome_dup
-                             genome_swap
-                             genome_rot
-                             genome_flush
-                             genome_eq
-                             genome_stackdepth
-                             genome_yank
-                             genome_yankdup
-                             genome_shove
-                             genome_empty
+                            genome_dup
+                            genome_swap
+                            genome_rot
+                            genome_flush
+                            genome_eq
+                            genome_stackdepth
+                            genome_yank
+                            genome_yankdup
+                            genome_shove
+                            genome_empty
                              ;;genome_gene_dup
                              ;;genome_gene_randomize
                              ;;genome_gene_replace
@@ -814,92 +814,114 @@
                              ;;genome_gene_silent
                              ;;genome_close_inc
                              ;;genome_close_dec
-                             genome_new
-                             genome_parent1
-                             genome_parent2
-                             autoconstructive_integer_rand
-                             autoconstructive_boolean_rand
-                             genome_autoconstructing
-                             genome_if_autoconstructing
-                             genome_gene_genome_instruction
-                             genome_if_gene_genome_instruction
-                             genome_genesis
-                             genome_uniform_instruction_mutation
-                             genome_uniform_integer_mutation
-                             genome_uniform_float_mutation
-                             genome_uniform_tag_mutation
-                             genome_uniform_string_mutation
-                             genome_uniform_boolean_mutation
-                             genome_uniform_close_mutation
-                             genome_uniform_silence_mutation
-                             genome_uniform_deletion
-                             genome_uniform_addition
-                             genome_uniform_addition_and_deletion
+                            genome_new
+                            genome_parent1
+                            genome_parent2
+                            autoconstructive_integer_rand
+                            autoconstructive_boolean_rand
+                            genome_autoconstructing
+                            genome_if_autoconstructing
+                            genome_gene_genome_instruction
+                            genome_if_gene_genome_instruction
+                            genome_genesis
+                            genome_uniform_instruction_mutation
+                            genome_uniform_integer_mutation
+                            genome_uniform_float_mutation
+                            genome_uniform_tag_mutation
+                            genome_uniform_string_mutation
+                            genome_uniform_boolean_mutation
+                            genome_uniform_close_mutation
+                            genome_uniform_silence_mutation
+                            genome_uniform_deletion
+                            genome_uniform_addition
+                            genome_uniform_addition_and_deletion
                              ;genome_uniform_combination_and_deletion
                              ;genome_alternation
                              ;genome_uniform_crossover
-                             ))
+                            ))
                     :gtm (let [by-type (registered-for-stacks
-                                         (if (:autoconstructive-environments @push-argmap)
-                                           [:integer :boolean :exec :float :tag :code :environment]
-                                           [:integer :boolean :exec :float :tag :code]))]
-                           '(gtm_left
-                              gtm_right
-                              gtm_inc_delay
-                              gtm_dec_delay
-                              gtm_dub1
-                              gtm_dub2
-                              gtm_bounce1
-                              gtm_bounce2
-                              gtm_blank0
-                              gtm_blank1
-                              gtm_blank2
-                              gtm_erase
-                              gtm_read_all
-                              gtm_write_all
-                              gtm_read_instruction
-                              gtm_write_instruction
-                              gtm_read_silent
-                              gtm_write_silent
-                              gtm_read_close
-                              gtm_write_close
-                              autoconstructive_integer_rand
-                              autoconstructive_boolean_rand
-                              autoconstructive_code_rand_atom
-                              genome_autoconstructing
-                              genome_if_autoconstructing
-                              exec_k_when_autoconstructing
-                              exec_s_when_autoconstructing
-                              exec_y_when_autoconstructing))
-                    :appending (let [by-type (registered-for-stacks
-                                               (if (:autoconstructive-environments @push-argmap)
-                                                 [:integer :boolean :exec :float :tag :code :environment]
-                                                 [:integer :boolean :exec :float :tag :code]))]
-                                 '(genome_append_parent1
-                                   genome_append_parent2
-                                   genome_append_random
-                                   genome_length
-                                   genome_parent1_length
-                                   genome_parent2_length
+                                        (if (:autoconstructive-environments @push-argmap)
+                                          [:integer :boolean :exec :float :tag :code :environment]
+                                          [:integer :boolean :exec :float :tag :code]))]
+                           (into by-type
+                                 '(gtm_left
+                                   gtm_right
+                                   gtm_inc_delay
+                                   gtm_dec_delay
+                                   gtm_dub1
+                                   gtm_dub2
+                                   gtm_bounce1
+                                   gtm_bounce2
+                                   gtm_blank0
+                                   gtm_blank1
+                                   gtm_blank2
+                                   gtm_erase
+                                   gtm_read_all
+                                   gtm_write_all
+                                   gtm_read_instruction
+                                   gtm_write_instruction
+                                   gtm_read_silent
+                                   gtm_write_silent
+                                   gtm_read_close
+                                   gtm_write_close
                                    autoconstructive_integer_rand
                                    autoconstructive_boolean_rand
+                                   autoconstructive_code_rand_atom
                                    genome_autoconstructing
-                                   genome_if_autoconstructing))
+                                   genome_if_autoconstructing
+                                   exec_k_when_autoconstructing
+                                   exec_s_when_autoconstructing
+                                   exec_y_when_autoconstructing)))
+                    :appending (let [by-type (registered-for-stacks
+                                              (if (:autoconstructive-environments @push-argmap)
+                                                [:integer :boolean :exec :float :tag :code :environment]
+                                                [:integer :boolean :exec :float :tag :code]))]
+                                 (into by-type
+                                       '(genome_append_parent1
+                                         genome_append_parent2
+                                         genome_append_random
+                                         genome_length
+                                         genome_parent1_length
+                                         genome_parent2_length
+                                         autoconstructive_integer_rand
+                                         autoconstructive_boolean_rand
+                                         genome_autoconstructing
+                                         genome_if_autoconstructing)))
                     :appending1 (let [by-type (registered-for-stacks
                                                (if (:autoconstructive-environments @push-argmap)
                                                  [:integer :boolean :exec :float :tag :code :environment]
                                                  [:integer :boolean :exec :float :tag :code]))]
-                                 '(genome_append1_parent1
-                                   genome_append1_parent2
-                                   genome_append1_random
-                                   genome_length
-                                   genome_parent1_length
-                                   genome_parent2_length
-                                   autoconstructive_integer_rand
-                                   autoconstructive_boolean_rand
-                                   genome_autoconstructing
-                                   genome_if_autoconstructing)))]
-      (when true (not (some #{instr} (:atom-generators @push-argmap)))
+                                  (into by-type
+                                        '(genome_append1_parent1
+                                          genome_append1_parent2
+                                          genome_append1_random
+                                          genome_length
+                                          genome_parent1_length
+                                          genome_parent2_length
+                                          autoconstructive_integer_rand
+                                          autoconstructive_boolean_rand
+                                          genome_autoconstructing
+                                          genome_if_autoconstructing)))
+                    :dubstep (let [by-type (registered-for-stacks
+                                            (if (:autoconstructive-environments @push-argmap)
+                                              [:integer :boolean :exec :float :tag :code :environment]
+                                              [:integer :boolean :exec :float :tag :code]))]
+                               (into by-type
+                                     '(genome_dub1
+                                       genome_dub2
+                                       genome_step1
+                                       genome_step2
+                                       genome_back1
+                                       genome_back2
+                                       genome_append1_random
+                                       genome_length
+                                       genome_parent1_length
+                                       genome_parent2_length
+                                       autoconstructive_integer_rand
+                                       autoconstructive_boolean_rand
+                                       genome_autoconstructing
+                                       genome_if_autoconstructing))))]
+      (when (not (some #{instr} (:atom-generators @push-argmap)))
         (swap! push-argmap assoc :atom-generators (conj (:atom-generators @push-argmap) instr))))
     ;;
     ;; include ERCs for floats, integers, and booleans


Revert to Gorilla REPL rather than Visual Studio Code (Calva) indentation

--- src/clojush/args.clj
+++ src/clojush/args.clj
@@ -10,64 +10,64 @@
           ;; Clojush system arguments
           ;;----------------------------------------

-         :use-single-thread false
+          :use-single-thread false
           ;; When true, Clojush will only use a single thread.

-         :random-seed (random/generate-mersennetwister-seed)
+          :random-seed (random/generate-mersennetwister-seed)
           ;; The seed for the random number generator.

-         :run-uuid nil
+          :run-uuid nil
           ;; This will be set to a new type 4 pseudorandom UUID on every run.

           ;;----------------------------------------
           ;; Standard GP arguments
           ;;----------------------------------------

-         :error-function (fn [p] '(0))
+          :error-function (fn [p] '(0))
           ;; Function that takes a program and returns a list of errors.

-         :error-threshold 0
+          :error-threshold 0
           ;; Pushgp will stop and return the best program if its total error
           ;; is <= error-threshold.

-         :atom-generators (into @registered-instructions
-                                (list
-                                 (fn [] (lrand-int 100))
-                                 (fn [] (lrand))))
+          :atom-generators (into @registered-instructions
+                                 (list
+                                   (fn [] (lrand-int 100))
+                                   (fn [] (lrand))))
           ;; The instructions that pushgp will use in random code.

-         :population-size 1000
+          :population-size 1000
           ;; Number of individuals in the population.

-         :max-generations 1001
+          :max-generations 1001
           ;; The maximum number of generations to run GP.

-         :max-point-evaluations 10e100
+          :max-point-evaluations 10e100
           ;; The limit for the number of point (instruction) evaluations to
           ;; execute during the run.

-         :genome-representation :plush
+          :genome-representation :plush
           ;; The representation for the genomes used for initialiation and inheritance.
           ;; Options include :plush and :plushy

-         :max-points 200
+          :max-points 200
           ;; Maximum size of push programs and push code, as counted by points
           ;; in the program. 1/4 this limit is used as the limit for sizes of
           ;; Plush genomes.

-         :max-genome-size-in-initial-program 50
+          :max-genome-size-in-initial-program 50
           ;; Maximum size of initial Plush genomes in generation 0. Keep in mind
           ;; that genome lengths will otherwise be limited by 1/4 of :max-points.

-         :evalpush-limit 150
+          :evalpush-limit 150
           ;; The number of Push instructions that can be evaluated before stopping
           ;; evaluation.

-         :evalpush-time-limit 0
+          :evalpush-time-limit 0
           ;; The time in nanoseconds that a program can evaluate before stopping,
           ;; 0 means no time limit.

-         :reuse-errors true
+          :reuse-errors true
           ;; When true, children produced through direct reproduction will not be
           ;; re-evaluated but will have the error vector of their parent.

@@ -75,30 +75,30 @@
           ;; Genetic operator probabilities
           ;;----------------------------------------

-         :genetic-operator-probabilities {:reproduction 0.0
-                                          :alternation 0.7
-                                          :uniform-mutation 0.1
-                                          :uniform-instruction-mutation 0.0
-                                          :uniform-integer-mutation 0.0
-                                          :uniform-float-mutation 0.0
-                                          :uniform-tag-mutation 0.0
-                                          :uniform-string-mutation 0.0
-                                          :uniform-boolean-mutation 0.0
+          :genetic-operator-probabilities {:reproduction 0.0
+                                           :alternation 0.7
+                                           :uniform-mutation 0.1
+                                           :uniform-instruction-mutation 0.0
+                                           :uniform-integer-mutation 0.0
+                                           :uniform-float-mutation 0.0
+                                           :uniform-tag-mutation 0.0
+                                           :uniform-string-mutation 0.0
+                                           :uniform-boolean-mutation 0.0
                                            ; Similar to the old ULTRA operator:
-                                          [:alternation :uniform-mutation] 0.2
-                                          :uniform-close-mutation 0.0
-                                          :uniform-silence-mutation 0.0
-                                          :uniform-crossover 0.0
-                                          :two-point-crossover 0.0
+                                           [:alternation :uniform-mutation] 0.2
+                                           :uniform-close-mutation 0.0
+                                           :uniform-silence-mutation 0.0
+                                           :uniform-crossover 0.0
+                                           :two-point-crossover 0.0
                                            ; A hill-climbing version of uniform-silence-mutation:
-                                          [:make-next-operator-revertable :uniform-silence-mutation] 0.0
-                                          :autoconstruction 0.0
-                                          :uniform-deletion 0.0
-                                          :uniform-addition 0.0
-                                          :uniform-addition-and-deletion 0.0
-                                          :uniform-combination-and-deletion 0.0
-                                          :genesis 0.0
-                                          :gene-selection 0.0}
+                                           [:make-next-operator-revertable :uniform-silence-mutation] 0.0
+                                           :autoconstruction 0.0
+                                           :uniform-deletion 0.0
+                                           :uniform-addition 0.0
+                                           :uniform-addition-and-deletion 0.0
+                                           :uniform-combination-and-deletion 0.0
+                                           :genesis 0.0
+                                           :gene-selection 0.0}
           ;; The map supplied to :genetic-operator-probabilities should contain genetic operators
           ;; that sum to 1.0. All available genetic operators are defined in clojush.pushgp.breed.
           ;; Along with single operators, pipelines (vectors) containing multiple operators are
@@ -111,85 +111,85 @@
           ;; Arguments related to genetic operators
           ;;----------------------------------------

-         :alternation-rate 0.01
+          :alternation-rate 0.01
           ;; When using alternation, the probability of alternating between the parents when moving
           ;; to the next gene.

-         :alignment-deviation 10
+          :alignment-deviation 10
           ;; When using alternation, the standard deviation of how far alternation may jump between
           ;; indices when switching between parents.

-         :uniform-mutation-rate 0.01
+          :uniform-mutation-rate 0.01
           ;; The probability of each token being mutated during uniform mutation.

-         :uniform-mutation-constant-tweak-rate 0.5
+          :uniform-mutation-constant-tweak-rate 0.5
           ;; The probability of mutating a constant instead of simply replacing the token
           ;; with a random instruction during uniform mutation.

-         :uniform-mutation-float-gaussian-standard-deviation 1.0
+          :uniform-mutation-float-gaussian-standard-deviation 1.0
           ;; The standard deviation used when tweaking float constants with Gaussian noise.

-         :uniform-mutation-int-gaussian-standard-deviation 1
+          :uniform-mutation-int-gaussian-standard-deviation 1
           ;; The standard deviation used when tweaking integer constants with Gaussian noise.

-         :uniform-mutation-string-char-change-rate 0.1
+          :uniform-mutation-string-char-change-rate 0.1
           ;; The probability of each character being changed when doing string constant tweaking.

-         :uniform-mutation-tag-gaussian-standard-deviation 100
+          :uniform-mutation-tag-gaussian-standard-deviation 100
           ;; The standard deviation used when tweaking tag locations with Gaussian noise.

-         :uniform-close-mutation-rate 0.1
+          :uniform-close-mutation-rate 0.1
           ;; The probability of each :close being incremented or decremented during uniform close
           ;; mutation.

-         :close-increment-rate 0.2
+          :close-increment-rate 0.2
           ;; The probability of making an increment change to :close during uniform close mutation,
           ;; as opposed to a decrement change.

-         :uniform-deletion-rate 0.01
+          :uniform-deletion-rate 0.01
           ;; The probability that any instruction will be deleted during uniform deletion.

-         :uniform-addition-rate 0.01
+          :uniform-addition-rate 0.01
           ;; The probability that any instruction will have a new one added before or after it during
           ;; uniform addition.

-         :uniform-addition-and-deletion-rate 0.01
+          :uniform-addition-and-deletion-rate 0.01
           ;; The probability, per gene, for additions in the first phase, and deletions in the second
           ;; phase (calculated for size-neutrality), of uniform-addition-and-deletion.

-         :uniform-combination-rate 0.01
+          :uniform-combination-rate 0.01
           ;; The probability, per gene, for combinations during uniform-combination

-         :uniform-combination-and-deletion-rate 0.01
+          :uniform-combination-and-deletion-rate 0.01
           ;; The probability, per gene, for combinations in the first phase, and deletions in
           ;; the second phase (calculated for size-neutrality), of uniform-combination-and-deletion.

-         :uniform-silence-mutation-rate 0.1
+          :uniform-silence-mutation-rate 0.1
           ;; The probability of each :silent being switched during uniform silent mutation.

-         :replace-child-that-exceeds-size-limit-with :random
+          :replace-child-that-exceeds-size-limit-with :random
           ;; When a child is produced that exceeds the size limit of (max-points / 4), this is
           ;; used to determine what program to return. Options include :parent, :empty, :random,
           ;; :truncate.

-         :parent-reversion-probability 1.0
+          :parent-reversion-probability 1.0
           ;; The probability of a child being reverted to its parent by a genetic operator that
           ;; has been made revertable, if the child is not as good as the parent on at least one
           ;; test case.

-         :tag-enrichment 0
+          :tag-enrichment 0
           ;; The number of extra copies of tag-related instructions that will be included in
           ;; the atom-generators.

-         :tag-enrichment-types [:integer :boolean :exec :float :char :string :code]
+          :tag-enrichment-types [:integer :boolean :exec :float :char :string :code]
           ;; The types for tag-related instructions that will be included in the atom-generators
           ;; when :tag-enrichment is greater than 0.

-         :gene-selection-rate 1.0
+          :gene-selection-rate 1.0
           ;; When using gene-selection, the probability of selecting a new parent when moving
           ;; to the next gene.

-         :autoconstructive false
+          :autoconstructive false
           ;; If true, then :genetic-operator-probabilities will be {:autoconstruction 1.0},
           ;; :epigenetic-markers will be [:close :silent], and :atom-generators will include
           ;; instructions specified via :autoconstructive-genome-instructions, and other settings
@@ -200,64 +200,64 @@
           ;; :genetic-operator-probabilities will be {[:make-next-operator-revertable
           ;; :autoconstruction] 1.0}.

-         :autoconstructive-diversification-test :gecco2016
+          :autoconstructive-diversification-test :gecco2016
           ;; Specifies the diversification test for autoconstruction. The default value of
           ;; :gecco2106, which uses the diversification test used in the work for the
           ;; paper "Evolution Evolves with Autoconstruction" in the ECADA workshop at GECCO 2016.
           ;; For other options and their effects, see the definition of diversifying? in
           ;; genetic-operators.clj.

-         :autoconstructive-genome-instructions :all
+          :autoconstructive-genome-instructions :all
           ;; Specifies the genome instructions to use for autoconstruction. The default value of
           ;; :all will use all genome instructions. See load-push-argmap in this file (args.clj)
           ;; for other options.

-         :autoconstructive-clone-probability 0.0
+          :autoconstructive-clone-probability 0.0
           ;; Specifies the probability that a clone will be produced rather than the result of
           ;; actual autoconstruction, when :autoconstructive is true.

-         :autoconstructive-decay 0.0
+          :autoconstructive-decay 0.0
           ;; The rate for random gene deletions after autoconstruction.

-         :autoconstructive-clone-decay :same
+          :autoconstructive-clone-decay :same
           ;; The rate for random gene deletions after cloning in autoconstruction. If this is
           ;; :same then the value for :autoconstructive-decay is used.

-         :autoconstructive-parent-decay 0.0
+          :autoconstructive-parent-decay 0.0
           ;; The rate for random gene deletions in parent genomes used for autoconstruction.

-         :autoconstructive-diffmeans-children 10
+          :autoconstructive-diffmeans-children 10
           ;; When using :autoconstructive-diversification-test :diffmeans-diversifying?, specifies
           ;; how many children of each child to generate and test. See genetic-operators.clj.

-         :autoconstructive-si-children 8
+          :autoconstructive-si-children 8
           ;; When using a "size and instruction" diversification test, specifies how many
           ;; children to generate and test. See genetic-operators.clj.

-         :autoconstructive-enough-new-errors-fraction 1/2
+          :autoconstructive-enough-new-errors-fraction 1/2
           ;; When using :enough-new-errors diversification test, specifies what fraction of the
           ;; errors in the maternal line must be distinct.

-         :autoconstructive-integer-rand-enrichment 0
+          :autoconstructive-integer-rand-enrichment 0
           ;; The number of extra instances of autoconstructive_integer_rand to include in
           ;; :atom-generators for autoconstruction. If negative then autoconstructive_integer_rand
           ;; will not be in :atom-generators at all.

-         :autoconstructive-boolean-rand-enrichment 0
+          :autoconstructive-boolean-rand-enrichment 0
           ;; The number of extra instances of autoconstructive_boolean_rand to include in
           ;; :atom-generators for autoconstruction. If negative then autoconstructive_boolean_rand
           ;; will not be in :atom-generators at all.

-         :autoconstructive-code-rand-atom-enrichment 0
+          :autoconstructive-code-rand-atom-enrichment 0
           ;; The number of extra instances of autoconstructive_code_rand_atom to include in
           ;; :atom-generators for autoconstruction. If negative then autoconstructive_code_rand_atom
           ;; will not be in :atom-generators at all.

-         :autoconstructive-tag-types [:integer :boolean :exec :float :char :string :code]
+          :autoconstructive-tag-types [:integer :boolean :exec :float :char :string :code]
           ;; The types for tag-related instructions that will be included in the atom-generators
           ;; when :autoconstructive is true.

-         :autoconstructive-environments false
+          :autoconstructive-environments false
           ;; If true, then :environment is included in the types for which instructions are
           ;; included for autoconstruction.

@@ -265,19 +265,19 @@
           ;; Epignenetics
           ;;----------------------------------------

-         :epigenetic-markers [:close]
+          :epigenetic-markers [:close]
           ;; A vector of the epigenetic markers that should be used in the individuals.
           ;; Implemented options include: :close, :silent

-         :close-parens-probabilities [0.772 0.206 0.021 0.001]
+          :close-parens-probabilities [0.772 0.206 0.021 0.001]
           ;; A vector of the probabilities for the number of parens ending at that position. See
           ;; random-closes in clojush.random

-         :silent-instruction-probability 0.2
+          :silent-instruction-probability 0.2
           ;; If :silent is used as an epigenetic-marker, this is the probability of random
           ;; instructions having :silent be true.

-         :track-instruction-maps false
+          :track-instruction-maps false
           ;; If true, each Plush instruction map will have a UUID attached to it. If the
           ;; gene has a "parent gene", it will also have the UUID of its parent.

@@ -285,7 +285,7 @@
           ;; Arguments related to Plushy representaion
           ;;----------------------------------------

-         :plushy-close-probability :automatic
+          :plushy-close-probability :automatic
           ;; Probability of choosing a :close (meta-) instruction when generating
           ;; Plushy genomes
           ;; Can either be a probability in [0, 1], or if :automatic, will be automatically
@@ -296,66 +296,66 @@
           ;; Arguments related to parent selection
           ;;----------------------------------------

-         :parent-selection :lexicase
+          :parent-selection :lexicase
           ;; The parent selection method. Options include :tournament, :lexicase, :epsilon-lexicase,
           ;; :elitegroup-lexicase, :uniform, :leaky-lexicase, :random-threshold-lexicase,
           ;; :random-toggle-lexicase, :randomly-truncated-lexicase, :novelty-search

-         :epsilon-lexicase-epsilon nil
+          :epsilon-lexicase-epsilon nil
           ;; When parent-selection is :epsilon-lexicase,
           ;; the value for epsilon. If nil, automatic epsilon lexicase selection will be used.

-         :epsilon-lexicase-probability 1
+          :epsilon-lexicase-probability 1
           ;; The probability that each filtering step in epsilon lexicase selection will allow
           ;; candidates with errors within epsilon of the best to survive, rather than just
           ;; the best.

-         :random-threshold-lexicase-probability 1
+          :random-threshold-lexicase-probability 1
           ;; The probability that each filtering step in random threshold lexicase selection will
           ;; allow candidates with errors equal to or better than a randomly chosen threshold to
           ;; survive, rather than just the best.

-         :random-toggle-lexicase-probability 1
+          :random-toggle-lexicase-probability 1
           ;; The probability that each filtering step in random toggle lexicase selection will
           ;; allow just the best to survive, rather than all individuals in the pool.

-         :randomly-truncated-lexicase-probability 1
+          :randomly-truncated-lexicase-probability 1
           ;; The probability that an application of randomly-truncated-lexicase-selection
           ;; will consider only a random subset of the test cases, rather than all of them.

-         :lexicase-leakage 0.1
+          :lexicase-leakage 0.1
           ;; If using leaky lexicase selection, the probability that a selection event will return
           ;; a random (tourny 1) individual from the entire population.

-         :lexicase-slippage 0
+          :lexicase-slippage 0
           ;; If using lexicase, leaky lexicase, epsilon lexicase, or random threshold lexicase
           ;; selection, the probability that each step of the lexicase selection process will
           ;; "slip" and return a random candidate from the current pool, rather than continuing
           ;; to filter the pool.

-         :sort-meta-errors-for-lexicase :random
+          :sort-meta-errors-for-lexicase :random
           ;; If using lexicase selection, determines how meta-errors will be sorted among
           ;; the actual errors. Options are :random (errors and meta-errors are shuffled
           ;; together), :first (meta-errors come first), or :last (meta-errors come last).

-         :tournament-size 7
+          :tournament-size 7
           ;; If using tournament selection, the size of the tournaments.

-         :total-error-method :sum
+          :total-error-method :sum
           ;; The method used to compute total error. Options include :sum (standard), :hah
           ;; (historically-assessed hardness), :rmse (root mean squared error), and :ifs
           ;; (implicit fitness sharing).

-         :normalization :none
+          :normalization :none
           ;; The method used to normalize the errors to the range [0,1], with 0 being best. Options
           ;; include :none (no normalization), :divide-by-max-error (divides by value of argument
           ;; :max-error), :e-over-e-plus-1 (e/(e+1) = 1 - 1/(e+1))

-         :max-error 1000
+          :max-error 1000
           ;; If :normalization is set to :divide-by-max-error, will use this number for
           ;; normalization.

-         :meta-error-categories []
+          :meta-error-categories []
           ;; A vector containing meta-error categories that can be used for parent selection,
           ;; but that do not affect total error or the determination of whether an individual
           ;; is considered to be a solution. Each meta-error-category should either be a function
@@ -367,33 +367,33 @@
           ;; function will be clojush.meta-errors/foo-meta-error. See clojush.meta-errors for
           ;; the current options for pre-defined meta-error functions.

-         :improvement-discount 0.5
+          :improvement-discount 0.5
           ;; The factor by successively older improvements are discounted when calculating
           ;; improvement-related meta-errors.

-         :error-change-recency-limit 5
+          :error-change-recency-limit 5
           ;; The number of generations within which an error change must have occurred to
           ;; have a :no-recent-error-change meta-error value of zero.

-         :decimation-ratio 1 ;; If >= 1, does nothing. Otherwise, is the percent of the population
+          :decimation-ratio 1 ;; If >= 1, does nothing. Otherwise, is the percent of the population
           ;; size that is retained before breeding. If 0 < decimation-ratio < 1, decimation
           ;; tournaments will be used to reduce the population to size (* population-size
           ;; decimation-ratio) before breeding.

-         :decimation-tournament-size 2
+          :decimation-tournament-size 2
           ;; Size of the decimation tournaments.

-         :print-selection-counts false
+          :print-selection-counts false
           ;; If true, keeps track of and prints the number of times each individual was selected
           ;; to be a parent

-         :self-mate-avoidance-limit 0
+          :self-mate-avoidance-limit 0
           ;; If non-zero, then when multiple parents are required for a genetic operator, an
           ;; effort will be made to select parents not equal to the first parent. The value
           ;; of this parameter is the number of re-selections that will be performed to try
           ;; to find a different parent, before using the same parent if the limit is exceeded.

-         :age-mediated-parent-selection false
+          :age-mediated-parent-selection false
           ;; If truthy, should be a vector of [pmin pmax]. In this case, then with probability
           ;; pmin, parent selection will consider only individuals with the minimum age in
           ;; the population; with probability pmax, all individuals will be considered; with
@@ -405,11 +405,11 @@
           ;; population, as you migh have, for example, from using the genesis operator or
           ;; autoconstruction.

-         :age-combining-function :average
+          :age-combining-function :average
           ;; For genetic operators that involve multiple parents, the function used to combine
           ;; the incremented ages of the parents to produce the age of the child.

-         :random-screen false
+          :random-screen false
           ;; If truthy, should be a map with values for :criterion, :probability and possibly
           ;; :reversible. In this case, then with probability :probability, each parent
           ;; selection event will consider only individuals with :grain-size equal to or less
@@ -420,18 +420,18 @@
           ;; to consider only individuals with :grain-size equal to or GREATER than the
           ;; chosen :grain-size.

-         :novelty-distance-metric :euclidean
+          :novelty-distance-metric :euclidean
           ;; When using novelty, the distance metric between two behavior vectors
           ;; Options: :manhattan, :euclidean

-         :individuals-for-novelty-archive-per-generation 0
+          :individuals-for-novelty-archive-per-generation 0
           ;; The number of individuals to add to the novelty archive per generation, if
           ;; using novelty search for parent selection or novelty as a meta-error. Default
           ;; of 0 means archive won't be maintained. Novelty GP paper uses one individual
           ;; every-other generation for 1000 generations; as such, a value of 1 seems like
           ;; a reasonable place to start.

-         :novelty-number-of-neighbors-k 25
+          :novelty-number-of-neighbors-k 25
           ;; The number of neighbors to consider when calculating the sparseness with
           ;; regard to the nearest neighbors. Paper claims it is "robust to modest variation."

@@ -439,72 +439,72 @@
           ;; Arguments related to the Push interpreter
           ;;----------------------------------------

-         :pop-when-tagging true
+          :pop-when-tagging true
           ;; When true, tagging instructions will pop the exec stack when tagging; otherwise, the
           ;; exec stack is not popped.

-         :tag-limit 10000
+          :tag-limit 10000
           ;; The size of the tag space.

-         :top-level-push-code false
+          :top-level-push-code false
           ;; When true, run-push will push the program's code onto the code stack prior to running.

-         :top-level-pop-code false
+          :top-level-pop-code false
           ;; When true, run-push will pop the code stack after running the program.

           ;;----------------------------------------
           ;; Arguments related to generational and final reports
           ;;----------------------------------------

-         :report-simplifications 100
+          :report-simplifications 100
           ;; The number of simplification steps that will happen during report simplifications

-         :final-report-simplifications 1000
+          :final-report-simplifications 1000
           ;; The number of simplification steps that will happen during final report
           ;; simplifications.

-         :problem-specific-initial-report default-problem-specific-initial-report
+          :problem-specific-initial-report default-problem-specific-initial-report
           ;; A function can be called to provide a problem-specific initial report, which happens
           ;; before the normal initial report is printed.

-         :problem-specific-report default-problem-specific-report
+          :problem-specific-report default-problem-specific-report
           ;; A function can be called to provide a problem-specific report, which happens before
           ;; the normal generational report is printed.

-         :return-simplified-on-failure false
+          :return-simplified-on-failure false
           ;; When true, will simplify the best indivual and return it, even if the error threshold
           ;; has not been reached. This will make failures return the same as successes.

-         :print-errors true
+          :print-errors true
           ;; When true, prints the error vector of the best individual.

-         :print-history false
+          :print-history false
           ;; When true, prints the history of the best individual's ancestors' total errors.

-         :print-timings false
+          :print-timings false
           ;; If true, report prints how long different parts of evolution have taken during the
           ;; current run.

-         :print-error-frequencies-by-case false
+          :print-error-frequencies-by-case false
           ; If true, print reports of error frequencies by case each generation.

-         :print-cosmos-data false
+          :print-cosmos-data false
           ;; If true, report prints COSMOS data each generation.

-         :maintain-ancestors false
+          :maintain-ancestors false
           ;; If true, save all ancestors in each individual (costly).

-         :print-ancestors-of-solution false
+          :print-ancestors-of-solution false
           ;; If true, final report prints the ancestors of the solution. Requires
           ;; :maintain-ancestors to be true.

-         :print-homology-data false
+          :print-homology-data false
           ;; If true, prints the homology statistics.

-         :exit-on-success true
+          :exit-on-success true
           ;; When true, will exit the run when there is an individual with a zero-error vector

-         :visualize false
+          :visualize false
           ;; When true, graphics will be displayed to indicate system progress.
           ;; See the comments in src/clojush/pushgp/visualize.clj

@@ -512,52 +512,52 @@
           ;; Arguments related to printing JSON, EDN, CSV, and remote recording
           ;;----------------------------------------

-         :print-csv-logs false
+          :print-csv-logs false
           ;; Prints a CSV log of the population each generation.

-         :print-edn-logs false
+          :print-edn-logs false
           ;; Prints an EDN log of the run.

-         :print-json-logs false
+          :print-json-logs false
           ;; Prints a JSON log of the population each generation.

-         :csv-log-filename "log.csv"
+          :csv-log-filename "log.csv"
           ;; The file to print CSV log to.

-         :edn-log-filename "log.edn"
+          :edn-log-filename "log.edn"
           ;; The file to print EDN log to.

-         :json-log-filename "log.json"
+          :json-log-filename "log.json"
           ;; The file to print JSON log to.

-         :csv-columns [:generation :location :total-error :push-program-size]
+          :csv-columns [:generation :location :total-error :push-program-size]
           ;; The columns to include in a printed CSV beyond the generation and individual. Options
           ;; include: [:generation :location :parent-uuids :genetic-operators :push-program-size
           ;; :plush-genome-size :push-program :plush-genome :genome-closes :push-paren-locations
           ;; :total-error :test-case-errors]

-         :edn-keys [:uuid :parent-uuids :genetic-operators :program :genome :total-error :errors]
+          :edn-keys [:uuid :parent-uuids :genetic-operators :program :genome :total-error :errors]
           ;; Keys from clojush.individual.individual that should be included.

-         :edn-additional-keys [:generation :location]
+          :edn-additional-keys [:generation :location]
           ;; Additional information to include in the edn-printout. Available options are
           ;; [:generation :location :push-program-size :plush-genome-size].

-         :log-fitnesses-for-all-cases false
+          :log-fitnesses-for-all-cases false
           ;; If true, the CSV and JSON logs will include the fitnesses of each individual on every
           ;; test case.

-         :json-log-program-strings false
+          :json-log-program-strings false
           ;; If true, JSON logs will include program strings for each individual.

-         :record-host nil
+          :record-host nil
           ;; Should be in the format "<hostname>:<port>"
           ;; If set, will send logs of each run to a server running on this
           ;; host
-         :label nil
+          :label nil
           ;; If set, will send this in the configuration of the run, to the
           ;; external record
-         )))
+          )))

 (defn augment-for-autoconstruction
   []


add increment csv

add increment csv

--- src/codestat/csv.clj
+++ src/codestat/csv.clj
@@ -142,16 +142,24 @@
               (partial get-project-records workspace)
               projects))))

-;;; noraml records should have less 10000 line added
-(defn is-valid-record?
-  [record]
-  (if (> (:added-lines record) 3000)
-    false
-    true))
+
 ;;; return date like: 2015-09-18
 (defn get-date
   [record]
   (subs (:date record) 0 10))
+;;; transfer 2015-09-01 to 2015009001
+(defn date2int
+  [date]
+  (Integer/parseInt (clojure.string/replace date #"-" "0")))
+;;;
+;;; noraml records should have less 10000 line added
+;;; and date later than 2015-09-01
+(defn is-valid-record?
+  [record]
+  (if (or (> (:added-lines record) 3000)
+          (< (date2int (get-date record)) (date2int "2015-09-01")))
+    false
+    true))

 (defn is-commit-in-date?
   [date record]
@@ -167,18 +175,26 @@
           0
           records))

+;;; get line increments
+(defn get-increment-lines
+  [records]
+  (reduce #(+ %1 (- (:added-lines %2) (:deleted-lines %2)))
+          0
+          records))
+
+
 (defrecord date-lines-record
   [date lines])
 ;;;
 ;;; merge records by date
 ;;;
 (defn merge-records-by-date
-  [records]
+  [records functor]
   (let [dm (group-by get-date (filter (partial is-commit-in-date? "*")
                                       (filter is-valid-record? records)))]
     (map #(->date-lines-record
              %1
-             (get-modified-lines (get dm %1)))
+             (functor (get dm %1)))
          (keys dm))))

 ;;;
@@ -194,12 +210,16 @@
                                 (:lines rs)))))

 (defn write-workspace-dlr-to-csv
-  [workspace file]
+  [workspace file functor]
   (write-date-lines-record-to-csv
     (merge-records-by-date
-      (get-workspace-records workspace))
+      (get-workspace-records workspace functor))
     file))

+
+(defn write-workspae-increment-dlr-to-csv
+  [workspace file]
+  (write-workspace-dlr-to-csv workspace file get-increment-lines))

 ;;; project's everyday progress
@@ -211,36 +231,36 @@
   {:project (:project record) :date (get-date record)})

 (defn get-project-lines-records
-  [workspace ]
+  [workspace functor]
   (let [dm (group-by get-project-and-date
             (filter is-valid-record? (get-workspace-records workspace)))]
     (map #(->project-lines-record
            (:project %1)
            (:date %1)
-           (get-modified-lines (get dm %1)))
+           (functor (get dm %1)))
          (keys dm))))
 ;;;
 ;;; project - loc
 ;;;
 (defn write-workspace-plr-to-csv
-  [workspace file]
+  [workspace file functor]
   (with-open [*out* (java.io.FileWriter. file)]
-    (doseq [rs (get-project-lines-records workspace)]
+    (doseq [rs (get-project-lines-records workspace functor)]
       (clojure.pprint/cl-format *out*
                                 "~s,~s,\"~d\"\r\n"
                                 (:project rs)
                                 (:date rs)
                                 (:lines rs)))))

-
-
-
-
-
-
-
-
-
-
-
-
+(defn write-workspace-modified-lines-to-csv
+  [workspace file ]
+  (write-workspace-plr-to-csv workspace file get-modified-lines))
+
+(defn write-workspace-increment-lines-to-csv
+  [workspace file]
+  (write-workspace-plr-to-csv workspace file get-increment-lines))
+
+;;;
+;;; count total line of project
+;;;
+


Remove trailing space

Remove trailing space

--- src/control/core.clj
+++ src/control/core.clj
@@ -346,7 +346,7 @@
                    task (task-name @tasks)
                    includes (:includes cluster)
                    debug (:debug cluster)
-                   log (or (:log cluster) true)
+                   log (or (:log cluster) true)
                    clients (if (nil? cluster) (create-clients (first args)) clients)]
                (check-valid-options cluster :user :clients :addresses :parallel :includes :debug :log :ssh-options :scp-options :rsync-options :name)
                ;;if task is nil,exit


Fix bug to fix build

Fix bug to fix build

--- src/degasolv/cli.clj
+++ src/degasolv/cli.clj
@@ -566,7 +566,7 @@
                 (:config-files global-options))
               config
               (get-config config-files)
-              cli-option-packs (:option-packs options)
+              cli-option-packs (:option-packs global-options)
               selected-option-packs
               (if (empty? cli-option-packs)
                 (into [] (:option-packs config))


Tidy up

Tidy up

--- src/discuss/lib.cljs
+++ src/discuss/lib.cljs
@@ -112,6 +112,7 @@
   []
   (get-in @app-state [:layout :error-msg]))

+
 ;; Change views
 (defn change-view!
   "Switch to a different view."
@@ -142,6 +143,10 @@
   [arg]
   (.log js/console arg))

+(defn substring?
+  "Evaluates if a substring is contained in the given string."
+  [sub st]
+  (not= (.indexOf st sub) -1))

 ;; CLJS to JS
 (defn clj->json


No longer needs to be wrapped in a vector

--- src/doctopus/web.clj
+++ src/doctopus/web.clj
@@ -77,7 +77,7 @@
                   "index.html"   {:get serve-index}
                   "add-head"     {:get serve-add-head-form :post add-head}
                   "add-tentacle" {:get serve-add-tentacle-form :post add-tentacle}
-                  "docs/"         [(load-routes doctopus)]}])
+                  "docs/"        (load-routes doctopus)}])

 (def application-handlers
   (bidi/make-handler routes))


Update arguments

Update arguments

--- src/grimoire/doc.clj
+++ src/grimoire/doc.clj
@@ -204,8 +204,8 @@
 (declare -main)

 (defn -main
-  "Usage: lein grim src <platform> <dst>
-  : lein grim artifact <platform> <groupid> <artifactid> <version> <dst>
+  "Usage: lein grim [src|:src|source|:source] <platform> <dst>
+  : lein grim [artifact|:artifact] <platform> <groupid> <artifactid> <version> <dst>

   In source mode, lein-grim traverses the source paths of the current project,
   enumerating and documenting all namespaces. This is intended for documenting


Improve 'missing log parameters' error message

--- src/onyx/log/zookeeper.clj
+++ src/onyx/log/zookeeper.clj
@@ -227,7 +227,8 @@
                (extensions/read-chunk log :log-parameters nil)
                (catch Throwable e
                  (warn e)
-                 (warn "Log parameters couldn't be discovered. Backing off 500ms and trying again...")
+                 (warn (str "Log parameters have yet to be written to ZooKeeper by a peer. "
+                            "Backing off 500ms and trying again..."))
                  nil))]
       chunk
       (do (Thread/sleep 500)


Added preconditions to numeric operations

--- src/staplo/operations.cljs
+++ src/staplo/operations.cljs
@@ -59,12 +59,28 @@
                           #(contains-str % "ca"))
               }
   "numbers" {
-    "+7" #(+ 7 %)
-    "+9" #(+ 9 %)
-    "*2" #(* 2 %)
-    "*5" #(* 5 %)
-    "*11" #(* 11 %)
-    "sqr" #(* % %)
-    "reverse" (wrap-endec str/reverse)
-    "rotate" (wrap-endec rotate)
-  }})
+              "+7" (operation-pair
+                     #(+ 7 %)
+                     (constantly true))
+              "+9" (operation-pair
+                     #(+ 9 %)
+                     (constantly true))
+              "*2" (operation-pair
+                     #(* 2 %)
+                     #(not= 0 %))
+              "*5" (operation-pair
+                     #(* 5 %)
+                     #(not= 0 %))
+              "*11" (operation-pair
+                      #(* 11 %)
+                      #(not= 0 %))
+              "sqr" (operation-pair
+                      #(* % %)
+                      #(<= % 20))
+              "reverse" (operation-pair
+                          (wrap-endec str/reverse)
+                          #(let [string (.toString %)] (not= (str (str/reverse string)))))
+              "rotate" (operation-pair
+                         (wrap-endec rotate)
+                         #(let [string (.toString %)] (not (same-char? string))))
+              }})


Sort files by publish date in RSS feed.

Sort files by publish date in RSS feed.

My rss feeds were generating entries in random order; this change allows
generating rss feeds consistently, sorted by the publish date set in the
entry.

--- src/io/perun/rss.clj
+++ src/io/perun/rss.clj
@@ -3,13 +3,15 @@
             [clj-rss.core  :as rss-gen]))

 (defn rss-definitions [files]
-  (for [file files]
-    {:link        (:canonical-url file)
-     :guid        (:canonical-url file)
-     :pubDate     (:date-published file)
-     :title       (:title file)
-     :description (:description file)
-     :author      (:author-email file)}))
+  (reverse
+   (sort-by :pubDate
+            (for [file files]
+              {:link        (:canonical-url file)
+               :guid        (:canonical-url file)
+               :pubDate     (:date-published file)
+               :title       (:title file)
+               :description (:description file)
+               :author      (:author-email file)}))))

 (defn generate-rss-str [files options]
   (let [rss-options  {:title       (:site-title options)


new fn for adding a book to a shelf

new fn for adding a book to a shelf

--- src/myshelf/core.clj
+++ src/myshelf/core.clj
@@ -253,3 +253,13 @@
                            access-token
                            review-url
                            params)))
+
+(defn add-book-to-shelf
+  [consumer access-token book-id shelf]
+  (let [add-url "https://www.goodreads.com/shelf/add_to_shelf.xml"
+        params {:name shelf
+                :book_id book-id}]
+    (make-auth-request-POST consumer
+                            access-token
+                            add-url
+                            params)))


changed css of range input to see how it feels on mobile

--- src/nn/views/css.clj
+++ src/nn/views/css.clj
@@ -52,11 +52,26 @@

                     [:.scroller {:display "none"}]

+                    [(keyword "input[type='range']")
+                     {:-webkit-appearance "none !important"
+                      :background-color "#FF0DFF"
+                      :outline "none"}
+                     ]
+
+                    [(keyword "input[type='range']::-webkit-slider-thumb")
+                     {:-webkit-appearance "none !important"
+                      :border-radius "10px"
+                      :background-color "white"
+                      :height "44px"
+                      :width "44px"}
+                     ]
+
                     (ss/at-media {:min-width "320px"  :max-width "480px"}
                                  [:.mobile ^:prefix {:flex-flow "column"
                                                      :width "100%"
                                                      :height "100%"}]
-                                 [:.scroller {:display "block"}])
+                                 [:.scroller {:display "block"
+                                              }])
                       [:.baseline ^:prefix {:align-items "baseline"}]
                       [:.start ^:prefix {:align-self "flex-start"}
                        ]


strings

strings

--- src/oi_lang/obj.cljs
+++ src/oi_lang/obj.cljs
@@ -9,13 +9,16 @@
    number = digit+
    <digit> = '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'

-   string = '\"'
+   string = <'\"'> char* <'\"'>
+   <char> = #'[^\"]'
    ")

 (defn parse [source]
   (insta/transform
-    {:number (fn [& digits] [:number (int (apply str digits))])}
+    {:number (fn [& digits] [:number (int (apply str digits))])
+     :string (fn [& chars] [:string (apply str chars)])}
     (oi-program source)))

 (deftest simple-parses
-  (is (= (parse "42") [:start [:literal [:number 42]]])))
+  (is (= (parse "42") [:start [:literal [:number 42]]]))
+  (is (= (parse "\"foo\"") [:start [:literal [:string "foo"]]])))


Partially working grounded quantification and ha-vs-ha transitions

--- src/player/core.cljs
+++ src/player/core.cljs
@@ -2,6 +2,7 @@
   (:require
     #_[om.core :as om :include-macros true]
     [clojure.set :refer [union]]
+    [clojure.walk :as walk]
     [sablono.core :as sab :include-macros true])
   (:require-macros
     [devcards.core :as dc :refer [defcard deftest]]))
@@ -18,7 +19,8 @@
   (* d (.ceil js/Math (/ t d))))

 (def frame-length (/ 1 30))
-(def time-unit (/ frame-length 4))
+(def time-units-per-frame 4)
+(def time-unit (/ frame-length time-units-per-frame))
 (def precision 0.001)

 (defn empty-interval? [[start end]]
@@ -48,9 +50,19 @@
     (vector? k) (get-var-and-flow has (get-in has [:objects (first k)]) (second k))
     :else (assert (or (nil? k) (keyword? k) (vector? k)) "Unrecognized variable lookup type")))

+(defn constant-from-expr [has ha c]
+  (cond
+    (number? c) c
+    (and (vector? c) (= (first c) :d)) (second (apply get-var-and-flow has ha (rest c)))
+    (vector? c) (first (get-var-and-flow has ha c))
+    (seq? c) (apply ({'+ + '- - '* * '/ /} (first c))
+                    (map #(constant-from-expr has ha %) (rest c)))))
+
 (defn simple-interval [has ha simple-guard]
   (let [rel (first simple-guard)
-        c (last simple-guard)
+        c (constant-from-expr has ha (last simple-guard))
+        _ (println "Constant" (last simple-guard) "is" c)
+        _ (println ":d :x is" (constant-from-expr has ha [:d :x]))
         v1k (second simple-guard)
         v2k (if (= (count simple-guard) 4) (third simple-guard) nil)
         [v10 v1f] (get-var-and-flow has ha v1k)
@@ -103,7 +115,7 @@

 (defn extrapolate [ha now]
   (let [req (:next-required-transition ha)
-        _ (assert (or (nil? req) (<= now (first (:interval req)))) "Extrapolating beyond next transition of HA")
+        ;_ (assert (or (nil? req) (<= now (first (:interval req)))) "Extrapolating beyond next transition of HA")
         s (:state ha)
         flows (:flows (get ha s))
         delta (- now (:entry-time ha))
@@ -155,6 +167,7 @@
 (defn make-edge [target guard label]
   (assert (every? #(#{:gt :geq :leq :lt} (first %)) guard)
           "Guard must be a list of difference formulae.")
+  (println "guard:" guard)
   {:target target :guard guard :label label :update identity})

 (defn invert-guard [g]
@@ -165,8 +178,10 @@
     :lt (assoc g 0 :geq)))

 (defn make-state [id flows & edges]
-  (let [edge-guards (map :guard (filter #(:required (:label %)) edges))]
+  (let [edges (flatten [edges])
+        edge-guards (map :guard (filter #(:required (:label %)) edges))]
     ; invariant is a disjunction of negated guards
+    (println "es" edges "eguards" edge-guards)
     {:id id :flows flows :edges edges :invariant (map #(map invert-guard %) edge-guards)}))

 (defn valid-for-inputs [_transition _inputs]
@@ -252,23 +267,35 @@
 (defonce scene-a (atom {}))
 (defonce last-time nil)

-(defn goomba [id x y speed]
+(defn goomba [id x y speed state others]
   (make-ha id                                               ;id
            {:x     x :y y                                   ;init
             :w     16 :h 16
-            :state :right}
-           (make-state :right                               ;name
-                       {:x speed}                           ;flows
-                       ;edges
-                       ; x < 16 && x + dx*frame >= 16 --> x >= 16 - dx*frame
-                       (make-edge :left [[:lt :x 16] [:geq :x (- 16 (* frame-length speed))]] #{:required}))
-           (make-state :left                                ;name
-                       {:x (- speed)}                       ;flows
-                       ;edges
-                       ; x > 8 && x + dx*frame <= 8 --> x <= 8 - dx*frame
-                       (make-edge :right [[:gt :x 8] [:leq :x (- 8 (* frame-length (- speed)))]] #{:required}))))
-
-(defn make-scene-a [x] (let [objects [(goomba :a x 8 8)]
+            :state state}
+           (make-state
+             :right                                         ;name
+             {:x speed}                                     ;flows
+             ;edges
+             ; x < 16 && x + dx*frame >= 16 --> x >= 16 - dx*frame
+             (make-edge :left [[:lt :x 64] [:geq :x '(- 64 [:d :x])]] #{:required})
+             ; x + 16 < x2 + dx2*frame && x + dx*frame + 16 >= x2 + dx2*frame
+             ; x - x2 < -16 + dx2*frame && x - x2 >= dx2*frame - dx*frame - 16
+             (map #(make-edge :left [[:lt :x [% :x] (list '+ -16 [:d % :x])]
+                                     [:geq :x [% :x] (list '- [:d % :x] [:d :x] 16)]]
+                              #{:required}) others))
+           (make-state
+             :left                                          ;name
+             {:x (- speed)}                                 ;flows
+             ;edges
+             ; x > 8 && x + dx*frame <= 8 --> x <= 8 - dx*frame
+             (make-edge :right [[:gt :x 8] [:leq :x '(- 8 [:d :x])]] #{:required})
+             ; x > x2 + 16 + dx2 && x + dx*frame <= x2 + dx2*frame + 16 --> x - x2 > 16 + dx2 && x - x2 <= dx2*frame + 16 - dx*frame
+             ; x - x2 > 16 + dx2
+             (map #(make-edge :right [[:gt :x [% :x] (list '+ 16 [:d % :x])]
+                                      [:leq :x [% :x] (list '+ [:d % :x] 16 (list '- [:d :x]))]]
+                              #{:required}) others))))
+
+(defn make-scene-a [x] (let [objects [(goomba :a x 8 8 :right #{:b}) (goomba :b (* x 4) 8 8 :left #{:a})]
                              obj-ids (map :id objects)
                              obj-dict (zipmap obj-ids objects)
                              ; got to let every HA enter its current (initial) state to set up state invariants like
@@ -297,18 +324,18 @@

 (defcard ha-data
          (fn [scene _owner]
-           (let [a (get-in @scene [:objects :a])]
+           (let [a (get-in @scene [:objects :a])
+                 b (get-in @scene [:objects :b])
+                 desc (fn [ha]
+                        [[:div "Required transitions:" (str (required-transitions ha))]
+                         [:div "Next required transition:" (str (:next-required-transition ha))]
+                         [:div "Optional transitions:" (str (optional-transitions ha))]
+                         [:div "Intervals:" (str (:optional-transitions ha))]])]
              (sab/html [:div
-                        [:div "Required transitions:" (str (required-transitions a))]
-                        [:div "Next required transition:" (str (:next-required-transition a))]
-                        [:div "Optional transitions:" (str (optional-transitions a))]
-                        [:div "Intervals:" (str (:optional-transitions a))]])))
+                        (concat
+                          (desc a)
+                          (desc b))])))
          scene-a)
-
-(defcard enter-trans
-         (let [a (get-in (make-scene-a 16) [:objects :a])
-               a (enter-state {:a a} a :right 0)]
-           (:next-required-transition (enter-state {:a a} a :left 0))))

 #_(defcard sample-time
            "What are the current values of the variables of object a?"
@@ -319,12 +346,30 @@

 (defcard draw-scene
          (fn [scene _owner]
-           (let [scale 2]
-             (sab/html [:div {:style {:backgroundColor "blue" :width (str (* scale 320) "px") :height (str (* scale 240) "px") :position "relative"}}
-                        (map (fn [{x :x y :y w :w h :h}]
-                               [:div {:style {:width           (str (* scale w) "px") :height (str (* scale h) "px") :borderRadius (str (* scale w) "px")
-                                              :backgroundColor "brown"
-                                              :position        "absolute" :left (str (* scale x) "px") :bottom (str (* scale y) "px")}}])
+           (let [scale 2
+                 view-h (str (* scale 240) "px")]
+             (sab/html [:div {:style {:backgroundColor "blue" :width (str (* scale 320) "px") :height view-h :position "relative"}}
+                        (map (fn [{x :x y :y w :w h :h :as ha}]
+                               [:div
+                                (map (fn [trans]
+                                       (println trans (:target trans))
+                                       (let [[s e] (:interval trans)
+                                             sx (* scale (:x (extrapolate ha s)))
+                                             ex (* scale (:x (extrapolate ha e)))]
+                                         [:div {:style {:height view-h :width (.abs js/Math (- sx ex)) :position :absolute :left (.min js/Math sx ex) :backgroundColor "grey"}}
+                                          [:div {:style {:position :absolute :top "64px" :width "200px"}} (str (:id ha) "-" (:target (:transition trans)))]
+                                          [:div {:style {:height view-h :width (* scale 2) :backgroundColor "red"}}]
+                                          [:div {:style {:height view-h :width (* scale 2) :backgroundColor "green"}}]]))
+                                     (vector (first (transition-intervals (:objects scene)
+                                                                 ha
+                                                                 Infinity
+                                                                 (required-transitions ha)))))])
+                             (map #(extrapolate % (:now @scene)) (vals (:objects @scene))))
+                        (map (fn [{x :x y :y w :w h :h :as ha}]
+                               [:div
+                                [:div {:style {:width           (str (* scale w) "px") :height (str (* scale h) "px") :borderRadius (str (* scale w) "px")
+                                               :backgroundColor "brown"
+                                               :position        "absolute" :left (str (* scale x) "px") :bottom (str (* scale y) "px")}}]])
                              (map #(extrapolate % (:now @scene)) (vals (:objects @scene))))
                         [:button {:onClick #(do (swap! scene (fn [s] (assoc s :playing (not (:playing s))))) true)} (if (:playing @scene) "PAUSE" "PLAY")]
                         [:button {:onClick #(reset-scene-a!)} "RESET"]])))


remove schema

remove schema

--- ssclj/jar/build.boot
+++ ssclj/jar/build.boot
@@ -43,7 +43,6 @@
                    [org.clojure/tools.logging]
                    [org.clojure/tools.namespace]
                    [potemkin]
-                   [prismatic/schema]
                    [ring/ring-core]
                    [ring/ring-json]
                    [superstring]


save generated geoson in app-state

save generated geoson in app-state

--- src/hatti/views/map.cljs
+++ src/hatti/views/map.cljs
@@ -313,8 +313,9 @@
 (defn- load-mapboxgl-helper
   "Helper for map-and-markers component (see below);
    If map doesn't exists in local-state, creates it and puts it there."
-  [{:keys [dataset-info] {:keys [tiles-server]} :map-page :as app-state}
-   owner & {:keys [geojson geofield]}]
+  [{:keys [dataset-info]
+    {:keys [tiles-server] map-geojson :geojson} :map-page :as app-state}
+   owner & {:keys [geofield] updated-map-geojson :geojson}]
   (let [mapboxgl-map (or (om/get-state owner :mapboxgl-map)
                          (mu/create-mapboxgl-map (om/get-node owner)))
         {:keys [formid id_string query]} dataset-info
@@ -327,6 +328,8 @@
                                   tiles-server)
                          (mu/get-tiles-endpoint tiles-server
                                                 formid ["id"] flat-form query))
+        ;; generated geojson
+        geojson (or updated-map-geojson map-geojson)
         load-layers (fn []
                       (mu/map-on-load
                        mapboxgl-map shared/event-chan id_string
@@ -360,11 +363,11 @@
           (load-layers))
         (do
           (.off mapboxgl-map "load")
-          (.on mapboxgl-map "load" load-layers)))
-      (om/set-state! owner :geojson geojson))
+          (.on mapboxgl-map "load" load-layers))))
     (om/set-state! owner :mapboxgl-map mapboxgl-map)
     (om/set-state! owner :layer-id id_string)
-    (om/update! app-state [:map-page :mapboxgl-map] mapboxgl-map)))
+    (om/update! app-state [:map-page :mapboxgl-map] mapboxgl-map)
+    (om/update! app-state [:map-page :geojson] geojson)))

 (defn mapboxgl-map
   "Map and markers. Initializes mapboxgl map + adds vector tile data to it.


cjl - Change game format

cjl - Change game format

--- src/icfp2015/problem.clj
+++ src/icfp2015/problem.clj
@@ -22,12 +22,12 @@
 ;            { :members [ { :x 0 :y 1 } { :x 5 :y 2 } ]
 ;              :pivot { :x 0 :y 1 } } ] }
 ;
-; a game looks like this
+; A game looks like this. Notice coordinate pairs are just vectors now
 ; { :width 10
 ;   :height 10
-;   :filled [ { :x 5 :y 4 } { :x 6 :y 2 } ]
-;   :units [ { :members [ { :x 1 :y 2 } { :x 0 :y 5 } ]
-;              :pivot { :x 0 :y 0 } } ] }
+;   :filled #{ [ 5 4 ] [ 6 2 ] }
+;   :units [ { :members #{ [ 1 2 ] [ 0 5 ] }
+;              :pivot [ 0 0 ] } ] }
 (defn get-games
   "Returns (count (:sourceSeeds problem)) games given a problem."
   [problem]


Fix whitespace errors in r.u.servelt.

Fix whitespace errors in r.u.servelt.

--- ring-servlet/src/ring/util/servlet.clj
+++ ring-servlet/src/ring/util/servlet.clj
@@ -77,15 +77,15 @@
           (.print writer (str chunk))
           (.flush writer)))
     (instance? InputStream body)
-    (let [^InputStream b body]
-      (with-open [out (.getOutputStream response)]
-        (io/copy b out)
-        (.close b)
-        (.flush out)))
+      (let [^InputStream b body]
+        (with-open [out (.getOutputStream response)]
+          (io/copy b out)
+          (.close b)
+          (.flush out)))
     (instance? File body)
-    (let [^File f body]
-      (with-open [stream (FileInputStream. f)]
-        (set-body response stream)))
+      (let [^File f body]
+        (with-open [stream (FileInputStream. f)]
+          (set-body response stream)))
     (nil? body)
       nil
     :else