A quick commit before blowing a lot of this away.
Completed the performProduction function, as well as associated sorting function.
Created a getAgentAverageProductionValue function for calculating the average value a particular production has according to purely agent belief.
Added a few lines of comments.
Last bit of code for tonight - attempted an ill advised sort adventure, and rolled it back.

Code compiles but does nothing - missing some key parts yet, but good progress overall.