private void Run(int iteration, ITashaHousehold household) { var persons = household.Persons; var eventCount = new int[NumberOfDistributionsLocal]; var addZero = new bool[NumberOfDistributionsLocal]; household.CreateHouseholdProjects(); for (int i = 0; i < persons.Length; i++) { persons[i].InitializePersonalProjects(); } for (int i = 0; i < persons.Length; i++) { Time workStartTime; Time workEndTime; ITashaPerson person = household.Persons[i]; AssignWorkSchoolEpisodes(persons[i], out workStartTime, out workEndTime, null); var primaryVehicle = PrimaryMode.RequiresVehicle; for (int j = 0; j < addZero.Length; j++) { eventCount[j] = 0; addZero[j] = false; } FirstPass(person, primaryVehicle, eventCount); int lunches = LunchPass(person, eventCount, ref workStartTime, ref workEndTime); AddWorkTrip(person, eventCount, addZero, ref workStartTime, ref workEndTime); ProcessZeroes(person, workStartTime, eventCount, addZero, lunches); // while adding the results back we need to do this in serial StoreResults(person.ExpansionFactor, eventCount, addZero); } System.Threading.Interlocked.Increment(ref CurrentHousehold); Progress = ((float)CurrentHousehold / NumberOfHouseholds) / TotalIterations + CompletedIterationPercentage; household.Recycle(); }
private static void AddProjects(ITashaHousehold h) { // Get everything read to add projects to the household h.CreateHouseholdProjects(); // Now that is setup, we can focus on the individual people foreach (ITashaPerson person in h.Persons) { person.InitializePersonalProjects(); } }
private static void AddProjects(ITashaHousehold h) { // Get everything read to add projects to the household h.CreateHouseholdProjects(); // Now that is setup, we can focus on the individual people foreach ( ITashaPerson person in h.Persons ) { person.InitializePersonalProjects(); } }