nTimer in the
Resource Manger is fired every half
second
nTwo arrays keep
track the current status of the photocells
and the previous status of the
photocells
nWhen these two
arrays differ we need to handle an arrival
or a departure of a train.
nOn an arrival the
system finds and if possible allocates new
resources to a train.
nOn a departure the
system frees resources no longer needed
by the train.