← Back to team overview

yade-users team mailing list archive

Re: [Question #702934]: After you add some code, it does not work correctly

 

Question #702934 on Yade changed:
https://answers.launchpad.net/yade/+question/702934

    Status: Open => Answered

Jan Stránský proposed the following answer:
Instant replay:

The indentation error is still there :-(
for the third time.. (!)
###
def checkUnbalanced():
 if unbalancedForce() < .01:
  O.pause()
                for b in O.bodies:
      if isinstance(b.shape,Sphere):
###

What does "immediately" mean? before next iteration? after very first
iteration? after two seconds? ... ?

> it will pause
>
> PyRunner(command='checkUnbalanced()', realPeriod=2),
>
> def checkUnbalanced():
>  if unbalancedForce() < .01:
>   O.pause()

Check if the pausing is due to the checkUnbalanced function called in the PyRunner.
If so, disable the the pyrunner / calling checkUnbalanced before continuation.

Cheers
Jan

-- 
You received this question notification because your team yade-users is
an answer contact for Yade.