1#ifndef CYCLUS_SRC_TOOLKIT_MATL_BUY_POLICY_H_
2#define CYCLUS_SRC_TOOLKIT_MATL_BUY_POLICY_H_
5#include <boost/shared_ptr.hpp>
122 TotalInvTracker* buf_tracker);
124 TotalInvTracker* buf_tracker,
double throughput,
129 TotalInvTracker* buf_tracker,
double throughput,
132 TotalInvTracker* buf_tracker,
double throughput,
133 std::string inv_policy,
double fill_behav,
double req_at);
135 TotalInvTracker* buf_tracker, std::string inv_policy,
136 double fill_behav,
double req_at);
138 TotalInvTracker* buf_tracker,
double throughput,
181 return std::min({throughput_, fill_to_ - buf_->quantity(), buf_->space(),
182 buf_tracker_->space()});
186 inline bool MakeReq()
const {
return buf_tracker_->quantity() <= req_at_; }
189 inline bool Excl()
const {
return quantize_ > 0; }
192 inline double ReqQty(
double amt)
const {
return Excl() ? quantize_ : amt; }
195 inline int NReq(
double amt)
const {
196 return Excl() ?
static_cast<int>(amt / quantize_) : 1;
203 return rsrc_commods_;
207 return (next_dormant_end_ < 0 || next_active_end_ < 0);
211 return (time >= next_active_end_ && time < next_dormant_end_);
230 struct CommodDetail {
235 void set_manager(
Agent* m);
236 void set_total_inv_tracker(TotalInvTracker* t = NULL);
237 void set_inv_policy(std::string p,
double x,
238 double y = std::numeric_limits<double>::max());
240 void set_fill_to(
double x);
242 void set_req_at(
double x);
243 void set_cumulative_cap(
double x);
244 void set_quantize(
double x);
245 void set_throughput(
double x);
246 void init_active_dormant();
248 ResBuf<Material>* buf_;
249 TotalInvTracker* buf_tracker_;
250 std::string name_, inv_policy;
251 double fill_to_, req_at_, quantize_, throughput_, cumulative_cap_,
254 int next_active_end_ = 0;
255 int next_dormant_end_ = 0;
261 std::map<Material::Ptr, std::string> rsrc_commods_;
262 std::map<std::string, CommodDetail> commod_details_;
The abstract base class used by all types of agents that live and interact in a simulation.
boost::shared_ptr< Composition > Ptr
boost::shared_ptr< DoubleDistribution > Ptr
boost::shared_ptr< IntDistribution > Ptr
boost::shared_ptr< Material > Ptr
virtual Agent * manager()
cyclus::IntDistribution::Ptr dormant_dist_
cyclus::IntDistribution::Ptr active_dist_
cyclus::DoubleDistribution::Ptr size_dist_
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or....
A Trade is a simple container that associates a request for a resource with a bid for that resource.