<commit_before>// FacilityModel.cpp
// Implements the FacilityModel class

#include "FacilityModel.h"

#include "Timer.h"
#include "BookKeeper.h"
#include "QueryEngine.h"
#include "InstModel.h"

#include <stdlib.h>
#include <sstream>
#include "Logger.h"
#include <limits>

using namespace std;

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FacilityModel::FacilityModel() : 
  fac_lifetime_(numeric_limits<int>::max()),
  decommission_date_(numeric_limits<int>::max()) {
  setModelType("Facility");
  in_commods_ = std::vector<std::string>();
  out_commods_ = std::vector<std::string>();
};

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FacilityModel::~FacilityModel() {};
  
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FacilityModel::initCoreMembers(QueryEngine* qe) {
  Model::initCoreMembers(qe);

  // get lifetime
  try {
    setFacLifetime(atoi(qe->getElementContent("lifetime").c_str()));
  }
  catch (CycNullQueryException e) {
    setFacLifetime(TI->simDur());
  }
  
  // get the incommodities
  std::string commod;
  try {
    int numInCommod = qe->nElementsMatchingQuery("incommodity");
    for (int i=0;i<numInCommod;i++){
      commod = qe->getElementContent("incommodity",i);
      in_commods_.push_back(commod);
      LOG(LEV_DEBUG2, "none!") << "Facility " << ID() << " has just added incommodity" << commod;<commit_msg>added the build date to the initialization list in facility model because it is invoked by the str() member<commit_after>// FacilityModel.cpp
// Implements the FacilityModel class

#include "FacilityModel.h"

#include "Timer.h"
#include "BookKeeper.h"
#include "QueryEngine.h"
#include "InstModel.h"

#include <stdlib.h>
#include <sstream>
#include "Logger.h"
#include <limits>

using namespace std;

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FacilityModel::FacilityModel() : 
  fac_lifetime_(numeric_limits<int>::max()),
  decommission_date_(numeric_limits<int>::max()),
  build_date_(0) {
  setModelType("Facility");
  in_commods_ = std::vector<std::string>();
  out_commods_ = std::vector<std::string>();
};

//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
FacilityModel::~FacilityModel() {};
  
//- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void FacilityModel::initCoreMembers(QueryEngine* qe) {
  Model::initCoreMembers(qe);

  // get lifetime
  try {
    setFacLifetime(atoi(qe->getElementContent("lifetime").c_str()));
  }
  catch (CycNullQueryException e) {
    setFacLifetime(TI->simDur());
  }
  
  // get the incommodities
  std::string commod;
  try {
    int numInCommod = qe->nElementsMatchingQuery("incommodity");
    for (int i=0;i<numInCommod;i++){
      commod = qe->getElementContent("incommodity",i);
      in_commods_.push_back(commod);
      LOG(LEV_DEBUG2, "none!") << "Facility " << ID() << " has just added incommodity" << commod;
{'fraction_non_alphanumeric': 0.21523619427811044, 'fraction_numerical': 0.00166333998669328, 'mean_word_length': 2.393905191873589, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 36, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2470843', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1122, 'n_words': 162}