alan-turing-institute / clamms

Cooperative Learning in Agent-Based Monetary Models (CLAMMs)
MIT License
3 stars 1 forks source link

Add a learning trait #42

Open sgreenbury opened 1 year ago

sgreenbury commented 1 year ago

Add trait that should be implemented by the learning model included in the board (global state) so that it can be generically included for different learning algorithms. For example:

pub trait Learning {
    fn init(&mut self);
    fn step(&mut self);
    fn loss(&self) -> f32;
}

pub struct Board <M: Learning> {
    ...,
    pub model: M
    ...,
}