How can I cycle messages in a nested while loop? #971
-
Hi, I am wanting to iterate through the same message list multiple times within a while-loop so that I may build a simple data network within the function. The rest of my code works fine (including the network building which I have temporally removed during bug fixing). However, I cannot get the nested loop to iterate through all the available messages in the message list given. I am not sure what is going on so any help on how this issue can be overcome would be greatly appreciated! I am using FLAME GPU 1 and have attached a report of the problem below. I'm dyslexic, so sorry for my horrible spelling... the spell checker of LibreOffice isn't working on my laptop. 2022_11_11_nested_loop_question.pdf Many thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
Hi Lewis. It is not possible to iterate message loops multiple times within the same agent function. To accomplish what you want to do there are a couple of options.
Also you should try Flame GPU 2. Porting your model will most likely not be a huge difficulty. The software has much better software engineering and support. |
Beta Was this translation helpful? Give feedback.
-
Within FLAME GPU 1, message list iteration is subject to a number of restrictions:
Effectivley this means that you cannot have a For your intended behaviour of building the network of agent connections there might be a few options to achieve this in FLAME GPU 1, but exactly how depends on a few thngs:
Depedning on exactly how this needs interacting with, you could:
FLAME GPU 2 does not have the same restrictions on iterating message lists together or only once, and has the majority of features from FLAME GPU 1 implemented, but will be a bit of effort to port to give n you have atleast 1400 lines of code. |
Beta Was this translation helpful? Give feedback.
Within FLAME GPU 1, message list iteration is subject to a number of restrictions:
get_next_X_message
must be called the same number of times by all threads (and strictly speaking without branching between the calls)).Effectivley this means that you cannot have a
while(message)
loop within any other branching statement (while
, orif
), and it is just a limitation of FLAME GPU 1.For your intended behaviour of building the network of agent connections there might be a few options to achieve this in FLAME GPU 1, but exactly how d…