How do I create two mutual producer/consumers with internal state in Haskell?

Posted by Keith on Stack Overflow See other posts from Stack Overflow or by Keith
Published on 2009-05-10T07:28:18Z Indexed on 2010/05/22 22:30 UTC
Read the original article Hit count: 202

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.

© Stack Overflow or respective owner

Related posts about haskell

Related posts about artificial-intelligence