Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
P
PHY571 Birds flocking
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Quentin LOUIS
PHY571 Birds flocking
Commits
29853b3c
Commit
29853b3c
authored
Nov 26, 2018
by
Quentin LOUIS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Modified multiple machine script
parent
f9fa10f1
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
32 deletions
+34
-32
Amaury/God/SaveAndLoad.py
Amaury/God/SaveAndLoad.py
+1
-1
Amaury/experiments.py
Amaury/experiments.py
+28
-29
Amaury/remote.py
Amaury/remote.py
+5
-2
No files found.
Amaury/God/SaveAndLoad.py
View file @
29853b3c
...
...
@@ -13,7 +13,7 @@ from God.Sky import Sky
# init dropbox
try
:
dbx
=
dropbox
.
Dropbox
(
'
token ici
'
)
dbx
=
dropbox
.
Dropbox
(
'
WBOMqrQ2sMAAAAAAAAAA0YgSejHTbbc1ZnZRdZfFDoKd3TqQD7U8lVVTHHLi4GcO
'
)
dbx
.
users_get_current_account
()
except
:
print
(
"Dropbox loading failed"
)
...
...
Amaury/experiments.py
View file @
29853b3c
...
...
@@ -44,49 +44,48 @@ def launch_two_groups(output_file: str, L: float, n_birds_1: int, n_birds_2: int
Life
.
simulate
(
physics
,
dt
,
total_time
,
verbose_prop
=
.
1
,
output_file
=
output_file
)
def
start_experiment
(
output_name
:
str
,
L
:
float
,
n_birds
:
int
,
eta
:
float
=
.
5
,
total_time
:
float
=
100
)
->
None
:
launch_simulation_random
(
f"simulation_data/
{
output_name
}
.json"
,
L
=
L
,
n_birds
=
n_birds
,
eta
=
eta
,
total_time
=
total_time
)
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
(
"simulation_data/test-machine.json"
,
"processing_data/test-machine"
,
verbose_prop
=
.
1
,
to_process
=
to_process
,
options
=
{
"correlations_stochastic_points"
:
5000
})
to_draw
=
[
"avg_speed"
,
"avg_angle"
,
"avg_polar"
,
"angle_pdf"
,
"correlations"
,
"correlations_fit"
,
"correlation_length"
,
"group_size"
,
"group_size_avg"
,
"group_size_avg_fit"
,
"group_dimension"
,
"group_dimension_avg"
,
"quiver"
,
"evolution_group_size"
]
Visualiser
(
"processing_data/test-machine"
,
"visualisations/test-machine.mp4"
,
simulation_data_file
=
"simulation_data/test-machine.json"
,
verbose_prop
=
.
1
,
to_draw
=
to_draw
,
options
=
{
"quiver_color_by_group"
:
True
,
"quiver_draw_by_group"
:
True
,
"quiver_color_single"
:
True
,
"max_group_size"
:
5000
,
"max_num_groups"
:
50000
}).
vizualize
()
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
:
for
i
in
range
(
nb_experiments
):
name
=
"N_"
+
str
(
n_birds
)
+
"_L_"
+
str
(
L
)
+
"_Eta_"
+
str
(
eta
)
+
"_angle_vel_"
+
"pi"
+
"_T_"
+
str
(
total_time
)
\
+
"_vel_"
+
str
(
vel
)
+
"_nb_exp_"
+
str
(
nb_experiments
)
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
=
[
"0000.000.000.00"
]
login
,
passw
=
""
,
""
addresses
=
[
"ablette, anchois, anguille, barbeau, barbue, baudroie, brochet, carrelet, gardon, gymnote, labre, "
"lieu, lotte, mulet, murene, piranha, raie, requin, "
"rouget, roussette, saumon, silure, sole, thon, truite"
]
login
,
passw
=
"quentin.louis"
,
"Ri6elM1/1"
Ns
=
[
10
,
100
]
t
s
=
[
10
,
15
]
l
=
10
l
s
=
[
10
,
15
]
t
=
10
eta
=
.
5
file
=
"test"
vel
=
0.1
nb_exp
=
1
current_server
=
-
1
for
n
in
Ns
:
for
t
in
t
s
:
for
l
in
l
s
:
current_server
+=
1
current_server_ip
=
addresses
[
current_server
%
len
(
addresses
)]
ssh
=
paramiko
.
SSHClient
()
ssh
.
connect
(
current_server_ip
,
username
=
login
,
password
=
passw
)
ssh_stdin
,
ssh_stdout
,
ssh_stderr
=
ssh
.
exec_command
(
f"./python3.6 remote.py --n
{
n
}
--l
{
l
}
--eta
{
eta
}
--t
{
t
}
"
)
f"./phy571-birds-flocking/venv/bin/python3.6 remote.py --file
{
file
}
--n
{
n
}
--l
{
l
}
--eta
{
eta
}
"
f"--t
{
t
}
--nb_exp
{
nb_exp
}
--vel
{
vel
}
"
)
log
.
info
(
f"server:
{
current_server_ip
}
, stdin:
{
ssh_stdin
}
, stdout:
{
ssh_stdout
}
, stderr:
{
ssh_stderr
}
"
)
...
...
Amaury/remote.py
View file @
29853b3c
...
...
@@ -10,14 +10,17 @@ log.setLevel(logging.INFO)
@
click
.
command
()
@
click
.
option
(
'--file'
,
help
=
"output_dir"
,
type
=
str
)
@
click
.
option
(
'--n'
,
help
=
"number of birds"
,
type
=
int
)
@
click
.
option
(
'--l'
,
help
=
"size of sky"
,
type
=
float
)
@
click
.
option
(
'--eta'
,
help
=
"noise"
,
type
=
float
)
@
click
.
option
(
'--t'
,
help
=
"simulation time"
,
type
=
float
)
def
main
(
n
,
l
,
eta
,
t
):
@
click
.
option
(
'--nb_exp'
,
help
=
"number of experiments"
,
type
=
int
)
@
click
.
option
(
'--vel'
,
help
=
"velocity"
,
type
=
float
)
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
(
name
,
l
,
n
,
eta
,
t
)
start_experiment
(
file
,
l
,
n
,
eta
,
t
,
nb_exp
,
vel
)
if
__name__
==
"__main__"
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment