|
The Meta Algorithm
The simulator manages a collection of objects which represent the structures, input hydrology and
control policies within a managed river basin. Since there are many different kinds of objects involved,
if this is to work, each object must be able to respond in a predictable way to a standard set of
messages. Note that this does not mean that each object does the same thing. Rather, it means
that each object will do its individual part to further the state of the simulation when it gets the proper
message.
This style of simulation is known as "event driven". Each object maintains a consistent internal state (for water handling objects, such as reservoirs, that means that inflow, outflow, storage and losses are such that mass is conserved). The meta algorithm consists of the following steps:
![]() Perhaps a simple example will help make this clearer. Consider a simple system with two reservoirs in series. During begin time step, reservoir A receives some inflow. The inflow means that the storage and perhaps the release will have to be adjusted, so reservoir A places itself on the queue. When A receives a dispatch message, it calculates its new storage and perhaps determines that its operating policy requires that it release some water downstream to reservoir B. Reservoir A calculates the magnitude of that release and sends that value to reservoir B during its propagate step. Upon receiving this information, reservoir B places itself on the queue. In our little example, if reservoir B has no policy objection to the amount of water released by A, the time step is finished once B has completed its dispatch step. If B must meet a downstream demand and has a policy that such demand must be satisfied from upstream storage, it will adjust the inflow provided by A and send the new value to A during its propagation phase. In that case, A would place itself back on the queue and the time step would continue for at least one more dispatch step. The initial simulation order is from upstream down. As upstream reservoirs are dispatched, they have the ability to query downstream and ascertain whether there is any demand on their water. In the absence of competitive constraints, the network settles in a single pass. If there are constraints that need to be balanced, only those reservoirs that have such constraints are involved in the iteration. Copyright Jon Behrens &
Associates, Inc. 1994 - 2000
|