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

Detailed Description

TransportUnit is a class that can be used in conjunction with packages to restrict the amount of material that can be traded between facilities.

Unlike Packages, TransportUnits are not a property of resources. They are simply applied at the response to request for bids phase and then the trade execution to determine whether the available number of packages is allowable given the TransportUnit parameters. Default is unrestricted Strategy "first" simply fill transport units one by one to max fill Strategy "equal" tries to fill all transport units with the Strategy "hybrid" is iterative, recursively filling transport units with the max fill until the remaining quantity can be filled with the at least the min fill. This is the most efficient strategy

Definition at line 134 of file package.h.

#include <package.h>

Public Types

typedef boost::shared_ptr< TransportUnitPtr
 

Public Member Functions

int fill_max () const
 
int fill_min () const
 
int GetTransportUnitFill (int qty)
 
int MaxShippablePackages (int pkgs)
 
std::string name () const
 
std::string strategy () const
 

Static Public Member Functions

static Ptr Create (std::string name, int fill_min=0, int fill_max=std::numeric_limits< int >::max(), std::string strategy="first")
 
static Ptrunrestricted ()
 
static int unrestricted_id ()
 
static std::string unrestricted_name ()
 

Member Typedef Documentation

◆ Ptr

Definition at line 136 of file package.h.

Member Function Documentation

◆ Create()

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

create a new transport unit type.

Should be called by the context only (see Context::AddTransportUnit), unless you want an untracked transport unit type (which you probably don't)

Definition at line 117 of file package.cc.

◆ fill_max()

int cyclus::TransportUnit::fill_max ( ) const
inline

Definition at line 158 of file package.h.

◆ fill_min()

int cyclus::TransportUnit::fill_min ( ) const
inline

Definition at line 156 of file package.h.

◆ GetTransportUnitFill()

int cyclus::TransportUnit::GetTransportUnitFill ( int qty)

Returns number of packages for each transport unit.

same number of packages

Definition at line 138 of file package.cc.

◆ MaxShippablePackages()

int cyclus::TransportUnit::MaxShippablePackages ( int pkgs)

Returns the max number of transport units that can be shipped from the available quantity.

Definition at line 165 of file package.cc.

◆ name()

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

Definition at line 154 of file package.h.

◆ strategy()

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

Definition at line 160 of file package.h.

◆ unrestricted()

TransportUnit::Ptr & cyclus::TransportUnit::unrestricted ( )
static

Definition at line 131 of file package.cc.

◆ unrestricted_id()

static int cyclus::TransportUnit::unrestricted_id ( )
inlinestatic

Definition at line 163 of file package.h.

◆ unrestricted_name()

static std::string cyclus::TransportUnit::unrestricted_name ( )
inlinestatic

Definition at line 166 of file package.h.


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