You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To implement the Python class that perform the fluid simulation for wind and current. See this confluence page for more details.
Description
Refer to the FluidGenerator class, found in boat_simulator/nodes/physics_engine/fluid_generation.py, which you will use to implement this issue.
The class named FluidGenerator has the following properties:
Class Attributes:
generator is the random number generator used to generate the fluid velocity. Take a look at the VectorGenerator and MVGaussianGenerator generator classes in boat_simulator/common/generators.py.
velocity is a 2D numpy array representing the fluid velocity.
Class Methods
FluidGenerator is a constructor that accepts the random number generator as an argument.
next is a function that accepts no arguments and updates the fluid simulator by generating the next velocity vector.
velocity is a property function that returns the most recently generated velocity vector.
speed is a property function that returns the fluid's speed derived from the velocity (magnitude).
direction is a property function that returns the direction of the fluid velocity, following the [-180, 180) convention. Use the bound_to_180 function from boat_simulator/common/utils.py.
Tests
Add your unit tests to tests/unit/nodes/physics_engine/. You will use the pytest API for testing, which is already installed.
Once complete, make a pull request to the main branch.
Purpose
To implement the Python class that perform the fluid simulation for wind and current. See this confluence page for more details.
Description
Refer to the
FluidGenerator
class, found inboat_simulator/nodes/physics_engine/fluid_generation.py
, which you will use to implement this issue.The class named
FluidGenerator
has the following properties:generator
is the random number generator used to generate the fluid velocity. Take a look at theVectorGenerator
andMVGaussianGenerator
generator classes inboat_simulator/common/generators.py
.velocity
is a 2D numpy array representing the fluid velocity.FluidGenerator
is a constructor that accepts the random number generator as an argument.next
is a function that accepts no arguments and updates the fluid simulator by generating the next velocity vector.velocity
is a property function that returns the most recently generated velocity vector.speed
is a property function that returns the fluid's speed derived from the velocity (magnitude).direction
is a property function that returns the direction of the fluid velocity, following the[-180, 180)
convention. Use thebound_to_180
function fromboat_simulator/common/utils.py
.Tests
Add your unit tests to
tests/unit/nodes/physics_engine/
. You will use the pytest API for testing, which is already installed.Once complete, make a pull request to the main branch.
Resources
The text was updated successfully, but these errors were encountered: