format summary.go

This commit is contained in:
Kistaro Windrider 2023-11-18 18:03:50 -08:00
parent b83a3ed5c3
commit 2ebc2f904f
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -69,22 +69,22 @@ func Summarize(price float64, allBidders []Bidder) *ResultSummary {
}
}
winner := allBidders[len(allBidders) - 1]
winner := allBidders[len(allBidders)-1]
rube := Bidder{}
if maxIdx >= 0 {
rube = allBidders[maxIdx]
}
return &ResultSummary {
Bidders: len(allbidders),
Price: price,
WinnerValue: winner.Value,
WinnerProfit: winner.Value - price,
LosersWithRegrets: regrets,
HighestValue: maxValue,
return &ResultSummary{
Bidders: len(allbidders),
Price: price,
WinnerValue: winner.Value,
WinnerProfit: winner.Value - price,
LosersWithRegrets: regrets,
HighestValue: maxValue,
HighestValuatorBid: rube.BidCeiling(),
MissedProfit: rube.Value - price,
ValueDelta: maxValue - winner.Value,
HighestValueRank: len(allBidders) - maxIdx,
MissedProfit: rube.Value - price,
ValueDelta: maxValue - winner.Value,
HighestValueRank: len(allBidders) - maxIdx,
}
}