More things, more tests

This commit is contained in:
2022-06-20 23:56:35 +02:00
parent 0efb0312da
commit 0a35645091
4 changed files with 195 additions and 4 deletions

View File

@@ -4,6 +4,7 @@ use crate::{
agent::Agent, game::Game, gaussian::Gaussian, player::Player, tuple_gt, tuple_max, N_INF,
};
#[derive(Debug)]
pub(crate) struct Skill {
pub(crate) forward: Gaussian,
backward: Gaussian,
@@ -52,7 +53,8 @@ impl Event {
}
}
pub(crate) struct Batch {
#[derive(Debug)]
pub struct Batch {
pub(crate) events: Vec<Event>,
pub(crate) skills: HashMap<String, Skill>,
pub(crate) time: u64,
@@ -220,7 +222,7 @@ impl Batch {
self.iteration(from, agents);
}
pub(crate) fn posterior(&self, agent: &str) -> Gaussian {
pub fn posterior(&self, agent: &str) -> Gaussian {
let skill = &self.skills[agent];
skill.likelihood * skill.backward * skill.forward