Skip to content

[NAD] Add a centralized way to manage stopping conditions in different class of the diagram-util layout algorithms #777

Description

@NathanDissoubray

Describe the current behavior

The stopping condition is made directly in the code for each layout class, which includes stopping number of steps sometimes, or custom checks related to the algorithm.

Describe the expected behavior

A centralized way to define stopping conditions for different algorithms. This will also include stopping conditions independent of the algorithm itself, such as a timeout condition.

Describe the motivation

This will allow a standardized interface for a part of the code that every layout algorithm needs. This will also (and mainly), allow us to easily manage timeout for all algorithms (and not require us to implement the timeout checking for each algorithm).

Extra Information

We could make an interface stoppingCriteria (name up to debate) or an abstract class that would provide common methods regarding the timeout and abstract method for the algorithm specific stopping criteria.

We could then make a class for each algorithm. We could also give those class objects to the setup and the post-processing to manage the timeout across the entire process (and not just the algorithm part in the middle).

We could also use this occasion to remove timeout parameters from the AlgorithmParameters of each algorithm since it would be managed in another object. We could also remove conflicting code introduced in #721 where two step limits or two different timeout can be used since there are two entry points to set it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions