mirror of
https://github.com/logos-blockchain/logos-blockchain-simulations.git
synced 2026-01-19 21:43:12 +00:00
Targeted experiments for queuing mechanism gather series into dataframe put exp_id to the CSV path revert iterations back to num_nodes/2 add missing print and decrease msg_interval_sec change param sequence for readability use struct instead of pickle for fixed-size & faster serde include dtime series into dataframe optimize: choose optimized connection type according to latency setting add skip_sending_noise option optimize filling up the queue with noises move queue_type to the end of param set, and build CSV gradually row by row fix: consider num_senders when waiting until all messages are disseminated fix: sample senders without duplicate fix: build param combinations correctly add plot script initialize MinSizeMixQueue with noises define SessionParameterSet and add paramset for session2 improve topology connectivity check to avoid "maxmimum recursions depth exceeded" error fix: the correct parameter set constructor store individual series to separate CSV files reorganize files and draw plot automatically start series file id from 1 (not 0) add queue_type CLI argument for parallelization pretty format of elapsed time pretty format of elapsed time add merge CLI and draw multiple plots split functions do not draw plot for each session use concurrent.futures to utilize multiprocessing add from_paramset argument fix: count num of finished iterations correctly draw plots for num_sent_msgs and num_senders for specific experiments
40 lines
1.2 KiB
Python
40 lines
1.2 KiB
Python
import argparse
|
|
|
|
from protocol.temporalmix import TemporalMixType
|
|
from queuesim.paramset import ExperimentID, SessionID
|
|
from queuesim.queuesim import run_session
|
|
|
|
if __name__ == "__main__":
|
|
parser = argparse.ArgumentParser(
|
|
description="Measure the message dissemination time with various configurations.",
|
|
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
|
|
)
|
|
parser.add_argument("--exp-id", type=int, required=True, help="Experiment ID (>=1)")
|
|
parser.add_argument(
|
|
"--session-id", type=int, required=True, help="Session ID (>=1)"
|
|
)
|
|
parser.add_argument(
|
|
"--queue-type",
|
|
type=str,
|
|
required=True,
|
|
help=f"Queue type: {' | '.join([t.value for t in TemporalMixType])}",
|
|
)
|
|
parser.add_argument("--outdir", type=str, required=True, help="output directory")
|
|
parser.add_argument(
|
|
"--from-paramset",
|
|
type=int,
|
|
required=False,
|
|
default=1,
|
|
help="A parameter set ID (>=1) to start from",
|
|
)
|
|
args = parser.parse_args()
|
|
|
|
run_session(
|
|
ExperimentID(args.exp_id),
|
|
SessionID(args.session_id),
|
|
TemporalMixType(args.queue_type),
|
|
args.outdir,
|
|
args.from_paramset,
|
|
)
|
|
print("All simulations completed!")
|