diff --git a/ant.zip b/ant.zip index d80181d9e9a677256bae64057edba365daca45d9..97ec78859c67f94f9e2bb70a5d80359d1bf945b7 100644 Binary files a/ant.zip and b/ant.zip differ diff --git a/ant/amas.py b/ant/amas.py index 822eb7a76abf8d78cf2c47c77cabbd5cc2156239..f0485b10aa2e289b0254a780d985a4d6f1bc9ba8 100644 --- a/ant/amas.py +++ b/ant/amas.py @@ -1,5 +1,6 @@ import sys from math import sqrt +from random import random, randint from iotAmak.amas.amas import Amas @@ -12,7 +13,7 @@ class AntAmas(Amas): def on_initial_agents_creation(self): for _ in range(self.agent_to_create): - self.add_agent("ant") + self.add_agent() def is_neighbour(self, id_a, id_b): if id_a == id_b: @@ -38,6 +39,18 @@ class AntAmas(Amas): self.agent_neighbour(j, i) + def to_graph(self) -> dict: + return { + "cycle": self.nbr_cycle, + "point": [ + { + "value": randint(0, 10), + "name": elem + } + for elem in ["a", "b", "c"] + ] + } + if __name__ == '__main__': s = AntAmas(str(sys.argv[1]), 15) s.run() diff --git a/ant/config.json b/ant/config.json index bb33cfc06802f0d9338ab482dcc1d0a7792a3b9f..1b03e659272e54c143f2248b3e79a92d080d7852 100644 --- a/ant/config.json +++ b/ant/config.json @@ -1,10 +1,16 @@ { - "iotamak_version": "0.0.7", + "iotamak_version": "0.0.8", "scheduling_type": "sync", "canvas": { "height" : 500, "width" : 500 + }, + + "graph" : { + "height" : 500, + "width" : 500, + "refresh": 10 } } \ No newline at end of file diff --git a/ant_communicating.zip b/ant_communicating.zip index f125378b6c59172994475573018d535ed5586d03..b0646eab6e2fabd5a4733f78b2304c943b78cc12 100644 Binary files a/ant_communicating.zip and b/ant_communicating.zip differ diff --git a/ant_communicating/amas.py b/ant_communicating/amas.py index cc5ce223226e8b4d10e0c2b2c2e40799475e5c4c..3e4b76f847a0b7376a9992978d79c2b570bfd6dc 100644 --- a/ant_communicating/amas.py +++ b/ant_communicating/amas.py @@ -12,7 +12,7 @@ class AntAmas(Amas): def on_initial_agents_creation(self): for _ in range(self.agent_to_create): - self.add_agent("ant_communicating") + self.add_agent() def is_neighbour(self, id_a, id_b): if id_a == id_b: diff --git a/ant_communicating/config.json b/ant_communicating/config.json index bb33cfc06802f0d9338ab482dcc1d0a7792a3b9f..1337e24a70420cc6b55acc0033a7a4444773c488 100644 --- a/ant_communicating/config.json +++ b/ant_communicating/config.json @@ -1,5 +1,5 @@ { - "iotamak_version": "0.0.7", + "iotamak_version": "0.0.8", "scheduling_type": "sync", "canvas": { diff --git a/box.zip b/box.zip index 1341005ebc9deb871cb11248c71264bfbc027384..2bbfc77f487ad16ddba641099de911dfe2cffd46 100644 Binary files a/box.zip and b/box.zip differ diff --git a/box/amas.py b/box/amas.py index d9b787f3022a4d65133a0091ead97fce30568744..863cda805c84e10b8f397d757695d24601900cb8 100644 --- a/box/amas.py +++ b/box/amas.py @@ -10,7 +10,7 @@ class BoxAmas(AsyncAmas): def on_initial_agents_creation(self): for i in range(len(self.clients)): - self.add_agent("box", client_ip=self.clients[i].hostname) + self.add_agent(client_ip=self.clients[i].hostname) if __name__ == '__main__': diff --git a/box/config.json b/box/config.json index c771fea31203ce149b239937b64a7f043b94db44..f956d8e3244533b41a319f550da3beadb1662b5d 100644 --- a/box/config.json +++ b/box/config.json @@ -1,4 +1,4 @@ { - "iotamak_version": "0.0.7", + "iotamak_version": "0.0.8", "scheduling_type": "async" } \ No newline at end of file diff --git a/demonstrator.zip b/demonstrator.zip index 986fcb0cf7f061607b934e5721516a50504782be..7ef26b5ae2a8cd36cec5c01ebfc428b30842e948 100644 Binary files a/demonstrator.zip and b/demonstrator.zip differ diff --git a/demonstrator/amas.py b/demonstrator/amas.py index 775492b703f42d49d96ea448da95890baf8e4b19..3469eb8a4d5f54fef9ba3bf0d41fcc03d45daf50 100644 --- a/demonstrator/amas.py +++ b/demonstrator/amas.py @@ -10,7 +10,7 @@ class IotAmas(Amas): def on_initial_agents_creation(self): for i in range(len(self.clients)): - self.add_agent("demonstrator", client_ip=self.clients[i].hostname, args=[len(self.clients)]) + self.add_agent(client_ip=self.clients[i].hostname, args=[len(self.clients)]) if __name__ == '__main__': diff --git a/demonstrator/config.json b/demonstrator/config.json index 4bb3bf2933863c21252e292b5a9f3bbe4bf28cfb..771bb3be0d6a34494801166b9238902bd67829ac 100644 --- a/demonstrator/config.json +++ b/demonstrator/config.json @@ -1,5 +1,5 @@ { - "iotamak_version": "0.0.7", + "iotamak_version": "0.0.8", "scheduling_type": "sync", "com_graph": { diff --git a/philosophers.zip b/philosophers.zip deleted file mode 100644 index 36a06f59b5c16b862e0b44f85cc23505f35b0377..0000000000000000000000000000000000000000 Binary files a/philosophers.zip and /dev/null differ