cyclus/cyclus — pull request #654 by gidden (2013-12-09 20:00:00+00:00)
Title: Unit capacities

I found a nasty bug in my implementation after running some enrichment scenarios with the Cycamore module.

The basic gist is the following:

The exchange graph has a notion of unit capacities associated with either node connected to an arc in a graph. The maximum flow allowable on that arc is determined by the unit capacity and current capacity of the arc.

I previously was normalizing by capacity, whereas I needed to be normalizing on mass flow.

As an example, consider an enrichment facility with a natural uranium inventory of 100kg and a request for 4kg of enriched uranium which would require 42 kg of natural uranium. The previous implementation would have satisfied this request and updated the inventory constraint to 100 - 4 * (42 / 100). Now it updates it correctly to 100 - 4 * (42 / 4).