Skip to content

Commit

Permalink
minor fixes !
Browse files Browse the repository at this point in the history
  • Loading branch information
harrionparrix committed Jun 26, 2024
1 parent 9fcb6c8 commit f98580a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 10 deletions.
29 changes: 20 additions & 9 deletions docs/gridAgent.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +46,25 @@ Sets the start state of the agent to the specified position (i, j) on the grid w

Sets the callback function for the agent's algorithm.

### `runAlgorithm()`
### `checkGoalState(i: int, j: int)`

Executes the callback function set by `setAlgorithmCallBack()`. Raises `ValueError` if the callback function is not set.
Checks if the specified position (i, j) on the grid world is a goal state.

### `getHeatMapColor(value: float)`
- Args:
- `i` (int): The row index of the target position.
- `j` (int): The column index of the target position.
- Returns:
- `bool`: True if the position is a goal state, False otherwise.

Maps a numeric value to a color on the heat map.
### `checkBlockState(i: int, j: int)`

- Args:
- `value` (float): The value to be mapped.
Checks if the specified position (i, j) on the grid world is a block state.

- Args:
- `i` (int): The row index of the target position.
- `j` (int): The column index of the target position.
- Returns:
- `str`: The RGB color string representing the mapped value on the heat map.
- `bool`: True if the position is a block state, False otherwise.

### `moveAgent(i: int, j: int, delay: float=0.5)`

Expand All @@ -77,8 +83,13 @@ Moves the agent to the specified position (i, j) on the grid world.
These methods are not intended to be directly called by users but support the functionality of the class:

- `_warmerColor(color: str, sValue: float)`: Generates a warmer color from the given color based on saturation value.
- `checkGoalState(i: int, j: int)`: Checks if the specified position (i, j) on the grid world is a goal state.
- `checkBlockState(i: int, j: int)`: Checks if the specified position (i, j) on the grid world is blocked or empty.
- `runAlgorithm()`: Executes the callback function set by `setAlgorithmCallBack()`. Raises `ValueError` if the callback function is not set.

- `getHeatMapColor(value: float)`: Maps a numeric value to a color on the heat map.
- Args:
- `value` (float): The value to be mapped.
- Returns:
- `str`: The RGB color string representing the mapped value on the heat map.


## Usage
Expand Down
2 changes: 1 addition & 1 deletion docs/gridWorld.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Class representing the world created using grids.
- `worldName` (`str`): The name of the world.
- `rows` (`int`): The number of rows in the world (between 1 and 1000).
- `cols` (`int`): The number of columns in the world (between 1 and 1000).
- `cellSize` (`int`, optional): Size of each cell in pixels (default: 10, between 10 and 50).
- `cellSize` (`int`, optional): Size of each cell in pixels (default: 20, between 10 and 50).
- `pathColor` (`str`, optional): Color of path cells (default: "gray").
- `blockColor` (`str`, optional): Color of block cells (default: "red").
- `goalColor` (`str`, optional): Color of goal cells (default: "green").
Expand Down

0 comments on commit f98580a

Please sign in to comment.