<commit_before>// batch_reactor.h
#ifndef CYCAMORE_MODELS_BATCHREACTOR_BATCH_REACTOR_H_
#define CYCAMORE_MODELS_BATCHREACTOR_BATCH_REACTOR_H_

#include <string>
#include <queue>
#include <map>

#include "bid_portfolio.h"
#include "capacity_constraint.h"
#include "commodity_producer.h"
#include "exchange_context.h"
#include "enrichment.h"
#include "facility_model.h"
#include "resource_buff.h"
#include "request_portfolio.h"
#include "transaction.h"
#include "material.h"

// forward declarations
namespace cycamore {
class BatchReactor;
} // namespace cycamore
namespace cyclus {  
class Context;
} // namespace cyclus

namespace cycamore {

/// @class BatchReactor
///
/// @brief The BatchReactor is a facility that models batch processing.
///
/// @todo finish documentation..
/// @todo add a refueling delay
/// @todo add decommissioning behavior if material is still in storage
class BatchReactor : public cyclus::FacilityModel,
      public cyclus::CommodityProducer {
 public:
  /// @brief defines all possible phases this facility can be in
  enum Phase {
    INITIAL, ///< The initial phase, after the facility is built but before it is
             /// filled
    PROCESS, ///< The processing phase
    WAITING, ///< The waiting phase, while the factility is waiting for fuel
             /// between processes
  };

  /// @brief a struct for initial conditions
  struct InitCond {
    InitCond(int n_reserves, int n_core, int n_storage)
     : n_reserves(n_reserves),
       n_core(n_core),
       n_storage(n_storage) {};
    
    int n_reserves;
    int n_core;
    int n_storage;<commit_msg>added documentation to the BatchReactor class<commit_after>// batch_reactor.h
#ifndef CYCAMORE_MODELS_BATCHREACTOR_BATCH_REACTOR_H_
#define CYCAMORE_MODELS_BATCHREACTOR_BATCH_REACTOR_H_

#include <string>
#include <queue>
#include <map>

#include "bid_portfolio.h"
#include "capacity_constraint.h"
#include "commodity_producer.h"
#include "exchange_context.h"
#include "enrichment.h"
#include "facility_model.h"
#include "resource_buff.h"
#include "request_portfolio.h"
#include "transaction.h"
#include "material.h"

// forward declarations
namespace cycamore {
class BatchReactor;
} // namespace cycamore
namespace cyclus {  
class Context;
} // namespace cyclus

namespace cycamore {

/// @class BatchReactor
///
/// @section introduction Introduction
/// The BatchReactor is a facility that models batch processing. It has three
/// buffers which hold batches of materials: reserves, core, and
/// storage. Incoming material orders are placed into reserves, from which the
/// core is provided batches during refueling. When a process has been
/// completed, batches are moved from the core into storage. Requests for
/// material are bid upon based on the state of the material in storage.
///
/// @section params Parameters
/// A BatchReactor has the following tuneable parameters:
///   #. batch_size : the size of batches
///   #. n_batches : the number of batches that constitute a full core
///   #. process_time : the number of timesteps a batch process takes
///   #. n_load : the number of batches processed at any given time (i.e.,
///   n_load is unloaded and reloaded after a process is finished
///   #. n_reserves : the preferred number of batches in reserve
///   #. preorder_time : the amount of time before a process is finished to
///   order fuel
///   #. refuel_time : the number of timesteps required to reload the core after
///   a process has finished
///   #. in_commodity : the name of the input commodity
///   #. in_recipe : the name of the input recipe
///   #. out_commodity : the name of the output commodity
///   #. out_recipe : the name of the output recipe
/// 
/// @section requests Requests  
/// A BatchReactor will make a request for its input commodity if the
/// preorder_time has been reached and there are less than n_reserves batches in
/// its reserves.
///
/// A special case exists when the reactor first enters the simulation, where it
/// will order as much fuel as is needed to fill its full core.
/// 
/// @section bids Bids
/// A BatchReactor will bid on any request for its out_commodity, up to its
/// storage buffer quantity.
///
/// @section ics Initial Conditions
/// A BatchReactor can be deployed with any number of batches in its reserve,
/// core, and storage buffers.
///
/// @todo add decommissioning behavior if material is still in storage
class BatchReactor : public cyclus::FacilityModel,
      public cyclus::CommodityProducer {
 public:
  /// @brief defines all possible phases this facility can be in
  enum Phase {
    INITIAL, ///< The initial phase, after the facility is built but before it is
             /// filled
    PROCESS, ///< The processing phase
    WAITING, ///< The waiting phase, while the factility is waiting for fuel
             /// between processes
  };

  /// @brief a struct for initial conditions
  struct InitCond {
    InitCond(int n_reserves, int n_core, int n_storage)
     : n_reserves(n_reserves),
       n_core(n_core),
       n_storage(n_storage) {};
    
    int n_reserves;
    int n_core;
    int n_storage;
{'fraction_non_alphanumeric': 0.09521951219512195, 'fraction_numerical': 0.0, 'mean_word_length': 3.3257383966244727, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3210886', 'n_tokens_mistral': 1535, 'n_tokens_neox': 1479, 'n_words': 572}