private float ProcessParameters(Job job)
        {
            // Step 1, figure out our parameters
            var length = job.Parameters.Length;

            for (int i = 0; i < length; i++)
            {
                Parameters[i].Current = job.Parameters[i];
            }
            SetupInputFiles(Parameters);
            NetworkAssignment.RunNetworkAssignment();
            return(ProcessResults());
        }
示例#2
0
 private float EvaluteParameters(ParameterSetting[] parameters)
 {
     SetupInputFiles(parameters);
     NetworkAssignment.RunNetworkAssignment();
     return(ProcessResults(parameters));
 }
示例#3
0
 public void Start()
 {
     CurrentIteration = 0;
     Status           = "Running Model System Setup";
     GetCurrentStatus = (() => NetworkAssignment.ToString());
     GetProgress      = (() => NetworkAssignment.Progress);
     NetworkAssignment.RunModelSystemSetup();
     if (ExitRequested)
     {
         return;
     }
     LoadZoneData();
     if (ExitRequested)
     {
         return;
     }
     Status           = "Running Initial Network Assignment";
     GetCurrentStatus = (() => NetworkAssignment.ToString());
     GetProgress      = (() => NetworkAssignment.Progress);
     NetworkAssignment.RunInitialAssignments();
     GetCurrentStatus = (() => "");
     if (ExitRequested)
     {
         return;
     }
     LoadNetworkData();
     if (ExitRequested)
     {
         return;
     }
     InitializePopulation();
     if (ExitRequested)
     {
         return;
     }
     for (int iteration = 0; iteration < TotalIterations; iteration++)
     {
         if (ExitRequested)
         {
             return;
         }
         foreach (var module in PreIteration)
         {
             Status      = String.Concat("Running Iteration ", (iteration + 1), " of ", TotalIterations, " : ", module.ToString());
             GetProgress = (() => module.Progress);
             module.Start();
         }
         if (iteration == 0)
         {
             TellModesWeAreStartingNewIteration();
             ReProcessWorkSchoolZones();
         }
         var purposeLength = Purpose.Count;
         for (int i = 0; i < purposeLength; i++)
         {
             Status      = String.Concat("Running Iteration ", (iteration + 1), " of ", TotalIterations, " : ", Purpose[i].PurposeName);
             GetProgress = (() => Purpose[i].Progress);
             Purpose[i].Run();
             if (ExitRequested)
             {
                 return;
             }
         }
         GetCurrentStatus = (() => NetworkAssignment.ToString());
         GetProgress      = (() => NetworkAssignment.Progress);
         Status           = String.Concat("Running Network Assignment (", (iteration + 1), " of ", TotalIterations, ")");
         UnloadNetworkData();
         NetworkAssignment.RunNetworkAssignment();
         GetCurrentStatus = (() => "");
         TellModesWeAreEndingIteration();
         // if it isn't the last iteration reprocess the locations that people work and go to school
         if (iteration < TotalIterations - 1)
         {
             CurrentIteration++;
             LoadNetworkData();
             TellModesWeAreStartingNewIteration();
             ReProcessWorkSchoolZones();
         }
     }
     CurrentIteration = TotalIterations;
     if (ExitRequested)
     {
         return;
     }
     GetCurrentStatus = (() => NetworkAssignment.ToString());
     GetProgress      = (() => NetworkAssignment.Progress);
     Status           = "Running Final Network Assignment";
     NetworkAssignment.RunPostAssignments();
     GetCurrentStatus = (() => "");
     if (ExitRequested)
     {
         return;
     }
     Status = "Running Post Run Modules";
     RunPostRunModules();
     GetProgress = (() => 1f);
     Status      = "Shutting Down";
     Population  = null;
     Demographics.UnloadData();
     ZoneSystem.UnloadData();
 }