From 73e9338d1b861c0fdff3bdcdca8e5c4f0716094a Mon Sep 17 00:00:00 2001 From: arleontr Date: Fri, 2 Feb 2024 21:04:24 +0300 Subject: [PATCH] 2 issues resolved. --- .../DistributedAlgorithms/Broadcasting/Broadcasting.py | 9 ++++++--- adhoccomputing/Generics.py | 1 + documentation/conf.py | 2 +- pyproject.toml | 4 ++-- setup.py | 9 ++------- 5 files changed, 12 insertions(+), 13 deletions(-) diff --git a/adhoccomputing/DistributedAlgorithms/Broadcasting/Broadcasting.py b/adhoccomputing/DistributedAlgorithms/Broadcasting/Broadcasting.py index bf4c50b..f1f65bf 100644 --- a/adhoccomputing/DistributedAlgorithms/Broadcasting/Broadcasting.py +++ b/adhoccomputing/DistributedAlgorithms/Broadcasting/Broadcasting.py @@ -29,8 +29,9 @@ def senddownbroadcast(self, eventobj: Event, whosends, sequencenumber): destination = MessageDestinationIdentifiers.NETWORKLAYERBROADCAST nexthop = MessageDestinationIdentifiers.LINKLAYERBROADCAST logger.info(f"{self.componentinstancenumber} will SEND a message to {destination} over {nexthop}") + interfaceid = float('inf') hdr = BroadcastingMessageHeader(BroadcastingMessageTypes.SIMPLEFLOOD, whosends, destination, - nexthop, sequencenumber=sequencenumber) + nexthop, interfaceid=interfaceid,sequencenumber=sequencenumber) payload = applmsg broadcastmessage = GenericMessage(hdr, payload) self.send_down(Event(self, EventTypes.MFRT, broadcastmessage)) @@ -60,8 +61,10 @@ def on_message_from_bottom(self, eventobj: Event): self.send_up(evt) # Also continue flooding once #time.sleep(random.randint(1, 3)) - self.senddownbroadcast(eventobj, eventobj.eventcontent.header.messagefrom, - eventobj.eventcontent.header.sequencenumber) + event = Event(self, BroadcastingEventTypes.BROADCAST, payload) + self.senddownbroadcast(event, eventobj.eventcontent.header.messagefrom, eventobj.eventcontent.header.sequencenumber) + #self.senddownbroadcast(eventobj, eventobj.eventcontent.header.messagefrom, + # eventobj.eventcontent.header.sequencenumber) def __init__(self, componentname, componentinstancenumber, context=None, configurationparameters=None, num_worker_threads=1, topology=None): super().__init__(componentname, componentinstancenumber, context, configurationparameters, num_worker_threads, topology) diff --git a/adhoccomputing/Generics.py b/adhoccomputing/Generics.py index 2c4ab33..399f482 100644 --- a/adhoccomputing/Generics.py +++ b/adhoccomputing/Generics.py @@ -247,6 +247,7 @@ def emit(self, record: LogRecord) -> None: logger = getLogger("AHC") ch = StreamHandler() chweb = AHCLoggingHttpHandler(host="localhost:8000", url='/logs', method='POST', secure=False) + def setAHCLogLevel(level): logger.setLevel(level) ch.setLevel(level) diff --git a/documentation/conf.py b/documentation/conf.py index de0bd33..6062572 100644 --- a/documentation/conf.py +++ b/documentation/conf.py @@ -9,7 +9,7 @@ project = 'Ad Hoc Computing Framework' copyright = '2024, Ertan Onur' author = 'Ertan Onur' -release = 'v2.1.5' +release = 'v2.1.6' # -- General configuration --------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration diff --git a/pyproject.toml b/pyproject.toml index b5a3c46..a2edbd4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [build-system] requires = [ - "setuptools>=42", + "setuptools>=61.0", "wheel" ] -build-backend = "setuptools.build_meta" \ No newline at end of file +build-backend = "setuptools.build_meta" diff --git a/setup.py b/setup.py index 897e7c7..a3d3a2a 100644 --- a/setup.py +++ b/setup.py @@ -7,20 +7,15 @@ setup( # TODO: Fix the configs in this part name='adhoccomputing', - version='2.1.5', + version='2.1.6', description="Ad Hoc Computing Library", long_description=long_description, long_description_content_type="text/markdown", url='https://github.com/cengwins/ahc', author='CengWins', author_email='ahc@ceng.metu.edu.tr', - license='BSD 2-clause', + license='GPL V3', packages=find_packages(), - install_requires=[ - 'matplotlib', - 'networkx', - 'setuptools', - ], project_urls={ "Bug Tracker": "https://github.com/cengwins/ahc/issues", "Simulator Website": "https://ahc.ceng.metu.edu.tr"