o
    h                     @   sj   d dl Zd dlm  mZ d dlmZ ejdejdZ	e	ddd  d9  < G dd	 d	ej
Zd
d ZdS )    N)assert_array_equal   r   dtype      g       @c                   @   s8   e Zd ZdZdd Zdd Zdd Zdd	 Zd
d ZdS )FlexibleMCPz Simple MCP subclass that allows the front to travel
    a certain distance from the seed point, and uses a constant
    cost factor that is independent of the cost array.
    c                 C   s&   t j|  tjdtjd | _d S )Nr   r   )mcpMCP_Flexible_resetnpzerosfloat32ravel	_distance)self r   \/var/www/html/scripts/venv/lib/python3.10/site-packages/skimage/graph/tests/test_flexible.pyr      s   zFlexibleMCP._resetc                 C   s   | j | dkr	dS dS )N   r   r   r   )r   indexcumcostr   r   r   goal_reached   s   zFlexibleMCP.goal_reachedc                 C   s   dS )Ng      ?r   r   r   	new_indexoffset_lengthr   r   r   travel_cost      zFlexibleMCP.travel_costc                 C   s   d S )Nr   r   r   r   r   examine_neighbor   r   zFlexibleMCP.examine_neighborc                 C   s   | j | d | j |< d S )Nr   r   r   r   r   r   update_node!   s   zFlexibleMCP.update_nodeN)	__name__
__module____qualname____doc__r   r   r   r   r    r   r   r   r   r	      s    r	   c                  C   s   t t} | dg\}}t|d dd df g dg dg dg dg t|dd d d f tjks7J t|d d dd f tjksIJ d S )N)r   r   r   )r   r      r   )r   r   r%   r   )r%   r%   r%   r   )r   r   r   r   )r	   a
find_costsr   r   allinf)r
   costs	tracebackr   r   r   test_flexible%   s   $(r-   )numpyr   skimage.graph.mcpgraphr
   skimage._shared.testingr   onesr   r'   r   r	   r-   r   r   r   r   <module>   s    