summaryrefslogtreecommitdiff
path: root/src/generic/problemresolver/tier_operation.h
AgeCommit message (Collapse)AuthorFilesLines
2010-04-09Restructure the source tree to move tier_ related code into files whose name ↵Daniel Burrows1-411/+0
is based on "cost" instead.
2010-04-08Yank out the "tier" type and just use operations instead.Daniel Burrows1-17/+0
Although the concept of a "tier" is useful (to distinguish changes in the tier from the things being changed), the actual data type isn't needed. We can just store an operation that computes the tier of a step given a minimal tier. Throwing out tier objects yields several benefits. It makes the code somewhat simpler by reducing the number of complex object types floating around. It will make it easier to clean up the nomenclature by talking about costs instead of tiers. And it will make it easier to impose a "cost ceiling", just by virtue of making the cost-tracking subsystem simpler.
2010-03-08Add a routine on tier operations that could be used to test whether a tier ↵Daniel Burrows1-0/+19
is above another tier without actually computing an intermediate value. The tier operation code was the only thing that looked at all like a new cost center in a profiling run (which makes sense since that's really all that changed in the build that's slower). This might help a little; the "take an upper bound and compare" trick is played a lot at the moment.
2010-03-07Merge changes on my laptop with changes on my desktop.Daniel Burrows1-0/+76
It looks at a quick glance like I was wrong about the efficiency issues; it may have just been due to comparing a non-optimized build to an optimized build.
2010-03-04Correctly throw an out_of_range exception when the user tries to set aDaniel Burrows1-0/+4
user level with a negative index in a tier operation.
2010-03-04Let client code query the components of a tier operation.Daniel Burrows1-0/+34
2010-03-04Expose the structural tier operation comparison more directly.Daniel Burrows1-0/+35
2010-03-04Implement a structural comparison operation on tier operations.Daniel Burrows1-0/+4
2010-02-07Throw an exception if the user tries to construct a tier operation that ↵Daniel Burrows1-0/+4
modifies a negative index in the user tiers array.
2010-02-07Initial implementation of a tiering system that is both sound and flexible.Daniel Burrows1-105/+212
The rule in this system is that you can increase tier levels either by adding positive numbers to them or by lower-bounding them. Any given slot in the tier has to be managed using only one of these operations, but different slots can be managed using different operations. This allows support for the new "add to tier" operation, while maintaining the ability to do the old "increase to level" operation (both for backwards-compatibility and for supporting pin priorities). Currently the unit tests fail; this needs to be fixed.
2010-01-31Implement the usual comparison and hashing functions on tier operations.Daniel Burrows1-2/+34
2010-01-31Normalize tier operations so that equivalent ones always store the same tier ↵Daniel Burrows1-0/+8
objects.
2010-01-31The greatest lower bound should discard trailing user levels.Daniel Burrows1-1/+1
2010-01-31Implement operator== and operator!= on tier operations.Daniel Burrows1-0/+9
2010-01-31Ditch increase-tier operations due to poor interaction with add-to-tier.Daniel Burrows1-35/+46
The comment at the top of tier_operation cheerily asserted that these two operations formed a specific partial order. They don't. Each of them *individually* does, but there is no natural ordering between them: for instance, "increase to 100" takes 5 to 100 and 105 to 105; "add 5" takes 5 to 10 and 105 to 110. Worse, they aren't closed under composition, since order matters and it isn't stored in an operation (and can't be without making operations contain a whole chain of compositions). The effect I was trying to get with increase-tier can be achieved, albeit not in a backwards-compatible way, by adding levelwise upper bounds to tier objects at a higher level (i.e., in the resolver). The point here is to be able to have a tier that, for instance, is 0 if there are no removed packages and 1 if there are *any* removed packages (i.e., it doesn't distinguish between different numbers of removals in the same way that the current removal tier doesn't).
2010-01-30Write the code to dump a tier operation to an ostream.Daniel Burrows1-0/+8
2010-01-30Make apply and operator+ on tier_operation const.Daniel Burrows1-2/+2
2010-01-30Flesh out the rest of the tier operation object.Daniel Burrows1-12/+38
This needs a unit test and an operator<<.
2010-01-30Add a first draft of a class to represent *operations* on tiers.Daniel Burrows1-0/+128
It's a bit awkward that it uses tiers to represent its components; on the other hand, its components are *almost* exactly tiers. Something to ponder.