Skip to content
Snippets Groups Projects
Commit 75ba410a authored by Sebastien GOYON's avatar Sebastien GOYON
Browse files

Delete agent.py

parent e73527b8
Branches
No related tags found
No related merge requests found
import random
import sys
from iotAmak.agent import Agent
class Ant(Agent):
def __init__(self, identifier: int, broker_ip: str):
self.x = 250
self.y = 250
super().__init__(identifier, broker_ip)
def on_initialization(self) -> None:
pass
def on_cycle_begin(self) -> None:
pass
def on_perceive(self) -> None:
pass
def on_decide(self) -> None:
pass
def on_act(self) -> None:
self.x += random.randint(-5, +5)
self.y += random.randint(-5, +5)
def on_cycle_end(self) -> None:
pass
def send_metric(self):
metric = super(Ant, self).send_metric()
metric["x"] = self.x
metric["y"] = self.y
return metric
if __name__ == '__main__':
a = Ant(int(sys.argv[1]), str(sys.argv[2]))
a.run()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment