frontload bug

divide availability adjusted price by frontload factor, which will be
close to 1 while index is low and close to 2 when index is high - the
reduction approaches 50% as index goes up.
This commit is contained in:
Jack 2016-09-30 00:36:23 -04:00
parent 5c391f4bb4
commit c130879ef7

View file

@ -23,7 +23,7 @@ class MeanAvailabilityWeightedPrice(object):
mean_availability = self.blob_tracker.last_mean_availability mean_availability = self.blob_tracker.last_mean_availability
availability = self.blob_tracker.availability.get(blob, []) availability = self.blob_tracker.availability.get(blob, [])
index = 0 # blob.index index = 0 # blob.index
price = self.base_price * (mean_availability / max(1, len(availability))) * self._frontload(index) price = self.base_price * (mean_availability / max(1, len(availability))) / self._frontload(index)
return round(max(self.min_price, price), 5) return round(max(self.min_price, price), 5)
def _frontload(self, index): def _frontload(self, index):