Added the writeCosimilarity function to BaseUniversalMetric