SELAB3 Python Code
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
morphevo.workspace.Workspace Class Reference

A class that represents a Workspace, which is actually the goal space i.e. More...

Public Member Functions

def __init__ (self, str workspace='normalized_cube', tuple cube_offset=(0, 0, 0), float side_length=13, float discretization_step=1.0)
 
None add_end_effector_position (self, np.ndarray end_effector_position, np.ndarray joint_angles)
 Registers a visit of the end effector at the given position in the workspaces internal grid. More...
 
float calculate_coverage (self)
 Calculates the coverage by dividing the amount of visited cells by the amount of all cells in the workspace. More...
 
float calculate_average_redundancy (self)
 Calculates the average redundancy by dividing the total amount of visits by the amount of all cells in the workspace. More...
 
List[float] get_x_range (self)
 Get the range as [min, max] of the workspace on the x-axis. More...
 
List[float] get_y_range (self)
 Get the range as [min, max] of the workspace on the y-axis. More...
 
List[float] get_z_range (self)
 Get the range as [min, max] of the workspace on the z-axis. More...
 

Public Attributes

 side_length
 
 discretization_step
 
 workspace
 
 cube_offset
 
 n_grid_cells
 
 grid
 

Detailed Description

A class that represents a Workspace, which is actually the goal space i.e.

all coordinates where the goal can appear.

Constructor & Destructor Documentation

◆ __init__()

def morphevo.workspace.Workspace.__init__ (   self,
str   workspace = 'normalized_cube',
tuple   cube_offset = (0, 0, 0),
float   side_length = 13,
float   discretization_step = 1.0 
)
Parameters
side_lengththe length of each side in case the workspace is a normalized or moved cube
discretization_stepstep size for discretization
workspacetype of workspace: normalized_cube or moved_cube
cube_offsettuple containing the offset of the moved cube

Member Function Documentation

◆ add_end_effector_position()

None morphevo.workspace.Workspace.add_end_effector_position (   self,
np.ndarray  end_effector_position,
np.ndarray  joint_angles 
)

Registers a visit of the end effector at the given position in the workspaces internal grid.

Parameters
end_effector_positionnumpy array consisting of the position [x,y,z] of the end effector
joint_anglesnumpy array containing all joint angles of the genome in the form [j0angel, j0x, j0y, j0z, ...]

◆ calculate_average_redundancy()

float morphevo.workspace.Workspace.calculate_average_redundancy (   self)

Calculates the average redundancy by dividing the total amount of visits by the amount of all cells in the workspace.

Returns
The calculated average redundancy.

◆ calculate_coverage()

float morphevo.workspace.Workspace.calculate_coverage (   self)

Calculates the coverage by dividing the amount of visited cells by the amount of all cells in the workspace.

Returns
The calculated coverage.

◆ get_x_range()

List[float] morphevo.workspace.Workspace.get_x_range (   self)

Get the range as [min, max] of the workspace on the x-axis.

Returns
A list of 2 containing the minimum and maximum.

◆ get_y_range()

List[float] morphevo.workspace.Workspace.get_y_range (   self)

Get the range as [min, max] of the workspace on the y-axis.

Returns
A list of 2 containing the minimum and maximum.

◆ get_z_range()

List[float] morphevo.workspace.Workspace.get_z_range (   self)

Get the range as [min, max] of the workspace on the z-axis.

Returns
A list of 2 containing the minimum and maximum.

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