Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix grammar and spelling in comments rail_env py #130

Merged
merged 3 commits into from
Feb 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions flatland/envs/rail_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class RailEnv(Environment):

Every time an agent stops, an agent has a certain probability of malfunctioning. Malfunctions of trains follow a
poisson process with a certain rate. Not all trains will be affected by malfunctions during episodes to keep
complexity managable.
complexity manageable.

TODO: currently, the parameters that control the stochasticity of the environment are hard-coded in init().
For Round 2, they will be passed to the constructor as arguments, to allow for more flexibility.
Expand Down Expand Up @@ -140,7 +140,7 @@ def __init__(self,
vectors for each agent.
remove_agents_at_target : bool
If remove_agents_at_target is set to true then the agents will be removed by placing to
RailEnv.DEPOT_POSITION when the agent has reach it's target position.
RailEnv.DEPOT_POSITION when the agent has reached its target position.
random_seed : int or None
if None, then its ignored, else the random generators are seeded with this number to ensure
that stochastic operations are replicable across multiple operations
Expand Down Expand Up @@ -440,7 +440,7 @@ def preprocess_action(self, action, agent):

action = action_preprocessing.preprocess_moving_action(action, self.rail, current_position, current_direction)

# Check transitions, bounts for executing the action in the given position and directon
# Check transitions, bounts for executing the action in the given position and direction
if action.is_moving_action() and not check_valid_action(action, self.rail, current_position, current_direction):
action = RailEnvActions.STOP_MOVING

Expand Down Expand Up @@ -673,7 +673,7 @@ def get_valid_directions_on_grid(self, row: int, col: int) -> List[int]:
def _exp_distirbution_synced(self, rate: float) -> float:
"""
Generates sample from exponential distribution
We need this to guarantee synchronity between different instances with same seed.
We need this to guarantee synchronicity between different instances with the same seed.
:param rate:
:return:
"""
Expand All @@ -683,7 +683,7 @@ def _exp_distirbution_synced(self, rate: float) -> float:

def _is_agent_ok(self, agent: EnvAgent) -> bool:
"""
Check if an agent is ok, meaning it can move and is not malfuncitoinig
Checks if an agent is ok, meaning it can move and is not malfunctioning.
Parameters
----------
agent
Expand All @@ -705,7 +705,7 @@ def render(self, mode="rgb_array", gl="PGL", agent_render_variant=AgentRenderVar
show_observations=False, show_predictions=False,
show_rowcols=False, return_image=True):
"""
This methods provides the option to render the
Provides the option to render the
environment's behavior as an image or to a window.
Parameters
----------
Expand Down Expand Up @@ -763,7 +763,7 @@ def update_renderer(self, mode, show, show_observations, show_predictions,

def close(self):
"""
This methods closes any renderer window.
Closes any renderer window.
"""
if hasattr(self, "renderer") and self.renderer is not None:
try:
Expand Down