<commit_before>﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms.DataVisualization.Charting;

namespace QueueSimulator
{
    class Program
    {
        class Customer
        {
            public int EntryTime { get; set; }
        }

        static void Main(string[] args)
        {
            List<double> arrivalRates = new List<double>();
            List<double> waitTimes = new List<double>();
            List<double> queueLengths = new List<double>();
            List<double> utilization = new List<double>();

            bool allowArrivals = true;
            Queue<Customer> queue = new Queue<Customer>();
            int totalCustomers = 0;
            int baseDuration = 2 * 60 * 60; // hrs * minutes/hr * seconds/min 
            int durationInSecs = baseDuration;
            double arrivalRate = 3.47;
            double serviceRate = 4.0;

            // main simulation loop
            // runs for duration; OR until queue is empty.
            for (var j = 0; j < durationInSecs; j++)
            {
                // Sample an arrival rate
                var currentArrivalRate = (int)Math.Round(PoissonDistribution.Next(arrivalRate));
                var currentServiceRate = (int)Math.Max(serviceRate, (int)Math.Round(PoissonDistribution.Next(serviceRate)));

                // Obey cool-down periods
                if (!allowArrivals)
                {
                    currentArrivalRate = 0;
                }

                // Queue arrivals
                for (var z = 0; z < currentArrivalRate; z++)
                {
                    var customer = new Customer();
                    var localTime = j;
                    customer.EntryTime = localTime;
                    queue.Enqueue(customer);
                    totalCustomers++;
                }
                
                // Service arrivals
                for (var m = 0; m < currentServiceRate; m++)
                {
                    if (queue.Count == 0)
                    {
                        break;
                    }
                    var customer = queue.Dequeue();
                    waitTimes.Add(j - customer.EntryTime);
                }
<commit_msg>Removed Poisson distribution use for service times...need to look into this more.<commit_after>﻿using System;
using System.Collections.Generic;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Text;
using System.Windows.Forms.DataVisualization.Charting;

namespace QueueSimulator
{
    class Program
    {
        class Customer
        {
            public int EntryTime { get; set; }
        }

        static void Main(string[] args)
        {
            List<double> arrivalRates = new List<double>();
            List<double> waitTimes = new List<double>();
            List<double> queueLengths = new List<double>();
            List<double> utilization = new List<double>();

            bool allowArrivals = true;
            Queue<Customer> queue = new Queue<Customer>();
            int totalCustomers = 0;
            int baseDuration = 2 * 60 * 60; // hrs * minutes/hr * seconds/min 
            int durationInSecs = baseDuration;
            double arrivalRate = 3.47;
            double serviceRate = 4.0;

            // main simulation loop
            // runs for duration; OR until queue is empty.
            for (var j = 0; j < durationInSecs; j++)
            {
                // Sample an arrival rate
                var currentArrivalRate = (int)Math.Round(PoissonDistribution.Next(arrivalRate));
                var currentServiceRate = (int)Math.Round(arrivalRate);

                // Obey cool-down periods
                if (!allowArrivals)
                {
                    currentArrivalRate = 0;
                }

                // Queue arrivals
                for (var z = 0; z < currentArrivalRate; z++)
                {
                    var customer = new Customer();
                    var localTime = j;
                    customer.EntryTime = localTime;
                    queue.Enqueue(customer);
                    totalCustomers++;
                }
                
                // Service arrivals
                for (var m = 0; m < currentServiceRate; m++)
                {
                    if (queue.Count == 0)
                    {
                        break;
                    }
                    var customer = queue.Dequeue();
                    waitTimes.Add(j - customer.EntryTime);
                }

{'fraction_non_alphanumeric': 0.08923143725575336, 'fraction_numerical': 0.006947459834997829, 'mean_word_length': 1.3139126067302862, 'pattern_counts': {'":': 0, '<': 29, '<?xml version=': 0, '>': 23, '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': '5159622', 'n_tokens_mistral': 1195, 'n_tokens_neox': 1079, 'n_words': 302}