I think it's best to first explain the problem and then explain what I think:
I have a record similar to the following:
Fruits, calories, costs Apple, 100,1 Apple, 200, 1.5 Apple, 150.2 Pear, 300.3 Pear, 100, 0.5 Pear, 250.2 orange, 100.1 Orange, 120.1 Orange, 400.2
And I try to maximize my calories while keeping my costs in a specific area. At this point, it's just a backpack problem, but what if I have to have 1 apple, 1 pear, and 2 oranges or some other arbitrary set of fruit numbers?
I can not really care how this works, given the additional limitations. I've been thinking about putting my costs and calories together in 1 metric, but I'm pretty sure it will not work as it loses.
My last thought may be to log the number of fruits in a list. When the right amount of fruit is reached, the next fruit will continue. I think about it, similar to a backpack with 3 limitations, weight, value and size, but the size is essentially just the number of fruits.
If I hope someone is here, can that tell me if I am heading in the right direction or if there is an algorithm that does this that I can investigate.