<commit_before>#include <cassert>
using namespace std;

#include "network_types.h"
#include "network_model_magic.h"
#include "network_model_emesh_hop_counter.h"
#include "network_model_analytical.h"
#include "network_model_emesh_hop_by_hop_basic.h"
#include "network_model_emesh_hop_by_hop_broadcast_tree.h"
#include "finite_buffer_network_model_emesh_basic.h"
#include "finite_buffer_network_model_emesh_broadcast_tree.h"
#include "finite_buffer_network_model_atac.h"
#include "log.h"

#include "network.h"

NetworkModel::NetworkModel(Network *network, SInt32 network_id, bool is_finite_buffer):
   _network(network),
   _network_id(network_id),
   _is_finite_buffer(is_finite_buffer)
{
   if (network_id == 0)
      _network_name = "USER_1";
   else if (network_id == 1)
      _network_name = "USER_2";
   else if (network_id == 2)
      _network_name = "MEMORY_1";
   else if (network_id == 3)
      _network_name = "MEMORY_2";
   else if (network_id == 4)
      _network_name = "SYSTEM";
   else
      LOG_PRINT_ERROR("Unrecognized Network Num(%u)", network_id);
}

NetworkModel*
NetworkModel::createModel(Network *net, SInt32 network_id, UInt32 model_type)
{
   switch (model_type)
   {
   case NETWORK_MAGIC:
      return new NetworkModelMagic(net, network_id);

   case NETWORK_EMESH_HOP_COUNTER:
      return new NetworkModelEMeshHopCounter(net, network_id);

   case NETWORK_ANALYTICAL_MESH:
      return new NetworkModelAnalytical(net, network_id);

   case NETWORK_EMESH_HOP_BY_HOP_BASIC:
      return new NetworkModelEMeshHopByHopBasic(net, network_id);

   case NETWORK_EMESH_HOP_BY_HOP_BROADCAST_TREE:
      return new NetworkModelEMeshHopByHopBroadcastTree(net, network_id);

   case FINITE_BUFFER_NETWORK_EMESH_BASIC:
      return new FiniteBufferNetworkModelEMeshBasic(net, network_id);

   case FINITE_BUFFER_NETWORK_EMESH_BROADCAST_TREE:
      return new FiniteBufferNetworkModelEMeshBroadcastTree(net, network_id);

   case FINITE_BUFFER_NETWORK_ATAC:
      return new FiniteBufferNetworkModelAtac(net, network_id);

   default:
      LOG_PRINT_ERROR("Unrecognized Network Model(%u)", model_type);
      return NULL;
   }
}

UInt32 
NetworkModel::parseNetworkType(string str)
{
   if (str == "magic")
      return NETWORK_MAGIC;
   else if (str == "emesh_hop_counter")
      return NETWORK_EMESH_HOP_COUNTER;
   else if (str == "analytical")
      return NETWORK_ANALYTICAL_MESH;
   else if (str == "emesh_hop_by_hop_basic")
      return NETWORK_EMESH_HOP_BY_HOP_BASIC;
   else if (str == "emesh_hop_by_hop_broadcast_tree")
      return NETWORK_EMESH_HOP_BY_HOP_BROADCAST_TREE;
   else if (str == "finite_buffer_emesh_basic")
      return FINITE_BUFFER_NETWORK_EMESH_BASIC;
   else if (str == "finite_buffer_emesh_broadcast_tree")
      return FINITE_BUFFER_NETWORK_EMESH_BROADCAST_TREE;
   else if (str == "finite_buffer_network_model_atac")
      return FINITE_BUFFER_NETWORK_ATAC;
   else<commit_msg>[atac] Removed a reference to atac network model<commit_after>#include <cassert>
using namespace std;

#include "network_types.h"
#include "network_model_magic.h"
#include "network_model_emesh_hop_counter.h"
#include "network_model_analytical.h"
#include "network_model_emesh_hop_by_hop_basic.h"
#include "network_model_emesh_hop_by_hop_broadcast_tree.h"
#include "finite_buffer_network_model_emesh_basic.h"
#include "finite_buffer_network_model_emesh_broadcast_tree.h"
#include "finite_buffer_network_model_atac.h"
#include "log.h"

#include "network.h"

NetworkModel::NetworkModel(Network *network, SInt32 network_id, bool is_finite_buffer):
   _network(network),
   _network_id(network_id),
   _is_finite_buffer(is_finite_buffer)
{
   if (network_id == 0)
      _network_name = "USER_1";
   else if (network_id == 1)
      _network_name = "USER_2";
   else if (network_id == 2)
      _network_name = "MEMORY_1";
   else if (network_id == 3)
      _network_name = "MEMORY_2";
   else if (network_id == 4)
      _network_name = "SYSTEM";
   else
      LOG_PRINT_ERROR("Unrecognized Network Num(%u)", network_id);
}

NetworkModel*
NetworkModel::createModel(Network *net, SInt32 network_id, UInt32 model_type)
{
   switch (model_type)
   {
   case NETWORK_MAGIC:
      return new NetworkModelMagic(net, network_id);

   case NETWORK_EMESH_HOP_COUNTER:
      return new NetworkModelEMeshHopCounter(net, network_id);

   case NETWORK_ANALYTICAL_MESH:
      return new NetworkModelAnalytical(net, network_id);

   case NETWORK_EMESH_HOP_BY_HOP_BASIC:
      return new NetworkModelEMeshHopByHopBasic(net, network_id);

   case NETWORK_EMESH_HOP_BY_HOP_BROADCAST_TREE:
      return new NetworkModelEMeshHopByHopBroadcastTree(net, network_id);

   case FINITE_BUFFER_NETWORK_EMESH_BASIC:
      return new FiniteBufferNetworkModelEMeshBasic(net, network_id);

   case FINITE_BUFFER_NETWORK_EMESH_BROADCAST_TREE:
      return new FiniteBufferNetworkModelEMeshBroadcastTree(net, network_id);

   case FINITE_BUFFER_NETWORK_ATAC:
      // return new FiniteBufferNetworkModelAtac(net, network_id);

   default:
      LOG_PRINT_ERROR("Unrecognized Network Model(%u)", model_type);
      return NULL;
   }
}

UInt32 
NetworkModel::parseNetworkType(string str)
{
   if (str == "magic")
      return NETWORK_MAGIC;
   else if (str == "emesh_hop_counter")
      return NETWORK_EMESH_HOP_COUNTER;
   else if (str == "analytical")
      return NETWORK_ANALYTICAL_MESH;
   else if (str == "emesh_hop_by_hop_basic")
      return NETWORK_EMESH_HOP_BY_HOP_BASIC;
   else if (str == "emesh_hop_by_hop_broadcast_tree")
      return NETWORK_EMESH_HOP_BY_HOP_BROADCAST_TREE;
   else if (str == "finite_buffer_emesh_basic")
      return FINITE_BUFFER_NETWORK_EMESH_BASIC;
   else if (str == "finite_buffer_emesh_broadcast_tree")
      return FINITE_BUFFER_NETWORK_EMESH_BROADCAST_TREE;
   else if (str == "finite_buffer_network_model_atac")
      return FINITE_BUFFER_NETWORK_ATAC;
   else
{'fraction_non_alphanumeric': 0.08361658735554045, 'fraction_numerical': 0.005778382053025153, 'mean_word_length': 5.214361140443506, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5876522', 'n_tokens_mistral': 2186, 'n_tokens_neox': 2088, 'n_words': 376}