Commit a17fa86a authored by Ahmad Reza's avatar Ahmad Reza
Browse files

The random seed is moved from world.py to swarm-sim.py, because the simulator...

The random seed is moved from world.py to swarm-sim.py, because the simulator is responsible for the randomness.
parent 5feb3c11
......@@ -26,7 +26,6 @@ class World:
:param seed: the seed number it is only used here for the csv file
:param max_particles: the maximal number of particles that are allowed to be or created in this world
"""
random.seed(config_data.seed_value)
self.__round_counter = 1
self.__end = False
......
......@@ -5,6 +5,7 @@ import logging
import os
import sys
import time
import random
from lib import world, config
from lib.gnuplot_generator import gnuplot_generator
......@@ -22,11 +23,15 @@ def swarm_sim(argv):
create_dir_for_data(config_data)
random.seed(config_data.seed_value)
swarm_sim_world = world.World(config_data)
while swarm_sim_world.get_actual_round() <= config_data.max_round and swarm_sim_world.get_end() is False:
round_start_timestamp = time.perf_counter()
run_solution(swarm_sim_world)
if config_data.visualization:
swarm_sim_world.window.draw_world(round_start_timestamp)
if swarm_sim_world.window.window_active is False:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment