CYCAMORE
Loading...
Searching...
No Matches
cycamore::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 cycamore::Storage:

Public Member Functions

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

Protected Member Functions

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

Protected Attributes

std::vector< intcycpp_shape_discrete_handling
 
std::vector< intcycpp_shape_in_commod_prefs
 
std::vector< intcycpp_shape_in_commods
 
std::vector< intcycpp_shape_in_recipe
 
std::vector< intcycpp_shape_inventory
 
std::vector< intcycpp_shape_inventory_tracker
 
std::vector< intcycpp_shape_max_inv_size
 
std::vector< intcycpp_shape_out_commods
 
std::vector< intcycpp_shape_package
 
std::vector< intcycpp_shape_processing
 
std::vector< intcycpp_shape_ready
 
std::vector< intcycpp_shape_residence_time
 
std::vector< intcycpp_shape_stocks
 
std::vector< intcycpp_shape_throughput
 
std::vector< intcycpp_shape_transport_unit
 
bool discrete_handling
 
std::list< intentry_times
 
std::vector< double > in_commod_prefs
 
std::vector< std::string > in_commods
 
std::string in_recipe
 
cyclus::toolkit::ResBuf< cyclus::Material > inventory
 
cyclus::toolkit::TotalInvTracker inventory_tracker
 
double max_inv_size
 
std::vector< std::string > out_commods
 
std::string package
 
cyclus::toolkit::ResBuf< cyclus::Material > processing
 
cyclus::toolkit::ResBuf< cyclus::Material > ready
 
int residence_time
 
cyclus::toolkit::ResBuf< cyclus::Material > stocks
 
double throughput
 
std::string transport_unit
 

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 package is the name of the package type to ship

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 build/cycamore/storage.h.

Constructor & Destructor Documentation

◆ Storage() [1/2]

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

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

References inventory, inventory_tracker, processing, ready, and stocks.

Referenced by cycamore::ConstructStorage(), and InitFrom().

◆ Storage() [2/2]

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

Member Function Documentation

◆ AddMat_() [1/2]

void cycamore::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 1740 of file build/cycamore/storage.cc.

References inventory.

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

◆ AddMat_() [2/2]

void cycamore::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.

◆ annotations()

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

Definition at line 270 of file build/cycamore/storage.cc.

◆ BeginProcessing_() [1/2]

void cycamore::Storage::BeginProcessing_ ( )
protected

Move all unprocessed inventory to processing.

Definition at line 1758 of file build/cycamore/storage.cc.

References entry_times, inventory, and processing.

Referenced by Tock().

◆ BeginProcessing_() [2/2]

void cycamore::Storage::BeginProcessing_ ( )
protected

Move all unprocessed inventory to processing.

◆ capacity() [1/2]

double cycamore::Storage::capacity ( )
inlineprotected

returns total capacity

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

References inventory_tracker.

◆ capacity() [2/2]

double cycamore::Storage::capacity ( )
inlineprotected

returns total capacity

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

References inventory_tracker.

◆ Clone()

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

Definition at line 1293 of file build/cycamore/storage.cc.

References InitFrom().

Referenced by cycamore::TEST_F().

◆ current_capacity() [1/2]

double cycamore::Storage::current_capacity ( )
inlineprotected

current maximum amount that can be added to processing

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

References inventory_tracker.

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

◆ current_capacity() [2/2]

double cycamore::Storage::current_capacity ( )
inlineprotected

current maximum amount that can be added to processing

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

References inventory_tracker.

◆ EnterNotify() [1/2]

void cycamore::Storage::EnterNotify ( )
virtual

Sets up the Storage Facility's trade requests.

Definition at line 1587 of file build/cycamore/storage.cc.

References in_commod_prefs, in_commods, in_recipe, inventory, inventory_tracker, max_inv_size, out_commods, package, stocks, throughput, and transport_unit.

◆ EnterNotify() [2/2]

virtual void cycamore::Storage::EnterNotify ( )
virtual

Sets up the Storage Facility's trade requests.

◆ InfileToDb()

◆ InitFrom() [1/2]

◆ InitFrom() [2/2]

◆ InitInv()

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

Definition at line 693 of file build/cycamore/storage.cc.

References inventory, processing, ready, and stocks.

◆ ProcessMat_() [1/2]

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

Move as many ready resources as allowable into stocks.

Parameters
capcurrent throughput capacity

Definition at line 1775 of file build/cycamore/storage.cc.

References discrete_handling, ready, and stocks.

Referenced by Tock().

◆ ProcessMat_() [2/2]

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

Move as many ready resources as allowable into stocks.

Parameters
capcurrent throughput capacity

◆ ready_time() [1/2]

int cycamore::Storage::ready_time ( )
inlineprotected

returns the time key for ready materials

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

References residence_time.

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

◆ ready_time() [2/2]

int cycamore::Storage::ready_time ( )
inlineprotected

returns the time key for ready materials

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

References residence_time.

◆ ReadyMatl_() [1/2]

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

