<commit_before>/* 
 * File:   TopologyOracle.hpp
 * Author: manuhalo
 *
 * Created on 25 giugno 2012, 10.36
 */

#ifndef IPTVTOPOLOGYORACLE_HPP
#define	IPTVTOPOLOGYORACLE_HPP

#include "TopologyOracle.hpp"
#include "zipf_distribution.hpp"
#include "boost/random/uniform_real_distribution.hpp"
#include <queue>




/* The TopologyOracle keeps track of what everyone is caching and uses that
 * information to match requesters to sources with the appropriate content.
 * Essentially it serves as a global tracker (in the BitTorrent sense).
 * We keep both a map of all the user caching a particular content (to fetch
 * potential sources quickly) and a map of what each individual user is caching
 * (to be able to simulate finite-size caching).
 */
class IPTVTopologyOracle : public TopologyOracle{
protected:
 
  boost::random::zipf_distribution<>* relDayDist;
  boost::random::zipf_distribution<>* rankDist;
  /* the following distributions are used to generate the parameters for the
   * Zipf-Mandelbrot popularity distribution, which is going to change each
   * day.
   */
  boost::random::uniform_int_distribution<>* shiftDist;
  boost::random::uniform_real_distribution<>* expDist;
  
  /* the daily catalog contains all the available contents sorted by day of
   * release, with dailyCatalog[0] being the content released in the current
   * day and dailyCatalog[6] the content released 6 days ago (and thus about 
   * to expire).
   */
  std::vector< std::vector<ContentElement*> > dailyCatalog;
  
  /* new members that are required for the chunking mechanisms:
   * chunkSize is the size of each chunk in Megabits
   * bufferSize is the number of chunks that can be stored in the streaming 
   * buffer for each user
   */
  uint chunkSize; // in Mbits
  uint bufferSize; // in # of chunks
  
  <commit_msg>Some global parameters (chunkSize and bufferSize) have been moved to the parent TopologyOracle class<commit_after>/* 
 * File:   TopologyOracle.hpp
 * Author: manuhalo
 *
 * Created on 25 giugno 2012, 10.36
 */

#ifndef IPTVTOPOLOGYORACLE_HPP
#define	IPTVTOPOLOGYORACLE_HPP

#include "TopologyOracle.hpp"
#include "zipf_distribution.hpp"
#include "boost/random/uniform_real_distribution.hpp"
#include <queue>




/* The TopologyOracle keeps track of what everyone is caching and uses that
 * information to match requesters to sources with the appropriate content.
 * Essentially it serves as a global tracker (in the BitTorrent sense).
 * We keep both a map of all the user caching a particular content (to fetch
 * potential sources quickly) and a map of what each individual user is caching
 * (to be able to simulate finite-size caching).
 */
class IPTVTopologyOracle : public TopologyOracle{
protected:
 
  boost::random::zipf_distribution<>* relDayDist;
  boost::random::zipf_distribution<>* rankDist;
  /* the following distributions are used to generate the parameters for the
   * Zipf-Mandelbrot popularity distribution, which is going to change each
   * day.
   */
  boost::random::uniform_int_distribution<>* shiftDist;
  boost::random::uniform_real_distribution<>* expDist;
  
  /* the daily catalog contains all the available contents sorted by day of
   * release, with dailyCatalog[0] being the content released in the current
   * day and dailyCatalog[6] the content released 6 days ago (and thus about 
   * to expire).
   */
  std::vector< std::vector<ContentElement*> > dailyCatalog;  
  
{'fraction_non_alphanumeric': 0.07672112018669779, 'fraction_numerical': 0.007584597432905484, 'mean_word_length': 4.3328149300155525, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '6688626', 'n_tokens_mistral': 1024, 'n_tokens_neox': 954, 'n_words': 385}