fts_solver/types/
outcome.rs

1use crate::Map;
2use std::hash::Hash;
3
4/// Solution data for an entire auction, containing the outcome for
5/// each authorization and product in the market.
6#[derive(Debug)]
7pub struct AuctionOutcome<AuthId: Eq + Hash, ProductId: Eq + Hash> {
8    /// Outcomes for each authorization, keyed by their ID
9    pub auths: Map<AuthId, AuthOutcome>,
10    /// Outcomes for each product, keyed by their ID
11    pub products: Map<ProductId, ProductOutcome>,
12    // TODO: consider a collection for the cost curves, so that we can report
13    // dual information for their linear constraints
14    // TODO: this struct is also a good home for market-wide summaries, such as
15    // sensitivity information
16}
17
18/// Solution data for an individual authorization, containing
19/// the trade quantity and effective price.
20#[derive(Debug)]
21pub struct AuthOutcome {
22    /// The effective price for this authorization
23    pub price: f64,
24    /// The quantity traded for this authorization (negative for sell, positive for buy)
25    pub trade: f64,
26    // TODO:
27    // consider reporting the dual information for the box constraint
28}
29
30/// Solution data for an individual product, containing
31/// the market-clearing price and total volume traded.
32#[derive(Debug)]
33pub struct ProductOutcome {
34    /// The market-clearing price for this product
35    pub price: f64,
36    /// The total quantity traded of this product (one-sided volume)
37    pub volume: f64,
38}