move ready resources from processing to ready at a certain time

Parameters
timethe time of interest

Definition at line 1806 of file build/cycamore/storage.cc.

References entry_times, processing, and ready.

Referenced by Tock().

◆ ReadyMatl_() [2/2]

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

move ready resources from processing to ready at a certain time

Parameters
timethe time of interest

◆ schema()

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

Definition at line 18 of file build/cycamore/storage.cc.

◆ Snapshot()

◆ SnapshotInv()

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

Definition at line 703 of file build/cycamore/storage.cc.

References inventory, processing, ready, and stocks.

◆ str() [1/2]

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

A verbose printer for the Storage Facility.

Definition at line 1659 of file build/cycamore/storage.cc.

References out_commods, residence_time, and throughput.

Referenced by cycamore::TEST_F().

◆ str() [2/2]

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

A verbose printer for the Storage Facility.

◆ Tick() [1/2]

void cycamore::Storage::Tick ( )
virtual

The handleTick function specific to the Storage.

Definition at line 1685 of file build/cycamore/storage.cc.

References current_capacity(), max_inv_size, processing, ready, and stocks.

Referenced by cycamore::TEST_F().

◆ Tick() [2/2]

virtual void cycamore::Storage::Tick ( )
virtual

The handleTick function specific to the Storage.

◆ Tock() [1/2]

◆ Tock() [2/2]

virtual void cycamore::Storage::Tock ( )
virtual

The handleTick function specific to the Storage.

◆ version() [1/2]

virtual std::string cycamore::Storage::version ( )
inlinevirtual

Definition at line 110 of file build/cycamore/storage.h.

References CYCAMORE_VERSION.

◆ version() [2/2]

virtual std::string cycamore::Storage::version ( )
inlinevirtual

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

References CYCAMORE_VERSION.

Friends And Related Symbol Documentation

◆ StorageTest

StorageTest
friend

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

References StorageTest.

Referenced by StorageTest.

Member Data Documentation

◆ cycpp_shape_discrete_handling

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

Definition at line 195 of file build/cycamore/storage.h.

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

◆ cycpp_shape_in_commod_prefs

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

Definition at line 153 of file build/cycamore/storage.h.

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

◆ cycpp_shape_in_commods

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

Definition at line 146 of file build/cycamore/storage.h.

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

◆ cycpp_shape_in_recipe

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

Definition at line 167 of file build/cycamore/storage.h.

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

◆ cycpp_shape_inventory

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

Definition at line 215 of file build/cycamore/storage.h.

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

◆ cycpp_shape_inventory_tracker

std::vector<int> cycamore::Storage::cycpp_shape_inventory_tracker
protected

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

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

◆ cycpp_shape_max_inv_size

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

Definition at line 188 of file build/cycamore/storage.h.

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

◆ cycpp_shape_out_commods

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

Definition at line 160 of file build/cycamore/storage.h.

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

◆ cycpp_shape_package

std::vector<int> cycamore::Storage::cycpp_shape_package
protected

Definition at line 202 of file build/cycamore/storage.h.

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

◆ cycpp_shape_processing

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

Definition at line 238 of file build/cycamore/storage.h.

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

◆ cycpp_shape_ready

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

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

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

◆ cycpp_shape_residence_time

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

Definition at line 174 of file build/cycamore/storage.h.

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

◆ cycpp_shape_stocks

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

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

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

◆ cycpp_shape_throughput

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

Definition at line 181 of file build/cycamore/storage.h.

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

◆ cycpp_shape_transport_unit

std::vector<int> cycamore::Storage::cycpp_shape_transport_unit
protected

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

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

◆ discrete_handling

bool cycamore::Storage::discrete_handling
protected

Definition at line 194 of file build/cycamore/storage.h.

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

◆ entry_times

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

Definition at line 234 of file build/cycamore/storage.h.

Referenced by BeginProcessing_(), and ReadyMatl_().

◆ in_commod_prefs

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

Definition at line 152 of file build/cycamore/storage.h.

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

◆ in_commods

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

Definition at line 145 of file build/cycamore/storage.h.

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

◆ in_recipe

std::string cycamore::Storage::in_recipe
protected

◆ inventory

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

◆ inventory_tracker

cyclus::toolkit::TotalInvTracker cycamore::Storage::inventory_tracker
protected

◆ max_inv_size

double cycamore::Storage::max_inv_size
protected

◆ out_commods

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

Definition at line 159 of file build/cycamore/storage.h.

Referenced by EnterNotify(), InfileToDb(), InitFrom(), InitFrom(), Snapshot(), str(), and Tock().

◆ package

std::string cycamore::Storage::package
protected

◆ processing

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

◆ ready

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

◆ residence_time

int cycamore::Storage::residence_time
protected

◆ stocks

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

◆ throughput

double cycamore::Storage::throughput
protected

◆ transport_unit

std::string cycamore::Storage::transport_unit
protected

Definition at line 208 of file build/cycamore/storage.h.

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


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