<commit_before>// This library requires mathtools.js to work

function ParameterClass(ParameterID, ArrayName, ArrayNumber, InterfaceHolder, NumberOfSamples){// InterfacePrefix
	this.ParameterID=ParameterID;// e.g. HCV.LFHCCProbability
	this.ArrayName=ArrayName;
	this.ArrayNumber=ArrayNumber;
	this.InterfaceID=[];
	
	this.SetInterfaceID(InterfaceHolder);// e.g. HCV.LFHCCProbability
	

	
	this.DistributionType="normal";
	
	//0: normal
	//1: lognormal
	//2: uniform
	//3: optimisedsample //used in a case where the parameters is unknown and an algorithm decides the sample chosen based on the outcome of an optimisation routine
	
	// The following are used for inside the simulations
	//4: exponential
	//5: logitnormal   // used for probability distributions (on [0,1]). Note sigma<1 to avoid strange edge effects
	//6: poisson
	//7: sqrnormal
	
	
	this.Median=NaN;
	this.StandardError=NaN;
	
	this.Upper95Range=NaN;// These values are calculated on the fly by the program, and are displayed in the interface
	this.Lower95Range=NaN;
	this.CalculatedMedian=NaN;
	
	this.NumberOfSamples=NumberOfSamples;
	this.Val=[];//This is the array of the samples
	
	this.MinValue="";// These values are used to put a bound on the values, e.g. many values must not be less than zero.
	this.MaxValue="";
	
	//The Description is used to describe what the variables are and where they are from including URLs and any other calculation
	this.Description=[];//
}

ParameterClass.prototype.SetInterfaceID= function (InterfaceHolder){
	this.InterfaceID=InterfaceHolder+"_"+this.ArrayNumber;
};



//Load the parameter from text
	//or maybe simply bind a JSON object
ParameterClass.prototype.Load= function (InputStructure){
	for (var Key in this){
		if (typeof(InputStructure[Key])!='undefined'){
			this[Key]=InputStructure[Key];
		}
	}
	// Check if there are problems
	if (this.ParameterID===""){
		console.error("Error trace here.");
		throw "ParameterID is not set";
	} 
};


	
ParameterClass.prototype.Name= function (){
	return (this.ArrayName+'['+this.ArrayNumber+']');
};
	
