CYCAMORE
Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
storage::Storage Class Reference

This Facility is intended to hold materials for a user specified amount of time in order to model a storage facility with a certain residence time or holdup time. More...

#include <storage.h>

Inheritance diagram for storage::Storage:

Public Member Functions

virtual Json::Value annotations ()
 
virtual cyclus::Agent * Clone ()
 
virtual void EnterNotify ()
 Sets up the Storage Facility's trade requests. More...
 
virtual void EnterNotify ()
 Sets up the Storage Facility's trade requests. More...
 
virtual void InfileToDb (cyclus::InfileTree *tree, cyclus::DbInit di)
 
virtual void InitFrom (storage::Storage *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 ()
 
 Storage (cyclus::Context *ctx)
 
 Storage (cyclus::Context *ctx)
 
virtual std::string str ()
 A verbose printer for the Storage Facility. More...
 
virtual std::string str ()
 A verbose printer for the Storage Facility. More...
 
virtual void Tick ()
 The handleTick function specific to the Storage. More...
 
virtual void Tick ()
 The handleTick function specific to the Storage. More...
 
virtual void Tock ()
 The handleTick function specific to the Storage. More...
 
virtual void Tock ()
 The handleTick function specific to the Storage. More...
 

Protected Member Functions

void AddMat_ (cyclus::Material::Ptr mat)
 adds a material into the incoming commodity inventory More...
 
void AddMat_ (cyclus::Material::Ptr mat)
 adds a material into the incoming commodity inventory More...
 
void BeginProcessing_ ()
 Move all unprocessed inventory to processing. More...
 
void BeginProcessing_ ()
 Move all unprocessed inventory to processing. More...
 
double current_capacity () const
 current maximum amount that can be added to processing More...
 
double current_capacity () const
 current maximum amount that can be added to processing More...
 
void ProcessMat_ (double cap)
 Move as many ready resources as allowable into stocks. More...
 
void ProcessMat_ (double cap)
 Move as many ready resources as allowable into stocks. More...
 
int ready_time ()
 returns the time key for ready materials More...
 
int ready_time ()
 returns the time key for ready materials More...
 
void ReadyMatl_ (int time)
 move ready resources from processing to ready at a certain time More...
 
void ReadyMatl_ (int time)
 move ready resources from processing to ready at a certain time More...
 

Protected Attributes

cyclus::toolkit::MatlBuyPolicy buy_policy
 
std::vector< int > cycpp_shape_discrete_handling
 
std::vector< int > cycpp_shape_in_commod_prefs
 
std::vector< int > cycpp_shape_in_commods
 
std::vector< int > cycpp_shape_in_recipe
 
std::vector< int > cycpp_shape_inventory
 
std::vector< int > cycpp_shape_max_inv_size
 
std::vector< int > cycpp_shape_out_commods
 
std::vector< int > cycpp_shape_processing
 
std::vector< int > cycpp_shape_ready
 
std::vector< int > cycpp_shape_residence_time
 
std::vector< int > cycpp_shape_stocks
 
std::vector< int > cycpp_shape_throughput
 
bool discrete_handling
 
std::list< int > entry_times
 
std::vector< double > in_commod_prefs
 
std::vector< std::string > in_commods
 
std::string in_recipe
 
cyclus::toolkit::ResBuf< cyclus::Material > inventory
 
double max_inv_size
 
std::vector< std::string > out_commods
 
cyclus::toolkit::ResBuf< cyclus::Material > processing
 
cyclus::toolkit::ResBuf< cyclus::Material > ready
 
int residence_time
 
cyclus::toolkit::MatlSellPolicy sell_policy
 
cyclus::toolkit::ResBuf< cyclus::Material > stocks
 
double throughput
 

Friends

class StorageTest
 

Detailed Description

This Facility is intended to hold materials for a user specified amount of time in order to model a storage facility with a certain residence time or holdup time.

The Storage class inherits from the Facility class and is dynamically loaded by the Agent class when requested.

Introduction

This Agent was initially developed to support the fco code-to-code comparison. It's very similar to the "NullFacility" of years past. Its purpose is to hold materials and release them only after some period of delay time.

Agent Parameters

in_commods is a vector of strings naming the commodities that this facility receives out_commods is a string naming the commodity that in_commod is stocks into residence_time is the minimum number of timesteps between receiving and offering in_recipe (optional) describes the incoming resource by recipe

Optional Parameters

max_inv_size is the maximum capacity of the inventory storage throughput is the maximum processing capacity per timestep

Detailed Behavior

Tick: Nothing really happens on the tick.

Tock: On the tock, any material that has been waiting for long enough (delay time) is 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 _tmp_build/cycamore/storage.h.

Constructor & Destructor Documentation

storage::Storage::Storage ( cyclus::Context *  ctx)
Parameters
ctxthe cyclus context for access to simulation-wide parameters

Definition at line 9 of file _tmp_build/cycamore/storage.cc.

Referenced by storage::ConstructStorage().

storage::Storage::Storage ( cyclus::Context *  ctx)
Parameters
ctxthe cyclus context for access to simulation-wide parameters

Member Function Documentation

void storage::Storage::AddMat_ ( cyclus::Material::Ptr  mat)
protected

adds a material into the incoming commodity inventory

Parameters
matthe material to add to the incoming inventory.
Exceptions
ifthere is trouble with pushing to the inventory buffer.
void storage::Storage::AddMat_ ( cyclus::Material::Ptr  mat)
protected

adds a material into the incoming commodity inventory

Parameters
matthe material to add to the incoming inventory.
Exceptions
ifthere is trouble with pushing to the inventory buffer.

Definition at line 545 of file _tmp_build/cycamore/storage.cc.

References inventory.

Referenced by storage::StorageTest::TestAddMat().

Json::Value storage::Storage::annotations ( )
virtual

Definition at line 72 of file _tmp_build/cycamore/storage.cc.

void storage::Storage::BeginProcessing_ ( )
protected

Move all unprocessed inventory to processing.

void storage::Storage::BeginProcessing_ ( )
protected

Move all unprocessed inventory to processing.

Definition at line 563 of file _tmp_build/cycamore/storage.cc.

References entry_times, inventory, and processing.

Referenced by Tock().

cyclus::Agent * storage::Storage::Clone ( )
virtual

Definition at line 354 of file _tmp_build/cycamore/storage.cc.

References InitFrom(), and m.

Referenced by storage::TEST_F().

double storage::Storage::current_capacity ( ) const
inlineprotected

current maximum amount that can be added to processing

Definition at line 121 of file src/storage.h.

References max_inv_size, processing, and stocks.

double storage::Storage::current_capacity ( ) const
inlineprotected

current maximum amount that can be added to processing

Definition at line 130 of file _tmp_build/cycamore/storage.h.

References max_inv_size, processing, and stocks.

Referenced by storage::StorageTest::TestCurrentCap(), and Tick().

virtual void storage::Storage::EnterNotify ( )
virtual

Sets up the Storage Facility's trade requests.

void storage::Storage::EnterNotify ( )
virtual

Sets up the Storage Facility's trade requests.

Definition at line 451 of file _tmp_build/cycamore/storage.cc.

References buy_policy, in_commod_prefs, in_commods, in_recipe, inventory, out_commods, sell_policy, stocks, and cycamore::string.

void storage::Storage::InfileToDb ( cyclus::InfileTree *  tree,
cyclus::DbInit  di 
)
virtual
void storage::Storage::InitFrom ( storage::Storage m)
virtual
void storage::Storage::InitFrom ( cyclus::QueryableBackend *  b)
virtual
void storage::Storage::InitInv ( cyclus::Inventories &  inv)
virtual

Definition at line 174 of file _tmp_build/cycamore/storage.cc.

References inventory, processing, ready, and stocks.

void storage::Storage::ProcessMat_ ( double  cap)
protected

Move as many ready resources as allowable into stocks.

Parameters
capcurrent throughput capacity
void storage::Storage::ProcessMat_ ( double  cap)
protected

Move as many ready resources as allowable into stocks.

Parameters
capcurrent throughput capacity

Definition at line 580 of file _tmp_build/cycamore/storage.cc.

References discrete_handling, ready, and stocks.

Referenced by Tock().

int storage::Storage::ready_time ( )
inlineprotected
int storage::Storage::ready_time ( )
inlineprotected

returns the time key for ready materials

Definition at line 134 of file _tmp_build/cycamore/storage.h.

References residence_time.

Referenced by storage::StorageTest::TestReadyTime(), and Tock().

void storage::Storage::ReadyMatl_ ( int  time)
protected

move ready resources from processing to ready at a certain time

Parameters
timethe time of interest
void storage::Storage::ReadyMatl_ ( int  time)
protected

move ready resources from processing to ready at a certain time

Parameters
timethe time of interest

Definition at line 616 of file _tmp_build/cycamore/storage.cc.

References entry_times, processing, and ready.

Referenced by Tock().

std::string storage::Storage::schema ( )
virtual

Definition at line 17 of file _tmp_build/cycamore/storage.cc.

void storage::Storage::Snapshot ( cyclus::DbInit  di)
virtual
cyclus::Inventories storage::Storage::SnapshotInv ( )
virtual

Definition at line 183 of file _tmp_build/cycamore/storage.cc.

References inventory, processing, ready, and stocks.

virtual std::string storage::Storage::str ( )
virtual

A verbose printer for the Storage Facility.

std::string storage::Storage::str ( )
virtual

A verbose printer for the Storage Facility.

Definition at line 490 of file _tmp_build/cycamore/storage.cc.

References out_commods, residence_time, cycamore::string, and throughput.

Referenced by storage::TEST_F().

virtual void storage::Storage::Tick ( )
virtual

The handleTick function specific to the Storage.

void storage::Storage::Tick ( )
virtual

The handleTick function specific to the Storage.

Definition at line 516 of file _tmp_build/cycamore/storage.cc.

References current_capacity(), and inventory.

Referenced by storage::TEST_F().

virtual void storage::Storage::Tock ( )
virtual

The handleTick function specific to the Storage.

void storage::Storage::Tock ( )
virtual

The handleTick function specific to the Storage.

Definition at line 530 of file _tmp_build/cycamore/storage.cc.

References BeginProcessing_(), inventory, ProcessMat_(), ready_time(), ReadyMatl_(), residence_time, and throughput.

Referenced by storage::TEST_F().

Friends And Related Function Documentation

StorageTest
friend

Definition at line 227 of file _tmp_build/cycamore/storage.h.

Member Data Documentation

cyclus::toolkit::MatlBuyPolicy storage::Storage::buy_policy
protected

Definition at line 221 of file _tmp_build/cycamore/storage.h.

Referenced by EnterNotify(), and ready_time().

std::vector<int> storage::Storage::cycpp_shape_discrete_handling
protected

Definition at line 187 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), InitFrom(), and Snapshot().

std::vector<int> storage::Storage::cycpp_shape_in_commod_prefs
protected

Definition at line 147 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), InitFrom(), and Snapshot().

std::vector<int> storage::Storage::cycpp_shape_in_commods
protected

Definition at line 139 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), InitFrom(), and Snapshot().

std::vector<int> storage::Storage::cycpp_shape_in_recipe
protected

Definition at line 161 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), InitFrom(), and Snapshot().

std::vector<int> storage::Storage::cycpp_shape_inventory
protected

Definition at line 193 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), and InitFrom().

std::vector<int> storage::Storage::cycpp_shape_max_inv_size
protected

Definition at line 182 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), InitFrom(), and Snapshot().

std::vector<int> storage::Storage::cycpp_shape_out_commods
protected

Definition at line 154 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), InitFrom(), and Snapshot().

std::vector<int> storage::Storage::cycpp_shape_processing
protected

Definition at line 216 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), and InitFrom().

std::vector<int> storage::Storage::cycpp_shape_ready
protected

Definition at line 205 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), and InitFrom().

std::vector<int> storage::Storage::cycpp_shape_residence_time
protected

Definition at line 168 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), InitFrom(), and Snapshot().

std::vector<int> storage::Storage::cycpp_shape_stocks
protected

Definition at line 199 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), and InitFrom().

