next up previous
Next: Limits of the CA Up: Cellular automata models for Previous: Dynamics on a graph


Moving particles and moving agents

There is a stark difference between typical physics particle hopping models and the transportation models: in transportation, the particles are intelligent agents, meaning that they have individual and potentially complex rules of how they react to the environment. This means that in implementations some pointer to these complicated rule structures needs to be maintained when the particles move. This immediately excludes the use of single bit coding, since these pointers typically occupy 32 or even 64 bits of memory.

In consequence, a simple typical vehicle grid in a transportation looks as follows



\begin{lstlisting}{}
class veh {
int ID ;
double Speed ;
...
};
veh* Road[200]; // memory allocation for 200 pointers
\end{lstlisting}
which means that Road consists of 200 pointers pointing to vehicles. Memory for the pointers is immediately allocated; memory for the vehicles is only allocated when it is used. For example, when the code decides to put a vehicle into cell number ii, the code fragment may look as



\begin{lstlisting}{}
Road[ii] = new veh ; // memory allocation for vehicle
Road[ii]->ID = SomeID ;
Road[ii]->Speed = 0. ;
\end{lstlisting}
Movement is still done in a relatively standard way:



\begin{lstlisting}{}
speed = int(Road[ii]->Speed) ;
Road[ii+speed] = Road[ii] ;
Road[ii] = NULL ;
\end{lstlisting}
The big advantage of this is that all information belonging to the vehicle is always being moved with it.

Clearly, many improvements to the above are possible or even recommended, such as using vectors instead of arrays, making clean definitions of constants such as ``200'', making IDs constant, explicitely defining constructors and destructors, etc.

The currently most important application of the agent technology in transportation simulations is that agents know where they are going. More precisely, it is possible to give each agent its full route, for example consisting of a sequence of nodes. A related but different area of research is to generate those strategic decisions for the agents. All this results in additional computational modules which are part of a complete transportation simulation package (e.g. [26]).


next up previous
Next: Limits of the CA Up: Cellular automata models for Previous: Dynamics on a graph
Kai Nagel 2002-05-31