cyclus/core — Issue #41: Adjust the Resource Creation and Transaction Paradigm to be more Logging Friendly (and more Complete)
Author: gidden
Created: 2012-02-19 01:53:18+00:00
State: open
Labels: Investigate, Output Side

@rwcarlsen @katyhuff @gonuke -- I'd enjoy some discussion/clarification on this topic.

While building new tables to log all of our information, I have noticed that we seem to create resources willy-nilly. There's not an idea of a permanent resource in the simulation that gets passed around, but rather resources are copied any time they're needed.

That's all well and good, but it messes up our logging paradigm with respect to resource IDs. Also, it implies that the the resource object that is created is NOT the same as the resource object that is being transacted. I do not think this is a good thing.

To make this issue more clear, I've pasted the below output from /null/test1.xml. Note the difference between the logs of what is inserted into Transactions versus what is inserted into Resources and Material History - The Resources and Material History log a resource ID of x and Transactions logs an ID of x+5.

(note this is only a snippet)
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

DEBUG5(table ): Added command to row commands: INSERT INTO Resources (ID, Type, Quantity, OriginatorID) VALUES (48, 0, 1000, 5);
DEBUG5(table ): Added command to row commands: INSERT INTO Material History (ID, StateID, Time) VALUES (48, 1, 8);
DEBUG5(table ): Added command to row commands: INSERT INTO Transactions (SenderID, ReceiverID, ResourceID, Time, Price) VALUES (5, 6, 53, 8, 0);
DEBUG5(table ): Added command to row commands: INSERT INTO Resources (ID, Type, Quantity, OriginatorID) VALUES (54, 0, 1000, 5);
DEBUG5(table ): Added command to row commands: INSERT INTO Material History (ID, StateID, Time) VALUES (54, 1, 9);
DEBUG5(table ): Added command to row commands: INSERT INTO Transactions (SenderID, ReceiverID, ResourceID, Time, Price) VALUES (5, 6, 59, 9, 0);