This Facility is intended to convert a resource from one commodity to another.
It also has an optional delay parameter. It can therefore be used quite easily as a storage facility. The CommodConverter class inherits from the Facility class and is dynamically loaded by the Agent class when requested.
This Agent was initially developed to support the fco code-to-code comparsion. It's very similar to the "NullFacility" of years past. Its purpose is to convert a commodity from one commodity to another after some period of delay time. This facility is very good for use as a storage facility or fuel fabrication.
in_commod is a string naming the commodity that this facility recieves out_commod is a string naming the commodity that in_commod is stocks into process_time is the number of timesteps between receiving and offering in_recipe (optional) describes the incoming resource by recipe out_recipe (optional) describes the outgoing resource by recipe
max_inv_size is the maximum capacity of the inventory storage capacity is the maximum processing capacity per timestep
Tick: Nothing really happens on the tick.
Tock: On the tock, any material that has been waiting for long enough (delay time) is stocks and placed in the stocks buffer.
Any brand new inventory that was received in this timestep is placed into the processing queue to begin waiting.
Making Requests: This facility requests all of the in_commod that it can.
Receiving Resources: Anything of the in_commod that is received by this facility goes into the inventory.
Making Offers: Any stocks material in the stocks buffer is offered to the market.
Sending Resources: Matched resources are sent immediately.
Definition at line 68 of file build/CommodConverter/commodconverter.h.
#include <commodconverter.h>

