Commit c2ba8270 authored by Amaury BARRAL's avatar Amaury BARRAL

Update README.md

parent eaa2931f
......@@ -17,13 +17,66 @@ Python libraries:
* matplotlib, cmocean (visualisation)
* paramiko (launch simulations over ssh)
* dropbox (online data load/saving)
* click (command-line interaction)
External executable in path:
* ffmpeg (visualisation & animation)
## How to use
All the relevant code is in the _Amaury_ directory.
### Run an experiment locally
In experiments.py, this is the typical code to run, process and visualize an experiment:
```python
launch_simulation_random("simulation_data/test.json", L=100, n_birds=10000, eta=.1, total_time=1000)
to_process = ["avg_speed", "avg_angle"]
process_options = {"correlations_stochastic_points": 5000}
Processor().process("simulation_data/test.json", "processing_data/test", verbose_prop=.1, to_process=to_process, options=process_options)
to_draw = ["quiver", "avg_speed", "avg_angle", "avg_polar", "angle_pdf"]
draw_options = {"max_num_groups": 1000, "max_group_size": 800}
Visualiser("processing_data/test", "visualisations/test.mp4", to_draw, "simulation_data/test.json", options=draw_options).vizualize()
```
Here's how it breaks down:
```python
launch_simulation_random("simulation_data/test.json", L=100, n_birds=10000, eta=.1, total_time=1000)
```
This launches a simulation with the given parameters (L=size of space, n_birds=# of birds, eta=temperature, total_time = total time of the simulation, look at the docstrings for other parameters) and saves it in the local path _simulation_data/test.json_.
```python
to_process = ["avg_speed", "avg_angle"]
process_options = {"correlations_stochastic_points": 5000}
Processor().process("simulation_data/test.json", "processing_data/test", verbose_prop=.1, to_process=to_process, options=process_options)
```
This processes the features _"avg_speed", "avg_angle"_ from simulation _simulation_data/test.json_ and stores the results the folder _processing_data/test_.
The available features are "avg_speed", "avg_angle", "group_size", "group_size_avg", "group_size_avg_fit", "groups",
"correlations", "correlations_fit", "group_to_size", "group_hulls"
The available options are "correlations_stochastic_points", "correlations_fit_spatial_points", "group_fit_max_size", detailed in the docstring
```python
to_draw = ["quiver", "avg_speed", "avg_angle", "avg_polar", "angle_pdf"]
draw_options = {"max_num_groups": 1000, "max_group_size": 800}
Visualiser("processing_data/test", "visualisations/test.mp4", to_draw, "simulation_data/test.json", options=draw_options).vizualize()
```
This draws the features _"quiver", "avg_speed", "avg_angle", "avg_polar", "angle_pdf"_ from simulation _simulation_data/test.json_ and processed data folder _processing_data/test_, and stored the resoluting animation in _visualisations/test.mp4_.
The available features are "quiver", "avg_speed", "avg_angle", "avg_polar", "angle_pdf", "correlations", "correlations_fit", "correlations_length",
"group_size", "group_size_avg", "group_size_avg_fit", "group_dimension", "group_dimension_avg", "group_dimension_avg_fit", "evolution_group_size"
The available options are "max_group_size", "max_num_groups", "quiver_color_by_group", "quiver_color_single", "quiver_draw_by_group", "groups_num_ymin", "vel_scaling", detailed in the docstring
### Run an experiment remotely (SSH)
You can easily run experiments on any number of machines via SSH (for this purpose enabling loading/saving via Dropbox is particularly useful)
First of all, in _experiments.py_'s, modify _start_experiment_ so that it launches the experiment you want on the remote host given the function's parameters.
## Contributing
......
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