iterates

yo ho

can i just confirm the following...

the iterate loops are repeated equal to the number of bird in the simulation. is this correct?

does the controller do all it's iterate loops, then the mobile do all it's iterate loops, then any other iterate loops

or

does the controller run thru once, then the mobile once, then others, then back to the controller etc etc . . . . .

cheer
gregger G

iterates

from the breve documentation...

section 3.4.5
iterate, if it exists, is called automatically during every iteration of the breve engine. If your class must perform a task during each iteration, then you may choose to implement an iterate method. The order in which the objects in the simulation are iterated cannot be controlledâ??if you need to control the order in which actions are performed, consider using iterate in conjunction with the post-iterate method described below.

so the iterate loop is run for every 'step' of your simulation. so the simulation will: calculate where to move --> then move --> calculate where to move --> then move --> calculate where to move --> then move --> ...

shark

iterates

gregger,

hope this doesnt sound offensive but you might want to do two things to help you program...

1. put lots of print statements in so it tell you what your variables are doing at diff times... first, set up an "iteration" int and print it each time the iterate loop runs (code: print "iteration at the moment is $iteration".) . then in the log window you will see what goes on between iterations. do the same thing for any other varaibles that you use.

2. you can also look at your variables in the object inspector...

t

iterates

cheer people for there ad-vice

one more questions for you

is there a method to just get the current iteration number? i tried using get-iteration-step but that did not work.

cheer
gergger G[/i]

iterates

get-iternatoin-step is for altering iteratoin speeds and suchlike. just have a counter in the main iteratoin so counter=counter+1. then whenever you want the iteratoin number it wil be in counter.

iterates

cheer Noz

i used...

counter+= 1.

...and it work!

cheer again
gregger G

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.