}
// create the state
State state = getStateFactory().create(agentId);
state.setAgentType(agentType);
state.destroy();
// instantiate the agent
Agent agent = (Agent) agentType.getConstructor().newInstance();
agent.setAgentFactory(this);
agent.setState(state);