|
def | __init__ (self, theSol, thePuzzle=None) |
|
def | planGreedyTSP (self) |
|
def | planNew (self) |
|
def | planOrdered (self, occlusionList=[], STEP_WISE=True, COMPLETE_PLAN=False, verbose=False) |
|
def | setCurrBoard (self, theBoard) |
|
def | setMatch (self, match, rotation_match=None) |
|
def | takeTurn (self, thePlan=None, defaultPlan='order', occlusionList=[], STEP_WISE=True, COMPLETE_PLAN=False, SAVED_PLAN=True) |
|
def | takeTurn (self, thePlan=None) |
|
◆ __init__()
def __init__ |
( |
|
self, |
|
|
|
theSol, |
|
|
|
thePuzzle = None |
|
) |
| |
@brief Constructor for the simple puzzle solver. Assume existence
of solution state and current puzzle state, the match is built up by
the manager.
Args:
theSol: The solution board.
thePuzzle: The estimated board.
Reimplemented from Base.
◆ planGreedyTSP()
def planGreedyTSP |
( |
|
self | ) |
|
@brief Generate a greedy plan based on TS-like problem.
The travelling salesman problem is to visit a set of cities in a
path optimal manner. This version applies the same idea in a greed
manner. That involves finding the piece closest to the true
solution, then placing it. After that it searches for a piece that
minimizes to distance to pick and to place (e.g., distance to the
next piece + distance to its true location). That piece is added to
the plan, and the process repeats until all pieces are planned.
◆ planNew()
@brief Implement Dr. Adan Vela's algorithm.
Returns:
plan: The plan list.
◆ planOrdered()
def planOrdered |
( |
|
self, |
|
|
|
occlusionList = [] , |
|
|
|
STEP_WISE = True , |
|
|
|
COMPLETE_PLAN = False , |
|
|
|
verbose = False |
|
) |
| |
@brief Plan is to solve puzzle pieces in order (col-wise).
Args:
occlusionList: The occlusion list.
STEP_WISE: If disabled, we will put the puzzle piece's rotation & location
in a single step.
COMPLETE_PLAN: If enabled, we will create the complete plan instead a single step.
verbose: For debug purpose.
Returns:
plan: The plan list.
◆ setCurrBoard()
def setCurrBoard |
( |
|
self, |
|
|
|
theBoard |
|
) |
| |
@brief Set up the current board.
Args:
theBoard (Board): A board instance.
Reimplemented from Base.
◆ setMatch()
def setMatch |
( |
|
self, |
|
|
|
match, |
|
|
|
rotation_match = None |
|
) |
| |
@brief Set up the match.
Args:
match: The match between the index in the measured board and the solution board.
rotation_match: The rotation angle for each piece in the match.
◆ takeTurn()
def takeTurn |
( |
|
self, |
|
|
|
thePlan = None , |
|
|
|
defaultPlan = 'order' , |
|
|
|
occlusionList = [] , |
|
|
|
STEP_WISE = True , |
|
|
|
COMPLETE_PLAN = False , |
|
|
|
SAVED_PLAN = True |
|
) |
| |
@brief Create a plan.
Args:
thePlan: A specific desired action plan. We assume it only knows (piece_id, action_type, action).
defaultPlan: The default plan strategy.
occlusionList: Skip the pieces in the occlusionList.
STEP_WISE: Perform STEP_WISE(rotation & movement together) action or not.
COMPLETE_PLAN: Create a complete plan or just a single step action.
SAVED_PLAN: Use the saved plan (self.plan) or not
Returns:
plan: Processed plan list.
◆ current
◆ match
◆ plan
◆ rotation_match
The documentation for this class was generated from the following file:
- /home/pvela/python/puzzle_solver/puzzle/solver/simple.py