Update.
[flatland.git] / README.md
1 # Introduction #
2
3 This is an implementation of a simple 2d physics simulator usable from
4 the pytorch framework.
5
6 The core provided function is
7
8 ```
9 torch.ByteTensor generate_sequence(bool pulling,
10                                    int nb_sequences,
11                                    int nb_images,
12                                    int image_height, int image_width,
13                                    int nb_shapes,
14                                    bool random_shape_size, bool random_colors) {
15 ```
16 with
17
18  * `pulling` indicating if one of the shape should be pulled upward,
19  * `nb_sequences` the number of sequences to generate
20  * `nb_images` the number of frames per sequence
21  * `image_height` an `image_width` the individual image size
22  * `nb_shapes` how many rectangular shapes to put in the simulation
23  * `random_shape_size` should they be of different size
24  * `random_colors` should they be of different colors
25
26 The returned ByteTensor has five dimensions:
27
28  * Sequence index
29  * Image index
30  * Channel (3, as for RGB)
31  * Pixel row
32  * Pixel col
33
34 Warning: For improper parameters values (e.g. too many shapes, too
35 small images), the simulation may be stuck.
36
37 # Installation and test #
38
39 ```
40 make -j -k
41 ./built.py
42 ./flatland-test.py
43 ```