CYCAMORE
Public Member Functions | Private Member Functions | Private Attributes | List of all members
cycamore::Sink Class Reference

This facility acts as a sink of materials and products with a fixed throughput (per time step) capacity and a lifetime capacity defined by a total inventory size. More...

#include <sink.h>

Inheritance diagram for cycamore::Sink:
Inheritance graph
[legend]
Collaboration diagram for cycamore::Sink:
Collaboration graph
[legend]

Public Member Functions

virtual void AcceptGenRsrcTrades (const std::vector< std::pair< cyclus::Trade< cyclus::Product >, cyclus::Product::Ptr > > &responses)
 SinkFacilities place accepted trade Materials in their Inventory. More...
 
virtual void AcceptGenRsrcTrades (const std::vector< std::pair< cyclus::Trade< cyclus::Product >, cyclus::Product::Ptr > > &responses)
 SinkFacilities place accepted trade Materials in their Inventory. More...
 
virtual void AcceptMatlTrades (const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
 SinkFacilities place accepted trade Materials in their Inventory. More...
 
virtual void AcceptMatlTrades (const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &responses)
 SinkFacilities place accepted trade Materials in their Inventory. More...
 
void AddCommodity (std::string name)
 add a commodity to the set of input commodities More...
 
void AddCommodity (std::string name)
 add a commodity to the set of input commodities More...
 
virtual Json::Value annotations ()
 
void Capacity (double cap)
 sets the capacity of a material generated at any given time step More...
 
double Capacity () const
 
void Capacity (double cap)
 sets the capacity of a material generated at any given time step More...
 
double Capacity () const
 
virtual cyclus::Agent * Clone ()
 
virtual void EnterNotify ()
 
virtual void EnterNotify ()
 
virtual std::set< cyclus::RequestPortfolio< cyclus::Product >::Ptr > GetGenRsrcRequests ()
 SinkFacilities request Products of their given commodity. More...
 
virtual std::set< cyclus::RequestPortfolio< cyclus::Product >::Ptr > GetGenRsrcRequests ()
 SinkFacilities request Products of their given commodity. More...
 
virtual std::set< cyclus::RequestPortfolio< cyclus::Material >::Ptr > GetMatlRequests ()
 SinkFacilities request Materials of their given commodity. More...
 
virtual std::set< cyclus::RequestPortfolio< cyclus::Material >::Ptr > GetMatlRequests ()
 SinkFacilities request Materials of their given commodity. More...
 
virtual void InfileToDb (cyclus::InfileTree *tree, cyclus::DbInit di)
 
virtual void InitFrom (cycamore::Sink *m)
 
virtual void InitFrom (cyclus::QueryableBackend *b)
 
virtual void InitInv (cyclus::Inventories &inv)
 
const std::vector< std::string > & input_commodities () const
 
const std::vector< std::string > & input_commodities () const
 
const std::vector< double > & input_commodity_preferences () const
 
const std::vector< double > & input_commodity_preferences () const
 
double InventorySize () const
 
double InventorySize () const
 
double MaxInventorySize () const
 
double MaxInventorySize () const
 
double RequestAmt () const
 determines the amount to request More...
 
double RequestAmt () const
 determines the amount to request More...
 
virtual std::string schema ()
 
void SetMaxInventorySize (double size)
 sets the size of the storage inventory for received material More...
 
void SetMaxInventorySize (double size)
 sets the size of the storage inventory for received material More...
 
 Sink (cyclus::Context *ctx)
 
 Sink (cyclus::Context *ctx)
 
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 ()
 
virtual std::string version ()
 
virtual std::string version ()
 
virtual ~Sink ()
 
virtual ~Sink ()
 

Private Member Functions

void RecordPosition ()
 
void RecordPosition ()
 

Private Attributes

double capacity
 monthly acceptance capacity More...
 
cyclus::toolkit::Position coordinates
 
std::vector< intcycpp_shape_capacity
 
std::vector< intcycpp_shape_in_commod_prefs
 
std::vector< intcycpp_shape_in_commods
 
std::vector< intcycpp_shape_inventory
 
std::vector< intcycpp_shape_latitude
 
std::vector< intcycpp_shape_longitude
 
std::vector< intcycpp_shape_max_inv_size
 
std::vector< intcycpp_shape_recipe_name
 
std::vector< double > in_commod_prefs
 
std::vector< std::string > in_commods
 all facilities must have at least one input commodity More...
 
cyclus::toolkit::ResBuf< cyclus::Resource > inventory
 this facility holds material in storage. More...
 
double latitude
 
double longitude
 
double max_inv_size
 max inventory size More...
 
std::string recipe_name
 

Detailed Description

This facility acts as a sink of materials and products with a fixed throughput (per time step) capacity and a lifetime capacity defined by a total inventory size.

The inventory size and throughput capacity both default to infinite. If a recipe is provided, it will request material with that recipe. Requests are made for any number of specified commodities.

Definition at line 23 of file _tmp_build/cycamore/sink.h.

Constructor & Destructor Documentation

◆ Sink() [1/2]

cycamore::Sink::Sink ( cyclus::Context *  ctx)

Definition at line 13 of file _tmp_build/cycamore/sink.cc.

References SetMaxInventorySize().

Referenced by cycamore::ConstructSink().

Here is the call graph for this function:

◆ ~Sink() [1/2]

cycamore::Sink::~Sink ( )
virtual

Definition at line 22 of file _tmp_build/cycamore/sink.cc.

◆ Sink() [2/2]

cycamore::Sink::Sink ( cyclus::Context *  ctx)

◆ ~Sink() [2/2]

virtual cycamore::Sink::~Sink ( )
virtual

Member Function Documentation

◆ AcceptGenRsrcTrades() [1/2]

virtual void cycamore::Sink::AcceptGenRsrcTrades ( const std::vector< std::pair< cyclus::Trade< cyclus::Product >, cyclus::Product::Ptr > > &  responses)
virtual

SinkFacilities place accepted trade Materials in their Inventory.

◆ AcceptGenRsrcTrades() [2/2]

void cycamore::Sink::AcceptGenRsrcTrades ( const std::vector< std::pair< cyclus::Trade< cyclus::Product >, cyclus::Product::Ptr > > &  responses)
virtual

SinkFacilities place accepted trade Materials in their Inventory.

Definition at line 461 of file _tmp_build/cycamore/sink.cc.

References inventory.

Referenced by version().

◆ AcceptMatlTrades() [1/2]

virtual void cycamore::Sink::AcceptMatlTrades ( const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &  responses)
virtual

SinkFacilities place accepted trade Materials in their Inventory.

◆ AcceptMatlTrades() [2/2]

void cycamore::Sink::AcceptMatlTrades ( const std::vector< std::pair< cyclus::Trade< cyclus::Material >, cyclus::Material::Ptr > > &  responses)
virtual

SinkFacilities place accepted trade Materials in their Inventory.

Definition at line 450 of file _tmp_build/cycamore/sink.cc.

References inventory.

Referenced by TEST_F(), and version().

◆ AddCommodity() [1/2]

void cycamore::Sink::AddCommodity ( std::string  name)
inline

add a commodity to the set of input commodities

Parameters
namethe commodity name

Definition at line 74 of file src/sink.h.

References in_commods.

◆ AddCommodity() [2/2]

void cycamore::Sink::AddCommodity ( std::string  name)
inline

add a commodity to the set of input commodities

Parameters
namethe commodity name

Definition at line 86 of file _tmp_build/cycamore/sink.h.

References in_commods.

Referenced by SinkTest::SetUpSink(), and TEST_F().

◆ annotations()

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

Definition at line 71 of file _tmp_build/cycamore/sink.cc.

Referenced by version().

◆ Capacity() [1/4]

void cycamore::Sink::Capacity ( double  cap)
inline

sets the capacity of a material generated at any given time step

Parameters
capacitythe reception capacity

Definition at line 96 of file src/sink.h.

References capacity.

◆ Capacity() [2/4]

double cycamore::Sink::Capacity ( ) const
inline
Returns
the reception capacity at any given time step

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

References capacity.

◆ Capacity() [3/4]

void cycamore::Sink::Capacity ( double  cap)
inline

sets the capacity of a material generated at any given time step

Parameters
capacitythe reception capacity

Definition at line 108 of file _tmp_build/cycamore/sink.h.

References capacity.

Referenced by SinkTest::SetUpSink(), and TEST_F().

◆ Capacity() [4/4]

double cycamore::Sink::Capacity ( ) const
inline
Returns
the reception capacity at any given time step

Definition at line 111 of file _tmp_build/cycamore/sink.h.

References capacity.

◆ Clone()

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

Definition at line 285 of file _tmp_build/cycamore/sink.cc.

References InitFrom().

Referenced by TEST_F(), and version().

Here is the call graph for this function:

◆ EnterNotify() [1/2]

virtual void cycamore::Sink::EnterNotify ( )
virtual

◆ EnterNotify() [2/2]

void cycamore::Sink::EnterNotify ( )
virtual

Definition at line 352 of file _tmp_build/cycamore/sink.cc.

References in_commod_prefs, in_commods, and RecordPosition().

Referenced by TEST_F(), and version().

Here is the call graph for this function:

◆ GetGenRsrcRequests() [1/2]

virtual std::set<cyclus::RequestPortfolio<cyclus::Product>::Ptr> cycamore::Sink::GetGenRsrcRequests ( )
virtual

SinkFacilities request Products of their given commodity.

Note that it is assumed the Sink operates on a single resource type!

◆ GetGenRsrcRequests() [2/2]

std::set< cyclus::RequestPortfolio< cyclus::Product >::Ptr > cycamore::Sink::GetGenRsrcRequests ( )
virtual

SinkFacilities request Products of their given commodity.

Note that it is assumed the Sink operates on a single resource type!

Definition at line 422 of file _tmp_build/cycamore/sink.cc.

References in_commods, RequestAmt(), and cycamore::string.

Referenced by version().

Here is the call graph for this function:

◆ GetMatlRequests() [1/2]

virtual std::set<cyclus::RequestPortfolio<cyclus::Material>::Ptr> cycamore::Sink::GetMatlRequests ( )
virtual

SinkFacilities request Materials of their given commodity.

Note that it is assumed the Sink operates on a single resource type!

◆ GetMatlRequests() [2/2]

std::set< cyclus::RequestPortfolio< cyclus::Material >::Ptr > cycamore::Sink::GetMatlRequests ( )
virtual

SinkFacilities request Materials of their given commodity.

Note that it is assumed the Sink operates on a single resource type!

Definition at line 390 of file _tmp_build/cycamore/sink.cc.

References in_commod_prefs, in_commods, recipe_name, and RequestAmt().

Referenced by TEST_F(), and version().

Here is the call graph for this function:

◆ InfileToDb()

void cycamore::Sink::InfileToDb ( cyclus::InfileTree *  tree,
cyclus::DbInit  di 
)
virtual

◆ InitFrom() [1/2]

void cycamore::Sink::InitFrom ( cycamore::Sink m)
virtual

◆ InitFrom() [2/2]

void cycamore::Sink::InitFrom ( cyclus::QueryableBackend *  b)
virtual

◆ InitInv()

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

Definition at line 279 of file _tmp_build/cycamore/sink.cc.

References inventory.

Referenced by version().

◆ input_commodities() [1/2]

const std::vector<std::string>& cycamore::Sink::input_commodities ( ) const
inline
Returns
the input commodities

Definition at line 103 of file src/sink.h.

References in_commods.

◆ input_commodities() [2/2]

const std::vector<std::string>& cycamore::Sink::input_commodities ( ) const
inline
Returns
the input commodities

Definition at line 115 of file _tmp_build/cycamore/sink.h.

References in_commods.

Referenced by TEST_F().

◆ input_commodity_preferences() [1/2]

const std::vector<double>& cycamore::Sink::input_commodity_preferences ( ) const
inline
Returns
the input commodities preferences

Definition at line 107 of file src/sink.h.

References capacity, coordinates, in_commod_prefs, in_commods, inventory, latitude, longitude, max_inv_size, recipe_name, RecordPosition(), and cycamore::string.

Here is the call graph for this function:

◆ input_commodity_preferences() [2/2]

const std::vector<double>& cycamore::Sink::input_commodity_preferences ( ) const
inline
Returns
the input commodities preferences

Definition at line 119 of file _tmp_build/cycamore/sink.h.

References in_commod_prefs.

Referenced by TEST_F().

◆ InventorySize() [1/2]

double cycamore::Sink::InventorySize ( ) const
inline
Returns
the current inventory storage size

Definition at line 87 of file src/sink.h.

References inventory.

◆ InventorySize() [2/2]

double cycamore::Sink::InventorySize ( ) const
inline
Returns
the current inventory storage size

Definition at line 99 of file _tmp_build/cycamore/sink.h.

References inventory.

Referenced by TEST_F().

◆ MaxInventorySize() [1/2]

double cycamore::Sink::MaxInventorySize ( ) const
inline
Returns
the maximum inventory storage size

Definition at line 84 of file src/sink.h.

References inventory.

◆ MaxInventorySize() [2/2]

double cycamore::Sink::MaxInventorySize ( ) const
inline
Returns
the maximum inventory storage size

Definition at line 96 of file _tmp_build/cycamore/sink.h.

References inventory.

Referenced by TEST_F().

◆ RecordPosition() [1/2]

void cycamore::Sink::RecordPosition ( )
private

◆ RecordPosition() [2/2]

void cycamore::Sink::RecordPosition ( )
private

Definition at line 506 of file _tmp_build/cycamore/sink.cc.

References latitude, longitude, and cycamore::string.

Referenced by EnterNotify(), and input_commodity_preferences().

◆ RequestAmt() [1/2]

double cycamore::Sink::RequestAmt ( ) const
inline

determines the amount to request

Definition at line 90 of file src/sink.h.

References capacity, and inventory.

◆ RequestAmt() [2/2]

double cycamore::Sink::RequestAmt ( ) const
inline

determines the amount to request

Definition at line 102 of file _tmp_build/cycamore/sink.h.

References capacity, and inventory.

Referenced by GetGenRsrcRequests(), GetMatlRequests(), TEST_F(), and Tick().

◆ schema()

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

Definition at line 23 of file _tmp_build/cycamore/sink.cc.

Referenced by version().

◆ SetMaxInventorySize() [1/2]

void cycamore::Sink::SetMaxInventorySize ( double  size)
inline

sets the size of the storage inventory for received material

Parameters
sizethe storage size

Definition at line 78 of file src/sink.h.

References inventory, and max_inv_size.

◆ SetMaxInventorySize() [2/2]

void cycamore::Sink::SetMaxInventorySize ( double  size)
inline

sets the size of the storage inventory for received material

Parameters
sizethe storage size

Definition at line 90 of file _tmp_build/cycamore/sink.h.

References inventory, and max_inv_size.

Referenced by SinkTest::SetUpSink(), and Sink().

◆ Snapshot()

void cycamore::Sink::Snapshot ( cyclus::DbInit  di)
virtual

◆ SnapshotInv()

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

Definition at line 271 of file _tmp_build/cycamore/sink.cc.

References inventory.

Referenced by version().

◆ str() [1/2]

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

◆ str() [2/2]

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

Definition at line 369 of file _tmp_build/cycamore/sink.cc.

References in_commods, inventory, and cycamore::string.

Referenced by TEST_F(), and version().

◆ Tick() [1/2]

virtual void cycamore::Sink::Tick ( )
virtual

◆ Tick() [2/2]

void cycamore::Sink::Tick ( )
virtual

Definition at line 472 of file _tmp_build/cycamore/sink.cc.

References in_commods, RequestAmt(), and cycamore::string.

Referenced by version().

Here is the call graph for this function:

◆ Tock() [1/2]

virtual void cycamore::Sink::Tock ( )
virtual

◆ Tock() [2/2]

void cycamore::Sink::Tock ( )
virtual

Definition at line 493 of file _tmp_build/cycamore/sink.cc.

References inventory.

Referenced by version().

◆ version() [1/2]

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

Definition at line 29 of file src/sink.h.

References AcceptGenRsrcTrades(), AcceptMatlTrades(), CYCAMORE_VERSION, EnterNotify(), GetGenRsrcRequests(), GetMatlRequests(), str(), cycamore::string, Tick(), and Tock().

Here is the call graph for this function:

◆ version() [2/2]

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

Member Data Documentation

◆ capacity

double cycamore::Sink::capacity
private

monthly acceptance capacity

Definition at line 155 of file _tmp_build/cycamore/sink.h.

Referenced by Capacity(), InfileToDb(), InitFrom(), input_commodity_preferences(), RequestAmt(), and Snapshot().

◆ coordinates

cyclus::toolkit::Position cycamore::Sink::coordinates
private

Definition at line 181 of file _tmp_build/cycamore/sink.h.

Referenced by input_commodity_preferences().

◆ cycpp_shape_capacity

std::vector<int> cycamore::Sink::cycpp_shape_capacity
private

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

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

◆ cycpp_shape_in_commod_prefs

std::vector<int> cycamore::Sink::cycpp_shape_in_commod_prefs
private

Definition at line 133 of file _tmp_build/cycamore/sink.h.

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

◆ cycpp_shape_in_commods

std::vector<int> cycamore::Sink::cycpp_shape_in_commods
private

Definition at line 126 of file _tmp_build/cycamore/sink.h.

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

◆ cycpp_shape_inventory

std::vector<int> cycamore::Sink::cycpp_shape_inventory
private

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

Referenced by InfileToDb(), and InitFrom().

◆ cycpp_shape_latitude

std::vector<int> cycamore::Sink::cycpp_shape_latitude
private

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

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

◆ cycpp_shape_longitude

std::vector<int> cycamore::Sink::cycpp_shape_longitude
private

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

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

◆ cycpp_shape_max_inv_size

std::vector<int> cycamore::Sink::cycpp_shape_max_inv_size
private

Definition at line 148 of file _tmp_build/cycamore/sink.h.

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

◆ cycpp_shape_recipe_name

std::vector<int> cycamore::Sink::cycpp_shape_recipe_name
private

Definition at line 140 of file _tmp_build/cycamore/sink.h.

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

◆ in_commod_prefs

std::vector< double > cycamore::Sink::in_commod_prefs
private

◆ in_commods

std::vector< std::string > cycamore::Sink::in_commods
private

all facilities must have at least one input commodity

Definition at line 125 of file _tmp_build/cycamore/sink.h.

Referenced by AddCommodity(), EnterNotify(), GetGenRsrcRequests(), GetMatlRequests(), InfileToDb(), InitFrom(), input_commodities(), input_commodity_preferences(), Snapshot(), str(), and Tick().

◆ inventory

cyclus::toolkit::ResBuf< cyclus::Resource > cycamore::Sink::inventory
private

◆ latitude

double cycamore::Sink::latitude
private

◆ longitude

double cycamore::Sink::longitude
private

◆ max_inv_size

double cycamore::Sink::max_inv_size
private

max inventory size

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

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

◆ recipe_name

std::string cycamore::Sink::recipe_name
private

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