cyclus/cyclus — pull request #660 by gidden (2013-12-10 22:55:11+00:00)
Title: Pref sort

This PR adds commodity ordering support to the core. The use case for this addition is that it is a necessary requirement to obtain the correct answer for our PHYSOR reactor/repro/repo problem. The market of concern is for used fuel, which will either go to the reprocessor or the repo.

The greedy solver is "dumb" in that it matches whatever arcs it can in the order it finds them. Accordingly, for the solver to find the reprocessor arc first, if it exists, we must precondition the graph. The preconditioner orders request groups and then requests within those groups (see greedy_preconditioner.h"). The previous preconditioning implementation ordered request groups based on commodity weight only, and did not take into account arc preference. Both groups and requests within groups are now ordered by a combination of commodity and preference in such a way that guarantees market ordering by commodity first and by preference second.

Additional support was added to provide commodity ordering in the input file.