Commit 6ca44051 authored by Quentin LOUIS's avatar Quentin LOUIS

m

parent 411cc3b8
......@@ -45,28 +45,29 @@ def launch_two_groups(output_file: str, L: float, n_birds_1: int, n_birds_2: int
def start_experiment(output_dir: str, L: float, n_birds: int, eta: float = .5, total_time:
float = 100, nb_experiments: int = 1, vel: float = 0.1) -> None:
subdir = ""
if nb_experiments > 1:
subdir = "N_" + str(n_birds) + "_L_" + str(L) + "_Eta_" + str(eta)
for i in range(nb_experiments):
name = subdir + "N_" + str(n_birds) + "_L_" + str(L) + "_Eta_" + str(eta) + "_angle_vel_" + "pi" + "_T_" + str(total_time) \
+ "_vel_" + str(vel) + "_nb_exp_" + str(i+1)
launch_simulation_random("phy571/simulation_data/" + output_dir + "/" + name + ".json", L=L, n_birds=n_birds, eta=eta,
total_time=total_time, ang_vel= 2*np.pi)
to_process = ["avg_speed", "avg_angle", "group_size", "group_size_avg", "group_size_avg_fit", "groups",
"correlations",
"correlations_fit", "group_to_size", "group_hulls"]
Processor().process("phy571/simulation_data/" + output_dir + "/" + name + ".json", "phy571/processing_data/" +
output_dir + "/" + name, verbose_prop=.1,
to_process=to_process,
options={"correlations_stochastic_points": 5000})
float = 100, num_exp: int = 1, vel: float = 0.1) -> None:
"""subdir = ""
if nb_experiments > 1:"""
subdir = "N_" + str(n_birds) + "_L_" + str(L) + "_Eta_" + str(eta) + "/"
#for i in range(nb_experiments):
name = subdir + "N_" + str(n_birds) + "_L_" + str(L) + "_Eta_" + str(eta) + "_angle_vel_" + "pi" + "_T_" + str(total_time) \
+ "_vel_" + str(vel) + "_nb_exp_" + str(num_exp)
launch_simulation_random("phy571/simulation_data/" + output_dir + "/" + name + ".json", L=L, n_birds=n_birds, eta=eta,
total_time=total_time, ang_vel= 2*np.pi)
to_process = ["avg_speed", "avg_angle", "group_size", "group_size_avg", "group_size_avg_fit", "groups",
"correlations",
"correlations_fit", "group_to_size", "group_hulls"]
Processor().process("phy571/simulation_data/" + output_dir + "/" + name + ".json", "phy571/processing_data/" +
output_dir + "/" + name, verbose_prop=.1,
to_process=to_process,
options={"correlations_stochastic_points": 5000})
def ssh_experiments():
addresses = ['129.104.254.97', '129.104.254.98', '129.104.254.99', '129.104.254.100', '129.104.254.101',
addresses = ['129.104.254.97', '129.104.254.98']
""", '129.104.254.99', '129.104.254.100', '129.104.254.101',
'129.104.254.102', '129.104.254.103', '129.104.254.104', '129.104.254.105', '129.104.254.106',
'129.104.254.107', '129.104.254.108', '129.104.254.109', '129.104.254.110', '129.104.254.111',
'129.104.254.112', '129.104.254.113', '129.104.254.114', '129.104.254.115', '129.104.253.32',
......@@ -92,7 +93,8 @@ def ssh_experiments():
'129.104.254.80', '129.104.254.81', '129.104.254.82', '129.104.254.83', '129.104.254.84',
#'129.104.254.85',
#'129.104.254.86',
'129.104.254.86', '129.104.254.87', '129.104.254.88', '129.104.252.32',
#'129.104.254.86',
'129.104.254.87', '129.104.254.88', '129.104.252.32',
'129.104.252.33', '129.104.252.34', '129.104.252.35', '129.104.252.36', '129.104.252.37',
'129.104.252.38', '129.104.252.39', '129.104.252.40', '129.104.252.41', '129.104.252.42',
'129.104.252.43', '129.104.252.44', '129.104.252.45', '129.104.252.46', '129.104.252.47',
......@@ -102,15 +104,15 @@ def ssh_experiments():
'129.104.252.70', '129.104.252.71', '129.104.252.72', '129.104.252.73', '129.104.252.74',
'129.104.252.75', '129.104.252.76', '129.104.252.77', '129.104.252.78', '129.104.252.79',
'129.104.252.80', '129.104.252.81', '129.104.252.82', '129.104.252.83', '129.104.252.84',
'129.104.252.85','129.104.252.86', '129.104.252.87', '129.104.252.88']
login, passw =
Ns = [400]#, 1600, 3600, 10000, 40000]
Ls = [20]#, 40, 60, 100, 200]
'129.104.252.85','129.104.252.86', '129.104.252.87', '129.104.252.88']"""
login, passw = "quentin.louis", "Ri6elM1/1"
Ns = [400, 1600]#, 3600, 10000, 40000]
Ls = [20, 40]#, 60, 100, 200]
t = 10
Eta = [0.01]#, 0.05, 0.1, 0.11, 0.12, 0.13, 0.132, 0.134, 0.136, 0.138, 0.14, 0.15, 0.2, 0.25, 0.3, 0.35, 0.4, 0.45, 0.5, 0.55, 0.6, 0.65, 0.7, 0.75, 0.8]
file = "28_11_18"
file = "28_11_18_quater"
vel = 0.1
nb_exp = 2
nb_exp = 3
current_server = -1
for i in range (len(Ns)):
......@@ -126,9 +128,9 @@ def ssh_experiments():
ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command(
f"./phy571-birds-flocking/venv/bin/python3.6 ./phy571-birds-flocking/Amaury/remote.py --file {file} --n {Ns[i]} --l {Ls[i]} --eta {Eta[k]} "
f"--t {t} --nb_exp {nb_exp} --vel {vel}")
#ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command(f"pkill ./phy571-birds-flocking/venv/bin/python3.6 && pkill ./phy571-birds-flocking/venv/bin/python")
ssh_stdout, ssh_stderr = ssh_stdout.read(), ssh_stderr.read()
ssh.close()
#ssh_stdin, ssh_stdout, ssh_stderr = ssh.exec_command(f"pkill ./phy571-birds-flocking/venv/bin/python3.6 2> \&1 1> \&1")
#ssh_stdout, ssh_stderr = ssh_stdout.readlines(), ssh_stderr.readlines()
#ssh.close()
log.info(f"server: {current_server_ip}, stdin: {ssh_stdin}, stdout: {ssh_stdout}, stderr: {ssh_stderr}")
......
......@@ -20,7 +20,8 @@ log.setLevel(logging.INFO)
def main(file, n, l, eta, t, nb_exp, vel):
name = f"N_{n}_L_{l}_Eta_{eta}_T_{t}"
log.info(f"Starting remote experiment {name}")
start_experiment(file, l, n, eta, t, nb_exp, vel)
for i in range(nb_exp):
start_experiment(file, l, n, eta, t, i, vel)
if __name__ == "__main__":
......
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