-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTestuj.java
43 lines (32 loc) · 1.32 KB
/
Testuj.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package planista;
import java.text.DecimalFormat;
import java.util.ArrayList;
/**
*
* @author konrad
*/
public class Testuj {
private static final DecimalFormat df = new DecimalFormat("0.00");
void przeprowadzTest(ArrayList<Proces> procesy, Strategia s) {
s.przedstawSię();
s.przeprowadzStrategie(procesy);
procesy.sort(new TestujComparator());
for(int i = 0; i < procesy.size(); ++i) {
System.out.print("[" + procesy.get(i).getId() + " " + procesy.get(i).getCzasPojawienia() + " " + df.format(procesy.get(i).getCzasZakończenia()) + "]");
}
System.out.println("");
Efektywność e1 = new ŚredniCzasObrotuZadania();
Efektywność e2 = new ŚredniCzasOczekiwania();
System.out.println(e1.getNazwa() + ": " + df.format(e1.zbadajEfektywność(procesy)));
if (s.getNazwa().equals("PS"))
System.out.println(e2.getNazwa() + ": 0.00");
else
System.out.println(e2.getNazwa() + ": " + df.format(e2.zbadajEfektywność(procesy)));
System.out.println("");
}
}