diff --git a/src/Client.java b/src/Client.java index cfc6eeb..f2afcb8 100644 --- a/src/Client.java +++ b/src/Client.java @@ -31,7 +31,7 @@ public class Client extends Thread { } catch (InterruptedException e){ e.printStackTrace(); } - System.out.println("Clien " + Thread.currentThread().getId() + " : a pris une portion"); + System.out.println("Clien " + Thread.currentThread().getId() + " : a pris une portion de " + compartiment.getName()); compartiment.servir(r); try{ diff --git a/src/Compartiment.java b/src/Compartiment.java index 9ae59a7..3b1e480 100644 --- a/src/Compartiment.java +++ b/src/Compartiment.java @@ -3,8 +3,9 @@ public class Compartiment{ private int quantite_courant; private String name; - Compartiment(){ + Compartiment(String name){ quantite_courant = 500; + this.name = name; } synchronized void remplir(){ @@ -18,4 +19,8 @@ public class Compartiment{ public int getQuantite(){ return quantite_courant; } + + public String getName(){ + return this.name; + } } diff --git a/src/Restaurant.java b/src/Restaurant.java index 9091122..76a1c27 100644 --- a/src/Restaurant.java +++ b/src/Restaurant.java @@ -30,9 +30,11 @@ public class Restaurant { */ public Restaurant(){ this.nbClient=0; - for(int i = 0 ; i