python3 -mpip install git+git://github.com/N-BodyPhysicsSimulator/Main.git
python3 -m nbp
- Fork the project.
- Write tests (TDD if possible [1 NL] [1 EN]) and write code.
- Commit [1] [2] [3] (READ THOSE THREE LINKS, please) and push it to your forked repository.
- Do a pull request. [1] [2] [3]
- You will receive a code review soon.
- If quality of code is high enough and Code Coverage is higher than before [1] [2], code will be merged. Otherwise: go to step 7.
- After we wrote a code review, you could improve your code according to our suggestions. Please, improve your code.
- Go to step 4.
For running the simulator, Python 3.5.x
or higher is required.
Not tested on Mac OS X
/macOS
or Microsoft Windows
.
- Run
make install-requirements-app
- Run tests and make sure there aren't any failing tests.
- Install bats
- Run
make install-requirements-dev
- Run
make test
- There are a few Input Providers, such as
csv
orjson
which you can use to import BodyStates (note: thecsv
Input Provider only imports one state. This is a required argument. - There are as well Output Writers, to do something with the input. Like the
ws
,http
andcsv
Output Writer. Required option. - Delta Time is a required option as well. This is the change of time between two states.
For example: run python3 -m nbp
usage: nbp [-h] --inputprovider ip --outputwriter outputwriter
[outputwriter ...] --delta-time seconds
[--modifier [modifiers [modifiers ...]]]
[--max-ticks ticks | --max-time seconds]
nbp: error: the following arguments are required: --inputprovider/-i, --outputwriter/-o, --delta-time/-dt
max-ticks
is used to exit the simulator after a specific amount of ticksmax-time
is used to exit the simulator after a specific amount of time (seedelta-time
)modifier
is used to modify data from the Input Provider before passing it to the Output Writers. You could usecalculation
to calculate new data.
You could run python3 -m nbp --inputprovider json -o ws -dt 10
[...]
nbp: error: the following arguments are required: --input-file, --ws-port
The json
Input Provider requires parameter --input-file
with a path to the JSON file and the ws
Output Writer requires --ws-port
with a port for the WebSocket server to 1listen on.
Let's run python3 -m nbp --inputprovider json -o ws -dt 10 --input-file /home/<user>/input.json --ws-port 8080
The simulator will now load the states from the JSON-file, but it won't calculate anything at all. We can use --modifier
to make it calculate data.
Run command python3 -m nbp --inputprovider json -o ws -dt 10 --input-file /home/<user>/input.json --ws-port 8080 --modifier calculation --max-ticks 10000
The simulator will now import the states from the JSON-file, and it output all states from the JSON-file to the OutputWriters. On the last state, the CalculationModifier will start to calculate. Simulator will quit after 10000 states because of the --max-ticks
option.
You can use multiple OutputWriters at once: python3 -m nbp --inputprovider json --outputwriter json csv ws -dt 10 --input-file /home/<user>/input.json --json-output-file /home/<user>/output.json --csv-output-path /home/<user>/csv-output --ws-port 8080
- 100% code coverage
- Reading and writing results to a .CSV-file
Excel-file (Excel will be used because of the possibility of multiple sheets/tabs. A different program will be created to export Pickle-�files to Excel files.) - Reading start-values of bodies from JSON
orand CSV - Reading and writing data from a file (JSON)
- Import and export from/to Pickle with Base64
- Optimizing code for CPU (use of async-code, multiple threads?)
- Optimizing code for GPU. GPU's are really good in doing many simple functions. (We could use ArrayFire, OpenCL or CUDA)
- The possibility to theoretically calculate infinite bodies
- Changing the delta time (change in time) based on the distance of bodies to eachother
- Spaceship: a body with the possibility to change speed depending on commands
- Showing the data of the simulator on xy-, yz- and xz-diagrams (2D)
- Changeable virtual time
- Determining the middle of the display
- Showing the data of the simulator in three dimensions (xyz, 3D)