 
 	// Periodic (intervalled) statistics collection routine
 	func collectStatistics(fromCity city: City) {
-		
+		if hooks["activeVehicleCount"] != nil {
+			writeToHook("activeVehicleCount", data: "\(city.events.now)\(separator)\(city.vehicles.count)\n")
+		}
 	}
 }
					hooks[hook] = ""
				}
			}
		}
	}


import Foundation

class Statistics {
	// Configuration entries
	var folder: String = "stats/"
	var interval: Double = 1.0
	var startTime: Double = 1.0

	// A dictionary containing (statisticName,statisticData) pairs
	var hooks = [String:String]()

	// Data separator (e.g. ',' or ';' for CSV (comma not recommended in Europe, prefer semicolon), '\t' for TSV
	let separator = "\t"

	init(config: NSDictionary) {
		// Load general statistics configurations, if defined: folder, interval, startTime
