コード例 #1
0
ファイル: Scheduler.cs プロジェクト: dianatle/XTMF
        /// <summary>
        /// Schedule the household
        /// </summary>
        /// <param name="h">The household to schedule</param>
        public void Run(ITashaHousehold h)
        {
            Random r = new Random(h.HouseholdId * this.Seed);

            // Setup the data, no random is needed here
            AddProjects(h);
            // Generate the schedules for each type of project
            if (!h.GenerateProjectSchedules(r, GenerationRateAdjustments))
            {
                // If we were not able to generate a schedule
                System.Threading.Interlocked.Increment(ref SchedulingFail);
                return;
            }
            System.Threading.Interlocked.Increment(ref SchedulingSuccess);
            // Now that we have the individual projects, create the individual schedules
            h.GeneratePersonSchedules(r, HouseholdIterations, MinimumTimeAtHomeBetweenActivities);
            JoinTripChains(h);
        }
コード例 #2
0
ファイル: Scheduler.cs プロジェクト: Cocotus/XTMF
 /// <summary>
 /// Schedule the household
 /// </summary>
 /// <param name="h">The household to schedule</param>
 public void Run(ITashaHousehold h)
 {
     Random r = new Random(h.HouseholdId * this.Seed);
     // Setup the data, no random is needed here
     AddProjects( h );
     // Generate the schedules for each type of project
     if ( !h.GenerateProjectSchedules(r) )
     {
         // If we were not able to generate a schedule
         System.Threading.Interlocked.Increment( ref SchedulingFail );
         return;
     }
     System.Threading.Interlocked.Increment( ref SchedulingSuccess );
     // Now that we have the individual projects, create the individual schedules
     h.GeneratePersonSchedules(r, HouseholdIterations);
     JoinTripChains( h );
 }