From ce6a25f5789e9515e9326a4109a19a008bedfd10 Mon Sep 17 00:00:00 2001 From: trochas Date: Tue, 3 Dec 2024 16:31:37 +0100 Subject: [PATCH] correction client --- Au_Woke.java | 2 +- src/Client.java | 8 ++++---- src/Restaurant.java | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Au_Woke.java b/Au_Woke.java index 9da0029..10e5059 100644 --- a/Au_Woke.java +++ b/Au_Woke.java @@ -1,5 +1,5 @@ public class Au_Woke { - private Client[] clients= new Client[30]; + private Client[] clients= new Client[100]; private Restaurant restaurant =new Restaurant(); Au_Woke(){ restaurant.cuisinier.start(); diff --git a/src/Client.java b/src/Client.java index efdb521..2170e64 100644 --- a/src/Client.java +++ b/src/Client.java @@ -33,7 +33,7 @@ public class Client extends Thread { } catch (InterruptedException e){ e.printStackTrace(); } - System.out.println("Clien " + Thread.currentThread().getId() + " : a pris une portion de " + compartiment.getName()); + System.out.println("Client " + Thread.currentThread().getId() + " : a pris une portion de " + compartiment.getName()); compartiment.servir(r); try{ @@ -63,7 +63,7 @@ public class Client extends Thread { public void manger(){ try{ - System.out.println("Clien " + Thread.currentThread().getId() + " : mange"); + System.out.println("Client " + Thread.currentThread().getId() + " : mange"); long temps_manger =new Random().nextInt(2000 - 1000) + 1000; Thread.sleep(temps_manger); }catch(InterruptedException e){ @@ -73,7 +73,7 @@ public class Client extends Thread { public void sort(){ synchronized(restaurant){ - System.out.println("Clien " + Thread.currentThread().getId() + " : sortir"); + System.out.println("Client " + Thread.currentThread().getId() + " : sortir"); restaurant.diminuerClient(); restaurant.notifyAll(); } @@ -86,7 +86,7 @@ public class Client extends Thread { while (stand.attendClient()!= this) { //Verify s'il est meme client wait(); } - System.out.println("Clien " + Thread.currentThread().getId() + " : fait cuir son plat"); + System.out.println("Client " + Thread.currentThread().getId() + " : fait cuir son plat"); stand.finir_cuit(this); }catch (InterruptedException e){ e.printStackTrace(); diff --git a/src/Restaurant.java b/src/Restaurant.java index deb9a1e..04a44a7 100644 --- a/src/Restaurant.java +++ b/src/Restaurant.java @@ -1,5 +1,5 @@ public class Restaurant { - protected final int MAX_CLIENTS = 4; + protected final int MAX_CLIENTS = 20; public int nbClient;