From 8068407d2a94cc398c7b0210a6ad0b613e5a2cfc Mon Sep 17 00:00:00 2001 From: Lucas Date: Thu, 11 Jul 2024 11:17:28 +0200 Subject: [PATCH 01/14] Fixed bug with negative offsets --- src/inet/queueing/gate/PeriodicGate.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/inet/queueing/gate/PeriodicGate.cc b/src/inet/queueing/gate/PeriodicGate.cc index 2e6e343cb74..a17175af1e1 100644 --- a/src/inet/queueing/gate/PeriodicGate.cc +++ b/src/inet/queueing/gate/PeriodicGate.cc @@ -96,7 +96,11 @@ void PeriodicGate::initializeGating() { index = 0; isOpen_ = initiallyOpen; - offset.setRaw(totalDuration != 0 ? initialOffset.raw() % totalDuration.raw() : 0); + if (totalDuration.raw() == 0) { + offset.setRaw(0); + } else { + offset.setRaw((initialOffset.raw() % totalDuration.raw() + totalDuration.raw()) % totalDuration.raw()); + } while (offset > CLOCKTIME_ZERO) { clocktime_t duration = durations[index]; if (offset >= duration) { From 25617d47a3d99e6c296e2bc94b1459cb71296ef8 Mon Sep 17 00:00:00 2001 From: Levente Meszaros Date: Mon, 15 Jul 2024 15:01:03 +0200 Subject: [PATCH 02/14] PeriodicGate: Cosmetics. --- src/inet/queueing/gate/PeriodicGate.cc | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/inet/queueing/gate/PeriodicGate.cc b/src/inet/queueing/gate/PeriodicGate.cc index a17175af1e1..352e64239bf 100644 --- a/src/inet/queueing/gate/PeriodicGate.cc +++ b/src/inet/queueing/gate/PeriodicGate.cc @@ -96,11 +96,10 @@ void PeriodicGate::initializeGating() { index = 0; isOpen_ = initiallyOpen; - if (totalDuration.raw() == 0) { + if (totalDuration.raw() == 0) offset.setRaw(0); - } else { + else offset.setRaw((initialOffset.raw() % totalDuration.raw() + totalDuration.raw()) % totalDuration.raw()); - } while (offset > CLOCKTIME_ZERO) { clocktime_t duration = durations[index]; if (offset >= duration) { From 17a3e4a54b9e0ea99000b5ff5d99e03b419dec43 Mon Sep 17 00:00:00 2001 From: Levente Meszaros Date: Tue, 16 Jul 2024 12:06:17 +0200 Subject: [PATCH 03/14] Examples: Fixed SuperpositioningMobility config for infrastructure branch. --- examples/mobility/MobileNetwork.ned | 2 +- examples/mobility/omnetpp.ini | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/mobility/MobileNetwork.ned b/examples/mobility/MobileNetwork.ned index 9efb4f37ca4..93c065c1c99 100644 --- a/examples/mobility/MobileNetwork.ned +++ b/examples/mobility/MobileNetwork.ned @@ -18,7 +18,7 @@ network MobileNetwork bool hasVisualizer = default(false); bool hasScenarioManager = default(false); bool hasEnvironment = default(false); - @display("bgb=600,400"); + @display("bgb=600,600"); submodules: visualizer: IntegratedCanvasVisualizer if hasVisualizer { parameters: diff --git a/examples/mobility/omnetpp.ini b/examples/mobility/omnetpp.ini index acc5342500a..efd6f43eb88 100644 --- a/examples/mobility/omnetpp.ini +++ b/examples/mobility/omnetpp.ini @@ -9,7 +9,7 @@ sim-time-limit = 1000s **.constraintAreaMinY = 0m **.constraintAreaMinZ = 0m **.constraintAreaMaxX = 600m -**.constraintAreaMaxY = 400m +**.constraintAreaMaxY = 600m **.constraintAreaMaxZ = 0m [Config Update] From b12bc7d80955c3c62c7f7ac8928ca81e9c0d7997 Mon Sep 17 00:00:00 2001 From: Levente Meszaros Date: Tue, 16 Jul 2024 12:26:36 +0200 Subject: [PATCH 04/14] EthernetMacBase: Removed ASSERT because the incoming frame can be shorter than minimum length. During a network node or network interface crash or cable disconnect. --- src/inet/linklayer/ethernet/base/EthernetMacBase.cc | 1 - 1 file changed, 1 deletion(-) diff --git a/src/inet/linklayer/ethernet/base/EthernetMacBase.cc b/src/inet/linklayer/ethernet/base/EthernetMacBase.cc index 816643e2780..b29099a9b67 100644 --- a/src/inet/linklayer/ethernet/base/EthernetMacBase.cc +++ b/src/inet/linklayer/ethernet/base/EthernetMacBase.cc @@ -282,7 +282,6 @@ void EthernetMacBase::encapsulate(Packet *frame) void EthernetMacBase::decapsulate(Packet *packet) { auto phyHeader = packet->popAtFront(); - ASSERT(packet->getDataLength() >= MIN_ETHERNET_FRAME_BYTES); packet->addTagIfAbsent()->setProtocol(&Protocol::ethernetMac); } From 7d6606898112efeb01c83b60afa62e2993d225e7 Mon Sep 17 00:00:00 2001 From: Levente Meszaros Date: Tue, 16 Jul 2024 12:27:30 +0200 Subject: [PATCH 05/14] EthernetMacBase: Added missing emit call for transmissionEnded signal. The transmissionStarted/transmissionEnded must be in pairs in order to correctly calculate the boolean transmitting statistic. --- src/inet/linklayer/ethernet/base/EthernetMacBase.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/inet/linklayer/ethernet/base/EthernetMacBase.cc b/src/inet/linklayer/ethernet/base/EthernetMacBase.cc index b29099a9b67..91bc8aa4a9a 100644 --- a/src/inet/linklayer/ethernet/base/EthernetMacBase.cc +++ b/src/inet/linklayer/ethernet/base/EthernetMacBase.cc @@ -239,8 +239,10 @@ void EthernetMacBase::processConnectDisconnect() emit(transmissionEndedSignal, curTxSignal); send(curTxSignal, SendOptions().finishTx(curTxSignal->getId()), physOutGate); } - else + else { + emit(transmissionEndedSignal, curTxSignal); delete curTxSignal; + } curTxSignal = nullptr; cancelEvent(endTxTimer); } From 5466bd175c88c98ce11c957a0fe67994267279c2 Mon Sep 17 00:00:00 2001 From: Levente Meszaros Date: Tue, 16 Jul 2024 14:26:44 +0200 Subject: [PATCH 06/14] SettableClock: Changed defaultOverdueClockEventHandlingMode to execute because it may actually happen in a correctly set up simulation. When the clock is being set, it may happen that some clock event becomes overdue. The old default setting may mislead the user to think that this is an error. --- src/inet/clock/model/SettableClock.ned | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/inet/clock/model/SettableClock.ned b/src/inet/clock/model/SettableClock.ned index 0e2a18fad30..156e4a5e9b3 100644 --- a/src/inet/clock/model/SettableClock.ned +++ b/src/inet/clock/model/SettableClock.ned @@ -17,7 +17,7 @@ package inet.clock.model; module SettableClock extends OscillatorBasedClock { parameters: - string defaultOverdueClockEventHandlingMode @enum("execute","skip","error") = default("error"); + string defaultOverdueClockEventHandlingMode @enum("execute","skip","error") = default("execute"); @class(SettableClock); } From c003657737a3d6e154add44f987a93001e75782b Mon Sep 17 00:00:00 2001 From: Levente Meszaros Date: Wed, 17 Jul 2024 09:57:50 +0200 Subject: [PATCH 07/14] Tests: Updated mobility fingerprints after changing the constraint area. --- tests/fingerprint/examples.csv | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/fingerprint/examples.csv b/tests/fingerprint/examples.csv index 198e3cf73a0..c5c59126484 100644 --- a/tests/fingerprint/examples.csv +++ b/tests/fingerprint/examples.csv @@ -389,8 +389,8 @@ /examples/mobility/, -f omnetpp.ini -c MassMobilityWithScenario -r 0, 10000s, 2889-e87d/tplx;0000-0000/~tNl;0000-0000/~tND;a741-30ba/tyf, PASS, /examples/mobility/, -f omnetpp.ini -c MoBANMobility1 -r 0, 10000s, 7e9a-4c42/tplx;0000-0000/~tNl;0000-0000/~tND;b785-055e/tyf, PASS, /examples/mobility/, -f omnetpp.ini -c MoBANMobility2 -r 0, 10000s, 5717-6286/tplx;0000-0000/~tNl;0000-0000/~tND;09e7-2670/tyf, PASS, -/examples/mobility/, -f omnetpp.ini -c RandomWaypointMobility1 -r 0, 5000s, deb8-422c/tplx;0000-0000/~tNl;0000-0000/~tND;2f09-8074/tyf, PASS, -/examples/mobility/, -f omnetpp.ini -c RandomWaypointMobility2 -r 0, 5000s, da35-f460/tplx;0000-0000/~tNl;0000-0000/~tND;3285-d52a/tyf, PASS, +/examples/mobility/, -f omnetpp.ini -c RandomWaypointMobility1 -r 0, 5000s, 5cb8-f4a6/tplx;0000-0000/~tNl;0000-0000/~tND;2f09-8074/tyf, PASS, +/examples/mobility/, -f omnetpp.ini -c RandomWaypointMobility2 -r 0, 5000s, 089c-8dea/tplx;0000-0000/~tNl;0000-0000/~tND;3285-d52a/tyf, PASS, /examples/mobility/, -f omnetpp.ini -c RectangleMobility -r 0, 10000s, 4860-beb1/tplx;0000-0000/~tNl;0000-0000/~tND;2df2-794e/tyf, PASS, /examples/mobility/, -f omnetpp.ini -c StaticGridMobility -r 0, 0s, 0000-0000/tplx;0000-0000/~tNl;0000-0000/~tND;0000-0000/tyf, PASS, # (zero time simulated) /examples/mobility/, -f omnetpp.ini -c StationaryMobility -r 0, 0s, 0000-0000/tplx;0000-0000/~tNl;0000-0000/~tND;0000-0000/tyf, PASS, # (zero time simulated) @@ -398,10 +398,10 @@ /examples/mobility/, -f omnetpp.ini -c TractorMobility -r 0, 10000s, 4b3c-6272/tplx;0000-0000/~tNl;0000-0000/~tND;d72c-bdc0/tyf, PASS, /examples/mobility/, -f omnetpp.ini -c TurtleMobility1 -r 0, 10000s, 0e28-b6e3/tplx;0000-0000/~tNl;0000-0000/~tND;95ce-e71e/tyf, PASS, /examples/mobility/, -f omnetpp.ini -c TurtleMobility2 -r 0, 10000s, 67c8-fee0/tplx;0000-0000/~tNl;0000-0000/~tND;9cfc-e867/tyf, PASS, -/examples/mobility/, -f omnetpp.ini -c TurtleMobility3 -r 0, 10000s, a39d-5092/tplx;0000-0000/~tNl;0000-0000/~tND;967b-27b8/tyf, PASS, +/examples/mobility/, -f omnetpp.ini -c TurtleMobility3 -r 0, 10000s, 3134-a400/tplx;0000-0000/~tNl;0000-0000/~tND;967b-27b8/tyf, PASS, /examples/mobility/, -f omnetpp.ini -c TurtleMobility4 -r 0, 10000s, 9511-7d84/tplx;0000-0000/~tNl;0000-0000/~tND;06f8-aff3/tyf, PASS, /examples/mobility/, -f omnetpp.ini -c TurtleMobility5 -r 0, 10000s, 9511-7d84/tplx;0000-0000/~tNl;0000-0000/~tND;a637-60c8/tyf, PASS, -/examples/mobility/, -f omnetpp.ini -c TurtleMobility6 -r 0, 10000s, 0e4c-de72/tplx;0000-0000/~tNl;0000-0000/~tND;22cd-9a0f/tyf, PASS, +/examples/mobility/, -f omnetpp.ini -c TurtleMobility6 -r 0, 10000s, 45b6-ed3c/tplx;0000-0000/~tNl;0000-0000/~tND;22cd-9a0f/tyf, PASS, /examples/mobility/, -f omnetpp.ini -c VehicleMobility, 10s, 566c-6355/tplx;0000-0000/~tNl;0000-0000/~tND;0000-0000/tyf, PASS, /examples/mpls/ldp/, -f omnetpp.ini -c General -r 0, 50s, 6a1b-caed/tplx;36d7-02a9/~tNl;6a67-8c1b/tyf, PASS, Ipv4 From 201cbfb7d797a2bed89dc171a4f55ab6e8055f12 Mon Sep 17 00:00:00 2001 From: Gyorgy Szaszko Date: Wed, 17 Jul 2024 11:16:23 +0200 Subject: [PATCH 08/14] fix: typos --- src/inet/networklayer/ipv4/IgmpMessage.msg | 2 +- src/inet/routing/eigrp/EigrpTimer.msg | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/inet/networklayer/ipv4/IgmpMessage.msg b/src/inet/networklayer/ipv4/IgmpMessage.msg index dd87650df97..11ea4b8b912 100644 --- a/src/inet/networklayer/ipv4/IgmpMessage.msg +++ b/src/inet/networklayer/ipv4/IgmpMessage.msg @@ -111,7 +111,7 @@ enum GroupRecordType class GroupRecord { @packetData; - int recordType enum(GroupRecordType); + int recordType @enum(GroupRecordType); Ipv4Address groupAddress; Ipv4AddressVector sourceList; uint32_t auxData[]; diff --git a/src/inet/routing/eigrp/EigrpTimer.msg b/src/inet/routing/eigrp/EigrpTimer.msg index a48b7f55ddd..2b9fdd7ac97 100644 --- a/src/inet/routing/eigrp/EigrpTimer.msg +++ b/src/inet/routing/eigrp/EigrpTimer.msg @@ -20,5 +20,5 @@ enum EigrpTimerType // general timer structure message EigrpTimer { - char timerKind enum(EigrpTimerType); + char timerKind @enum(EigrpTimerType); }; From 94d7923ced409c2aced819d595aab3f1cca876df Mon Sep 17 00:00:00 2001 From: Gyorgy Szaszko Date: Wed, 17 Jul 2024 17:25:20 +0200 Subject: [PATCH 09/14] python: inet.scave.plot: eliminate FutureWarning: ChainedAssignmentError --- python/inet/scave/plot.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python/inet/scave/plot.py b/python/inet/scave/plot.py index 403f0caac4a..3b008dcbfdc 100644 --- a/python/inet/scave/plot.py +++ b/python/inet/scave/plot.py @@ -700,8 +700,8 @@ def remove_zero_index_if_present(df): for i in range(0,len(df)): pattern = re.compile(value) - logger.debug(f"value: {value}, pattern: {pattern}, df[column][i] {df[column][i]}") - match = re.fullmatch(pattern, df[column][i]) + logger.debug(f"value: {value}, pattern: {pattern}, df.loc[i, column] {df.loc[i, column]}") + match = re.fullmatch(pattern, df.loc[i, column]) logger.debug(f"match: {match}") if match != None: # if debug: @@ -732,9 +732,9 @@ def remove_zero_index_if_present(df): logger.debug(f'order_column: {order_column}, order_dict {order_dict}') for i in order_dict.items(): for j in range(0,len(df)): - # if df[order_column][j] == i[0]: + # if df.loc[j, order_column] == i[0]: pattern = re.compile(i[0]) - match = re.fullmatch(pattern, df[order_column][j]) + match = re.fullmatch(pattern, df.loc[j, order_column]) if match != None: df.loc[j, 'order'] = i[1] else: @@ -743,9 +743,9 @@ def remove_zero_index_if_present(df): logger.debug(f'order_column: {order_column}, order_list {order_list}') for order in range(0, len(order_list)): for j in range(0,len(df)): - # if df[order_column][j] == i[0]: + # if df.loc[j, order_column] == i[0]: pattern = re.compile(order_list[order]) - match = re.fullmatch(pattern, df[order_column][j]) + match = re.fullmatch(pattern, df.loc[j, order_column]) if match != None: df.loc[j, 'order'] = order From 54d6840eb9750c4518a0e7ebed68823cd4ccf97c Mon Sep 17 00:00:00 2001 From: Gyorgy Szaszko Date: Wed, 17 Jul 2024 18:13:00 +0200 Subject: [PATCH 10/14] showcases: fix FutureWarning: ChainedAssignmentError in anf files --- .../clockdrift/ClockDriftShowcase.anf | 36 +++++++++---------- .../timesynchronization/gptp/GptpShowcase.anf | 16 ++++----- showcases/wireless/errorrate/ErrorRate.anf | 2 +- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/showcases/tsn/timesynchronization/clockdrift/ClockDriftShowcase.anf b/showcases/tsn/timesynchronization/clockdrift/ClockDriftShowcase.anf index 3689fe9d8e0..8de8901f518 100644 --- a/showcases/tsn/timesynchronization/clockdrift/ClockDriftShowcase.anf +++ b/showcases/tsn/timesynchronization/clockdrift/ClockDriftShowcase.anf @@ -48,8 +48,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df['legend'])): - df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','') - df['legend'][i] = df['legend'][i].replace('.clock','') + df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','') + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','') # plot utils.plot_vectors(df, props) @@ -629,8 +629,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df['legend'])): - df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','') - df['legend'][i] = df['legend'][i].replace('.clock','') + df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','') + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','') # plot utils.plot_vectors(df, props) @@ -1210,8 +1210,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df['legend'])): - df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','') - df['legend'][i] = df['legend'][i].replace('.clock','') + df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','') + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','') # plot utils.plot_vectors(df, props) @@ -1791,8 +1791,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df['legend'])): - df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','') - df['legend'][i] = df['legend'][i].replace('.clock','') + df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','') + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','') # plot utils.plot_vectors(df, props) @@ -2372,8 +2372,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df['legend'])): - df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','') - df['legend'][i] = df['legend'][i].replace('.clock','') + df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','') + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','') # plot utils.plot_vectors(df, props) @@ -2953,8 +2953,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df['legend'])): - df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','') - df['legend'][i] = df['legend'][i].replace('.clock','') + df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','') + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','') # plot utils.plot_vectors(df, props) @@ -3534,8 +3534,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df['legend'])): - df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','') - df['legend'][i] = df['legend'][i].replace('.clock','') + df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','') + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','') # plot utils.plot_vectors(df, props) @@ -4117,8 +4117,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df['legend'])): - df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','') - df['legend'][i] = df['legend'][i].replace('.clock','') + df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','') + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','') # plot utils.plot_vectors(df, props) @@ -4698,8 +4698,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df['legend'])): - df['legend'][i] = df['module'][i].replace('ClockDriftShowcase.','') - df['legend'][i] = df['legend'][i].replace('.clock','') + df.loc[i, 'legend'] = df.loc[i, 'module'].replace('ClockDriftShowcase.','') + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace('.clock','') # plot utils.plot_vectors(df, props) diff --git a/showcases/tsn/timesynchronization/gptp/GptpShowcase.anf b/showcases/tsn/timesynchronization/gptp/GptpShowcase.anf index 03d358bc039..61c5a8f256d 100644 --- a/showcases/tsn/timesynchronization/gptp/GptpShowcase.anf +++ b/showcases/tsn/timesynchronization/gptp/GptpShowcase.anf @@ -41,8 +41,8 @@ if df.empty: df['legend'] = df['module'] for i in range(0,len(df)): - df['legend'][i] = df['legend'][i].replace("OneMasterClockGptpShowcase.","") - df['legend'][i] = df['legend'][i].replace(".clock","") + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace("OneMasterClockGptpShowcase.","") + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace(".clock","") # apply vector operations df = utils.perform_vector_ops(df, props["vector_operations"]) @@ -628,8 +628,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df)): - df['legend'][i] = df['legend'][i].replace("TwoMasterClocksTreeGptpShowcase.","") -# df['legend'][i] = df['legend'][i].replace(".clock","") + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace("TwoMasterClocksTreeGptpShowcase.","") +# df.loc[i, 'legend'] = df.loc[i, 'legend'].replace(".clock","") # plot utils.plot_vectors(df, props) @@ -1204,8 +1204,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df)): - df['legend'][i] = df['legend'][i].replace("TwoMasterClocksTreeGptpShowcase.","") -# df['legend'][i] = df['legend'][i].replace(".clock[0]","") + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace("TwoMasterClocksTreeGptpShowcase.","") +# df.loc[i, 'legend'] = df.loc[i, 'legend'].replace(".clock[0]","") # plot utils.plot_vectors(df, props) @@ -1780,8 +1780,8 @@ df = utils.perform_vector_ops(df, props["vector_operations"]) df['legend'] = df['module'] for i in range(0,len(df)): - df['legend'][i] = df['legend'][i].replace("TwoMasterClocksTreeGptpShowcase.","") -# df['legend'][i] = df['legend'][i].replace(".clock[0]","") + df.loc[i, 'legend'] = df.loc[i, 'legend'].replace("TwoMasterClocksTreeGptpShowcase.","") +# df.loc[i, 'legend'] = df.loc[i, 'legend'].replace(".clock[0]","") # plot utils.plot_vectors(df, props) diff --git a/showcases/wireless/errorrate/ErrorRate.anf b/showcases/wireless/errorrate/ErrorRate.anf index dda567fef51..b4b4ab83537 100644 --- a/showcases/wireless/errorrate/ErrorRate.anf +++ b/showcases/wireless/errorrate/ErrorRate.anf @@ -1990,7 +1990,7 @@ if df.empty: for i in range(len(df['value'])): # avoid SettingWithCopyWarning value = df['value'].copy() - value[i] = float(df['bitrate'][i]) * (1 - float(df['value'][i])) + value[i] = float(df.loc[i, 'bitrate']) * (1 - float(df.loc[i, 'value'])) df['value'] = value xaxis_itervar, group_by = utils.select_xaxis_and_groupby(df, props) From 6b53048da945541ce1251bca8440c76628df2a23 Mon Sep 17 00:00:00 2001 From: Gyorgy Szaszko Date: Thu, 18 Jul 2024 17:31:34 +0200 Subject: [PATCH 11/14] showcases: eliminate invalid escape sequence warning in anf files --- python/inet/scave/plot.py | 2 +- .../invehicle/InVehicleNetworkShowcase.anf | 4 +- .../eager/EagerGateSchedulingShowcase.anf | 10 ++-- .../tsn/gatescheduling/sat/SatShowcase.anf | 16 +++--- .../TokenBucketPolicingShowcase.anf | 4 +- .../PeekingUnderTheHoodShowcase.anf | 6 +-- .../AsynchronousShaperShowcase.anf | 54 +++++++++---------- .../cbsandats/CbsAndAtsShowcase.anf | 8 +-- .../cbsandtas/CbsAndTasShowcase.anf | 14 ++--- .../CreditBasedShaperShowcase.anf | 44 +++++++-------- .../TimeAwareShaperShowcase.anf | 28 +++++----- .../PeekingUnderTheHoodShowcase.anf | 6 +-- 12 files changed, 98 insertions(+), 98 deletions(-) diff --git a/python/inet/scave/plot.py b/python/inet/scave/plot.py index 3b008dcbfdc..a71aa7a4479 100644 --- a/python/inet/scave/plot.py +++ b/python/inet/scave/plot.py @@ -665,7 +665,7 @@ def add_to_dataframe(df, style_tuple_list=None, default_dict=None, order=None): or order = ['configname', 'Advanced_config', 'Default_config', 'Manual_config'] - Note that the value parameter in style_tuple_list and the order can contain regex (e.g. .*foo). Make sure to escape regex characters such as [ and ] with \ + Note that the value parameter in style_tuple_list and the order can contain regex (e.g. .*foo). Make sure to escape regex characters such as [ and ] with \\ """ diff --git a/showcases/tsn/combiningfeatures/invehicle/InVehicleNetworkShowcase.anf b/showcases/tsn/combiningfeatures/invehicle/InVehicleNetworkShowcase.anf index dc3c36df016..8644a2eb394 100644 --- a/showcases/tsn/combiningfeatures/invehicle/InVehicleNetworkShowcase.anf +++ b/showcases/tsn/combiningfeatures/invehicle/InVehicleNetworkShowcase.anf @@ -4624,7 +4624,7 @@ if df.empty: # apply vector operations df = utils.perform_vector_ops(df, props["vector_operations"]) -df['legend'] = df['module'].map(lambda module: re.sub(".*\.(.*)\..*", "\\1", module)) +df['legend'] = df['module'].map(lambda module: re.sub(".*\\.(.*)\\..*", "\\1", module)) # plot utils.plot_vectors(df, props) @@ -5198,7 +5198,7 @@ if df.empty: # apply vector operations df = utils.perform_vector_ops(df, props["vector_operations"]) -df['legend'] = df['module'].map(lambda module: re.sub(".*\.(.*)\..*", "\\1", module)) +df['legend'] = df['module'].map(lambda module: re.sub(".*\\.(.*)\\..*", "\\1", module)) # plot utils.plot_vectors(df, props) diff --git a/showcases/tsn/gatescheduling/eager/EagerGateSchedulingShowcase.anf b/showcases/tsn/gatescheduling/eager/EagerGateSchedulingShowcase.anf index 9002076849e..f9b4423b138 100644 --- a/showcases/tsn/gatescheduling/eager/EagerGateSchedulingShowcase.anf +++ b/showcases/tsn/gatescheduling/eager/EagerGateSchedulingShowcase.anf @@ -5,7 +5,7 @@ - + - + - + - + - + - + - + - +