How do I create two mutual producer/consumers with internal state in Haskell?
- by Keith
I've got an agent that takes in states and returns actions, while keeping an internal representation of the utility of state/action pairs. I've also got an environment that takes in actions and returns state/reward pairs.
I need to be able to set the agent up with a start state and then continuously go from agent -(action)- environment -(state, reward)- agent -(action)-...
However, the internal states (which need to be updated every iteration) need to stay private (that is, within the agent or the environment). This means that I can't simply call environment as a function within the agent using state and action as arguments.
I'm somewhat of a Haskell noobie, so I'm not even sure if this is possible.