-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
52 lines (40 loc) · 1.52 KB
/
Copy pathMain.java
File metadata and controls
52 lines (40 loc) · 1.52 KB
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
44
45
46
47
48
49
50
51
52
/*
* 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 com.mycompany.sisdistribuidosrelogio;
import java.util.Calendar;
/**
*
* @author jean.scherer
*/
public class Main {
public static int qtdServidores = 8;
//EQUIPE - 14
//Jean Patrick Scherer
//Gabriel Andrade
public static void main(String[] args) {
prepareAndExecuteBerkeley();
}
public static void prepareAndExecuteBerkeley() {
System.out.println("------------ INICIANDO ------------");
System.out.println("Criando mock servidores");
var controle = new Controle();
for (int i = 0; i < qtdServidores; i++) {
var data = Calendar.getInstance();
data.add(Calendar.MINUTE, (int)Math.round(randomMinutes()));
controle.servidores.add(new Servidor(i, data));
}
System.out.println("Servidores criados e adicionados");
System.out.println("Inicio da execução do algoritmo");
controle.executeBerkeley();
System.out.println("Fim da execução do algoritmo");
System.out.println("------------ FINALIZANDO ------------");
}
public static double randomMinutes(){
double random = Math.random();
double calculated = 100.0 * random;
return calculated;
}
}