Application of Agent-Based Modeling to Complex Systems