   )
 )
 
+(defn no-op [v]
+  v
+)
+
+(defn make-counter [init-val]
+  (let [c (atom init-val)]
+    {:next #(swap! c inc)
+     :reset #(reset! c init-val)
+     :curr #(swap! c no-op)}
+  )
+)
+
 (defn gen-big-data
   [districtCount schoolCount studentCount]
   (def sectionName "7th Grade Math - Sec 2")
   (def assessmentName "Grade 7 State Math")
-
+  (def i (make-counter 0))
+  ;(def i (atom 0))
+  (println
+    (format "Starting assessment data generation: [%d districts %d schools %d students/school]"
+    districtCount schoolCount studentCount)
+  )
+  (println (format "[0/%d districts]" districtCount))
   (gen-assessment assessmentName "/tmp/test/F-assessment.xml")
   (def rng (range 1 (+ 1 studentCount)))
   (doseq [ [district] (map list (gen-district-schools districtCount schoolCount studentCount))]
+    (def startTime (System/currentTimeMillis))
     (doseq [ [districtName schools] district]
       (gen-schools districtName schools (format "/tmp/test/A-%s-schools.xml" districtName))
       (gen-sessions districtName schools (format "/tmp/test/B-%s-calendar.xml" districtName))

)

(defn enroll [schoolName studentId]
  (gen-enroll schoolName studentId)
  (gen-section-assoc schoolName studentId)
)

(defn gen-enrollments [schools rng output-file]


(defn gen-edfi
  [interchange output-file contents]
  ; (prn output-file)
  (with-open [out (java.io.OutputStreamWriter. (java.io.FileOutputStream. output-file) "UTF-8")]
    (emit (element interchange {:xmlns "http://ed-fi.org/0100"} contents) out)
  )
