Trait Solver

Source
pub trait Solver {
    type Settings;

    // Required methods
    fn new(settings: Self::Settings) -> Self;
    fn solve<AuthId: Eq + Hash + Clone + Ord, ProductId: Eq + Hash + Clone + Ord>(
        &self,
        auction: &[Submission<AuthId, ProductId>],
    ) -> AuctionOutcome<AuthId, ProductId>;
}
Expand description

The Solver trait defines the interface for market-clearing solvers.

A Solver takes market participant submissions (bids/offers) and computes the optimal trades and market-clearing prices that maximize total welfare.

Implementations may use different optimization algorithms with varying performance and precision characteristics.

Required Associated Types§

Source

type Settings

The configuration type for this solver

Required Methods§

Source

fn new(settings: Self::Settings) -> Self

Create a new instance with the provided settings

Source

fn solve<AuthId: Eq + Hash + Clone + Ord, ProductId: Eq + Hash + Clone + Ord>( &self, auction: &[Submission<AuthId, ProductId>], ) -> AuctionOutcome<AuthId, ProductId>

Solve the market clearing problem for the given auction submissions

§Parameters
  • auction - A slice of Submission objects representing all bids and offers
§Returns
  • AuctionOutcome - Contains the clearing prices and trades for each product and authorization

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§