IVALab Python Libraries
Collection of code for computer vision and robotics with specific API.
All Classes Namespaces Files Functions Variables Modules Pages
Public Member Functions | Public Attributes | List of all members
SimTime Class Reference
Inheritance diagram for SimTime:
Inheritance graph
[legend]
Collaboration diagram for SimTime:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, thePuzzle, theHand, thePlanner=None, thePlannerHand=None, theFig=None, shareFlag=True, theParams=ParamST())
 
def calibrate (self, ID_DISPLAY=True)
 
def display (self, ID_DISPLAY=True, CONTOUR_DISPLAY=True)
 
def instruction (self)
 
def reset_cache (self)
 
def simulate_step (self, robot_only=False, ID_DISPLAY=True, CONTOUR_DISPLAY=True)
 
def simulate_step_small (self)
 
- Public Member Functions inherited from SimTimeLess
def simulate_step (self, ID_DISPLAY=True, CONTOUR_DISPLAY=True)
 
- Public Member Functions inherited from Basic
def __init__ (self, thePuzzle, theSolution=None, thePlanner=None, theFig=None, shareFlag=True, theParams=ParamBasic)
 
def addPiece (self, piece)
 
def display (self, theImage=None, ID_DISPLAY=True, CONTOUR_DISPLAY=True, BOUNDING_BOX=True)
 
def dragPieces (self, pVecs)
 
def progress (self, gt_pAssignments)
 
def rmPiece (self, id)
 
def setPieces (self, pLocs)
 
def takeAction (self, plan, verbose=False)
 
def toImage (self, theImage=None, theMask=None, ID_DISPLAY=False, COLOR=(0, 0, 0), CONTOUR_DISPLAY=True, BOUNDING_BOX=True)
 
def translateAction (self, pAssignments, piece_id)
 

Public Attributes

 cache_action
 
 cluster_piece_dict
 
 cluster_region_list
 
 FPS
 
 FramePerSec
 
 pygameFig
 
 shareFlag
 
 timer
 
- Public Attributes inherited from SimTimeLess
 cache_action
 
 canvas
 
 fig
 
 hand
 
 im
 
 params
 
 plannerHand
 
 shareFlag
 
- Public Attributes inherited from Basic
 canvas
 
 fig
 
 matchSimulator
 
 params
 
 planner
 
 puzzle
 
 shareFlag
 
 solution
 

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  thePuzzle,
  theHand,
  thePlanner = None,
  thePlannerHand = None,
  theFig = None,
  shareFlag = True,
  theParams = ParamST() 
)
@brief: The timeless simulator class that simulates the puzzle solving progress.

The class stores an initial board, a solution board, and an agent instance.
During the simulation, the simulator will execute the following process:
1. Let the agent observe the board
2. Let the agent process the board, which means:
    2.1 Plan actions if don't know what to do (no more stored actions)
    2.2 Execute the next planned actions
3. If no more process result, meaning no more plans or actions to be executed,
    then end the simulation. Otherwise repreat the above process

@param[in]  thePuzzle           The current board
@param[in]  agent               The puzzle solving agent
@param[in]  param               The parameters

Reimplemented from SimTimeLess.

Member Function Documentation

◆ calibrate()

def calibrate (   self,
  ID_DISPLAY = True 
)
@brief Provide the user with an option to manually segment the solution board into several regions by mouse. The regions could be used later.

Args:
    ID_DISPLAY: Display the ID or not.

◆ display()

def display (   self,
  ID_DISPLAY = True,
  CONTOUR_DISPLAY = True 
)
@brief  Displays the current puzzle board.

Args:
    ID_DISPLAY: Flag indicating ID_DISPLAY or not.
    CONTOUR_DISPLAY: Flag indicating CONTOUR_DISPLAY or not.

Reimplemented from SimTimeLess.

◆ instruction()

def instruction (   self)
@brief Display a screen with some instructions.

◆ reset_cache()

def reset_cache (   self)
@brief Reset the cache.

◆ simulate_step()

def simulate_step (   self,
  robot_only = False,
  ID_DISPLAY = True,
  CONTOUR_DISPLAY = True 
)
@brief Create the simulation.

Args:
    robot_only: If there is no hand.
    ID_DISPLAY: Display the ID on the board.
    CONTOUR_DISPLAY: Display the contours of the puzzle pieces or not.

◆ simulate_step_small()

def simulate_step_small (   self)
Overwrite the simulate_step function

Member Data Documentation

◆ cache_action

cache_action

◆ cluster_piece_dict

cluster_piece_dict

◆ cluster_region_list

cluster_region_list

◆ FPS

FPS

◆ FramePerSec

FramePerSec

◆ pygameFig

pygameFig

◆ shareFlag

shareFlag

◆ timer

timer

The documentation for this class was generated from the following file: