Skip to content

Commit

Permalink
Merge pull request #20 from virtual-labs/dev
Browse files Browse the repository at this point in the history
exp2
  • Loading branch information
prakriti5dhang authored Apr 25, 2024
2 parents ab71608 + b1b2c9a commit 2405731
Show file tree
Hide file tree
Showing 3 changed files with 153 additions and 138 deletions.
2 changes: 1 addition & 1 deletion experiment/simulation/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@

</script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js"></script>
<script src="./js/main.js"></script>
<script src="./js/simulation.js"></script>
</body>
</html>
138 changes: 1 addition & 137 deletions experiment/simulation/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,49 +7,7 @@ Author: Prakriti Dhang */



/* function updateSlider() {
//var sliderDiv = document.getElementById("sliderAmount");
//sliderDiv.innerHTML = slideAmount;
var sliderval = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = sliderval;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
var effortpsb= ((parseFloat(sliderval))**(parseFloat(typb))).toFixed(2); // projectsize^b
var efforts = (parseFloat(typa) * parseFloat(effortpsb)).toFixed(2); // typa * effortb
var effortsc=((parseFloat(efforts))**(parseFloat(typc))).toFixed(2); // effort^c
var tdevs= (2.5 * (parseFloat(effortsc))).toFixed(2); // 2.5 *effort^c
var ndevolperss = Math.round((parseFloat(efforts))/(parseFloat(tdevs))); //calculate no of developers
document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers
}*/

var sliderval = document.getElementById("slide");
var output= document.getElementById("sliderAmount")
output.innerHTML = sliderval.value;
sliderval.oninput = function() {
output.innerHTML = this.value;
var sliderval = document.getElementById("slide").value;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
var effortpsb= ((parseFloat(sliderval))**(parseFloat(typb))).toFixed(2); // projectsize^b
var efforts = (parseFloat(typa) * parseFloat(effortpsb)).toFixed(2); // typa * effortb

var effortsc=((parseFloat(efforts))**(parseFloat(typc))).toFixed(2); // effort^c
var tdevs= (2.5 * (parseFloat(effortsc))).toFixed(2); // 2.5 *effort^c

var ndevolperss = Math.round((parseFloat(efforts))/(parseFloat(tdevs))); //calculate no of developers

document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers
}




