Herd behavior in artificial stock markets