pucauto
pucauto copied to clipboard
Make bundling more resilient to missing out on some sends
Given you have your min_value set to 100, when a user wants two cards on your Haves list: Foo worth 78 points, and Bar worth 55 points, but that user only has 102 points total and thus cannot receive both cards.
How would you expect Pucauto to behave?
Currently, Pucauto will recognize that 78 + 55 is >= 100 and that the user has >= 100 points and accept the 78 point card first since it's the highest value, but then fail on the 55 point card. Cards are accepted from high to low values to optimize.
I think I could change the logic to only treat the bundle as valid if the user has >= min_value points and any combination of cards in the bundle >= min_value points. This may minimize the odds of sending an under min_value bundle, but makes things a bit more strict and may result in less trades.
- Is the current implementation a problem?
- If I decide to change it, should it be a configuration option?
Feedback:
My vote is Puca auto reject this type of trade, as I view my minimum value as basically the lowest amount of profit I'd like to make and expect the bot to not pursue ones that can't possibly meet it. I don't view missing out on these type of trades as having fewer trade as they generally aren't worth my time shipping and packaging. I don't mind if a few below my minimum value sneak in from time to time if a trader beats us out, but past that I'd like to keep it to a minimum.
More feedback:
I'd rather it look at 78+55 on a 102 point user and the script ignore sending anything. This mirrors what I would do in real life with PucaPower.
What if an "optimal bundle" was chosen which may not be the highest valued bundle, but through some formula of card count, member points, and bundle value, an optimal bundle was chosen. That'd be cool!
I agree with earlier comments: trades should only be made if the min_value
is less than both:
- the user's available points, and
- the total value of the cards to be "claimed".
As for the last comment made - a more optimal solution - that's a LP problem and while feasible, probably not worth it. Simply claiming from the most-valuable down is probably good enough.
@eengstrom The complicated thing is:
min_value
is 150
Recipient has 152 points
Bundling logic discovered Recipient wants cards with values [90, 80, 80, 75]
If I just check recipient_points >= min_value and bundle_value >= min_value
, then this trade will be attempted. But after the 90 point card is accepted, the user doesn't have enough points to accept anything else. So we have missed our min_value
goal.
I need to check that, within a bundle of unknown length, there are some combination of cards >= min_value
. I haven't came up with a clever solution for this yet other than brute force which isn't ideal.