From a6a135c3120e6dd45861fb9aad16b5ec968c926e Mon Sep 17 00:00:00 2001 From: shinedday <shinedday@gmail.com> Date: Mon, 9 May 2022 08:39:04 +0200 Subject: [PATCH] fix philosophers example to 3 agentss --- README.md | 6 ++++++ ihm.py | 2 +- philosophers/amas.py | 2 +- philosophers/env.py | 2 +- tool/mqtt_client.py | 2 +- tool/ssh_client.py | 2 +- 6 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index a5a4a61..eb44f40 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,12 @@ WSL (pour pouvoir démarer l'amas) # Random note +Programme de la semaine : + * Surcouche mqtt pour le framework + * décision dela forme du framewor (module python ?) + * Implementation d'un 2nd example + + Start procédure : 1. start broker 2. start scheduler diff --git a/ihm.py b/ihm.py index 83f601a..cc88f5b 100644 --- a/ihm.py +++ b/ihm.py @@ -63,7 +63,7 @@ class Ihm(MqttClient, SSHClient): # automatise la mise a jour de l'exerience sur les raspberry if cmd.lower() == "update": - r = RemoteClient("192.168.105.18", "pi", "raspberry") + r = RemoteClient("192.168.24.18", "pi", "raspberry") updater = VersionManager(r) updater.update() diff --git a/philosophers/amas.py b/philosophers/amas.py index 2e2049a..5422fc3 100644 --- a/philosophers/amas.py +++ b/philosophers/amas.py @@ -33,5 +33,5 @@ class PhiAmas(Amas): # self.run_cmd(1, agents[2:]) if __name__ == '__main__': - s = PhiAmas(100) + s = PhiAmas(3) s.run() \ No newline at end of file diff --git a/philosophers/env.py b/philosophers/env.py index 9f043ce..179ba88 100644 --- a/philosophers/env.py +++ b/philosophers/env.py @@ -65,5 +65,5 @@ class PhiEnv(Environment): if __name__ == '__main__': - s = PhiEnv(100) + s = PhiEnv(3) s.run() \ No newline at end of file diff --git a/tool/mqtt_client.py b/tool/mqtt_client.py index 3c56578..ed865d4 100644 --- a/tool/mqtt_client.py +++ b/tool/mqtt_client.py @@ -6,7 +6,7 @@ class MqttClient: def __init__(self, client_id: str = None): self.client = Client(client_id=client_id) self.client.username_pw_set(username="goyon", password="mosquitto") - self.client.connect("192.168.105.209", 1883, 60) + self.client.connect("192.168.24.209", 1883, 60) self.client.loop_start() def subscribe(self, topic, fun): diff --git a/tool/ssh_client.py b/tool/ssh_client.py index 47faa58..4fcc760 100644 --- a/tool/ssh_client.py +++ b/tool/ssh_client.py @@ -21,7 +21,7 @@ class SSHClient: def __init__(self): self.clients = [ - RemoteClient("192.168.105.18", "pi", "raspberry")# , + RemoteClient("192.168.24.18", "pi", "raspberry")# , # RemoteClient("192.168.199.75", "pi", "raspberry") ] -- GitLab