/[ascend]/trunk/pygtk/simulation.cpp
ViewVC logotype

Diff of /trunk/pygtk/simulation.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 889 by johnpye, Sun Sep 10 06:13:44 2006 UTC revision 890 by johnpye, Thu Oct 12 14:06:37 2006 UTC
# Line 391  Simulation::getSingularityInfo() const{ Line 391  Simulation::getSingularityInfo() const{
391    
392  void  void
393  Simulation::setSolver(Solver &solver){  Simulation::setSolver(Solver &solver){
394      cerr << "SETTING SOLVER ON SIMULATION TO " << solver.getName() << endl;      //cerr << "SETTING SOLVER ON SIMULATION TO " << solver.getName() << endl;
395    
396      if(!sys)throw runtime_error("Can't solve: Simulation system has not been built yet.");      if(!sys)throw runtime_error("Can't solve: Simulation system has not been built yet.");
397      // Update the solver object because sometimes an alternative solver can be returned, apparently.      // Update the solver object because sometimes an alternative solver can be returned, apparently.
# Line 576  Simulation::solve(Solver solver, SolverR Line 576  Simulation::solve(Solver solver, SolverR
576          throw runtime_error("Simulation::solver: simulation is not yet built, can't start solving.");          throw runtime_error("Simulation::solver: simulation is not yet built, can't start solving.");
577      }      }
578    
579      cerr << "SIMULATION::SOLVE STARTING..." << endl;      //cerr << "SIMULATION::SOLVE STARTING..." << endl;
580      enum inst_t k = getModel().getKind();      enum inst_t k = getModel().getKind();
581      if(k!=MODEL_INST)throw runtime_error("Can't solve: not an instance of type MODEL_INST");      if(k!=MODEL_INST)throw runtime_error("Can't solve: not an instance of type MODEL_INST");
582    
# Line 586  Simulation::solve(Solver solver, SolverR Line 586  Simulation::solve(Solver solver, SolverR
586    
587      if(!sys)throw runtime_error("Can't solve: Simulation system has not been built yet.");      if(!sys)throw runtime_error("Can't solve: Simulation system has not been built yet.");
588    
589      cerr << "SIMULATION::SOLVE: SET SOLVER..." << endl;      //cerr << "SIMULATION::SOLVE: SET SOLVER..." << endl;
590      setSolver(solver);      setSolver(solver);
591    
592    
593      cerr << "PRESOLVING SYSTEM...";      //cerr << "PRESOLVING SYSTEM...";
594      slv_presolve(sys);      slv_presolve(sys);
595      cerr << "DONE" << endl;      //cerr << "DONE" << endl;
596    
597      cerr << "SOLVING SYSTEM..." << endl;      //cerr << "SOLVING SYSTEM..." << endl;
598      // Add some stuff here for cleverer iteration....      // Add some stuff here for cleverer iteration....
599      unsigned niter = 1000;      unsigned niter = 1000;
600      //double updateinterval = 0.02;      //double updateinterval = 0.02;
# Line 631  Simulation::solve(Solver solver, SolverR Line 631  Simulation::solve(Solver solver, SolverR
631      // Just a little bit of console output:      // Just a little bit of console output:
632    
633      if(status.isOK()){      if(status.isOK()){
634          cerr << "... SOLVED, STATUS OK" << endl;          //cerr << "... SOLVED, STATUS OK" << endl;
635      }else{      }else{
636          cerr << "... SOLVER FAILED" << endl;          cerr << "... SOLVER FAILED" << endl;
637      }      }
638    
639      cerr << "SOLVER PERFORMED " << status.getIterationNum() << " ITERATIONS IN " << elapsed << "s" << endl;      //cerr << "SOLVER PERFORMED " << status.getIterationNum() << " ITERATIONS IN " << elapsed << "s" << endl;
640  }  }
641    
642  //------------------------------------------------------------------------------  //------------------------------------------------------------------------------

Legend:
Removed from v.889  
changed lines
  Added in v.890

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22