/* Exercise number choice */
Expand Down Expand Up @@ -153,100 +111,6 @@ function viewsolutionb(){
var typa, typb, typc, prjtsize,effort, tdev,eaf, effcorrec, tdvcorr, ndevolpers;
var effortb,effortc, efforta, effcorc;

/* Calulation on change in project type in simulation page*/
var ptype =document.getElementById("selecttype");

function choicetype(){
if(ptype.options[ptype.selectedIndex].value==0){
document.getElementById("ta").innerHTML="2.4";
document.getElementById("tb").innerHTML="1.05";
document.getElementById("tc").innerHTML="0.38";


var x = document.getElementById("slide");
x.setAttribute("min", 2);
x.setAttribute("max", 50);
x.setAttribute("step", 2);
var svalue = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = svalue;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
var effortpsb= ((parseFloat(svalue))**(parseFloat(typb))).toFixed(2); // projectsize^b
var efforts = (parseFloat(typa) * parseFloat(effortpsb)).toFixed(2); // typa * effortb

var effortsc=((parseFloat(efforts))**(parseFloat(typc))).toFixed(2); // effort^c
var tdevs= (2.5 * (parseFloat(effortsc))).toFixed(2); // 2.5 *effort^c

var ndevolperss = Math.round((parseFloat(efforts))/(parseFloat(tdevs))); //calculate no of developers

document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers



}

if(ptype.options[ptype.selectedIndex].value==1){
document.getElementById("ta").innerHTML="3";
document.getElementById("tb").innerHTML="1.12";
document.getElementById("tc").innerHTML="0.35";


var x = document.getElementById("slide");
x.setAttribute("min", 50);
x.setAttribute("max", 300);
x.setAttribute("step", 25);
var svalue = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = svalue;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
var effortpsb= ((parseFloat(svalue))**(parseFloat(typb))).toFixed(2); // projectsize^b
var efforts = (parseFloat(typa) * parseFloat(effortpsb)).toFixed(2); // typa * effortb

var effortsc=((parseFloat(efforts))**(parseFloat(typc))).toFixed(2); // effort^c
var tdevs= (2.5 * (parseFloat(effortsc))).toFixed(2); // 2.5 *effort^c

var ndevolperss = Math.round((parseFloat(efforts))/(parseFloat(tdevs))); //calculate no of developers

document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers



}
if(ptype.options[ptype.selectedIndex].value==2){
document.getElementById("ta").innerHTML="3.6";
document.getElementById("tb").innerHTML="1.2";
document.getElementById("tc").innerHTML="0.32";

var x = document.getElementById("slide");
x.setAttribute("min", 300);
x.setAttribute("max", 500);
x.setAttribute("step", 25);
var svalue = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = svalue;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
var effortpsb= ((parseFloat(svalue))**(parseFloat(typb))).toFixed(2); // projectsize^b
var efforts = (parseFloat(typa) * parseFloat(effortpsb)).toFixed(2); // typa * effortb

var effortsc=((parseFloat(efforts))**(parseFloat(typc))).toFixed(2); // effort^c
var tdevs= (2.5 * (parseFloat(effortsc))).toFixed(2); // 2.5 *effort^c

var ndevolperss = Math.round((parseFloat(efforts))/(parseFloat(tdevs))); //calculate no of developers

document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers


}
}

/* Exercise 1 */

Expand Down
151 changes: 151 additions & 0 deletions experiment/simulation/js/simulation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
/*Redeveloped
Lab: Software Engineering
Exp:Estimation of Project Metrics
File Name: simulation.js
Author: Prakriti Dhang */




/* function updateSlider() {
//var sliderDiv = document.getElementById("sliderAmount");
//sliderDiv.innerHTML = slideAmount;
var sliderval = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = sliderval;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
var effortpsb= ((parseFloat(sliderval))**(parseFloat(typb))).toFixed(2); // projectsize^b
var efforts = (parseFloat(typa) * parseFloat(effortpsb)).toFixed(2); // typa * effortb
var effortsc=((parseFloat(efforts))**(parseFloat(typc))).toFixed(2); // effort^c
var tdevs= (2.5 * (parseFloat(effortsc))).toFixed(2); // 2.5 *effort^c
var ndevolperss = Math.round((parseFloat(efforts))/(parseFloat(tdevs))); //calculate no of developers
document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers
}*/

var sliderval = document.getElementById("slide");
var output= document.getElementById("sliderAmount")
output.innerHTML = sliderval.value;
sliderval.oninput = function() {
output.innerHTML = this.value;
var sliderval = document.getElementById("slide").value;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
var effortpsb= ((parseFloat(sliderval))**(parseFloat(typb))).toFixed(2); // projectsize^b
var efforts = (parseFloat(typa) * parseFloat(effortpsb)).toFixed(2); // typa * effortb

var effortsc=((parseFloat(efforts))**(parseFloat(typc))).toFixed(2); // effort^c
var tdevs= (2.5 * (parseFloat(effortsc))).toFixed(2); // 2.5 *effort^c

var ndevolperss = Math.round((parseFloat(efforts))/(parseFloat(tdevs))); //calculate no of developers

document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers
}

/* simulation project type choice*/

var typa, typb, typc, prjtsize,effort, tdev,eaf, effcorrec, tdvcorr, ndevolpers;
var effortb,effortc, efforta, effcorc;

/* Calulation on change in project type in simulation page*/
var ptype =document.getElementById("selecttype");

function choicetype(){
if(ptype.options[ptype.selectedIndex].value==0){
document.getElementById("ta").innerHTML="2.4";
document.getElementById("tb").innerHTML="1.05";
document.getElementById("tc").innerHTML="0.38";


var x = document.getElementById("slide");
x.setAttribute("min", 2);
x.setAttribute("max", 50);
x.setAttribute("step", 2);
var svalue = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = svalue;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
var effortpsb= ((parseFloat(svalue))**(parseFloat(typb))).toFixed(2); // projectsize^b
var efforts = (parseFloat(typa) * parseFloat(effortpsb)).toFixed(2); // typa * effortb

var effortsc=((parseFloat(efforts))**(parseFloat(typc))).toFixed(2); // effort^c
var tdevs= (2.5 * (parseFloat(effortsc))).toFixed(2); // 2.5 *effort^c

var ndevolperss = Math.round((parseFloat(efforts))/(parseFloat(tdevs))); //calculate no of developers

document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers



}

if(ptype.options[ptype.selectedIndex].value==1){
document.getElementById("ta").innerHTML="3";
document.getElementById("tb").innerHTML="1.12";
document.getElementById("tc").innerHTML="0.35";


var x = document.getElementById("slide");
x.setAttribute("min", 50);
x.setAttribute("max", 300);
x.setAttribute("step", 25);
var svalue = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = svalue;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
var effortpsb= ((parseFloat(svalue))**(parseFloat(typb))).toFixed(2); // projectsize^b
var efforts = (parseFloat(typa) * parseFloat(effortpsb)).toFixed(2); // typa * effortb

var effortsc=((parseFloat(efforts))**(parseFloat(typc))).toFixed(2); // effort^c
var tdevs= (2.5 * (parseFloat(effortsc))).toFixed(2); // 2.5 *effort^c

var ndevolperss = Math.round((parseFloat(efforts))/(parseFloat(tdevs))); //calculate no of developers

document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers



}
if(ptype.options[ptype.selectedIndex].value==2){
document.getElementById("ta").innerHTML="3.6";
document.getElementById("tb").innerHTML="1.2";
document.getElementById("tc").innerHTML="0.32";

var x = document.getElementById("slide");
x.setAttribute("min", 300);
x.setAttribute("max", 500);
x.setAttribute("step", 25);
var svalue = document.getElementById("slide").value;
document.getElementById("sliderAmount").innerHTML = svalue;
typa = document.getElementById("ta").innerText; //a value type
typb = document.getElementById("tb").innerText; //b value type
typc = document.getElementById("tc").innerText; //c value type
var effortpsb= ((parseFloat(svalue))**(parseFloat(typb))).toFixed(2); // projectsize^b
var efforts = (parseFloat(typa) * parseFloat(effortpsb)).toFixed(2); // typa * effortb

var effortsc=((parseFloat(efforts))**(parseFloat(typc))).toFixed(2); // effort^c
var tdevs= (2.5 * (parseFloat(effortsc))).toFixed(2); // 2.5 *effort^c

var ndevolperss = Math.round((parseFloat(efforts))/(parseFloat(tdevs))); //calculate no of developers

document.getElementById("opteff").value=efforts; //display effort
document.getElementById("opttdev").value=tdevs; //display tdev
document.getElementById("optdev").value=ndevolperss; //no of developers


}
}

0 comments on commit 2405731

Please sign in to comment.