class fm2.entities.fm2_map.FM2Map(binary_map: ndarray)

The FM2Map is a dataclass that contains the information of the map

Attributes:
shapetuple[int, int] | tuple[int, int, int]

the shape of the map

dimensionsint

the dimensionality of the map

binary_map: np.ndarray

the binary map

w_matrix: np.ndarray

the speed matrix

Methods

from_binary_map(cls, binary_map: np.ndarray, create_border: bool = False) -> FM2Map:

creates a map from a binary map

from_image(cls, filename: str, create_border: bool = False) -> FM2Map:

creates a map from an image

classmethod from_binary_map(binary_map: ndarray, create_border: bool = False)

instantiates the map from a binary map

Parameters:
binary_map: np.ndarray

the binary map

create_borderbool, optional

when True the map gets surrounded by walls

Returns:
out~.entities.FM2Map

an instance of the class

Raises:
ValueError

if the map is nor binary

classmethod from_image(filename: str, create_border: bool = False)

instantiates the map from an image

Parameters:
filenamestr

the path to the image

create_borderbool, optional

when True the map gets surrounded by walls

Returns:
out~.entities.FM2Map

an instance of the class

Raises:
ValueError

if the map is nor binary