|
Quilt Loader 1
|
A wrapper around sat4j. More...
Classes | |
| class | RuleDefinerInternal |
| class | Sat4jSolver |
| Contains the actual Sat4j fields for computation. | |
Public Member Functions | |
| void | resetStage () |
Clears out this Sat4jWrapper of all data EXCEPT the added Rules and LoadOptions. | |
| void | addOption (LoadOption option) |
Adds a new LoadOption, without any weight. | |
| void | setWeight (LoadOption option, Rule key, int weight) |
Sets the weight of an existing LoadOption, applied by the given rule. | |
| void | removeOption (LoadOption option) |
| void | addRule (Rule rule) |
Adds a new Rule to this solver. | |
| void | removeRule (Rule rule) |
| void | redefine (Rule rule) |
Clears any current definitions this rule is associated with, and calls Rule#define(RuleDefiner) sometime before solving. | |
| boolean | hasSolution () throws TimeoutException, ModSolvingError |
| Attempts to find a solution. | |
| Collection< Rule > | getError () throws TimeoutException |
| Collection< LoadOption > | getSolution () throws TimeoutException, ModSolvingError |
| Computes and returns the optimised solution. | |
| void | cancel () |
| Cancels any current and future operation. | |
| void | appendRules (StringBuilder sb) |
Appends all current rules and options using the SolverPreProcessor format. | |
Additional Inherited Members | |
| Static Public Member Functions inherited from org.quiltmc.loader.api.plugin.solver.RuleContext | |
| static boolean | isNegated (LoadOption option) |
| static LoadOption | negate (LoadOption option) |
A wrapper around sat4j.
We use this instead of DependencyHelper since that's a bit more limited.
Solving happens in x stages:
This is (mostly) separated from any more specific rules
|
inline |
Adds a new LoadOption, without any weight.
Implements org.quiltmc.loader.api.plugin.solver.RuleContext.
|
inline |
Adds a new Rule to this solver.
This calls Rule#onLoadOptionAdded(LoadOption) for every LoadOption currently held, and calls Rule#define(RuleDefiner) once afterwards.
Implements org.quiltmc.loader.api.plugin.solver.RuleContext.
|
inline |
hasSolution() from returning true. | IllegalStateException | if the last call to hasSolution() didn't return false, or if any other methods have been called since the last call to hasSolution(). |
|
inline |
Computes and returns the optimised solution.
| TimeoutException | if the optimisation was cancelled before it completed. This will only be thrown if it hasn't computed any solutions when it is cancelled. |
| IllegalStateException | if hasSolution() didn't just return true, or if any other methods have been called since the last call to hasSolution(). |
|
inline |
Attempts to find a solution.
If this returns true then you should call getSolution() to get it, otherwise call getError() to get the first reason why this doesn't have a solution.
|
inline |
Clears any current definitions this rule is associated with, and calls Rule#define(RuleDefiner) sometime before solving.
Implements org.quiltmc.loader.api.plugin.solver.RuleContext.
|
inline |
Implements org.quiltmc.loader.api.plugin.solver.RuleContext.
|
inline |
Sets the weight of an existing LoadOption, applied by the given rule.
| key | The rule which provides the weight modifier. May be null. If not null then this weight modifier will be removed whenever the rule is removed. |
| weight | The weight. Negative values will mean the solver will try to include the option, positive values encourage the solver to pick a different option. Absolute values are unimportant when only 1 of a set of options can be chosen, instead only relative will be important. The sum of all weights is used when solving. |
| IllegalArgumentException | if the given LoadOption isn't present. |
Implements org.quiltmc.loader.api.plugin.solver.RuleContext.