use crate::{N_INF, gaussian::Gaussian};

pub(crate) struct TeamMessage {
    pub(crate) prior: Gaussian,
    pub(crate) likelihood_lose: Gaussian,
    pub(crate) likelihood_win: Gaussian,
    pub(crate) likelihood_draw: Gaussian,
}

impl TeamMessage {
    /*
    pub(crate) fn p(&self) -> Gaussian {
        self.prior * self.likelihood_lose * self.likelihood_win * self.likelihood_draw
    }
    */

    #[inline]
    pub(crate) fn posterior_win(&self) -> Gaussian {
        self.prior * self.likelihood_lose * self.likelihood_draw
    }

    #[inline]
    pub(crate) fn posterior_lose(&self) -> Gaussian {
        self.prior * self.likelihood_win * self.likelihood_draw
    }

    #[inline]
    pub(crate) fn likelihood(&self) -> Gaussian {
        self.likelihood_win * self.likelihood_lose * self.likelihood_draw
    }
}

impl Default for TeamMessage {
    fn default() -> Self {
        Self {
            prior: N_INF,
            likelihood_lose: N_INF,
            likelihood_win: N_INF,
            likelihood_draw: N_INF,
        }
    }
}

/*
pub(crate) struct DrawMessage {
    pub(crate) prior: Gaussian,
    pub(crate) prior_team: Gaussian,
    pub(crate) likelihood_lose: Gaussian,
    pub(crate) likelihood_win: Gaussian,
}

impl DrawMessage {
    pub(crate) fn p(&self) -> Gaussian {
        self.prior_team * self.likelihood_lose * self.likelihood_win
    }

    pub(crate) fn posterior_win(&self) -> Gaussian {
        self.prior_team * self.likelihood_lose
    }

    pub(crate) fn posterior_lose(&self) -> Gaussian {
        self.prior_team * self.likelihood_win
    }

    pub(crate) fn likelihood(&self) -> Gaussian {
        self.likelihood_win * self.likelihood_lose
    }
}
*/
pub(crate) struct DiffMessage {
    pub(crate) prior: Gaussian,
    pub(crate) likelihood: Gaussian,
}

impl DiffMessage {
    /*
    pub(crate) fn p(&self) -> Gaussian {
        self.prior * self.likelihood
    }
    */
}
