/[ascend]/trunk/pygtk/study.py
ViewVC logotype

Diff of /trunk/pygtk/study.py

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

revision 2597 by aakash, Tue Aug 16 11:14:13 2011 UTC revision 2598 by jpye, Tue Apr 17 21:00:29 2012 UTC
# Line 248  class StudyWin: Line 248  class StudyWin:
248          _browser.start_waiting("Solving with %s..." % _browser.solver.getName())          _browser.start_waiting("Solving with %s..." % _browser.solver.getName())
249          _browser.prefs.setStringPref("Study","nsteps",str(_nsteps))          _browser.prefs.setStringPref("Study","nsteps",str(_nsteps))
250          self.studywin.destroy()          self.studywin.destroy()
251          reporter = PopupSolverReporter(_browser, _browser.sim.getNumVars(), self.instance, _nsteps, self)          reporter = StudyReporter(_browser, _browser.sim.getNumVars(), self.instance, _nsteps, self)
252          i = 0          i = 0
253          while i<=_nsteps and reporter.guiinterrupt == False:          while i<=_nsteps and reporter.guiinterrupt == False:
254                            
255              #run method              #run method
256              if self.method != None:              if self.method:
257                  _browser.do_method(self.method)                  try:
258                        _browser.sim.run(method)
259                    except RuntimeError,e:
260                        _browser.reporter.reportError(str(e))
261                                    
262              #set the value              #set the value
263                ## FIXME do this test outside the loop...
264              if self.instance.getType().isRefinedSolverVar():              if self.instance.getType().isRefinedSolverVar():
265                  # for solver vars, set the 'fixed' flag as well                  # for solver vars, set the 'fixed' flag as well
266                    ## FIXME shouldn't be necessary to set the 'fixed' flag each time.
267                    ## FIXME this function seems to somehow be repeatedly parsing units: avoid doing that every step.
268                  self.instance.setFixedValue(parameters[0])                  self.instance.setFixedValue(parameters[0])
269              else:              else:
270                    ## why would we NOT want to fix this variable??
271                  self.instance.setRealValue(parameters[0])                  self.instance.setRealValue(parameters[0])
272                            
273              #solve              #solve
# Line 271  class StudyWin: Line 278  class StudyWin:
278                  _browser.reporter.reportError(str(e))                  _browser.reporter.reportError(str(e))
279    
280              i = i+1              i = i+1
281                # any issue with accumulation of rounding errors here?
282              if _log == True:              if _log == True:
283                  parameters[0] = parameters[0]*exp(_diff)                  parameters[0] = parameters[0]*exp(_diff)
284              else:              else:
# Line 280  class StudyWin: Line 288  class StudyWin:
288                    
289          _browser.stop_waiting()          _browser.stop_waiting()
290          _browser.modelview.refreshtree()          _browser.modelview.refreshtree()
           
291            

Legend:
Removed from v.2597  
changed lines
  Added in v.2598

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