BradenEverson / earthmover

Embedded RL with modular rewards based on peripherals and a simulation server for deciding best actions
4 stars 2 forks source link

Achiever: Implement `Body` Struct #2

Closed BradenEverson closed 2 weeks ago

BradenEverson commented 3 weeks ago

In the Achiever crate, we need a way of communicating with the agent's actual hardware. We need to have access to all inputs and outputs, and some generalized (maybe a trait) way of gaining inputs from an input, and sending outputs to an output. My idea is we could have the following enum:

enum Peripheral {
    Input(Box<dyn Input>),
    Output(Box<dyn Output>),
}

where Input and Output would look like something as follows:

trait Input {
    fn read_bytes(&mut self) -> &[u8];
}

trait Output {
    fn write_bytes(&mut self, bytes: &[u8]);
}

Maybe the type of bytes needs to be different, but the general gist is there. This should update the Body module in Achiever