CYCLUS
|
A Product is a general type of resource in the Cyclus simulation, and is a catch-all for non-standard resources.
It implements the Resource class interface in a simple way usable for things such as: bananas, man-hours, water, buying power, etc.
#include <product.h>
Public Types | |
typedef boost::shared_ptr< Product > | Ptr |
Public Types inherited from cyclus::Resource | |
typedef boost::shared_ptr< Resource > | Ptr |
Public Member Functions | |
void | Absorb (Product::Ptr other) |
virtual void | ChangePackage (std::string new_package_name=Package::unpackaged_name()) |
virtual Resource::Ptr | Clone () const |
Product::Ptr | Extract (double quantity) |
virtual Resource::Ptr | ExtractRes (double quantity) |
virtual std::string | package_name () |
virtual Resource::Ptr | PackageExtract (double qty, std::string new_package_name=Package::unpackaged_name()) |
virtual int | qual_id () const |
virtual const std::string & | quality () const |
virtual double | quantity () const |
virtual void | Record (Context *ctx) const |
virtual const ResourceType | type () const |
virtual std::string | units () const |
Public Member Functions inherited from cyclus::Resource | |
virtual void | Absorb (Ptr res) |
void | BumpStateId () |
virtual void | Decay (int curr_time) |
const int | obj_id () const |
template<class T > | |
std::vector< typename T::Ptr > | Package (Package::Ptr pkg) |
Resource () | |
const int | state_id () const |
virtual | ~Resource () |
Static Public Member Functions | |
static Ptr | Create (Agent *creator, double quantity, std::string quality, std::string package_name=Package::unpackaged_name()) |
static Ptr | CreateUntracked (double quantity, std::string quality) |
Static Public Attributes | |
static const ResourceType | kType = "Product" |
typedef boost::shared_ptr<Product> cyclus::Product::Ptr |
void cyclus::Product::Absorb | ( | Product::Ptr | other | ) |
Absorbs the contents of the given 'other' resource into this resource.
ValueError | 'other' resource is of different quality |
Definition at line 48 of file product.cc.
|
virtual |
Changes the product's package id.
Reimplemented from cyclus::Resource.
Definition at line 97 of file product.cc.
|
virtual |
Returns an untracked (not part of the simulation) copy of the resource.
A cloned resource should never record anything in the output database.
Implements cyclus::Resource.
Definition at line 40 of file product.cc.
|
static |
Creates a new product that is "live" and tracked.
creator is a pointer to the agent creating the resource (usually will be the caller's "this" pointer). All future output data recorded will be done using the creator's context.
Definition at line 15 of file product.cc.
|
static |
Creates a new product that does not actually exist as part of the simulation and is untracked.
Definition at line 32 of file product.cc.
Product::Ptr cyclus::Product::Extract | ( | double | quantity | ) |
Extracts the specified mass from this resource and returns it as a new product object with the same quality/type.
ValueError | tried to extract more than exists. |
Definition at line 59 of file product.cc.
|
virtual |
Splits the resource and returns the extracted portion as a new resource object.
Allows for things like ResBuf and Traders to split offers/requests of arbitrary resource implementation type.
Implements cyclus::Resource.
Definition at line 72 of file product.cc.
|
virtual |
Returns the package id.
Reimplemented from cyclus::Resource.
Definition at line 76 of file product.cc.
|
virtual |
Implements cyclus::Resource.
Definition at line 80 of file product.cc.
Returns the quantity of this resource with dimensions as specified by the return value of units().
Implements cyclus::Resource.
Records the resource's state to the output database.
This method should generally NOT record data accessible via the Resource class public methods (e.g. qual_id, units, type, quantity).
ctx | the simulation context used to record the data. |
Implements cyclus::Resource.
|
inlinevirtual |
|
inlinevirtual |
Returns the units this resource is based in (e.g. "kg").
Implements cyclus::Resource.
|
static |