Commit 49bee700 authored by Myriam Begel's avatar Myriam Begel

Les StrengthRandom ne sont pas forcément entiers

parent c5597464
Pipeline #151 failed with stages
in 9 seconds
......@@ -27,7 +27,7 @@ def generate_purchase(needs, person):
# No period, so no timedelta from the period
days = r.randrange(need.schedule.triggerTimeRandomRange+1)
purchase.startTime = need.schedule.firstDay + d.timedelta(days)
purchase.priceSpecification = PriceSpecification(price = need.strength + r.randrange(need.strengthRandomRange+1), priceCurrency = 'EUR')
purchase.priceSpecification = PriceSpecification(price = need.strength + r.uniform(0,need.strengthRandomRange), priceCurrency = 'EUR')
purchase.seller = r.choice(Organization.objects.filter(subcategory=need.subcategory))
tradeActions.append(purchase)
else:
......@@ -39,7 +39,7 @@ def generate_purchase(needs, person):
purchase.object_rdfProp = Product(name=need.name, category=need.subcategory)
days = i*need.schedule.periodDay + r.randrange(need.schedule.triggerTimeRandomRange+1)
purchase.startTime = need.schedule.firstDay + d.timedelta(days)
purchase.priceSpecification = PriceSpecification(price = need.strength + r.randrange(need.strengthRandomRange+1), priceCurrency = 'EUR')
purchase.priceSpecification = PriceSpecification(price = need.strength + r.uniform(0,need.strengthRandomRange), priceCurrency = 'EUR')
purchase.seller = r.choice(Organization.objects.filter(subcategory=need.subcategory))
tradeActions.append(purchase)
return tradeActions
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment