/// <summary> /// Provides <see cref="Selections"/> that satisfy the specified <see cref="Requirements"/>. /// </summary> /// <returns>The selected <see cref="ImplementationSelection"/>s.</returns> /// <exception cref="SolverException">The solver was unable to provide <see cref="Selections"/> that fulfill the <see cref="Requirements"/>.</exception> public Selections Solve() { try { if (!TryFulfill(Demand(_requirements))) { throw new SolverException("No solution found"); } return(Selections); } finally { Selections.PurgeRestrictions(); Selections.Implementations.Sort(); } }
/// <summary> /// Provides <see cref="Selections"/> that satisfy the specified <see cref="Requirements"/>. /// </summary> /// <returns>The selected <see cref="ImplementationSelection"/>s.</returns> /// <exception cref="SolverException">The solver was unable to provide <see cref="Selections"/> that fulfill the <see cref="Requirements"/>.</exception> public Selections Solve() { try { if (!TryFulfill(Demand(_requirements))) { CandidateProvider.FailedFeeds.Values.FirstOrDefault()?.Rethrow(); throw new SolverException("No solution found"); } return(Selections); } finally { Selections.PurgeRestrictions(); Selections.Implementations.Sort(); } }