I have created rules where the code that is generated does
not generate in the order that I define in the rule. I
have had several cases, and they tend to rear their ugly
heads when a Set is involved. Although I honestly do not
know if they are limited to these circumstances. I will
include my metaabm file.
Right now note that the code being generated cannot compile.
I have to manually fix a few things (isAvailable() for one)
and another I will mention in another thread.
1. Look at the Person Act "Ask Neighbor About Food Center Location".
Notice the Set and If happen before neighbor is even defined.
2. I also notice that the build rule for the model does not
follow the order that I would like. I want my grid to be
created first, and have this at the top of my list of things
to do when building the model. I have to manually modify
the file to build the grid first. I build the grid first
to place stationary agents such as buildings first, before
mobile agents such a people randomly become initialized
to a location where a stationary agent belongs. I definite
BuildGrid first, but the agents are created first, regardless
of the fact I specify the grid to be built first.
3. I also remember an example off the top of my head, although
I don't have an example here. If I perform an evaluation
and then do a Set as a child of the evaluation to an attribute
on the agent, that is fine. However, if AFTER the evaluation
(as a sibling of the evaluation) I try to query the attribute
I set, the generated code will place the set AFTER the query.
Not sure if that makes sense, let me know if I need to send
an example.
ev