1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/examples/pendulum-simulation
2023-05-11 18:28:49 +10:00
..
modules/sim checker: only allow &u8 with byteptr and itself (#18146) 2023-05-11 18:28:49 +10:00
.gitignore examples: improve the pendulum simulation, with several modes and diagrams (#13446) 2022-02-12 19:38:07 +02:00
animation.v fmt: replace go with spawn 2022-11-05 10:46:40 +03:00
full.v fmt: replace go with spawn 2022-11-05 10:46:40 +03:00
LICENSE examples: improve the pendulum simulation, with several modes and diagrams (#13446) 2022-02-12 19:38:07 +02:00
parallel_with_iw.v fmt: replace go with spawn 2022-11-05 10:46:40 +03:00
parallel.v fmt: replace go with spawn 2022-11-05 10:46:40 +03:00
README.md examples: improve the pendulum simulation, with several modes and diagrams (#13446) 2022-02-12 19:38:07 +02:00
sequential.v all: change optional to result of io (#16075) 2022-10-16 09:28:57 +03:00

Pendulum Simulation in V

You can see the origin implementation among with some benchmarks at ulises-jeremias/v-pendulum-simulation.

vlang.io | Docs | Contributing

Build Status Docs Validation License: MIT

Run the Simulations

Sequential Simulation

$ v -gc boehm -prod sequential.v
$ ./sequential # execute ./sequential -h for more info

Parallel Simulation

$ v -gc boehm -prod parallel.v
$ ./parallel # execute ./parallel -h for more info

image

Parallel Simulation with Image Worker

$ v -gc boehm -prod parallel_with_iw.v
$ ./parallel_with_iw # execute ./parallel_with_iw -h for more info

image

Parallel Simulation with Graphic User Interface

$ v -gc boehm -prod animation.v
$ ./animation # execute ./animation -h for more info

Full Parallel Simulation with Graphic User Interface and Image Output

$ v -gc boehm -prod full.v
$ ./full # execute ./full -h for more info

Testing

To test the module, just type the following command:

$ v test .

Benchmark

Check the original repository for tools to run benchmark tests. In there you can execute the following command to execute benchmark tests to get a full comparison between implementations:

$ ./bin/run-benchmark-test --help

image