Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
104 commits
Select commit Hold shift + click to select a range
2f5b080
prod: version bumped to 4.5.1
rhornig Aug 24, 2023
50f19cc
build: added a missing INET_API macro causing a linker error on Windows
rhornig Aug 24, 2023
b6588b4
ChangeLogs updated
avarga Aug 24, 2023
51b439a
ChangeLogs tagged to 4.5.1
avarga Aug 24, 2023
487023f
GateScheduleCanvasVisualizer: fix runtime error on Windows
avarga Aug 29, 2023
5c66e91
python: inet.scave.plot: description fix
adamgeorge309 Apr 12, 2023
e82b679
TcpBasicClientApp: bugfix: fixed stopTime detection
ZoltanBojthe Apr 17, 2023
f1a62f6
StreamBufferChunkSerializer: Fixed padding with 0s after the currentS…
levy Apr 25, 2023
eb7b787
Packet: Fixed missing offset from length calculation.
ZoltanBojthe Apr 27, 2023
f8a2154
Gptp: Fixed interpolationmode parameter value.
levy Apr 27, 2023
3ca5f64
voipstream: Replace deprecated code
ZoltanBojthe Apr 27, 2023
1ef660f
voipstream: More verbose error messages
ZoltanBojthe Apr 27, 2023
6fa5a48
VoipStreamSender: Use swr_alloc_set_opts2() instead of many av_opt_se…
ZoltanBojthe Apr 27, 2023
86ec6dc
voipstream: Fixup: set frame_size in pEncoderCtx.
ZoltanBojthe May 3, 2023
5a85e4a
VoipStreamSender: padding last frame when the sending will be repeati…
ZoltanBojthe May 5, 2023
d891ccf
queueing: Fixed incorrectly used getPathStartGate/getPathEndGate.
levy May 8, 2023
fab8f88
ModuleRefByGate: Fixed infinite recursion.
levy May 9, 2023
9ecabb6
EligibilityTimeMeter: Fixed number of token statistic to not have neg…
Musteblume May 12, 2023
57a427f
ThroughputFilter: Fixed the 0 time interval case when emitting the th…
levy Jun 1, 2023
6ff7453
addendum to "GateScheduleCanvasVisualizer: fix runtime error on Windows"
avarga Aug 29, 2023
7596266
prod: bumped version to 4.5.2
rhornig Aug 29, 2023
7e0dacb
doc: updated changelogs
rhornig Aug 29, 2023
4e9a499
doc: tagged changelogs
rhornig Aug 29, 2023
a6273ea
pathloss: fix#956 - Rayleigh pathloss computation was incorrect
rhornig Mar 11, 2024
5c741b9
misc: fix incorrect enum declarations (required for OMNeT++ 6.1)
avarga Apr 8, 2024
4680667
prod: version bump to 4.5.2, updated WHATSNEW and ChangeLogs
rhornig Aug 7, 2024
cd05e0e
NodeStatus: follow enum registration fix.
avarga Apr 10, 2024
fef170f
python: Fixed #982, moved GDB printers to a separate toplevel folder.
levy Sep 3, 2024
2ee75c3
NeighborListNeighborCache: Fixed #974 bug.
levy May 14, 2024
4cc66b0
MacForwardingConfigurator: Fixed #880, the new forwarding rule is add…
levy Apr 11, 2023
516b43c
L3NetworkConfiguratorBase: Fixed #913, copied frame creation code fro…
levy Oct 9, 2023
40b5a42
WireJunction: Added @wireJunction property for the Sequence Chart tool.
levy Nov 27, 2023
0342c1b
common: Fixed bug #967.
levy Mar 28, 2024
2d47fe8
QueueingPacketDelayer: Fixed issues reported in #919.
levy Mar 27, 2024
cf38848
queueing: Added separate statistics for each token bucket in a MultiT…
levy May 18, 2023
bc1920d
CreditBasedGate: Extracted udpateGateState method.
levy May 2, 2023
2fb182a
CreditBasedGate: Changed scheduleChangeTimer() to cancel the timer ev…
levy May 5, 2023
6ce5834
CreditBasedGate: There's no need to schedule the change timer when pr…
levy May 5, 2023
0eb5517
queueing: Added a bit more logging.
levy May 2, 2023
164daf5
CreditBasedGate: Changed scheduling the change timer to allow schedul…
levy May 5, 2023
e4f3f1a
Tests: Updated fingerprints after confirming the original issues in #…
levy May 8, 2023
2b7aca5
UdpBasicBurst: Fixed missing Define_Module.
levy Sep 19, 2024
9f284c3
UdpBasicBurst: Fixed enumeration name in cEnum::get.
levy Sep 19, 2024
0b3a24f
visualizer: Replaced @enum("light", "dark") with documentation.
levy May 8, 2024
2992576
prod: version umped to 4.5.4
rhornig Oct 10, 2024
2f5fef0
inet_fingerprinttest: Fixed escaping errors in regular expression.
levy Sep 26, 2024
5aab7e0
python: Changed the first argument to be a raw string in all re.sub, …
levy Oct 11, 2024
84aa937
python: Replaced \\ with \ in all raw regexps.
levy Oct 11, 2024
74da563
QosClassifier: Removed useless @enum().
levy May 7, 2024
9f8caff
all: Fixed 'warning: variable length arrays in C++ are a Clang extens…
levy Oct 14, 2024
dbed817
SnirReceiverBase: Fixed printing enum value.
levy Oct 14, 2024
c4e864c
all: follow omnetpp change: cNedValue::OBJECT renamed to POINTER
ZoltanBojthe Sep 25, 2023
e200e82
python: Added stdout, stderr to TaskResult and use it from OppTestTask.
levy Oct 14, 2024
a08d64b
Tests: Followed changes with PeriodicGate_1.test
levy Oct 14, 2024
ab9cb37
python: Refactored opp tests to avoid using the runtest shell script.
levy Oct 14, 2024
ce2c216
python: Added more possibilities to TaskResult to return a useful err…
levy Oct 15, 2024
a9858d7
tests: Added Makefiles generated by opp_makemake for the libs in modu…
levy Oct 15, 2024
e6520df
bin: Added inet_run_packet_tests script.
levy Oct 15, 2024
0d42db7
python: Fixed INET project executable path.
levy Oct 15, 2024
909ed63
python: Fixed obsolete code fragments where a FutureWarning was print…
levy Oct 15, 2024
9bee8f6
all: Fixed passing in the buffer pointer introduced by path all: Fixe…
levy Oct 16, 2024
65b72ec
Gptp: Added missing packetDrop signal and related statistics.
levy Oct 16, 2024
3b23196
python: Added optional start, end task index parameters when executin…
levy Oct 16, 2024
33f6486
python: Added support for marking simulations explicitly as emulations.
levy Oct 16, 2024
70987ba
Examples: Marked osudp simulations as emulations.
levy Oct 16, 2024
b433ee0
ChunkPtr: moved to Chunk.msg
ZoltanBojthe Apr 5, 2023
ea13fd3
CutthroughTag: Added trailerChunk field.
ZoltanBojthe Apr 5, 2023
4516571
PacketDirectionReverser: Copying all fields of CutthroughTag
ZoltanBojthe Apr 25, 2023
b9c450a
EthernetFcsChecker: Skip checking Ethernet FCS for cut-through packets.
ZoltanBojthe Apr 5, 2023
d83f725
EthernetFcsInserter: Copy received FCS for cut-through packets.
levy Apr 25, 2023
9265cda
StreamBufferChunkSerializer: Added temporary fix to avoid serializati…
levy Oct 18, 2024
5412e92
Tests: Updated fingerprints after recent cut-through related fixes.
ZoltanBojthe Apr 19, 2023
33fa348
Tests: Updated simulation time limits in the JSON fingerprint store b…
levy Oct 17, 2024
b272397
Tests: Updated fingerprints in the JSON fingerprint store by copying …
levy Oct 16, 2024
f006d4c
Tests: Updated fingerprints in the JSON fingerprint store to SKIP sim…
levy Oct 17, 2024
1df32b2
802.11: Fixed various memory leaks detected by sanitizer tests.
levy Oct 18, 2024
e013fe4
voipstream: Fixed memory leaks in how ffmpeg is used detected by sani…
levy Oct 18, 2024
40ca3cc
VoipStreamSender: Fixed memory leaks found by sanitizer build.
levy Oct 21, 2024
b2591be
Tcp: Temporarily removed @enum from tcpAlgorithmClass parameter becau…
levy Oct 21, 2024
400e247
StreamDecoder: Fixed memory leak found by sanitizer test.
levy Oct 22, 2024
896d707
Showcases: Changed OsgGeographicCoordinateSystem to be optional depen…
levy Oct 22, 2024
1af65f1
physicallayer: Fixed ApskSymbol and Ieee80211OfdmSymbol related memor…
levy Oct 22, 2024
5b31c88
XMac: Fixed memory leak found by sanitizer test.
levy Oct 22, 2024
10fe042
Examples: Marked gPTP example sync4 as expected error.
levy Oct 22, 2024
9559205
Tests: Followed recent changes in ApskSymbol ownership inside Ieee802…
levy Oct 22, 2024
19a9eec
python: Changed to run smoke tests only for run 0 by default.
levy Oct 22, 2024
ac2d6f6
python: Fixed handling no stderr (when capture_output=True) during ru…
levy Oct 22, 2024
bd96de8
python: Changed chart tests to execute only run 0 by default.
levy Oct 22, 2024
bc444f0
python: Added support for skipping simulations marked with expected r…
levy Oct 22, 2024
9d1b34f
python: Sorted all test groups in alphanumeric order.
levy Oct 22, 2024
998ecff
bin: Added inet_run_release_tests shell script.
levy Oct 22, 2024
abac8fd
python: Added run_release_tests function that configures INET using t…
levy Oct 24, 2024
9222d56
python: Changed INET project path to use INET_ROOT environment variable.
levy Oct 24, 2024
68f59ef
python: Removed the omnetpp sample projects.
levy Oct 24, 2024
ef7dec3
python: Changed packet tests to run if the working_directory is a pre…
levy Oct 24, 2024
2e67a8a
python: Added build_project in release mode before collecting simulat…
levy Oct 24, 2024
f22835d
python: Added 'make makefiles' to build_project to make sure the Make…
levy Oct 24, 2024
8e5a69d
python: Added building the test library under the lib folder before r…
levy Oct 24, 2024
5b26762
python: Added debug mode argument to MultipleSimulationTestTask.
levy Oct 24, 2024
2670cc5
prod: added python/requirements.txt for easier installation of python…
rhornig Oct 29, 2024
8e31be0
prod: updated install instructions to include python module dependencies
rhornig Oct 29, 2024
007e5b9
prod: updated changelogs
rhornig Oct 29, 2024
0a1d409
prod: WHATSNEW update
rhornig Oct 29, 2024
643455a
FlowMeasurementRecorder: Clarify confusing parameter names (fixes #1089)
Feb 18, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .gdbinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
if 'register_inet_printers' in dir():
print('inet pretty printers already initialized.')
else:
from inet.printers import register_inet_printers
from inetgdb.printers import register_inet_printers
register_inet_printers(None)
print('Pretty printers initialized: inet')
11 changes: 7 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,18 @@ General
If you are building from command line:
--------------------------------------
3. Change to the INET directory and source the `setenv` script.

$ source setenv

4. Type `make makefiles`. This should generate the makefiles for you automatically.
4. Make sure that any required Python modules are properly installed by executing
`pip install -r python/requirements.txt`

5. Type `make makefiles`. This should generate the makefiles for you automatically.

5. Type `make` to build the inet executable (release version). Use `make MODE=debug`
6. Type `make` to build the inet executable (release version). Use `make MODE=debug`
to build debug version.

6. You can run specific examples by changing into the example's directory and executing `inet`
7. You can run specific examples by changing into the example's directory and executing `inet`

If you are using the IDE:
-------------------------
Expand Down
32 changes: 32 additions & 0 deletions WHATSNEW
Original file line number Diff line number Diff line change
@@ -1,6 +1,38 @@
Recent changes in the INET Framework
====================================

INET-4.5.4 (October 2024) - Stable
----------------------------------

This is a minor patch release containing OMNeT++ 6.1 compatibility fixes (enum
related issues). It contains also fixes for #880, #886, #913, #919, #956,
#967, #974, #982. Several memory lake errors were fixed. Added logging and
testing framework enhancements. Added a `python/requirements.txt` so Python
dependenies can be installed by `pip install -r python/requirements.txt`.
Fixed escaping errors with Python 3.12 in pythons scripts.

Test framework enhancements:
- Added new commands `inet_run_*_tests` to allow running various tests.
- Smoke tests are executed for run #0 only by default.
- Tets marked as intentionally as SKIP are now left out from the test execution.
- Added `inet_run_release_tests` for pre-release testing.
- A lot of mischelanous fixes.


INET-4.5.3 (September 2024) - Stable
------------------------------------
This version was yanked because of `@enum` related issues.


INET-4.5.2 (August 2024) - Stable
---------------------------------

This is a minor bugfix release containing OMNeT++ 6.1 compatibility fixes
and and a fix for an incorrect formula used in Rayleigh pathloss computation
(NOTE: This change may alter a simulation's results if it used the
Rayleigh pathloss model).


INET-4.5 (April 2023) - Stable
------------------------------

Expand Down
2 changes: 1 addition & 1 deletion bin/inet_fingerprinttest
Original file line number Diff line number Diff line change
Expand Up @@ -479,7 +479,7 @@ class FingerprintTestCase(SimulationTestCase):
workingdir = _iif(self.wd.startswith('/'), rootDir + "/" + self.wd, self.wd)
wdname = '' + self.wd + ' ' + self.cmdLine
wdname = re.sub('/', '_', wdname)
wdname = re.sub('[\W]+', '_', wdname)
wdname = re.sub(r'[\W]+', '_', wdname)
resultdir = os.path.abspath(".") + "/results/" + self.csvFile + "/" + wdname
ensure_dir(resultdir)

Expand Down
5 changes: 5 additions & 0 deletions bin/inet_run_packet_tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env python3

from inet.main import *

run_packet_tests_main()
5 changes: 5 additions & 0 deletions bin/inet_run_release_tests
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env python3

from inet.main import *

run_release_tests_main()
1 change: 1 addition & 0 deletions examples/gptp/omnetpp.ini
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,4 @@ description = gptp on, master is in a hurry, client is precise
extends = sync1, _DriftMaster, _DriftSlave
description = gptp on, master is in a hurry, client is late

# expected-result = "ERROR"
1 change: 1 addition & 0 deletions examples/voipstream/osudp/receiver.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
network = VoipStreamReceiverApplication
scheduler-class = "inet::RealTimeScheduler"
sim-time-limit = 1h
#emulation = true

*.app.localPort = 1000
*.app.resultFile = "results/sound.wav"
1 change: 1 addition & 0 deletions examples/voipstream/osudp/sender.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
network = VoipStreamSenderApplication
scheduler-class = "inet::RealTimeScheduler"
#abstract-config = true (requires omnet 7)
#emulation = true

*.app.packetTimeLength = 20ms
*.app.voipHeaderSize = 28B
Expand Down
4 changes: 2 additions & 2 deletions python/inet/common/summary.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ def collect_modules(simulation_project, path="src"):
match = re.match(r"^package ([\w\.]+)", line)
if match:
package = match.group(1)
package = re.sub("^\w+?\.", "", package)
package = re.sub(r"^\w+?\.", "", package)
match = re.match(r"^(simple|module) (\w+)\b", line)
if match:
module = match.group(2)
Expand Down Expand Up @@ -120,7 +120,7 @@ def collect_classes(simulation_project, path="src"):
if match:
class_name = match.group(1)
relative_path = os.path.relpath(os.path.dirname(file_name), project_path)
relative_path = re.sub("^(\w+)/", "", relative_path)
relative_path = re.sub(r"^(\w+)/", "", relative_path)
classes.append(relative_path + "/" + class_name)
file.close()
return classes
Expand Down
12 changes: 8 additions & 4 deletions python/inet/common/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
logger = logging.getLogger(__name__)

class TaskResult:
def __init__(self, task=None, result="DONE", expected_result="DONE", reason=None, error_message=None, exception=None, elapsed_wall_time=None, possible_results=["DONE", "CANCEL", "ERROR"], possible_result_colors=[COLOR_GREEN, COLOR_CYAN, COLOR_RED], **kwargs):
def __init__(self, task=None, result="DONE", expected_result="DONE", reason=None, stdout=None, stderr=None, error_message=None, exception=None, elapsed_wall_time=None, possible_results=["DONE", "CANCEL", "ERROR"], possible_result_colors=[COLOR_GREEN, COLOR_CYAN, COLOR_RED], **kwargs):
self.locals = locals()
self.locals.pop("self")
self.kwargs = kwargs
Expand All @@ -21,6 +21,8 @@ def __init__(self, task=None, result="DONE", expected_result="DONE", reason=None
self.expected_result = expected_result
self.expected = expected_result == result
self.reason = reason
self.stdout = stdout
self.stderr = stderr
self.error_message = error_message
self.exception = exception
self.elapsed_wall_time = elapsed_wall_time
Expand All @@ -40,7 +42,7 @@ def get_description(self, complete_error_message=True, include_parameters=False,
(" " + self.get_error_message(complete_error_message=complete_error_message) if self.result == "ERROR" else "")

def get_error_message(self, **kwargs):
return self.error_message or "<Error message not found>"
return self.error_message or self.stderr or (self.exception and str(self.exception)) or "<No error message>"

def print_result(self, complete_error_message=False, output_stream=sys.stdout, **kwargs):
print(self.get_description(complete_error_message=complete_error_message), file=output_stream)
Expand Down Expand Up @@ -247,12 +249,14 @@ def run_protected(self, **kwargs):
1/0

class MultipleTasks:
def __init__(self, tasks=[], name="task", concurrent=True, randomize=False, chunksize=1, pool_class=multiprocessing.pool.ThreadPool, multiple_task_results_class=MultipleTaskResults, **kwargs):
def __init__(self, tasks=[], name="task", start=None, end=None, concurrent=True, randomize=False, chunksize=1, pool_class=multiprocessing.pool.ThreadPool, multiple_task_results_class=MultipleTaskResults, **kwargs):
self.locals = locals()
self.locals.pop("self")
self.kwargs = kwargs
self.tasks = tasks
self.name = name
self.start = start
self.end = end
self.concurrent = concurrent
self.randomize = randomize
self.chunksize = chunksize
Expand Down Expand Up @@ -287,7 +291,7 @@ def run(self, **kwargs):
return multiple_task_results

def run_protected(self, **kwargs):
tasks = self.tasks
tasks = self.tasks[self.start:self.end+1] if self.start is not None and self.end is not None else self.tasks
task_count = len(tasks)
for task in tasks:
task.set_cancel(False)
Expand Down
2 changes: 1 addition & 1 deletion python/inet/common/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def coalesce(*values):

def convert_to_seconds(s):
seconds_per_unit = {"ns": 1E-9, "us": 1E-6, "ms": 1E-3, "s": 1, "second": 1, "m": 60, "min": 60, "h": 3600, "hour": 3600, "d": 86400, "day": 86400, "w": 604800, "week": 604800}
match = re.match("(-?[0-9]*\.?[0-9]*) *([a-zA-Z]+)", s)
match = re.match(r"(-?[0-9]*\.?[0-9]*) *([a-zA-Z]+)", s)
return float(match.group(1)) * seconds_per_unit[match.group(2)]

def write_object(file_name, object):
Expand Down
9 changes: 7 additions & 2 deletions python/inet/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def parse_arguments(task_name):
parser.add_argument("-u", "--user-interface", choices=["Cmdenv", "Qtenv"], default="Cmdenv", help="User interface")
parser.add_argument("-t", "--sim-time-limit", default=None, help="Simulation time limit")
parser.add_argument("-T", "--cpu-time-limit", default=None, help="CPU time limit")
parser.add_argument('--start', default=None, help="First task index")
parser.add_argument('--end', default=None, help="Last task index")
parser.add_argument("-f", "--filter", default=None, help="Filter")
parser.add_argument("--exclude-filter", default=None, help="Exclude filter")
parser.add_argument("-w", "--working-directory-filter", default=None, help="Working directory filter")
Expand All @@ -43,7 +45,7 @@ def process_arguments(task):
logger.addHandler(handler)
kwargs = {k: v for k, v in vars(args).items() if v is not None}
kwargs["working_directory_filter"] = args.working_directory_filter or os.path.relpath(os.getcwd(), os.path.realpath(inet_project.get_full_path(".")))
kwargs["working_directory_filter"] = re.sub("(.*)/$", "\\1", kwargs["working_directory_filter"])
kwargs["working_directory_filter"] = re.sub(r"(.*)/$", "\\1", kwargs["working_directory_filter"])
return kwargs

def run_main(main_function, task_name):
Expand Down Expand Up @@ -94,4 +96,7 @@ def run_validation_tests_main():
run_main(run_validation_tests, "validation tests")

def run_all_tests_main():
run_main(run_all_tests, "tests")
run_main(run_all_tests, "all tests")

def run_release_tests_main():
run_main(run_release_tests, "release tests")
4 changes: 4 additions & 0 deletions python/inet/simulation/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@

def build_project(simulation_project, mode="debug", capture_output=True, **kwargs):
logger.info(f"Building {simulation_project.get_name()} started")
args = ["make", "makefiles"]
subprocess_result = subprocess.run(args, cwd=simulation_project.get_full_path("."), capture_output=capture_output)
if subprocess_result.returncode != 0:
raise Exception(f"Build {simulation_project.get_name()} failed")
args = ["make", "MODE=" + mode, "-j", str(multiprocessing.cpu_count())]
subprocess_result = subprocess.run(args, cwd=simulation_project.get_full_path("."), capture_output=capture_output)
if subprocess_result.returncode != 0:
Expand Down
32 changes: 19 additions & 13 deletions python/inet/simulation/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@

from inet.common import *
from inet.simulation.project import *
from inet.simulation.build import *

logger = logging.getLogger(__name__)

class SimulationConfig:
def __init__(self, simulation_project, working_directory, ini_file="omnetpp.ini", config="General", num_runs=1, sim_time_limit=None, abstract=False, expected_result="DONE", user_interface="Cmdenv", description=None):
def __init__(self, simulation_project, working_directory, ini_file="omnetpp.ini", config="General", num_runs=1, sim_time_limit=None, abstract=False, emulation=False, expected_result="DONE", user_interface="Cmdenv", description=None):
self.simulation_project = simulation_project
self.working_directory = working_directory
self.ini_file = ini_file
self.config = config
self.num_runs = num_runs
self.sim_time_limit = sim_time_limit
self.abstract = abstract
self.emulation = working_directory.find("emulation") != -1
self.emulation = working_directory.find("emulation") != -1 or emulation
self.expected_result = expected_result
self.user_interface = user_interface
self.description = description
Expand Down Expand Up @@ -67,7 +68,7 @@ def get_sim_time_limit(config_dicts, config):
# KLUDGE TODO replace this with a Python binding to the C++ configuration reader
def collect_ini_file_simulation_configs(simulation_project, ini_path):
def create_config_dict(config):
return {"config": config, "abstract_config": False, "expected_result": "DONE", "user_interface": None, "description": None, "network": None}
return {"config": config, "abstract_config": False, "emulation" : False, "expected_result": "DONE", "user_interface": None, "description": None, "network": None}
simulation_configs = []
working_directory = os.path.dirname(ini_path)
num_runs_fast = get_num_runs_fast(ini_path)
Expand All @@ -76,30 +77,33 @@ def create_config_dict(config):
config_dicts = {"General": create_config_dict("General")}
config_dict = {}
for line in file:
match = re.match("\\[(Config +)?(.*?)\\]|\\[(General)\\]", line)
match = re.match(r"\[(Config +)?(.*?)\]|\[(General)\]", line)
if match:
config = match.group(2) or match.group(3)
config_dict = create_config_dict(config)
config_dicts[config] = config_dict
match = re.match(" *extends *= *(\w+)", line)
match = re.match(r" *extends *= *(\w+)", line)
if match:
config_dict["extends"] = match.group(1)
match = re.match(" *user-interface *= \"*(\w+)\"", line)
match = re.match(r" *user-interface *= \"*(\w+)\"", line)
if match:
config_dict["user_interface"] = match.group(1)
match = re.match("#? *abstract-config *= *(\w+)", line)
match = re.match(r"#? *abstract-config *= *(\w+)", line)
if match:
config_dict["abstract_config"] = bool(match.group(1))
match = re.match("#? *expected-result *= *\"(\w+)\"", line)
match = re.match(r"#? *emulation *= *(\w+)", line)
if match:
config_dict["emulation"] = bool(match.group(1))
match = re.match(r"#? *expected-result *= *\"(\w+)\"", line)
if match:
config_dict["expected_result"] = match.group(1)
match = re.match("description *= *\"(.*)\"", line)
match = re.match(r"description *= *\"(.*)\"", line)
if match:
config_dict["description"] = match.group(1)
match = re.match("network *= *(.*)", line)
match = re.match(r"network *= *(.*)", line)
if match:
config_dict["network"] = match.group(1)
match = re.match("sim-time-limit *= *(.*)", line)
match = re.match(r"sim-time-limit *= *(.*)", line)
if match:
config_dict["sim_time_limit"] = match.group(1)
general_config_dict = config_dicts["General"]
Expand All @@ -119,15 +123,17 @@ def create_config_dict(config):
raise Exception("Cannot determine number of runs")
sim_time_limit = get_sim_time_limit(config_dicts, config)
description = config_dict["description"]
description_abstract = (re.search("\((a|A)bstract\)", description) is not None) if description else False
description_abstract = (re.search(r"\((a|A)bstract\)", description) is not None) if description else False
abstract = (config_dict["network"] is None and config_dict["config"] == "General") or config_dict["abstract_config"] or description_abstract
emulation = config_dict["emulation"] or general_config_dict["emulation"]
expected_result = config_dict["expected_result"]
user_interface = config_dict["user_interface"] or general_config_dict["user_interface"]
simulation_config = SimulationConfig(simulation_project, os.path.relpath(working_directory, simulation_project.get_full_path(".")), ini_file=ini_file, config=config, sim_time_limit=sim_time_limit, num_runs=num_runs, abstract=abstract, expected_result=expected_result, user_interface=user_interface, description=description)
simulation_config = SimulationConfig(simulation_project, os.path.relpath(working_directory, simulation_project.get_full_path(".")), ini_file=ini_file, config=config, sim_time_limit=sim_time_limit, num_runs=num_runs, abstract=abstract, emulation=emulation, expected_result=expected_result, user_interface=user_interface, description=description)
simulation_configs.append(simulation_config)
return simulation_configs

def collect_all_simulation_configs(simulation_project, ini_path_globs, concurrent=True, **kwargs):
build_project(simulation_project=simulation_project, mode="release")
logger.info("Collecting all simulation configs started")
ini_paths = list(itertools.chain.from_iterable(map(lambda g: glob.glob(g, recursive=True), ini_path_globs)))
if concurrent:
Expand Down
Loading