Public Member Functions | |
| virtual void | AcceptMatlTrades (const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses) |
| virtual void | AcceptMatlTrades (const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses) |
| virtual Json::Value | annotations () |
| virtual cyclus::Agent * | Clone () |
| CommodConverter (cyclus::Context *ctx) | |
| CommodConverter (cyclus::Context *ctx) | |
| virtual void | EnterNotify () |
| virtual void | EnterNotify () |
| virtual std::set < cyclus::BidPortfolio < cyclus::Material >::Ptr > | GetMatlBids (cyclus::CommodMap< cyclus::Material >::type &commod_requests) |
| virtual std::set < cyclus::BidPortfolio < cyclus::Material >::Ptr > | GetMatlBids (cyclus::CommodMap< cyclus::Material >::type &commod_requests) |
| virtual std::set < cyclus::RequestPortfolio < cyclus::Material >::Ptr > | GetMatlRequests () |
| virtual std::set < cyclus::RequestPortfolio < cyclus::Material >::Ptr > | GetMatlRequests () |
| virtual void | GetMatlTrades (const std::vector< cyclus::Trade< cyclus::Material > > &trades, std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses) |
| virtual void | GetMatlTrades (const std::vector< cyclus::Trade< cyclus::Material > > &trades, std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses) |
| virtual void | InfileToDb (cyclus::InfileTree *tree, cyclus::DbInit di) |
| virtual void | InitFrom (commodconverter::CommodConverter *m) |
| virtual void | InitFrom (cyclus::QueryableBackend *b) |
| virtual void | InitInv (cyclus::Inventories &inv) |
| virtual std::string | schema () |
| virtual void | Snapshot (cyclus::DbInit di) |
| virtual cyclus::Inventories | SnapshotInv () |
| virtual std::string | str () |
| virtual std::string | str () |
| virtual void | Tick () |
| virtual void | Tick () |
| virtual void | Tock () |
| virtual void | Tock () |
Protected Member Functions | |
| void | AddMat_ (cyclus::Material::Ptr mat) |
| void | AddMat_ (cyclus::Material::Ptr mat) |
| void | BeginProcessing_ () |
| void | BeginProcessing_ () |
| void | capacity_ (double c) |
| double | capacity_ () const |
| void | capacity_ (double c) |
| double | capacity_ () const |
| void | Convert_ () |
| void | Convert_ () |
| void | cost_ (double c) |
| double | cost_ () const |
| void | cost_ (double c) |
| double | cost_ () const |
| void | crctx (const cyclus::toolkit::CommodityRecipeContext &crctx) |
| cyclus::toolkit::CommodityRecipeContext | crctx () const |
| void | crctx (const cyclus::toolkit::CommodityRecipeContext &crctx) |
| cyclus::toolkit::CommodityRecipeContext | crctx () const |
| double | current_capacity () const |
| double | current_capacity () const |
| cyclus::BidPortfolio < cyclus::Material >::Ptr | GetBids_ (cyclus::CommodMap< cyclus::Material >::type &commod_requests, std::string commod, cyclus::toolkit::ResourceBuff *buffer) |
| cyclus::BidPortfolio < cyclus::Material >::Ptr | GetBids_ (cyclus::CommodMap< cyclus::Material >::type &commod_requests, std::string commod, cyclus::toolkit::ResourceBuff *buffer) |
| void | in_commod_ (std::string c) |
| std::string | in_commod_ () const |
| void | in_commod_ (std::string c) |
| std::string | in_commod_ () const |
| void | in_recipe_ (std::string c) |
| std::string | in_recipe_ () const |
| void | in_recipe_ (std::string c) |
| std::string | in_recipe_ () const |
| void | max_inv_size_ (double c) |
| double | max_inv_size_ () const |
| void | max_inv_size_ (double c) |
| double | max_inv_size_ () const |
| void | out_commod_ (std::string c) |
| std::string | out_commod_ () const |
| void | out_commod_ (std::string c) |
| std::string | out_commod_ () const |
| void | out_recipe_ (std::string c) |
| std::string | out_recipe_ () const |
| void | out_recipe_ (std::string c) |
| std::string | out_recipe_ () const |
| void | process_time_ (int t) |
| int | process_time_ () const |
| void | process_time_ (int t) |
| int | process_time_ () const |
| int | ready () |
| int | ready () |
| cyclus::Material::Ptr | Request_ () |
| cyclus::Material::Ptr | Request_ () |
| cyclus::Material::Ptr | TradeResponse_ (double qty, cyclus::toolkit::ResourceBuff *buffer) |
| cyclus::Material::Ptr | TradeResponse_ (double qty, cyclus::toolkit::ResourceBuff *buffer) |
Protected Attributes | |
| double | capacity |
| double | cost |
| cyclus::toolkit::CommodityRecipeContext | crctx_ |
| std::string | in_commod |
| std::string | in_recipe |
| cyclus::toolkit::ResourceBuff | inventory |
| double | max_inv_size |
| std::string | out_commod |
| std::string | out_recipe |
| int | process_time |
| std::map< int, cyclus::toolkit::ResourceBuff > | processing |
| cyclus::toolkit::ResourceBuff | stocks |
| commodconverter::CommodConverter::CommodConverter | ( | cyclus::Context * | ctx | ) |
Constructor for CommodConverter Class.
| ctx | the cyclus context for access to simulation-wide parameters |
Definition at line 9 of file build/CommodConverter/commodconverter.cc.
| commodconverter::CommodConverter::CommodConverter | ( | cyclus::Context * | ctx | ) |
Constructor for CommodConverter Class.
| ctx | the cyclus context for access to simulation-wide parameters |
|
virtual |
The CommodConverter place accepted trade Materials in their Inventory.
|
virtual |
The CommodConverter place accepted trade Materials in their Inventory.
Definition at line 246 of file build/CommodConverter/commodconverter.cc.
|
protected |
adds a material into the incoming commodity inventory
| mat | the material to add to the incoming inventory. |
| if | there is trouble with pushing to the inventory buffer. |
|
protected |
adds a material into the incoming commodity inventory
| mat | the material to add to the incoming inventory. |
| if | there is trouble with pushing to the inventory buffer. |
Definition at line 303 of file build/CommodConverter/commodconverter.cc.
|
virtual |
Definition at line 51 of file build/CommodConverter/commodconverter.cc.
|
protected |
Move all unprocessed inventory to processing.
|
protected |
Move all unprocessed inventory to processing.
Definition at line 401 of file build/CommodConverter/commodconverter.cc.
|
inlineprotected |
the maximum amount processed per timestep
Definition at line 232 of file src/commodconverter.h.
|
inlineprotected |
Definition at line 233 of file src/commodconverter.h.
|
inlineprotected |
the maximum amount processed per timestep
Definition at line 238 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
Definition at line 239 of file build/CommodConverter/commodconverter.h.
|
virtual |
Definition at line 130 of file build/CommodConverter/commodconverter.cc.
|
protected |
Convert one ready resource in processing.
|
protected |
Convert one ready resource in processing.
Definition at line 415 of file build/CommodConverter/commodconverter.cc.
|
inlineprotected |
the cost per unit out_commod
Definition at line 236 of file src/commodconverter.h.
|
inlineprotected |
Definition at line 237 of file src/commodconverter.h.
|
inlineprotected |
the cost per unit out_commod
Definition at line 242 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
Definition at line 243 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
this facility's commodity-recipe context
Definition at line 163 of file src/commodconverter.h.
|
inlineprotected |
Definition at line 167 of file src/commodconverter.h.
|
inlineprotected |
this facility's commodity-recipe context
Definition at line 177 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
Definition at line 181 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
current maximum amount that can be added to processing
Definition at line 256 of file src/commodconverter.h.
|
inlineprotected |
current maximum amount that can be added to processing
Definition at line 262 of file build/CommodConverter/commodconverter.h.
|
virtual |
|
virtual |
Definition at line 169 of file build/CommodConverter/commodconverter.cc.
|
protected |
gathers information about bids
| commod_requests | the materials that have been requested |
|
protected |
gathers information about bids
| commod_requests | the materials that have been requested |
Definition at line 336 of file build/CommodConverter/commodconverter.cc.
|
virtual |
Responds to each request for this facility's commodity.
If a given request is more than this facility's inventory capacity, it will offer its minimum of its capacities.
|
virtual |
Responds to each request for this facility's commodity.
If a given request is more than this facility's inventory capacity, it will offer its minimum of its capacities.
Definition at line 258 of file build/CommodConverter/commodconverter.cc.
|
virtual |
The CommodConverter request Materials of its given commodity.
|
virtual |
The CommodConverter request Materials of its given commodity.
Definition at line 221 of file build/CommodConverter/commodconverter.cc.
|
virtual |
respond to each trade with a material of out_commod and out_recipe
| trades | all trades in which this trader is the supplier |
| responses | a container to populate with responses to each trade |
|
virtual |
respond to each trade with a material of out_commod and out_recipe
| trades | all trades in which this trader is the supplier |
| responses | a container to populate with responses to each trade |
Definition at line 278 of file build/CommodConverter/commodconverter.cc.
|
inlineprotected |
the in commodity
Definition at line 240 of file src/commodconverter.h.
|
inlineprotected |
Definition at line 241 of file src/commodconverter.h.
|
inlineprotected |
the in commodity
Definition at line 246 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
Definition at line 247 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
the in recipe
Definition at line 248 of file src/commodconverter.h.
|
inlineprotected |
Definition at line 249 of file src/commodconverter.h.
|
inlineprotected |
the in recipe
Definition at line 254 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
Definition at line 255 of file build/CommodConverter/commodconverter.h.
|
virtual |
Definition at line 95 of file build/CommodConverter/commodconverter.cc.
|
virtual |
The Prime Directive Generates code that handles all input file reading and restart operations (e.g., reading from the database, instantiating a new object, etc.).
Definition at line 138 of file build/CommodConverter/commodconverter.cc.
|
virtual |
Definition at line 151 of file build/CommodConverter/commodconverter.cc.
|
virtual |
Definition at line 85 of file build/CommodConverter/commodconverter.cc.
|
inlineprotected |
the maximum amount allowed in inventory
Definition at line 228 of file src/commodconverter.h.
|
inlineprotected |
Definition at line 229 of file src/commodconverter.h.
|
inlineprotected |
the maximum amount allowed in inventory
Definition at line 234 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
Definition at line 235 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
the out commodity
Definition at line 244 of file src/commodconverter.h.
|
inlineprotected |
Definition at line 245 of file src/commodconverter.h.
|
inlineprotected |
the out commodity
Definition at line 250 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
Definition at line 251 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
the out recipe
Definition at line 252 of file src/commodconverter.h.
|
inlineprotected |
Definition at line 253 of file src/commodconverter.h.
|
inlineprotected |
the out recipe
Definition at line 258 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
Definition at line 259 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
the processing time required for a full process
Definition at line 224 of file src/commodconverter.h.
|
inlineprotected |
Definition at line 225 of file src/commodconverter.h.
|
inlineprotected |
the processing time required for a full process
Definition at line 230 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
Definition at line 231 of file build/CommodConverter/commodconverter.h.
|
inlineprotected |
returns the time key for ready materials
Definition at line 172 of file src/commodconverter.h.
|
inlineprotected |
returns the time key for ready materials
Definition at line 186 of file build/CommodConverter/commodconverter.h.
|
protected |
generates a request for this facility given its current state.
The quantity of the material will be equal to the remaining inventory size.
|
protected |
generates a request for this facility given its current state.
The quantity of the material will be equal to the remaining inventory size.
Definition at line 324 of file build/CommodConverter/commodconverter.cc.
|
virtual |
Definition at line 17 of file build/CommodConverter/commodconverter.cc.
|
virtual |
Definition at line 118 of file build/CommodConverter/commodconverter.cc.
|
virtual |
Definition at line 89 of file build/CommodConverter/commodconverter.cc.
|
virtual |
The Prime Directive Generates code that handles all input file reading and restart operations (e.g., reading from the database, instantiating a new object, etc.).
|
virtual |
A verbose printer for the CommodConverter.
Definition at line 180 of file build/CommodConverter/commodconverter.cc.
|
virtual |
The handleTick function specific to the CommodConverter.
| time | the time of the tick |
|
virtual |
The handleTick function specific to the CommodConverter.
| time | the time of the tick |
Definition at line 204 of file build/CommodConverter/commodconverter.cc.
|
virtual |
The handleTick function specific to the CommodConverter.
| time | the time of the tock |
|
virtual |
The handleTick function specific to the CommodConverter.
| time | the time of the tock |
Definition at line 210 of file build/CommodConverter/commodconverter.cc.
|
protected |
suggests, based on the buffer, a material response to an offer
|
protected |
suggests, based on the buffer, a material response to an offer
Definition at line 376 of file build/CommodConverter/commodconverter.cc.
|
protected |
Definition at line 215 of file build/CommodConverter/commodconverter.h.
|
protected |
Definition at line 219 of file build/CommodConverter/commodconverter.h.
|
protected |
Definition at line 227 of file build/CommodConverter/commodconverter.h.
|
protected |
Definition at line 191 of file build/CommodConverter/commodconverter.h.
|
protected |
Definition at line 199 of file build/CommodConverter/commodconverter.h.
|
protected |
Definition at line 221 of file build/CommodConverter/commodconverter.h.
|
protected |
Definition at line 211 of file build/CommodConverter/commodconverter.h.
|
protected |
Definition at line 195 of file build/CommodConverter/commodconverter.h.
|
protected |
Definition at line 203 of file build/CommodConverter/commodconverter.h.
|
protected |
Definition at line 207 of file build/CommodConverter/commodconverter.h.
|
protected |
map from ready time to resource buffers
Definition at line 225 of file build/CommodConverter/commodconverter.h.
|
protected |
Definition at line 222 of file build/CommodConverter/commodconverter.h.
1.8.7