Added handling of new simulation parameters: emitters_fraction and dist_type to the Starlark script

This commit is contained in:
Jordi Arranz 2023-01-05 15:28:46 +00:00
parent b3bf5e5d1a
commit 055648cbad
1 changed files with 10 additions and 2 deletions

View File

@ -4,9 +4,9 @@ system_variables = import_module("github.com/logos-co/wakurtosis/src/system_vari
# Module Imports
files = import_module(system_variables.FILE_HELPERS_MODULE)
def create_wsl_config(simulation_time=300, message_rate=50, min_packet_size=1, max_packet_size=1024):
def create_wsl_config(simulation_time=300, message_rate=50, min_packet_size=1, max_packet_size=1024, dist_type='uniform', emitters_fraction=0.5):
template_data = {"simulation_time": simulation_time, "message_rate" : message_rate, "min_packet_size" : min_packet_size, "max_packet_size" : max_packet_size}
template_data = {"simulation_time": simulation_time, "message_rate" : message_rate, "min_packet_size" : min_packet_size, "max_packet_size" : max_packet_size, "dist_type" : dist_type, "emitters_fraction" : emitters_fraction}
# Traffic simulation parameters
wsl_yml_template = """
@ -27,6 +27,14 @@ def create_wsl_config(simulation_time=300, message_rate=50, min_packet_size=1, m
# Packet size in bytes
min_packet_size : {{.min_packet_size}}
max_packet_size : {{.max_packet_size}}
# Packe size distribution
# Values: uniform and gaussian
dist_type : {{.dist_type}}
# Fraction (of the total number of nodes) that inject traffic
# Values: [0., 1.]
emitters_fraction : {{.emitters_fraction}}
"""
artifact_id = render_templates(