CYCLUS
Loading...
Searching...
No Matches
cyclus::Package Class Reference

Detailed Description

Package is a class that packages materials into discrete items in ways.

Definition at line 19 of file package.h.

#include <package.h>

Public Types

typedef boost::shared_ptr< PackagePtr
 

Public Member Functions

double fill_max () const
 
double fill_min () const
 
std::vector< doubleGetFillMass (double qty)
 
bool IsValidStrategy (std::string strategy)
 
std::string name () const
 
void SetDistribution ()
 
std::string strategy () const
 

Static Public Member Functions

static Ptr Create (std::string name, double fill_min=0, double fill_max=std::numeric_limits< double >::max(), std::string strategy="first")
 
static void ExceedsSplitLimits (int pkgs, std::string ss_extra="")
 
static int SplitLimit ()
 
static int SplitWarn ()
 
static Ptrunpackaged ()
 
static std::string unpackaged_name ()
 

Member Typedef Documentation

◆ Ptr

typedef boost::shared_ptr<Package> cyclus::Package::Ptr

Definition at line 21 of file package.h.

Member Function Documentation

◆ Create()

Package::Ptr cyclus::Package::Create ( std::string name,
double fill_min = 0,
double fill_max = std::numeric_limits<double>::max(),
std::string strategy = "first" )
static

Definition at line 9 of file package.cc.

◆ ExceedsSplitLimits()

static void cyclus::Package::ExceedsSplitLimits ( int pkgs,
std::string ss_extra = "" )
inlinestatic

Definition at line 73 of file package.h.

◆ fill_max()

double cyclus::Package::fill_max ( ) const
inline

Definition at line 63 of file package.h.

◆ fill_min()

double cyclus::Package::fill_min ( ) const
inline

Definition at line 61 of file package.h.

◆ GetFillMass()

std::vector< double > cyclus::Package::GetFillMass ( double qty)

Returns optimal fill mass for a resource to be packaged, and number of packages that can be crated at that fill mass (note that up to one additional package may be possible to create with a lower fill mass, which much be checked separately).

Can be used to determine how to respond to requests for material, and to actually package and send off trades. Packaging strategy "first" simply fills the packages one by one to the maximum fill. Therefore, it should always try to max fill. Packaging strategy "equal" tries to fill all packages to the same mass. This tries to find the optimal number and fill mass of packages given the packaging limitations. It does this by calculating bounding fills, floor(quantity/fill_min) and ceiling(quantity/fill_max). Packaging strategy "uniform" fills packages with a random mass between fill_min and fill_max, if at least fill_max is available. If less than fill_max is available, a partial package is filled with the total mass. Packaging strategy "normal" fills packages with a random mass between fill_min and fill_max, with a normal distribution. Mean is the middle of fill_min and fill_max, standard deviation is 1/6 of the range such that 3 sigma is the range. If less than fill_max is available, a partial package is filled with the total mass (no dist sampling). There might be a scenario where there is no solution, i.e. an integer number of packages cannot be filled with no remainder. In this case, the most effective fill strategy is to fill to the max. Numeric example: quantity = 5, fill_min = 3, fill_max = 4. num_min_fill = floor(5/3) = 1, num_max_fill = ceil(5/4) = 2. num_min_fill < num_max_fill, so fill to the max.

Definition at line 45 of file package.cc.

◆ IsValidStrategy()

bool cyclus::Package::IsValidStrategy ( std::string strategy)
inline

Definition at line 98 of file package.h.

◆ name()

std::string cyclus::Package::name ( ) const
inline

Definition at line 59 of file package.h.

◆ SetDistribution()

void cyclus::Package::SetDistribution ( )

Definition at line 33 of file package.cc.

◆ SplitLimit()

static int cyclus::Package::SplitLimit ( )
inlinestatic

Definition at line 94 of file package.h.

◆ SplitWarn()

static int cyclus::Package::SplitWarn ( )
inlinestatic

Definition at line 90 of file package.h.

◆ strategy()

std::string cyclus::Package::strategy ( ) const
inline

Definition at line 65 of file package.h.

◆ unpackaged()

Package::Ptr & cyclus::Package::unpackaged ( )
static

Definition at line 24 of file package.cc.

◆ unpackaged_name()

static std::string cyclus::Package::unpackaged_name ( )
inlinestatic

Definition at line 68 of file package.h.


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