All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.btrplace.scheduler.runner.disjoint.splitter.ConstraintSplitter Maven / Gradle / Ivy

Go to download

Instance solvers that split a single problem into smaller parts to solve them in parallel.

There is a newer version: 1.9.3
Show newest version
/*
 * Copyright  2020 The BtrPlace Authors. All rights reserved.
 * Use of this source code is governed by a LGPL-style
 * license that can be found in the LICENSE.txt file.
 */

package org.btrplace.scheduler.runner.disjoint.splitter;

import gnu.trove.map.hash.TIntIntHashMap;
import org.btrplace.model.Instance;
import org.btrplace.model.constraint.Constraint;

import java.util.List;

/**
 * Interface to specify a method that makes a constraint
 * compatible with multiple partitions.
 * 

* In practice, the splitter ensures the given constraint * does not spread over multiple partitions. * This may require to split the constraint. * * @author Fabien Hermenier */ public interface ConstraintSplitter { /** * Get the class of the Constraint associated to the splitter. * * @return a Class derived from {@link org.btrplace.model.constraint.Constraint} */ Class getKey(); /** * Ensure a given constraint fit into a single partition. * If necessary, the constraint may have be split. * this call inserts the constrain (or its subdivisions) inside their respective instances * * @param cstr the model constraint * @param origin the original instance to split * @param partitions the possible partitions @return {@code false} iff this leads to a problem without solutions. * @param vmsPosition the partition associated to each VM * @param nodePosition the partition associated to each node * @return {@code true} iff the split was successful. {@code false} otherwise */ boolean split(C cstr, Instance origin, List partitions, TIntIntHashMap vmsPosition, TIntIntHashMap nodePosition); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy