<commit_before>--[[
	The MG1 policy

	Like Cohort scheduling's wavefront pattern, the MG1 policy was based on a very simple idea, namely
	that stages should receive time on the CPU in proportion to their load.

	The polling tables for the MG1 policy are constructed in such a way that the most heavily-loaded 	 stages are visited more frequently than mostly-idle stages.

	Reference: http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-781.pdf

	**************************************** PUC-RIO 2014 ****************************************

	Implemented by: 
		- <NAME>
		- <NAME>
		- <NAME>   
		- <NAME>
		
	Implemented on March 2014
	   
	**********************************************************************************************
]]--
local a = {}
local mg1    = {}
local lstage = require 'lstage'
local sort   = require 'lstage.utils.mergesort'
local stages = {}

--[[
	<summary>
		MG1 configure method
	</summary>
	<param name="stagesTable">LEDA stages table</param>
	<param name="numberOfThreads">Number of threads to be created</param>
	<param name="refreshSeconds">Time (in seconds) to refresh stage's rate</param>
]]--
function mg1.configure(stagesTable, numberOfThreads, refreshSeconds)
	-- Creating threads
	for index=1,numberOfThreads do
		lstage.pool:add()
	end

	-- Graph with one stage<commit_msg>Testando<commit_after>--[[
	The MG1 policy

	Like Cohort scheduling's wavefront pattern, the MG1 policy was based on a very simple idea, namely
	that stages should receive time on the CPU in proportion to their load.

	The polling tables for the MG1 policy are constructed in such a way that the most heavily-loaded 	 stages are visited more frequently than mostly-idle stages.

	Reference: http://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-781.pdf

	**************************************** PUC-RIO 2014 ****************************************

	Implemented by: 
		- <NAME>
		- <NAME>
		- <NAME>   
		- <NAME>
		
	Implemented on March 2014
	   
	**********************************************************************************************
]]--
local a = {}zz
local mg1    = {}
local lstage = require 'lstage'
local sort   = require 'lstage.utils.mergesort'
local stages = {}

--[[
	<summary>
		MG1 configure method
	</summary>
	<param name="stagesTable">LEDA stages table</param>
	<param name="numberOfThreads">Number of threads to be created</param>
	<param name="refreshSeconds">Time (in seconds) to refresh stage's rate</param>
]]--
function mg1.configure(stagesTable, numberOfThreads, refreshSeconds)
	-- Creating threads
	for index=1,numberOfThreads do
		lstage.pool:add()
	end

	-- Graph with one stage
{'fraction_non_alphanumeric': 0.22281571919114843, 'fraction_numerical': 0.013735215566577643, 'mean_word_length': 4.428571428571429, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '2441663', 'n_tokens_mistral': 809, 'n_tokens_neox': 726, 'n_words': 250}