Skip to content
Snippets Groups Projects
Commit a6a135c3 authored by shinedday's avatar shinedday
Browse files

fix philosophers example to 3 agentss

parent 8fadd690
Branches
Tags
No related merge requests found
...@@ -40,6 +40,12 @@ WSL (pour pouvoir démarer l'amas) ...@@ -40,6 +40,12 @@ WSL (pour pouvoir démarer l'amas)
# Random note # 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 : Start procédure :
1. start broker 1. start broker
2. start scheduler 2. start scheduler
......
...@@ -63,7 +63,7 @@ class Ihm(MqttClient, SSHClient): ...@@ -63,7 +63,7 @@ class Ihm(MqttClient, SSHClient):
# automatise la mise a jour de l'exerience sur les raspberry # automatise la mise a jour de l'exerience sur les raspberry
if cmd.lower() == "update": if cmd.lower() == "update":
r = RemoteClient("192.168.105.18", "pi", "raspberry") r = RemoteClient("192.168.24.18", "pi", "raspberry")
updater = VersionManager(r) updater = VersionManager(r)
updater.update() updater.update()
......
...@@ -33,5 +33,5 @@ class PhiAmas(Amas): ...@@ -33,5 +33,5 @@ class PhiAmas(Amas):
# self.run_cmd(1, agents[2:]) # self.run_cmd(1, agents[2:])
if __name__ == '__main__': if __name__ == '__main__':
s = PhiAmas(100) s = PhiAmas(3)
s.run() s.run()
\ No newline at end of file
...@@ -65,5 +65,5 @@ class PhiEnv(Environment): ...@@ -65,5 +65,5 @@ class PhiEnv(Environment):
if __name__ == '__main__': if __name__ == '__main__':
s = PhiEnv(100) s = PhiEnv(3)
s.run() s.run()
\ No newline at end of file
...@@ -6,7 +6,7 @@ class MqttClient: ...@@ -6,7 +6,7 @@ class MqttClient:
def __init__(self, client_id: str = None): def __init__(self, client_id: str = None):
self.client = Client(client_id=client_id) self.client = Client(client_id=client_id)
self.client.username_pw_set(username="goyon", password="mosquitto") 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() self.client.loop_start()
def subscribe(self, topic, fun): def subscribe(self, topic, fun):
......
...@@ -21,7 +21,7 @@ class SSHClient: ...@@ -21,7 +21,7 @@ class SSHClient:
def __init__(self): def __init__(self):
self.clients = [ self.clients = [
RemoteClient("192.168.105.18", "pi", "raspberry")# , RemoteClient("192.168.24.18", "pi", "raspberry")# ,
# RemoteClient("192.168.199.75", "pi", "raspberry") # RemoteClient("192.168.199.75", "pi", "raspberry")
] ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment