Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. package exercicio;
  2.  
  3. import java.util.Random;
  4. import java.util.concurrent.ThreadLocalRandom;
  5.  
  6. public class bitMap {
  7.  
  8. public static void main(String[] args) {
  9.  
  10. Random numeroAleatorio = new Random();
  11.  
  12. int inicioBloco;
  13. int fimBloco;
  14. int tamanho;
  15.  
  16. //Gerando números aleatórios de 30 a 50
  17. int[] memoria = new int[ThreadLocalRandom.current().nextInt(30, 50 +1)];
  18.  
  19. //Inicializando a memório com 0
  20. for (int i = 0; i < memoria.length; i++) {
  21. memoria[i] = 0;
  22. }
  23.  
  24. //Simulando os 30 processos
  25. for (int i = 0; i <= 30; i++) {
  26. int bloco = numeroAleatorio.nextInt(8);
  27.  
  28. //Procura de espaços vazios na memória
  29. for (int j = 0; j < memoria.length; j++) {
  30.  
  31. }
  32. }
  33.  
  34. }
  35.  
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement