Goal-oriented agents in a market