Modeling and Agent-Based Simulation of Organization in a Stochastic Environment