AA007: Change FindRoute() To Keep Scanning Until Max Moves
===========================================================
Description
The RoutePlanner class is designed to plan the most efficient route for a robot to traverse a grid of cells. However, the current implementation of the findRoute()
method stops scanning once the target threshold is reached. This change proposal aims to modify the findRoute()
method to continue scanning until the user-defined move limit is hit, providing users with more flexibility and insights into their coverage.
Priority
Medium
User Story
As a user, I want to see how much coverage I can achieve based on my specified move limit.
Acceptance Criteria
The RoutePlanner will continue running until 100% of traversable Cells are scanned or the move limit is hit.
Background
The current implementation of the RoutePlanner class has a limitation where it stops scanning once the target threshold is reached. This can be restrictive for users who want to explore their coverage beyond the initial threshold. By modifying the findRoute()
method to continue scanning until the move limit is hit, we can provide users with more flexibility and insights into their coverage.
Proposed Changes
To implement this change, we need to add a private member variable to the RoutePlanner class to store the user-defined move limit. This variable will be used to track the number of moves made by the robot. The findRoute()
method will be modified to continue scanning until the move limit is hit or 100% of traversable Cells are scanned.
Add Move Limit Member Variable
private int moveLimit;
Modify findRoute() Method
public void findRoute() {
// Initialize move counter
int moveCount = 0;
// Continue scanning until move limit is hit or 100% of traversable Cells are scanned
while (moveCount < moveLimit && !isScanned()) {
// Perform route planning and scanning
planRoute();
scanCells();
// Increment move counter
moveCount++;
}
}
Add isScanned() Method
public boolean isScanned() {
// Check if 100% of traversable Cells are scanned
return getScannedCells() == getTraversableCells();
}
Add getScannedCells() and getTraversableCells() Methods
public int getScannedCells() {
// Return the number of scanned Cells
return scannedCells;
}
public int getTraversableCells() {
// Return the total number of traversable Cells
return traversableCells;
}
Benefits
This change will provide users with more flexibility and insights into their coverage. By continuing to scan until the move limit is hit or 100% of traversable Cells are scanned, users can gain a better understanding of their coverage and make more informed decisions.
Assumptions and Dependencies
This change proposal assumes that the planRoute()
and scanCells()
methods will be modified to accommodate the new move limit variable. Additionally, this change proposal depends on the completion of BA003, which will add the move limit variable to the RoutePlanner class.
Risks and Mitigation
The main risk associated with this change is that it may introduce performance issues if the move limit is set too high. To mitigate this risk, we can implement a mechanism to limit the number of moves made by the robot, such as introducing a timeout or a maximum number of moves per iteration.
Conclusion
This change proposal aims to modify the findRoute()
method to continue scanning until the user-defined move limit is hit, providing users with more flexibility and insights into their coverage. By adding a private member variable to store the move limit and modifying the findRoute()
method to continue scanning until the move limit is hit or 100% of traversable Cells are scanned, we can provide users with a more comprehensive understanding of their coverage.
Future Work
Future work will focus on implementing the planRoute()
and scanCells()
methods to accommodate the new move limit variable. Additionally, we will need to implement a mechanism to limit the number of moves made by the robot to mitigate performance issues.
References
- BA003 - Add move limit variable to RoutePlanner class
- RoutePlanner Class Documentation - RoutePlanner class documentation
===========================================================
Q: What is the purpose of this change proposal?
A: The purpose of this change proposal is to modify the findRoute()
method to continue scanning until the user-defined move limit is hit, providing users with more flexibility and insights into their coverage.
Q: Why is this change necessary?
A: This change is necessary because the current implementation of the findRoute()
method stops scanning once the target threshold is reached. This can be restrictive for users who want to explore their coverage beyond the initial threshold.
Q: What are the benefits of this change?
A: The benefits of this change include:
- Providing users with more flexibility and insights into their coverage
- Allowing users to explore their coverage beyond the initial threshold
- Enabling users to make more informed decisions based on their coverage
Q: How will this change be implemented?
A: This change will be implemented by adding a private member variable to the RoutePlanner class to store the user-defined move limit. The findRoute()
method will be modified to continue scanning until the move limit is hit or 100% of traversable Cells are scanned.
Q: What are the risks associated with this change?
A: The main risk associated with this change is that it may introduce performance issues if the move limit is set too high. To mitigate this risk, we can implement a mechanism to limit the number of moves made by the robot, such as introducing a timeout or a maximum number of moves per iteration.
Q: What is the relationship between this change and BA003?
A: This change proposal depends on the completion of BA003, which will add the move limit variable to the RoutePlanner class.
Q: What are the next steps for this change proposal?
A: The next steps for this change proposal include:
- Implementing the
planRoute()
andscanCells()
methods to accommodate the new move limit variable - Implementing a mechanism to limit the number of moves made by the robot to mitigate performance issues
- Reviewing and testing the modified
findRoute()
method to ensure it meets the requirements
Q: What are the potential implications of this change on the RoutePlanner class?
A: The potential implications of this change on the RoutePlanner class include:
- Increased complexity of the
findRoute()
method - Potential performance issues if the move limit is set too high
- Need for additional testing and validation to ensure the modified
findRoute()
method meets the requirements
Q: How will this change be tested and validated?
A: This change will be tested and validated through a combination of unit tests, integration tests, and manual testing. The modified findRoute()
method will be reviewed and tested to ensure it meets the requirements and does not introduce any performance issues.
Q: What is the expected timeline for this change proposal?
A: The expected timeline for this change proposal is dependent on the completion of BA003 and the implementation of the planRoute()
and scanCells()
methods. Once these tasks are completed, the modified findRoute()
method will be reviewed and tested, and the change will be deployed to production.
Q: Who is responsible for implementing this change proposal?
A: The implementation of this change proposal is the responsibility of the development team. The development team will work together to implement the planRoute()
and scanCells()
methods, implement a mechanism to limit the number of moves made by the robot, and review and test the modified findRoute()
method.
Q: What is the expected outcome of this change proposal?
A: The expected outcome of this change proposal is to provide users with more flexibility and insights into their coverage, allowing them to explore their coverage beyond the initial threshold and make more informed decisions based on their coverage.