ParameterClass.prototype.UpdateTypeDisplay= function (){
	var ParameterHTML="";
	// Draw the expand and save buttons
	ParameterHTML+="<a onClick=\"ToggleDisplay(this, 'ParamInfoBox');\" style='background-color: #acf;'>[+]</a>\n"+"&nbsp;"+
		"<a  onClick='"+this.Name()+".Save();' style='background-color: #acf;'>Save</a>  \n";
	
	
	
	
	// Set up the name and parameter type
	ParameterHTML+="<input type='text' name='ParameterID' value='" + this.ParameterID + "' style='width:250px;'>\n"+ 
		"<select name='DistributionType'  onchange='"+this.Name()+".DistributionType=this.value;"+this.Name()+".UpdateTypeDisplay();'>\n"+//change the type, then redisplay
		
		"	<option value='normal'>Normal</option>\n"+
		"	<option value='lognormal'>Log Normal</option>\n"+
		"	<option value='uniform'>Uniform</option>\n"+
		"	<option value='optimisedsample'>Optimised Sample</option>\n"+
		
		"</select>\n ";
	
	
	if (this.DistributionType=="normal"){
		ParameterHTML+="Median <input type='text' name='Median' value='" + this.Median + " '>\n"+
		" Standard error <input type='text' name='StandardError' value='" + this.StandardError + " '>\n";
	}
	else if (this.DistributionType=="lognormal"){
		ParameterHTML+="Median <input type='text' name='Median' value='" + this.Median + " '>\n"+
		" Standard error of log <input type='text' name='StandardError' value='" + this.StandardError + " '>\n";
	}
	else if (this.DistributionType=="uniform"){
		ParameterHTML+="Lower Bound <input type='text' name='MinValue' value='" + this.MinValue + " '>\n"+
		" Upper Bound <input type='text' name='MaxValue' value='" + this.MaxValue + " '>\n";
	}
	else if (this.DistributionType=="optimisedsample"){
		ParameterHTML+="Lower Bound <input type='text' name='MinValue' value='" + this.MinValue + " '>\n"+
		" Upper Bound <input type='text' name='MaxValue' value='" + this.MaxValue + " '>\n";
	}
	
	
	// Determine estimated value of the mean, IQR and 95% range of the parameters
	this.CalculateUncertaintyBounds();
	// Display this information to the user
	
	// Save button
		// When pressed, 
		// Get the values from all the fields
		// save the value to Param
		// Save Param
	
	// This information exists for all parameters
	ParameterHTML+="<div class='ParamInfoBox' style='display: none;'>\n";
	if (this.DistributionType=="normal" || this.DistributionType=="lognormal"){
		ParameterHTML+="<p>\n"+
		"    Hard distribution bounds: Min <input type='text' name='MinValue' value='" + this.MinValue + " '>\n"+
		"    Max <input type='text' name='MaxValue' value='" + this.MaxValue + " '>\n"+
		"</p>\n";
	}
		<commit_msg>Small formatting<commit_after>// This library requires mathtools.js to work

function ParameterClass(ParameterID, ArrayName, ArrayNumber, InterfaceHolder, NumberOfSamples){// InterfacePrefix
	this.ParameterID=ParameterID;// e.g. HCV.LFHCCProbability
	this.ArrayName=ArrayName;
	this.ArrayNumber=ArrayNumber;
	this.InterfaceID=[];
	
	this.SetInterfaceID(InterfaceHolder);// e.g. HCV.LFHCCProbability
	

	
	this.DistributionType="normal";
	
	//0: normal
	//1: lognormal
	//2: uniform
	//3: optimisedsample //used in a case where the parameters is unknown and an algorithm decides the sample chosen based on the outcome of an optimisation routine
	
	// The following are used for inside the simulations
	//4: exponential
	//5: logitnormal   // used for probability distributions (on [0,1]). Note sigma<1 to avoid strange edge effects
	//6: poisson
	//7: sqrnormal
	
	
	this.Median=NaN;
	this.StandardError=NaN;
	
	this.Upper95Range=NaN;// These values are calculated on the fly by the program, and are displayed in the interface
	this.Lower95Range=NaN;
	this.CalculatedMedian=NaN;
	
	this.NumberOfSamples=NumberOfSamples;
	this.Val=[];//This is the array of the samples
	
	this.MinValue="";// These values are used to put a bound on the values, e.g. many values must not be less than zero.
	this.MaxValue="";
	
	//The Description is used to describe what the variables are and where they are from including URLs and any other calculation
	this.Description=[];//
}

ParameterClass.prototype.SetInterfaceID= function (InterfaceHolder){
	this.InterfaceID=InterfaceHolder+"_"+this.ArrayNumber;
};



//Load the parameter from text
	//or maybe simply bind a JSON object
ParameterClass.prototype.Load= function (InputStructure){
	for (var Key in this){
		if (typeof(InputStructure[Key])!='undefined'){
			this[Key]=InputStructure[Key];
		}
	}
	// Check if there are problems
	if (this.ParameterID===""){
		console.error("Error trace here.");
		throw "ParameterID is not set";
	} 
};


	
ParameterClass.prototype.Name= function (){
	return (this.ArrayName+'['+this.ArrayNumber+']');
};
	
ParameterClass.prototype.UpdateTypeDisplay= function (){
	var ParameterHTML="";
	// Draw the expand and save buttons
	ParameterHTML+="<a onClick=\"ToggleDisplay(this, 'ParamInfoBox');\" style='background-color: #acf;'>[+]</a>\n"+"&nbsp;"+
		"<a  onClick='"+this.Name()+".Save();' style='background-color: #acf;'>Save</a>  \n";
	
	
	
	
	// Set up the name and parameter type
	ParameterHTML+="<input type='text' name='ParameterID' value='" + this.ParameterID + "' style='width:250px;'>\n"+ 
		"<select name='DistributionType'  onchange='"+this.Name()+".DistributionType=this.value;"+this.Name()+".UpdateTypeDisplay();'>\n"+//change the type, then redisplay
		
		"	<option value='normal'>Normal</option>\n"+
		"	<option value='lognormal'>Log Normal</option>\n"+
		"	<option value='uniform'>Uniform</option>\n"+
		"	<option value='optimisedsample'>Optimised Sample</option>\n"+
		
		"</select>\n ";
	
	
	if (this.DistributionType=="normal"){
		ParameterHTML+="Median <input type='text' name='Median' value='" + this.Median + " '>\n"+
		" Standard error <input type='text' name='StandardError' value='" + this.StandardError + " '>\n";
	}
	else if (this.DistributionType=="lognormal"){
		ParameterHTML+="Median <input type='text' name='Median' value='" + this.Median + " '>\n"+
		" Standard error of log <input type='text' name='StandardError' value='" + this.StandardError + " '>\n";
	}
	else if (this.DistributionType=="uniform"){
		ParameterHTML+="Min <input type='text' name='MinValue' value='" + this.MinValue + " '>\n"+
		" Max <input type='text' name='MaxValue' value='" + this.MaxValue + " '>\n";
	}
	else if (this.DistributionType=="optimisedsample"){
		ParameterHTML+="Min <input type='text' name='MinValue' value='" + this.MinValue + " '>\n"+
		" Max <input type='text' name='MaxValue' value='" + this.MaxValue + " '>\n";
	}
	
	
	// Determine estimated value of the mean, IQR and 95% range of the parameters
	this.CalculateUncertaintyBounds();
	// Display this information to the user
	
	// Save button
		// When pressed, 
		// Get the values from all the fields
		// save the value to Param
		// Save Param
	
	// This information exists for all parameters
	ParameterHTML+="<div class='ParamInfoBox' style='display: none;'>\n";
	if (this.DistributionType=="normal" || this.DistributionType=="lognormal"){
		ParameterHTML+="<p>\n"+
		"    Hard distribution bounds: Min <input type='text' name='MinValue' value='" + this.MinValue + " '>\n"+
		"    Max <input type='text' name='MaxValue' value='" + this.MaxValue + " '>\n"+
		"</p>\n";
	}
		
{'fraction_non_alphanumeric': 0.16136339121993312, 'fraction_numerical': 0.0043145291770035595, 'mean_word_length': 4.599033816425121, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 59, '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': '4288965', 'n_tokens_mistral': 3099, 'n_tokens_neox': 2870, 'n_words': 797}