diff --git a/dist/iotAmak-0.0.3-py3-none-any.whl b/dist/iotAmak-0.0.3-py3-none-any.whl index 4e796ec802ff8fedbc6e548e34f7f88fc97704f5..aa1e26e8b87d7839981f61ecabea378170805e4e 100644 Binary files a/dist/iotAmak-0.0.3-py3-none-any.whl and b/dist/iotAmak-0.0.3-py3-none-any.whl differ diff --git a/iotAmak/amas.py b/iotAmak/amas.py index 89a83123be56087cb6683b397f6f2229600b0be4..f43df41d38381a684fe1783f793dffd57fb923ae 100644 --- a/iotAmak/amas.py +++ b/iotAmak/amas.py @@ -83,6 +83,12 @@ class Amas(Schedulable, SSHClient): ) print("Amas, push agent done") + def agent_neighbour(self, id_agent1: int, id_agent2: int) -> None: + """ + share the metric of agent 2 to agent 1 + """ + self.publish("amas/agent/" + str(id_agent1) + "/neighbor", self.agents_metric[id_agent2]) + def agent_log(self, client, userdata, message) -> None: """ Called when the amas receive a log from any agent, print it in stdout diff --git a/iotAmak/scheduler.py b/iotAmak/scheduler.py index 13203119af943a6a31cab2fc4d5eeadc5d2f37b4..600b9101a596d7663e8891c6b3635073d9963729 100644 --- a/iotAmak/scheduler.py +++ b/iotAmak/scheduler.py @@ -61,7 +61,7 @@ class Scheduler(Schedulable): Function called whenever the amas/env have finished an action and is waiting """ self.schedulable_semaphore.release() - print("__Schedulable is waiting") + # print("__Schedulable is waiting") def update_nbr_agent(self, client, userdata, message) -> None: """ @@ -70,14 +70,14 @@ class Scheduler(Schedulable): """ self.nbr_agent += 1 self.subscribe("agent/" + str(message.payload.decode("utf-8")) + "/cycle_done", self.agent_done) - print("__Update agent : ", self.nbr_agent, str(message.payload.decode("utf-8"))) + # print("__Update agent : ", self.nbr_agent, str(message.payload.decode("utf-8"))) def agent_done(self, client, userdata, message) -> None: """ Called whenever an agent have done an action and is waiting """ self.agent_semaphore.release() - print("__Agent done") + # print("__Agent done") def wait_agent(self) -> None: """