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

Diff of /trunk/pygtk/interface/simulation.cpp

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

revision 151 by johnpye, Thu Dec 22 10:58:33 2005 UTC revision 153 by johnpye, Thu Dec 22 13:53:42 2005 UTC
# Line 55  extern "C"{ Line 55  extern "C"{
55      @TODO fix mutex on compile command filenames      @TODO fix mutex on compile command filenames
56  */  */
57  Simulation::Simulation(Instance *i, const SymChar &name) : Instanc(i, name), simroot(GetSimulationRoot(i),SymChar("simroot")){  Simulation::Simulation(Instance *i, const SymChar &name) : Instanc(i, name), simroot(GetSimulationRoot(i),SymChar("simroot")){
58        is_built = false;
59      // Create an Instance object for the 'simulation root' (we'll call      // Create an Instance object for the 'simulation root' (we'll call
60      // it the 'simulation model') and it can be fetched using 'getModel()'      // it the 'simulation model') and it can be fetched using 'getModel()'
61      // any time later.      // any time later.
# Line 193  Simulation::build(){ Line 194  Simulation::build(){
194      if(sys == NULL){      if(sys == NULL){
195          throw runtime_error("Unable to build system");          throw runtime_error("Unable to build system");
196      }      }
197        is_built = true;
198      cerr << "...DONE BUILDING" << endl;      cerr << "...DONE BUILDING" << endl;
199  }  }
200    
# Line 250  Simulation::getFixableVariables(){ Line 252  Simulation::getFixableVariables(){
252    
253  void  void
254  Simulation::solve(Solver solver){  Simulation::solve(Solver solver){
255        if(!is_built){
256            throw runtime_error("Simulation::solver: simulation is not yet built, can't start solving.");
257        }
258    
259      cerr << "SIMULATION::SOLVE STARTING..." << endl;      cerr << "SIMULATION::SOLVE STARTING..." << endl;
260      enum inst_t k = getModel().getKind();      enum inst_t k = getModel().getKind();
261      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");

Legend:
Removed from v.151  
changed lines
  Added in v.153

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