|
|
|
@ -50,17 +50,17 @@ fn parse_sequential_args() !SequentialArgs {
|
|
|
|
|
fp.skip_executable()
|
|
|
|
|
|
|
|
|
|
// output parameters
|
|
|
|
|
width := fp.int('width', `w`, sim.default_width, 'width of the image output. Defaults to $sim.default_width')
|
|
|
|
|
height := fp.int('height', `h`, sim.default_height, 'height of the image output. Defaults to $sim.default_height')
|
|
|
|
|
width := fp.int('width', `w`, sim.default_width, 'width of the image output. Defaults to ${sim.default_width}')
|
|
|
|
|
height := fp.int('height', `h`, sim.default_height, 'height of the image output. Defaults to ${sim.default_height}')
|
|
|
|
|
filename := fp.string('output', `o`, 'out.ppm', 'name of the image output. Defaults to out.ppm')
|
|
|
|
|
|
|
|
|
|
// simulation parameters
|
|
|
|
|
rope_length := fp.float('rope-length', 0, sim.default_rope_length, 'rope length to use on simulation. Defaults to $sim.default_rope_length')
|
|
|
|
|
bearing_mass := fp.float('bearing-mass', 0, sim.default_bearing_mass, 'bearing mass to use on simulation. Defaults to $sim.default_bearing_mass')
|
|
|
|
|
magnet_spacing := fp.float('magnet-spacing', 0, sim.default_magnet_spacing, 'magnet spacing to use on simulation. Defaults to $sim.default_magnet_spacing')
|
|
|
|
|
magnet_height := fp.float('magnet-height', 0, sim.default_magnet_height, 'magnet height to use on simulation. Defaults to $sim.default_magnet_height')
|
|
|
|
|
magnet_strength := fp.float('magnet-strength', 0, sim.default_magnet_strength, 'magnet strength to use on simulation. Defaults to $sim.default_magnet_strength')
|
|
|
|
|
gravity := fp.float('gravity', 0, sim.default_gravity, 'gravity to use on simulation. Defaults to $sim.default_gravity')
|
|
|
|
|
rope_length := fp.float('rope-length', 0, sim.default_rope_length, 'rope length to use on simulation. Defaults to ${sim.default_rope_length}')
|
|
|
|
|
bearing_mass := fp.float('bearing-mass', 0, sim.default_bearing_mass, 'bearing mass to use on simulation. Defaults to ${sim.default_bearing_mass}')
|
|
|
|
|
magnet_spacing := fp.float('magnet-spacing', 0, sim.default_magnet_spacing, 'magnet spacing to use on simulation. Defaults to ${sim.default_magnet_spacing}')
|
|
|
|
|
magnet_height := fp.float('magnet-height', 0, sim.default_magnet_height, 'magnet height to use on simulation. Defaults to ${sim.default_magnet_height}')
|
|
|
|
|
magnet_strength := fp.float('magnet-strength', 0, sim.default_magnet_strength, 'magnet strength to use on simulation. Defaults to ${sim.default_magnet_strength}')
|
|
|
|
|
gravity := fp.float('gravity', 0, sim.default_gravity, 'gravity to use on simulation. Defaults to ${sim.default_gravity}')
|
|
|
|
|
|
|
|
|
|
fp.finalize() or {
|
|
|
|
|
println(fp.usage())
|
|
|
|
@ -87,7 +87,7 @@ fn parse_sequential_args() !SequentialArgs {
|
|
|
|
|
grid: grid
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sim.log('$args')
|
|
|
|
|
sim.log('${args}')
|
|
|
|
|
|
|
|
|
|
return args
|
|
|
|
|
}
|
|
|
|
@ -100,20 +100,20 @@ fn parse_parallel_args(extra_workers int) !ParallelArgs {
|
|
|
|
|
fp.description('This is a pendulum simulation written in pure V')
|
|
|
|
|
fp.skip_executable()
|
|
|
|
|
|
|
|
|
|
workers := fp.int('workers', 0, args.max_parallel_workers, 'amount of workers to use on simulation. Defaults to $args.max_parallel_workers')
|
|
|
|
|
workers := fp.int('workers', 0, args.max_parallel_workers, 'amount of workers to use on simulation. Defaults to ${args.max_parallel_workers}')
|
|
|
|
|
|
|
|
|
|
// output parameters
|
|
|
|
|
width := fp.int('width', `w`, sim.default_width, 'width of the image output. Defaults to $sim.default_width')
|
|
|
|
|
height := fp.int('height', `h`, sim.default_height, 'height of the image output. Defaults to $sim.default_height')
|
|
|
|
|
width := fp.int('width', `w`, sim.default_width, 'width of the image output. Defaults to ${sim.default_width}')
|
|
|
|
|
height := fp.int('height', `h`, sim.default_height, 'height of the image output. Defaults to ${sim.default_height}')
|
|
|
|
|
filename := fp.string('output', `o`, 'out.ppm', 'name of the image output. Defaults to out.ppm')
|
|
|
|
|
|
|
|
|
|
// simulation parameters
|
|
|
|
|
rope_length := fp.float('rope-length', 0, sim.default_rope_length, 'rope length to use on simulation. Defaults to $sim.default_rope_length')
|
|
|
|
|
bearing_mass := fp.float('bearing-mass', 0, sim.default_bearing_mass, 'bearing mass to use on simulation. Defaults to $sim.default_bearing_mass')
|
|
|
|
|
magnet_spacing := fp.float('magnet-spacing', 0, sim.default_magnet_spacing, 'magnet spacing to use on simulation. Defaults to $sim.default_magnet_spacing')
|
|
|
|
|
magnet_height := fp.float('magnet-height', 0, sim.default_magnet_height, 'magnet height to use on simulation. Defaults to $sim.default_magnet_height')
|
|
|
|
|
magnet_strength := fp.float('magnet-strength', 0, sim.default_magnet_strength, 'magnet strength to use on simulation. Defaults to $sim.default_magnet_strength')
|
|
|
|
|
gravity := fp.float('gravity', 0, sim.default_gravity, 'gravity to use on simulation. Defaults to $sim.default_gravity')
|
|
|
|
|
rope_length := fp.float('rope-length', 0, sim.default_rope_length, 'rope length to use on simulation. Defaults to ${sim.default_rope_length}')
|
|
|
|
|
bearing_mass := fp.float('bearing-mass', 0, sim.default_bearing_mass, 'bearing mass to use on simulation. Defaults to ${sim.default_bearing_mass}')
|
|
|
|
|
magnet_spacing := fp.float('magnet-spacing', 0, sim.default_magnet_spacing, 'magnet spacing to use on simulation. Defaults to ${sim.default_magnet_spacing}')
|
|
|
|
|
magnet_height := fp.float('magnet-height', 0, sim.default_magnet_height, 'magnet height to use on simulation. Defaults to ${sim.default_magnet_height}')
|
|
|
|
|
magnet_strength := fp.float('magnet-strength', 0, sim.default_magnet_strength, 'magnet strength to use on simulation. Defaults to ${sim.default_magnet_strength}')
|
|
|
|
|
gravity := fp.float('gravity', 0, sim.default_gravity, 'gravity to use on simulation. Defaults to ${sim.default_gravity}')
|
|
|
|
|
|
|
|
|
|
fp.finalize() or {
|
|
|
|
|
println(fp.usage())
|
|
|
|
@ -141,7 +141,7 @@ fn parse_parallel_args(extra_workers int) !ParallelArgs {
|
|
|
|
|
workers: get_workers(workers, extra_workers)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sim.log('$args')
|
|
|
|
|
sim.log('${args}')
|
|
|
|
|
|
|
|
|
|
return args
|
|
|
|
|
}
|
|
|
|
|