CYCLUS
Classes | Public Member Functions | List of all members
cyclus::ResourceExchange< T > Class Template Reference

Detailed Description

template<class T>
class cyclus::ResourceExchange< T >

The ResourceExchange class manages the communication for the supply and demand of resources in a simulation.

At any given timestep, there are three main phases involved:

  1. Request for Bids Agents that demand resources of a given type post their
    demands to the exchange
  2. Response to Request for Bids Agents that supply resources of a given type respond to
    those requests
  3. Preference Adjustment Preferences for each request-bid pair are set, informing
    the evenutal soluation mechanism

For example, assuming a simulation Context, ctx, and resource type, ResourceType:

ResourceExchange<ResourceType> exchng(ctx);
exchng.AddAllRequests();
exchng.AddAllBids();
exchng.AdjustAll();

Definition at line 61 of file resource_exchange.h.

#include <resource_exchange.h>

Public Member Functions

void AddAllBids ()
 
void AddAllRequests ()
 
void AdjustAll ()
 
bool Empty ()
 
ExchangeContext< T > & ex_ctx ()
 
 ResourceExchange (Context *ctx)
 

Constructor & Destructor Documentation

template<class T>
cyclus::ResourceExchange< T >::ResourceExchange ( Context ctx)
inline

default constructor

Parameters
ctxthe simulation context

Definition at line 66 of file resource_exchange.h.

Member Function Documentation

template<class T>
void cyclus::ResourceExchange< T >::AddAllBids ( )
inline

queries traders and collects all responses to requests for bids

Definition at line 85 of file resource_exchange.h.

template<class T>
void cyclus::ResourceExchange< T >::AddAllRequests ( )
inline

queries traders and collects all requests for bids

Definition at line 75 of file resource_exchange.h.

template<class T>
void cyclus::ResourceExchange< T >::AdjustAll ( )
inline

adjust preferences for requests given bid responses

Definition at line 95 of file resource_exchange.h.

template<class T>
bool cyclus::ResourceExchange< T >::Empty ( )
inline

return true if this is an empty exchange (i.e., no requests exist, therefore no bids)

Definition at line 108 of file resource_exchange.h.

template<class T>
ExchangeContext<T>& cyclus::ResourceExchange< T >::ex_ctx ( )
inline

Definition at line 70 of file resource_exchange.h.


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