// Copyright (c) 2016, 2020 Kiel University and others.
//
// This program and the accompanying materials are made available under the
// terms of the Eclipse Public License 2.0 which is available at
// https://www.eclipse.org/legal/epl-2.0.
//
// SPDX-License-Identifier: EPL-2.0

package stress

import (
	
	
	
	
)

type Provider struct{}

func ( *core.AlgorithmRegistry) error {
	return .Register(core.AlgorithmData{
		ID:     "org.eclipse.elk.stress",
		Create: func() core.LayoutProvider { return &Provider{} },
	})
}

func (*Provider) ( *graph.Model,  graph.NodeID,  core.ProgressMonitor) error {
	if !graph.Get(&.Node().Properties, force.Interactive) {
		if  := force.InitialLayout(, , .Subtask(1));  != nil {
			return 
		}
	} else if !graph.Get(&.Node().Properties, force.OmitNodeMicroLayout) {
		nodespacing.CalculateLabelAndNodeSizes(, , nil)
	}

	 := force.NewImporter(, )
	,  := .ImportGraph()
	if  != nil {
		return 
	}
	 := force.Split()
	for ,  := range  {
		if len(.Nodes) <= 1 {
			continue
		}
		 := &Majorization{}
		.Initialize(, )
		.Execute()
		for ,  := range .Labels {
			.RefreshPosition()
		}
	}
	.ApplyLayout(force.Recombine())
	return nil
}