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:
Inheritance graph
[legend]
Collaboration diagram for storage::Storage:
Collaboration graph
[legend]

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...
 
void RecordPosition ()
 
void RecordPosition ()
 

Protected Attributes

cyclus::toolkit::MatlBuyPolicy buy_policy
 
cyclus::toolkit::Position coordinates
 
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_latitude
 
std::vector< int > cycpp_shape_longitude
 
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 latitude
 
double longitude
 
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() [1/2]

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() [2/2]

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

Member Function Documentation

◆ AddMat_() [1/2]

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.

◆ AddMat_() [2/2]

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 621 of file _tmp_build/cycamore/storage.cc.

References inventory.

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

◆ annotations()

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

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

◆ BeginProcessing_() [1/2]

void storage::Storage::BeginProcessing_ ( )
protected

Move all unprocessed inventory to processing.

◆ BeginProcessing_() [2/2]

void storage::Storage::BeginProcessing_ ( )
protected

Move all unprocessed inventory to processing.

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

References entry_times, inventory, and processing.

Referenced by Tock().

◆ Clone()

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

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

References InitFrom().

Referenced by storage::TEST_F().

Here is the call graph for this function:

◆ current_capacity() [1/2]

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

current maximum amount that can be added to processing

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

References max_inv_size, processing, and stocks.

◆ current_capacity() [2/2]

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

current maximum amount that can be added to processing

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

References max_inv_size, processing, and stocks.

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

◆ EnterNotify() [1/2]

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

Sets up the Storage Facility's trade requests.

◆ EnterNotify() [2/2]

void storage::Storage::EnterNotify ( )
virtual

Sets up the Storage Facility's trade requests.

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

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

Here is the call graph for this function:

◆ InfileToDb()

void storage::Storage::InfileToDb ( cyclus::InfileTree *  tree,
cyclus::DbInit  di 
)
virtual

◆ InitFrom() [1/2]

void storage::Storage::InitFrom ( storage::Storage m)
virtual

◆ InitFrom() [2/2]

void storage::Storage::InitFrom ( cyclus::QueryableBackend *  b)
virtual

◆ InitInv()

void storage::Storage::InitInv ( cyclus::Inventories &  inv)
virtual

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

References inventory, processing, ready, and stocks.

◆ ProcessMat_() [1/2]

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

Move as many ready resources as allowable into stocks.

Parameters
capcurrent throughput capacity

◆ ProcessMat_() [2/2]

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

Move as many ready resources as allowable into stocks.

Parameters
capcurrent throughput capacity

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

References discrete_handling, ready, and stocks.

Referenced by Tock().

◆ ready_time() [1/2]

int storage::Storage::ready_time ( )
inlineprotected

returns the time key for ready materials

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

References buy_policy, coordinates, discrete_handling, entry_times, in_commod_prefs, in_commods, in_recipe, inventory, latitude, longitude, max_inv_size, out_commods, processing, ready, RecordPosition(), residence_time, sell_policy, stocks, cycamore::string, and throughput.

Here is the call graph for this function:

◆ ready_time() [2/2]

int storage::Storage::ready_time ( )
inlineprotected

returns the time key for ready materials

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

References residence_time.

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

◆ ReadyMatl_() [1/2]

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

move ready resources from processing to ready at a certain time

Parameters
timethe time of interest

◆ ReadyMatl_() [2/2]

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 692 of file _tmp_build/cycamore/storage.cc.

References entry_times, processing, and ready.

Referenced by Tock().

◆ RecordPosition() [1/2]

void storage::Storage::RecordPosition ( )
protected

◆ RecordPosition() [2/2]

void storage::Storage::RecordPosition ( )
protected

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

References latitude, longitude, and cycamore::string.

Referenced by EnterNotify(), and ready_time().

◆ schema()

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

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

◆ Snapshot()

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

◆ SnapshotInv()

cyclus::Inventories storage::Storage::SnapshotInv ( )
virtual

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

References inventory, processing, ready, and stocks.

◆ str() [1/2]

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

A verbose printer for the Storage Facility.

◆ str() [2/2]

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

A verbose printer for the Storage Facility.

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

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

Referenced by storage::TEST_F().

◆ Tick() [1/2]

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

The handleTick function specific to the Storage.

◆ Tick() [2/2]

void storage::Storage::Tick ( )
virtual

The handleTick function specific to the Storage.

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

References current_capacity(), and inventory.

Referenced by storage::TEST_F().

Here is the call graph for this function:

◆ Tock() [1/2]

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

The handleTick function specific to the Storage.

◆ Tock() [2/2]

void storage::Storage::Tock ( )
virtual

The handleTick function specific to the Storage.

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

References BeginProcessing_(), current_capacity(), in_commod_prefs, in_commods, inventory, out_commods, ProcessMat_(), ready_time(), ReadyMatl_(), residence_time, stocks, and throughput.

Referenced by storage::TEST_F().

Here is the call graph for this function:

Friends And Related Function Documentation

◆ StorageTest

StorageTest
friend

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

Member Data Documentation

◆ buy_policy

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

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

Referenced by EnterNotify(), and ready_time().

◆ coordinates

cyclus::toolkit::Position storage::Storage::coordinates
protected

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

Referenced by ready_time().

◆ cycpp_shape_discrete_handling

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

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

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

◆ cycpp_shape_in_commod_prefs

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

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

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

◆ cycpp_shape_in_commods

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

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

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

◆ cycpp_shape_in_recipe

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

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

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

◆ cycpp_shape_inventory

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

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

Referenced by InfileToDb(), and InitFrom().

◆ cycpp_shape_latitude

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

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

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

◆ cycpp_shape_longitude

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

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

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

◆ cycpp_shape_max_inv_size

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

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

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

◆ cycpp_shape_out_commods

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

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

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

◆ cycpp_shape_processing

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

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

Referenced by InfileToDb(), and InitFrom().

◆ cycpp_shape_ready

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

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

Referenced by InfileToDb(), and InitFrom().

◆ cycpp_shape_residence_time

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

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

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

◆ cycpp_shape_stocks

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

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

Referenced by InfileToDb(), and InitFrom().

◆ cycpp_shape_throughput

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

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

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

◆ discrete_handling

bool storage::Storage::discrete_handling
protected

◆ entry_times

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

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

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

◆ in_commod_prefs

std::vector< double > storage::Storage::in_commod_prefs
protected

◆ in_commods

std::vector< std::string > storage::Storage::in_commods
protected

◆ in_recipe

std::string storage::Storage::in_recipe
protected

◆ inventory

cyclus::toolkit::ResBuf< cyclus::Material > storage::Storage::inventory
protected

◆ latitude

double storage::Storage::latitude
protected

◆ longitude

double storage::Storage::longitude
protected

◆ max_inv_size

double storage::Storage::max_inv_size
protected

◆ out_commods

std::vector< std::string > storage::Storage::out_commods
protected

◆ processing

cyclus::toolkit::ResBuf< cyclus::Material > storage::Storage::processing
protected

◆ ready

cyclus::toolkit::ResBuf< cyclus::Material > storage::Storage::ready
protected

◆ residence_time

int storage::Storage::residence_time
protected

◆ sell_policy

cyclus::toolkit::MatlSellPolicy storage::Storage::sell_policy
protected

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

Referenced by EnterNotify(), and ready_time().

◆ stocks

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

◆ throughput

double storage::Storage::throughput
protected

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