A Plea for Functionality: Dynamic Alter Global Variable Values

FUNCTIONALITY REQUESTED

The ability to dynamically alter the value of a globally scoped
variable.

DOMAINS REQUIRING THIS FUNCTIONALITY

Multi-agent simulation, parallel processing, complex adaptive systems.

REASON FOR REQUIRING THIS FUNCTIONALITY

Consider a multi-agent simulation: I would like to have code to express
the movement rules for a *single* agent, and then *separately* have code
which *applies* the movement rules to each agent (a classic case of
separation of concerns, and a classic paradigm of parallel processing).

I will show a simple example in pseudocode:

Agent Movement Rule
   Move forward one cell
   Turn right 90 degrees
   Move forward 2 cells

Agent Processing
   For each agent do:
      Apply Agent Movement Rule

In this example we see that we have cleanly separated the statement of
the how each agent should move (Agent Movement Rule), from the
application of the movement rule to each agent (Agent Processing).

In order for the Agent Processing code to to apply the Movement Rule
code to each agent it will need to modify the value of a global
variable.  Thus, you now see why I am requesting this functionality. 

CAN MULTI-AGENT SIMULATION BE DONE WITH EXISTING 2.0 FUNCTIONALITY?

Yes.  In the above example the Agent Movement Rule could be nested
within the Agent Processing code (in fact, I have implemented this). 
However, it results in (very) brittle, complex code and it does not
support separation of concerns (e.g., one person writing the Agent
Movement Rule, another person writing the Agent Processing code).

NOT TOO LATE, I HOPE!

I realize that this request is late in the game.  However, I feel that
without this functionality the 2.0 version will have a large gaping hole
in its capability, and severely cripple multiple communities.

Thanks for your time.  /Roger

Received on Sunday, 21 March 2004 07:40:20 UTC