use crate::models::{DemandCurve, DemandGroup, Map, ProductGroup};
use std::hash::Hash;
pub trait Solver<DemandId: Eq + Hash, PortfolioId: Eq + Hash, ProductId: Eq + Hash> {
type Error: std::error::Error;
type PortfolioOutcome;
type ProductOutcome;
type State: Default;
fn solve(
&self,
demand_curves: Map<DemandId, DemandCurve>,
portfolios: Map<PortfolioId, (DemandGroup<DemandId>, ProductGroup<ProductId>)>,
state: Self::State,
) -> impl Future<
Output = Result<
(
Map<PortfolioId, Self::PortfolioOutcome>,
Map<ProductId, Self::ProductOutcome>,
),
Self::Error,
>,
> + Send;
}