std::vector<int> storage::Storage::cycpp_shape_throughput
protected

Definition at line 175 of file _tmp_build/cycamore/storage.h.

Referenced by InfileToDb(), InitFrom(), and Snapshot().

bool storage::Storage::discrete_handling
protected
std::list< int > storage::Storage::entry_times
protected

Definition at line 212 of file _tmp_build/cycamore/storage.h.

Referenced by BeginProcessing_(), ready_time(), and ReadyMatl_().

std::vector< double > storage::Storage::in_commod_prefs
protected
std::vector< std::string > storage::Storage::in_commods
protected
std::string storage::Storage::in_recipe
protected
cyclus::toolkit::ResBuf< cyclus::Material > storage::Storage::inventory
protected
double storage::Storage::max_inv_size
protected
std::vector< std::string > storage::Storage::out_commods
protected
cyclus::toolkit::ResBuf< cyclus::Material > storage::Storage::processing
protected
cyclus::toolkit::ResBuf< cyclus::Material > storage::Storage::ready
protected
int storage::Storage::residence_time
protected
cyclus::toolkit::MatlSellPolicy storage::Storage::sell_policy
protected

Definition at line 224 of file _tmp_build/cycamore/storage.h.

Referenced by EnterNotify(), and ready_time().

cyclus::toolkit::ResBuf< cyclus::Material > storage::Storage::stocks
protected
double storage::Storage::throughput
protected

The documentation for this class was generated from the following files: