double CalculateWeight(double volume)
{
switch (weighting)
{
case 0://constant
return 1;//no-volume information
case 1://linear
return volume;
case 2://log
if (volume > 0)
return Math.Log(volume) + 1;
else
return 0;
default:
throw new Exception("Not defined");
}
}