Skip to content

Commit

Permalink
Merge pull request #69 from srajan-kiyotaka/hpx
Browse files Browse the repository at this point in the history
minor fixes !
  • Loading branch information
srajan-kiyotaka authored Jun 26, 2024
2 parents ca3febf + bfeac7a commit 3ccc758
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 13 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ TraverseCraft currently supports the creation and simulation of three distinct w

| World Type | Description |
|-------------|---------------------------------------------------------------------------------------|
| Grid World | A structured grid layout where agents can navigate based on grid coordinates. |
| Tree World | A hierarchical tree structure, perfect for visualizing tree traversal algorithms. |
| Graph World | A versatile graph structure allowing for complex network simulations and algorithm testing. |
| Grid World |A customizable simulation of a grid environment for testing algorithms and agent navigation, with options for path, goal, and block states to mimic various grid scenarios. |
| Tree World | A visualized tree data structure, perfect for experimenting with various tree-based algorithms. It offers customizable weights, positions, and appearance for flexible and detailed tree like simulations.  |
| Graph World | A visualized graph data structure, perfect for experimenting with various graph-based algorithms. It offers customizable weights, edges, positions, and appearance for flexible and detailed graph like simulations.  |

Each world type is equipped with specialized agents designed to interact within these environments, enabling comprehensive testing and visualization of algorithms. For more information about each class and methods please refer to [API Reference](https://harrionparrix.github.io/traversecraft/references/world/World.html) section.

Expand Down
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 3ccc758

Please sign in to comment.