# These are the functions used to aggreagate values.  Not sure the best place to put these. 


    WeightAggregate.SharedFanPercentage <- function(x) {
      sqrt(prod(x))
    }
 
     WeightAggregate <- function(x) {
    # x should be a length-two vector
      min(x) * sum(x)/ max(x) / 2
    }



"
------   This is an alternate Weight method ---- 
      Figure out where it should go, if at all 
"

if (FALSE) {
Weight2

n <- 6
eg <- data.table(Artist = paste0("Art", fw0(n)), TotalFans = roundOutToX(seq(10, 10000, length=n), 10), key="Artist")
arts <- CJ(Art1=eg$Artist, Art2=eg$Artist)[Art1 < Art2]
arts[, A1Tot := eg[Art1][, TotalFans]]
arts[, A2Tot := eg[Art2][, TotalFans]]
set.seed(1)
arts[, SampSize := roundOutToX((.4 * A1Tot)-3, 5)]
arts[, paste0("Art", 1:2, "Perc") := lapply(.SD[, c("A1Tot", "A2Tot"), with=FALSE], function(x) SampSize / x)]


arts[, Prod := (Art1Perc * Art2Perc)]
arts[, ProdSqrt := sqrt(Art1Perc * Art2Perc)]
arts[, Sum  := (Art1Perc + Art2Perc)]
.rx(arts[order(Prod)])
}