   [["-c" "--customers N" "Number of customers"
     :default 100
     :parse-fn #(Integer/parseInt %)]
-   ["-r" "--reservations N" "Number of reservations"
-    ; Corresponds to parameter -t in vacation.
+   ["-n" "--queries N" "Number of queries per relation per reservation"
+    ; In vacation, this is the total number of queries per reservation; here,
+    ; this is the number of queries per relation per reservation, so / 3.
+    :default 100
+    :parse-fn #(Integer/parseInt %)]
+   ["-r" "--relations N" "Number of flights/rooms/cars"
+    :default 500
+    :parse-fn #(Integer/parseInt %)]
+   ["-t" "--reservations N" "Number of reservations"
+    ; Reservations are called "transactions" in vacation.
     :default 1000
-    :parse-fn #(Integer/parseInt %)]
-   ["-n" "--relations N" "Number of flights/rooms/cars"
-    ; Corresponds to parameter -r in vacation.
-    :default 500
     :parse-fn #(Integer/parseInt %)]
    ;["-w" "--workers N" "Number of workers"
    ; :default 20

(defn -main [& args]
  "Main function. `args` should be a list of command line arguments."
  (when-let [options (parse-args args)]
    (let [{n-customers    :customers
           n-reservations :reservations
           n-relations    :relations} options
          {:keys [reservations cars flights rooms]}
            (initialize-data n-customers n-reservations n-relations)
          customer-actors
            (map #(spawn customer-behavior %) (range n-customers))
          done-promises
            (repeatedly n-reservations promise)]
      (when (not= (rem n-reservations n-customers) 0)
        (println "WARNING: number of reservations is not divisible by number"
          "of customers."))
      (doseq [[customer reservation done?] (zip (cycle customer-actors) reservations done-promises)]
        (send customer reservation done?))
      (doseq [done? done-promises]
        (deref done?))))
  (shutdown-agents))

    (when (:debug options)
      (def log log-debug))
    (if proceed?
      (let [options {:n-customers    (:customers options)
                     :n-reservations (:reservations options)
                     :n-relations    (:relations options)
                     :n-queries      (:queries options)}]
        (log "options: " options)
        options)
      nil)))

; HELPER FUNCTIONS

(defn zip [& lists]
  "Zip m lists of n elements into list of n m-tuples.

  > (zip [1 2 3 4] [5 6 7 8] [9 10 11 12])
  ([1 5 9] [2 6 10] [3 7 11] [4 8 12])

  Based on http://stackoverflow.com/a/2588385/8137"
  (apply map vector lists))

(defn random-subset [n coll]
  "Get `n` randomly picked elements from `coll`.
  Sampling is done with replacement, i.e. elements may appear multiple times."
  (repeatedly n #(rand-nth coll)))

(defn initialize-data [{:keys [n-reservations n-relations]}]
  (letfn [(rand-seats []
            (* (+ (rand-int 5) 1) 100))
          (rand-price []
            (+ (* (rand-int 5) 10) 50))
          (generate-relation []
            (for [i (range n-relations)]
              (ref {:id i :seats (rand-seats) :price (rand-price)})))]
