コード例 #1
0
 void Rebuild(Specification specification)
 {
     if (optimizationSegments == null || optimizationSegments.NeedsRebuild(specification))
     {
         Console.WriteLine("Rebuilding OptimizationSegments...");
         optimizationSegments = OptimizationSegments.Create(specification);
     }
     if (optimizationProblem == null || optimizationProblem.NeedsRebuild(optimizationSegments, specification))
     {
         Console.WriteLine("Rebuilding OptimizationProblem...");
         optimizationProblem = OptimizationProblem.Create(optimizationSegments, specification);
     }
     if (optimizationSubstitutions == null || optimizationSubstitutions.NeedsRebuild(optimizationSegments, optimizationProblem, specification))
     {
         Console.WriteLine("Rebuilding OptimizationSubstitutions...");
         optimizationSubstitutions = OptimizationSubstitutions.Create(optimizationSegments, optimizationProblem, specification);
     }
     if (optimizationSolver == null || optimizationSolver.NeedsRebuild(optimizationProblem, optimizationSubstitutions))
     {
         Console.WriteLine("Rebuilding OptimizationSolver...");
         optimizationSolver = OptimizationSolver.Create(optimizationProblem, optimizationSubstitutions);
     }
     if (optimizationPosition == null || optimizationPosition.NeedsRebuild(optimizationSolver, specification.Position))
     {
         Console.WriteLine("Rebuilding OptimizationPosition...");
         optimizationPosition = OptimizationPosition.Create(optimizationSolver, specification.Position);
     }
 }