func versionAdjustments(entry modules.HostDBEntry) float64 {
	base := float64(1)
	if build.VersionCmp(entry.Version, "1.4.0") < 0 {
		base = base * 0.99999  
	}
	if build.VersionCmp(entry.Version, "1.3.2") < 0 {
		base = base * 0.9
	}
	if build.VersionCmp(entry.Version, "1.3.1") < 0 {
		base = math.SmallestNonzeroFloat64
	}
	return base
}
versionAdjustments will adjust the weight of the entry according to the siad
version reported by the host.
package hostdb
import (
	"math"
	"math/big"
	"github.com/NebulousLabs/Sia/build"
	"github.com/NebulousLabs/Sia/modules"
	"github.com/NebulousLabs/Sia/types"
)
var (
	baseWeight = types.NewCurrency(new(big.Int).Exp(big.NewInt(10), big.NewInt(80), nil))
	collateralExponentiation = 0.75
	minCollateral = types.SiacoinPrecision.Div64(5).Div64(tbMonth)
	minTotalPrice = types.SiacoinPrecision.Mul64(1).Div64(tbMonth)
	priceDivNormalization = types.SiacoinPrecision.Div64(10e3).Div64(tbMonth)
	priceExponentiation = 5
	requiredStorage = build.Select(build.Var{
		Standard: uint64(20e9),
		Dev:      uint64(1e6),
		Testing:  uint64(1e3),
	}).(uint64)
	tbMonth = uint64(4032) * uint64(1e12)
)
func (hdb *HostDB) collateralAdjustments(entry modules.HostDBEntry) float64 {
	if build.DEBUG {
		if minCollateral.Div64(1e3).Cmp(priceDivNormalization) < 0 {
			build.Critical("Maladjusted minCollateral and divNormalization constants in hostdb package")
		}
	}
	usedCollateral := entry.Collateral
	if entry.Collateral.Cmp(minCollateral) < 0 {
		usedCollateral = minCollateral
	}
	baseU64, err := minCollateral.Div(priceDivNormalization).Uint64()
	if err != nil {
		baseU64 = math.MaxUint64
	}
	actualU64, err := usedCollateral.Div(priceDivNormalization).Uint64()
	if err != nil {
		actualU64 = math.MaxUint64
	}
	base := float64(baseU64)
	actual := float64(actualU64)
	weight := math.Pow(actual/base, collateralExponentiation)
	gigaByte := types.NewCurrency64(1e9)
	if entry.MaxCollateral.Cmp(entry.Collateral.Mul(gigaByte).Mul64(100)) < 0 {
		weight = weight / 2  
	}
	if entry.MaxCollateral.Cmp(entry.Collateral.Mul(gigaByte).Mul64(33)) < 0 {
		weight = weight / 5  
	}
	if entry.MaxCollateral.Cmp(entry.Collateral.Mul(gigaByte).Mul64(10)) < 0 {
		weight = weight / 10  
	}
	if entry.MaxCollateral.Cmp(entry.Collateral.Mul(gigaByte).Mul64(3)) < 0 {
		weight = weight / 10  
	}
	return weight
}
func (hdb *HostDB) interactionAdjustments(entry modules.HostDBEntry) float64 {
	hsi := entry.HistoricSuccessfulInteractions + 30
	hfi := entry.HistoricFailedInteractions + 1
	ratio := float64(hsi) / float64(hsi+hfi)
	return math.Pow(ratio, 15)
}
func (hdb *HostDB) priceAdjustments(entry modules.HostDBEntry) float64 {
	if build.DEBUG {
		if minTotalPrice.Div64(1e3).Cmp(priceDivNormalization) < 0 {
			build.Critical("Maladjusted minDivePrice and divNormalization constants in hostdb package")
		}
	}
	adjustedContractPrice := entry.ContractPrice.Div64(6048).Div64(25e9)         
	adjustedUploadPrice := entry.UploadBandwidthPrice.Div64(24192)               
	adjustedDownloadPrice := entry.DownloadBandwidthPrice.Div64(12096).Div64(3)  
	siafundFee := adjustedContractPrice.Add(adjustedUploadPrice).Add(adjustedDownloadPrice).Add(entry.Collateral).MulTax()
	totalPrice := entry.StoragePrice.Add(adjustedContractPrice).Add(adjustedUploadPrice).Add(adjustedDownloadPrice).Add(siafundFee)
	if totalPrice.Cmp(minTotalPrice) < 0 {
		totalPrice = minTotalPrice
	}
	baseU64, err := minTotalPrice.Div(priceDivNormalization).Uint64()
	if err != nil {
		baseU64 = math.MaxUint64
	}
	actualU64, err := totalPrice.Div(priceDivNormalization).Uint64()
	if err != nil {
		actualU64 = math.MaxUint64
	}
	base := float64(baseU64)
	actual := float64(actualU64)
	weight := float64(1)
	for i := 0; i < priceExponentiation; i++ {
		weight *= base / actual
	}
	return weight
}
func storageRemainingAdjustments(entry modules.HostDBEntry) float64 {
	base := float64(1)
	if entry.RemainingStorage < 200*requiredStorage {
		base = base / 2  
	}
	if entry.RemainingStorage < 150*requiredStorage {
		base = base / 2  
	}
	if entry.RemainingStorage < 100*requiredStorage {
		base = base / 2  
	}
	if entry.RemainingStorage < 80*requiredStorage {
		base = base / 2  
	}
	if entry.RemainingStorage < 40*requiredStorage {
		base = base / 2  
	}
	if entry.RemainingStorage < 20*requiredStorage {
		base = base / 2  
	}
	if entry.RemainingStorage < 15*requiredStorage {
		base = base / 2  
	}
	if entry.RemainingStorage < 10*requiredStorage {
		base = base / 2  
	}
	if entry.RemainingStorage < 5*requiredStorage {
		base = base / 2  
	}
	if entry.RemainingStorage < 3*requiredStorage {
		base = base / 2  
	}
	if entry.RemainingStorage < 2*requiredStorage {
		base = base / 2  
	}
	if entry.RemainingStorage < requiredStorage {
		base = base / 2  
	}
	return base
}