// the method assumes that the conditionals are full conditionals // The data processing has already been done // [BF] The method should be changed so that it can generate any // kind of agents public List<SimulationObject> GenerateAgents(SpatialZone currZone, int numAgents, SimulationObject initAgent, bool warmUpStatus, List<ConditionalDistribution> mobelCond, OutputFileWriter currWriter) { switch(initAgent.GetAgentType()) { case AgentType.Household: return GenerateHousholds(currZone, numAgents, (Household)initAgent, warmUpStatus, mobelCond, currWriter); case AgentType.Person: return GeneratePersons(currZone, numAgents, (Person)initAgent, warmUpStatus, currWriter); } return null; }
public SimulationObject GetNextAgent(DiscreteMarginalDistribution f_x, ConditionalDistribution g_x, string dimension, SimulationObject prvAgent, SpatialZone currZone, int agentID) { switch(prvAgent.GetAgentType()) { case AgentType.Household: return GetNextAgentHousehold( f_x, g_x, dimension, (Household)prvAgent, currZone); case AgentType.Person: return GetNextAgentPerson( f_x, g_x, dimension, (Person)prvAgent, currZone); case AgentType.HouseholdPersonComposite: return GetNextAgentCompositeHhld( f_x, g_x, dimension, (HouseholdPersonComposite)prvAgent, currZone, agentID); default: return null; } }